PageSourceSearch

https://mealmuse.ai/assets/index-D-LjABIO.js

js mealmuse.ai collected 2026-10-05 12:15:07 UTC 1,326,142 bytes, 566 lines download raw bytes

vendor: 4,665 bytes, lines 1-9
1var D$=Object.defineProperty;var xS=e=>{throw TypeError(e)};var M$=(e,t,n)=>t in e?D$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Hi=(e,t,n)=>M$(e,typeof t!="symbol"?t+"":t,n),nv=(e,t,n)=>t.has(e)||xS("Cannot "+n);var M=(e,t,n)=>(nv(e,t,"read from private field"),n?n.call(e):t.get(e)),we=(e,t,n)=>t.has(e)?xS("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ue=(e,t,n,r)=>(nv(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Oe=(e,t,n)=>(nv(e,t,"access private method"),n);var If=(e,t,n,r)=>({set _(i){ue(e,t,i,n)},get _(){return M(e,t,r)}});function L$(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var Ir=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Uw(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function F$(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var AP={exports:{}},Lm={},OP={exports:{}},ze={};/**
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 of=Symbol.for("react.element"),$$=Symbol.for("react.portal"),U$=Symbol.for("react.fragment"),V$=Symbol.for("react.strict_mode"),z$=Symbol.for("react.profiler"),B$=Symbol.for("react.provider"),W$=Symbol.for("react.context"),q$=Symbol.for("react.forward_ref"),H$=Symbol.for("react.suspense"),G$=Symbol.for("react.memo"),K$=Symbol.for("react.lazy"),wS=Symbol.iterator;function Y$(e){return e===null||typeof e!="object"?null:(e=wS&&e[wS]||e["@@iterator"],typeof e=="function"?e:null)}var DP={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},MP=Object.assign,LP={};function _c(e,t,n){this.props=e,this.context=t,this.refs=LP,this.updater=n||DP}_c.prototype.isReactComponent={};_c.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")};_c.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function FP(){}FP.prototype=_c.prototype;function Vw(e,t,n){this.props=e,this.context=t,this.refs=LP,this.updater=n||DP}var zw=Vw.prototype=new FP;zw.constructor=Vw;MP(zw,_c.prototype);zw.isPureReactComponent=!0;var bS=Array.isArray,$P=Object.prototype.hasOwnProperty,Bw={current:null},UP={key:!0,ref:!0,__self:!0,__source:!0};function VP(e,t,n){var r,i={},s=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)$P.call(t,r)&&!UP.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];i.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return{$$typeof:of,type:e,key:s,ref:o,props:i,_owner:Bw.current}}function Q$(e,t){return{$$typeof:of,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Ww(e){return typeof e=="object"&&e!==null&&e.$$typeof===of}
vendor: 4,989 bytes, lines 9-17
9function X$(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var _S=/\/+/g;function rv(e,t){return typeof e=="object"&&e!==null&&e.key!=null?X$(""+e.key):t.toString(36)}function Nh(e,t,n,r,i){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case of:case $$:o=!0}}if(o)return o=e,i=i(o),e=r===""?"."+rv(o,0):r,bS(i)?(n="",e!=null&&(n=e.replace(_S,"$&/")+"/"),Nh(i,t,n,"",function(u){return u})):i!=null&&(Ww(i)&&(i=Q$(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(_S,"$&/")+"/")+e)),t.push(i)),1;if(o=0,r=r===""?".":r+":",bS(e))for(var a=0;a<e.length;a++){s=e[a];var l=r+rv(s,a);o+=Nh(s,t,n,l,i)}else if(l=Y$(e),typeof l=="function")for(e=l.call(e),a=0;!(s=e.next()).done;)s=s.value,l=r+rv(s,a++),o+=Nh(s,t,n,l,i);else if(s==="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 Af(e,t,n){if(e==null)return e;var r=[],i=0;return Nh(e,r,"","",function(s){return t.call(n,s,i++)}),r}function Z$(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 On={current:null},Rh={transition:null},J$={ReactCurrentDispatcher:On,ReactCurrentBatchConfig:Rh,ReactCurrentOwner:Bw};function zP(){throw Error("act(...) is not supported in production builds of React.")}ze.Children={map:Af,forEach:function(e,t,n){Af(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Af(e,function(){t++}),t},toArray:function(e){return Af(e,function(t){return t})||[]},only:function(e){if(!Ww(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ze.Component=_c;ze.Fragment=U$;ze.Profiler=z$;ze.PureComponent=Vw;ze.StrictMode=V$;ze.Suspense=H$;ze.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=J$;ze.act=zP;ze.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=MP({},e.props),i=e.key,s=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,o=Bw.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)$P.call(t,l)&&!UP.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 u=0;u<l;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:of,type:e.type,key:i,ref:s,props:r,_owner:o}};ze.createContext=function(e){return e={$$typeof:W$,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:B$,_context:e},e.Consumer=e};ze.createElement=VP;ze.createFactory=function(e){var t=VP.bind(null,e);return t.type=e,t};ze.createRef=function(){return{current:null}};ze.forwardRef=function(e){return{$$typeof:q$,render:e}};ze.isValidElement=Ww;ze.lazy=function(e){return{$$typeof:K$,_payload:{_status:-1,_result:e},_init:Z$}};ze.memo=function(e,t){return{$$typeof:G$,type:e,compare:t===void 0?null:t}};ze.startTransition=function(e){var t=Rh.transition;Rh.transition={};try{e()}finally{Rh.transition=t}};ze.unstable_act=zP;ze.useCallback=function(e,t){return On.current.useCallback(e,t)};ze.useContext=function(e){return On.current.useContext(e)};ze.useDebugValue=function(){};ze.useDeferredValue=function(e){return On.current.useDeferredValue(e)};ze.useEffect=function(e,t){return On.current.useEffect(e,t)};ze.useId=function(){return On.current.useId()};ze.useImperativeHandle=function(e,t,n){return On.current.useImperativeHandle(e,t,n)};ze.useInsertionEffect=function(e,t){return On.current.useInsertionEffect(e,t)};ze.useLayoutEffect=function(e,t){return On.current.useLayoutEffect(e,t)};ze.useMemo=function(e,t){return On.current.useMemo(e,t)};ze.useReducer=function(e,t,n){return On.current.useReducer(e,t,n)};ze.useRef=function(e){return On.current.useRef(e)};ze.useState=function(e){return On.current.useState(e)};ze.useSyncExternalStore=function(e,t,n){return On.current.useSyncExternalStore(e,t,n)};ze.useTransition=function(){return On.current.useTransition()};ze.version="18.3.1";OP.exports=ze;var m=OP.exports;const F=Uw(m),BP=L$({__proto__:null,default:F},[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 e5=m,t5=Symbol.for("react.element"),n5=Symbol.for("react.fragment"),r5=Object.prototype.hasOwnProperty,i5=e5.__SECRET_INT
vendor: 11,418 bytes, lines 17-34
17ERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s5={key:!0,ref:!0,__self:!0,__source:!0};function WP(e,t,n){var r,i={},s=null,o=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)r5.call(t,r)&&!s5.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:t5,type:e,key:s,ref:o,props:i,_owner:i5.current}}Lm.Fragment=n5;Lm.jsx=WP;Lm.jsxs=WP;AP.exports=Lm;var c=AP.exports,qP={exports:{}},pr={},HP={exports:{}},GP={};/**
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(R,L){var H=R.length;R.push(L);e:for(;0<H;){var z=H-1>>>1,Q=R[z];if(0<i(Q,L))R[z]=L,R[H]=Q,H=z;else break e}}function n(R){return R.length===0?null:R[0]}function r(R){if(R.length===0)return null;var L=R[0],H=R.pop();if(H!==L){R[0]=H;e:for(var z=0,Q=R.length,de=Q>>>1;z<de;){var ne=2*(z+1)-1,ye=R[ne],he=ne+1,Pe=R[he];if(0>i(ye,H))he<Q&&0>i(Pe,ye)?(R[z]=Pe,R[he]=H,z=he):(R[z]=ye,R[ne]=H,z=ne);else if(he<Q&&0>i(Pe,H))R[z]=Pe,R[he]=H,z=he;else break e}}return L}function i(R,L){var H=R.sortIndex-L.sortIndex;return H!==0?H:R.id-L.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var l=[],u=[],d=1,f=null,h=3,p=!1,g=!1,v=!1,w=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(R){for(var L=n(u);L!==null;){if(L.callback===null)r(u);else if(L.startTime<=R)r(u),L.sortIndex=L.expirationTime,t(l,L);else break;L=n(u)}}function _(R){if(v=!1,b(R),!g)if(n(l)!==null)g=!0,V(S);else{var L=n(u);L!==null&&$(_,L.startTime-R)}}function S(R,L){g=!1,v&&(v=!1,y(C),C=-1),p=!0;var H=h;try{for(b(L),f=n(l);f!==null&&(!(f.expirationTime>L)||R&&!N());){var z=f.callback;if(typeof z=="function"){f.callback=null,h=f.priorityLevel;var Q=z(f.expirationTime<=L);L=e.unstable_now(),typeof Q=="function"?f.callback=Q:f===n(l)&&r(l),b(L)}else r(l);f=n(l)}if(f!==null)var de=!0;else{var ne=n(u);ne!==null&&$(_,ne.startTime-L),de=!1}return de}finally{f=null,h=H,p=!1}}var E=!1,k=null,C=-1,P=5,T=-1;function N(){return!(e.unstable_now()-T<P)}function I(){if(k!==null){var R=e.unstable_now();T=R;var L=!0;try{L=k(!0,R)}finally{L?O():(E=!1,k=null)}}else E=!1}var O;if(typeof x=="function")O=function(){x(I)};else if(typeof MessageChannel<"u"){var j=new MessageChannel,A=j.port2;j.port1.onmessage=I,O=function(){A.postMessage(null)}}else O=function(){w(I,0)};function V(R){k=R,E||(E=!0,O())}function $(R,L){C=w(function(){R(e.unstable_now())},L)}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(R){R.callback=null},e.unstable_continueExecution=function(){g||p||(g=!0,V(S))},e.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<R?Math.floor(1e3/R):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(R){switch(h){case 1:case 2:case 3:var L=3;break;default:L=h}var H=h;h=L;try{return R()}finally{h=H}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(R,L){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var H=h;h=R;try{return L()}finally{h=H}},e.unstable_scheduleCallback=function(R,L,H){var z=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?z+H:z):H=z,R){case 1:var Q=-1;break;case 2:Q=250;break;case 5:Q=1073741823;break;case 4:Q=1e4;break;default:Q=5e3}return Q=H+Q,R={id:d++,callback:L,priorityLevel:R,startTime:H,expirationTime:Q,sortIndex:-1},H>z?(R.sortIndex=H,t(u,R),n(l)===null&&R===n(u)&&(v?(y(C),C=-1):v=!0,$(_,H-z))):(R.sortIndex=Q,t(l,R),g||p||(g=!0,V(S))),R},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(R){var L=h;return function(){var H=h;h=L;try{return R.apply(this,arguments)}finally{h=H}}}})(GP);HP.exports=GP;var o5=HP.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 a5=m,fr=o5;function Z(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 KP=new Set,Xu={};function La(e,t){tc(e,t),tc(e+"Capture",t)}function tc(e,t){for(Xu[e]=t,e=0;e<t.length;e++)KP.add(t[e])}var us=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Gy=Object.prototype.hasOwnProperty,l5=/^[: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]*$/,SS={},ES={};function c5(e){return Gy.call(ES,e)?!0:Gy.call(SS,e)?!1:l5.test(e)?ES[e]=!0:(SS[e]=!0,!1)}function u5(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 d5(e,t,n,r){if(t===null||typeof t>"u"||u5(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 Dn(e,t,n,r,i,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var on={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){on[e]=new Dn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];on[t]=new Dn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){on[e]=new Dn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){on[e]=new Dn(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){on[e]=new Dn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){on[e]=new Dn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){on[e]=new Dn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){on[e]=new Dn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){on[e]=new Dn(e,5,!1,e.toLowerCase(),null,!1,!1)});var qw=/[\-:]([a-z])/g;function Hw(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(qw,Hw);on[t]=new Dn(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(qw,Hw);on[t]=new Dn(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(qw,Hw);on[t]=new Dn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){on[e]=new Dn(e,1,!1,e.toLowerCase(),null,!1,!1)});on.xlinkHref=new Dn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){on[e]=new Dn(e,1,!1,e.toLowerCase(),null,!0,!0)});function Gw(e,t,n,r){var i=on.hasOwnProperty(t)?on[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(d5(t,n,i,r)&&(n=null),r||i===null?c5(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var xs=a5.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Of=Symbol.for("react.element"),ll=Symbol.for("react.portal"),cl=Symbol.for("react.fragment"),Kw=Symbol.for("react.strict_mode"),Ky=Symbol.for("react.profiler"),YP=Symbol.for("react.provider"),QP=Symbol.for("react.context"),Yw=Symbol.for("react.forward_ref"),Yy=Symbol.for("react.suspense"),Qy=Symbol.for("react.suspense_list"),Qw=Symbol.for("react.memo"),Os=Symbol.for("react.lazy"),XP=Symbol.for("react.offscreen"),kS=Symbol.iterator;function Kc(e){return e===null||typeof e!="object"?null:(e=kS&&e[kS]||e["@@iterator"],typeof e=="function"?e:null)}var xt=Object.assign,iv;function vu(e){if(iv===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);iv=t&&t[1]||""}return`
34`+iv+e}var sv=!1;function ov(e,t){if(!e||sv)return"";sv=!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(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}
vendor: 4,297 bytes, lines 34-37
34catch(u){if(u&&r&&typeof u.stack=="string"){for(var i=u.stack.split(`
35`),s=r.stack.split(`
36`),o=i.length-1,a=s.length-1;1<=o&&0<=a&&i[o]!==s[a];)a--;for(;1<=o&&0<=a;o--,a--)if(i[o]!==s[a]){if(o!==1||a!==1)do if(o--,a--,0>a||i[o]!==s[a]){var l=`
37`+i[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{sv=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?vu(e):""}function f5(e){switch(e.tag){case 5:return vu(e.type);case 16:return vu("Lazy");case 13:return vu("Suspense");case 19:return vu("SuspenseList");case 0:case 2:case 15:return e=ov(e.type,!1),e;case 11:return e=ov(e.type.render,!1),e;case 1:return e=ov(e.type,!0),e;default:return""}}function Xy(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 cl:return"Fragment";case ll:return"Portal";case Ky:return"Profiler";case Kw:return"StrictMode";case Yy:return"Suspense";case Qy:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case QP:return(e.displayName||"Context")+".Consumer";case YP:return(e._context.displayName||"Context")+".Provider";case Yw:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Qw:return t=e.displayName||null,t!==null?t:Xy(e.type)||"Memo";case Os:t=e._payload,e=e._init;try{return Xy(e(t))}catch{}}return null}function h5(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 Xy(t);case 8:return t===Kw?"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 xo(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ZP(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function p5(e){var t=ZP(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Df(e){e._valueTracker||(e._valueTracker=p5(e))}function JP(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ZP(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function cp(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 Zy(e,t){var n=t.checked;return xt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function CS(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=xo(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 eN(e,t){t=t.checked,t!=null&&Gw(e,"checked",t,!1)}function Jy(e,t){eN(e,t);var n=xo(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")?e0(e,t.type,n):t.hasOwnProperty("defaultValue")&&e0(e,t.type,xo(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}
vendor: 4,180 bytes, line 37
37function TS(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 e0(e,t,n){(t!=="number"||cp(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var yu=Array.isArray;function Pl(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+xo(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function t0(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(Z(91));return xt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function jS(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(Z(92));if(yu(n)){if(1<n.length)throw Error(Z(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:xo(n)}}function tN(e,t){var n=xo(t.value),r=xo(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 PS(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function nN(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 n0(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?nN(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Mf,rN=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Mf=Mf||document.createElement("div"),Mf.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Mf.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Zu(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Tu={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},m5=["Webkit","ms","Moz","O"];Object.keys(Tu).forEach(function(e){m5.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Tu[t]=Tu[e]})});function iN(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Tu.hasOwnProperty(e)&&Tu[e]?(""+t).trim():t+"px"}function sN(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=iN(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var g5=xt({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 r0(e,t){if(t){if(g5[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Z(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Z(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Z(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Z(62))}}function i0(e,t){if(e.indexOf("-")===-1)return typeof t.is=="str
37ing";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var s0=null;function Xw(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var o0=null,Nl=null,Rl=null;function NS(e){if(e=cf(e)){if(typeof o0!="function")throw Error(Z(280));var t=e.stateNode;t&&(t=zm(t),o0(e.stateNode,e.type,t))}}function oN(e){Nl?Rl?Rl.push(e):Rl=[e]:Nl=e}function aN(){if(Nl){var e=Nl,t=Rl;if(Rl=Nl=null,NS(e),t)for(e=0;e<t.length;e++)NS(t[e])}}function lN(e,t){return e(t)}function cN(){}var av=!1;function uN(e,t,n){if(av)return e(t,n);av=!0;try{return lN(e,t,n)}finally{av=!1,(Nl!==null||Rl!==null)&&(cN(),aN())}}function Ju(e,t){var n=e.stateNode;if(n===null)return null;var r=zm(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(Z(231,t,typeof n));return n}var a0=!1;if(us)try{var Yc={};Object.defineProperty(Yc,"passive",{get:function(){a0=!0}}),window.addEventListener("test",Yc,Yc),window.removeEventListener("test",Yc,Yc)}catch{a0=!1}function v5(e,t,n,r,i,s,o,a,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var ju=!1,up=null,dp=!1,l0=null,y5={onError:function(e){ju=!0,up=e}};function x5(e,t,n,r,i,s,o,a,l){ju=!1,up=null,v5.apply(y5,arguments)}function w5(e,t,n,r,i,s,o,a,l){if(x5.apply(this,arguments),ju){if(ju){var u=up;ju=!1,up=null}else throw Error(Z(198));dp||(dp=!0,l0=u)}}function Fa(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 dN(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 RS(e){if(Fa(e)!==e)throw Error(Z(188))}function b5(e){var t=e.alternate;if(!t){if(t=Fa(e),t===null)throw Error(Z(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return RS(i),e;if(s===r)return RS(i),t;s=s.sibling}throw Error(Z(188))}if(n.return!==r.return)n=i,r=s;else{for(var o=!1,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){for(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)throw Error(Z(189))}}if(n.alternate!==r)throw Error(Z(190))}if(n.tag!==3)throw Error(Z(188));return n.stateNode.current===n?e:t}function fN(e){return e=b5(e),e!==null?hN(e):null}function hN(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=hN(e);if(t!==null)return t;e=e.sibling}return null}var pN=fr.unstable_scheduleCallback,IS=fr.unstable_cancelCallback,_5=fr.unstable_shouldYield,S5=fr.unstable_requestPaint,Rt=fr.unstable_now,E5=fr.unstable_getCurrentPriorityLevel,Zw=fr.unstable_ImmediatePriority,mN=fr.unstable_UserBlockingPriority,fp=fr.unstable_NormalPriority,k5=fr.unstable_LowPriority,gN=fr.unstable_IdlePriority,Fm=null,ji=null;function C5(e){if(ji&&typeof ji.onCommitFiberRoot=="function")try{ji.onCommitFiberRoot(Fm,e,void 0,(e.current.flags&128)===128)}catch{}}var ni=Math.clz32?Math.clz32:P5,T5=Math.log,j5=Math.LN2;function P5(e){return e>>>=0,e===0?32:31-(T5(e)/j5|0)|0}var Lf=64,Ff=4194304;function xu(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 hp(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~i;a!==0?r=xu(a):(s&=o,s!==0&&(r=xu(s)))}else o=n&~i,o!==0?r=xu(o):s!==0&&(r=xu(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-ni(t),i=1<<n,r|=e[n],t&=~i;return r}function N5(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 R5(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var o=31-ni(s),a=1<<o,l=i[o];l===-1?(!(a&n)||a&r)&&(i[o]=N5(a,t)):l<=t&&(e.expiredLanes|=a),s&=~a}}function c0(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function vN(){var e=Lf;return Lf<<=1,!(Lf&4194240)&&(Lf=64),e}function lv(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function af(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ni(t),e[t]=n}function I5(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 i=31-ni(n),s=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~s}}function Jw(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ni(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Xe=0;function yN(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var xN,eb,wN,bN,_N,u0=!1,$f=[],no=null,ro=null,io=null,ed=new Map,td=new Map,Fs=[],A5="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function AS(e,t){switch(e){case"focusin":case"focusout":no=null;break;case"dragenter":case"dragleave":ro=null;break;case"mouseover":case"mouseout":io=null;break;case"pointerover":case"pointerout":ed.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":td.delete(t.pointerId)}}function Qc(e,t,n,r,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},t!==null&&(t=cf(t),t!==null&&eb(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function O5(e,t,n,r,i){switch(t){case"focusin":return no=Qc(no,e,t,n,r,i),!0;case"dragenter":return ro=Qc(ro,e,t,n,r,i),!0;case"mouseover":return io=Qc(io,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return ed.set(s,Qc(ed.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,td.set(s,Qc(td.get(s)||null,e,t,n,r,i)),!0}return!1}function SN(e){var t=ta(e.target);if(t!==null){var n=Fa(t);if(n!==null){if(t=n.tag,t===13){if(t=dN(n),t!==null){e.blockedOn=t,_N(e.priority,function(){wN(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 Ih(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=d0(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);s0=r,n.target.dispatchEvent(r),s0=null}else return t=cf(n),t!==null&&eb(t),e.blockedOn=n,!1;t.shift()}return!0}function OS(e,t,n){Ih(e)&&n.delete(t)}function D5(){u0=!1,no!==null&&Ih(no)&&(no=null),ro!==null&&Ih(ro)&&(ro=null),io!==null&&Ih(io)&&(io=null),ed.forEach(OS),td.forEach(OS)}function Xc(e,t){e.blockedOn===t&&(e.blockedOn=null,u0||(u0=!0,fr.unstable_scheduleCallback(fr.unstable_NormalPriority,D5)))}
vendor: 10,421 bytes, line 37
37function nd(e){function t(i){return Xc(i,e)}if(0<$f.length){Xc($f[0],e);for(var n=1;n<$f.length;n++){var r=$f[n];r.blockedOn===e&&(r.blockedOn=null)}}for(no!==null&&Xc(no,e),ro!==null&&Xc(ro,e),io!==null&&Xc(io,e),ed.forEach(t),td.forEach(t),n=0;n<Fs.length;n++)r=Fs[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Fs.length&&(n=Fs[0],n.blockedOn===null);)SN(n),n.blockedOn===null&&Fs.shift()}var Il=xs.ReactCurrentBatchConfig,pp=!0;function M5(e,t,n,r){var i=Xe,s=Il.transition;Il.transition=null;try{Xe=1,tb(e,t,n,r)}finally{Xe=i,Il.transition=s}}function L5(e,t,n,r){var i=Xe,s=Il.transition;Il.transition=null;try{Xe=4,tb(e,t,n,r)}finally{Xe=i,Il.transition=s}}function tb(e,t,n,r){if(pp){var i=d0(e,t,n,r);if(i===null)yv(e,t,r,mp,n),AS(e,r);else if(O5(i,e,t,n,r))r.stopPropagation();else if(AS(e,r),t&4&&-1<A5.indexOf(e)){for(;i!==null;){var s=cf(i);if(s!==null&&xN(s),s=d0(e,t,n,r),s===null&&yv(e,t,r,mp,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else yv(e,t,r,null,n)}}var mp=null;function d0(e,t,n,r){if(mp=null,e=Xw(r),e=ta(e),e!==null)if(t=Fa(e),t===null)e=null;else if(n=t.tag,n===13){if(e=dN(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 mp=e,null}function EN(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(E5()){case Zw:return 1;case mN:return 4;case fp:case k5:return 16;case gN:return 536870912;default:return 16}default:return 16}}var Js=null,nb=null,Ah=null;function kN(){if(Ah)return Ah;var e,t=nb,n=t.length,r,i="value"in Js?Js.value:Js.textContent,s=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[s-r];r++);return Ah=i.slice(e,1<r?1-r:void 0)}function Oh(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 Uf(){return!0}function DS(){return!1}function mr(e){function t(n,r,i,s,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Uf:DS,this.isPropagationStopped=DS,this}return xt(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=Uf)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Uf)},persist:function(){},isPersistent:Uf}),t}var Sc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},rb=mr(Sc),lf=xt({},Sc,{view:0,detail:0}),F5=mr(lf),cv,uv,Zc,$m=xt({},lf,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ib,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!==Zc&&(Zc&&e.type==="mousemove"?(cv=e.screenX-Zc.screenX,uv=e.screenY-Zc.screenY):uv=cv=0,Zc=e),cv)},movementY:function(e){return"movementY"in e?e.movementY:uv}}),MS=mr($m),$5=xt({},$m,{dataTransfer:0}),U5=mr($5),V5=xt({},lf,{relatedTarget:0}),dv=mr(V5),z5=xt({},Sc,{animationName:0,elapsedTime:0,pseudoElement:0}),B5=mr(z5),W5=xt({},Sc,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),q5=mr(W5),H5=xt({},Sc,{data:0}),LS=mr(H5),G5={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},K5={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"},Y5={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Q5(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Y5[e])?!!t[e]:!1}function ib(){return Q5}var X5=xt({},lf,{key:function(e){if(e.key){var t=G5[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Oh(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?K5[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ib,charCode:function(e){return e.type==="keypress"?Oh(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Oh(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Z5=mr(X5),J5=xt({},$m,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),FS=mr(J5),eU=xt({},lf,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ib}),tU=mr(eU),nU=xt({},Sc,{propertyName:0,elapsedTime:0,pseudoElement:0}),rU=mr(nU),iU=xt({},$m,{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}),sU=mr(iU),oU=[9,13,27,32],sb=us&&"CompositionEvent"in window,Pu=null;us&&"documentMode"in document&&(Pu=document.documentMode);var aU=us&&"TextEvent"in window&&!Pu,CN=us&&(!sb||Pu&&8<Pu&&11>=Pu),$S=" ",US=!1;function TN(e,t){switch(e){case"keyup":return oU.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jN(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ul=!1;function lU(e,t){switch(e){case"compositionend":return jN(t);case"keypress":return t.which!==32?null:(US=!0,$S);case"textInput":return e=t.data,e===$S&&US?null:e;default:return null}}function cU(e,t){if(ul)return e==="compositionend"||!sb&&TN(e,t)?(e=kN(),Ah=nb=Js=null,ul=!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 CN&&t.locale!=="ko"?null:t.data;default:return null}}var uU={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 VS(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!uU[e.type]:t==="textarea"}function PN(e,t,n,r){oN(r),t=gp(t,"onChange"),0<t.length&&(n=new rb("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Nu=null,rd=null;function dU(e){UN(e,0)}function Um(e){var t=hl(e);if(JP(t))return e}function fU(e,t){if(e==="change")return t}var NN=!1;if(us){var fv;if(us){var hv="oninput"in document;if(!hv){var zS=document.createElement("div");zS.setAttribute("oninput","return;"),hv=typeof zS.oninput=="function"}fv=hv}else fv=!1;NN=fv&&(!document.documentMode||9<document.documentMode)}function BS(){Nu&&(Nu.detachEvent("onpropertychange",RN),rd=Nu=null)}function RN(e){if(e.propertyName==="value"&&Um(rd)){var t=[];PN(t,rd,e,Xw(e)),uN(dU,t)}}function hU(e,t,n){e==="focusin"?(BS(),Nu=t,rd=n,Nu.attachEvent("onpropertychange",RN)):e==="focusout"&&BS()}function pU(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Um(rd)}function mU(e,t){if(e==="click")return Um(t)}function gU(e,t){if(e==="input"||e==="change")return Um(t)}function vU(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var si=typeof Object.is=="function"?Object.is:vU;function id(e,t){if(si(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 i=n[r];if(!Gy.call(t,i)||!si(e[i],t[i]))return!1}return!0}function WS(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function qS(e,t){var n=WS(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=WS(n)}}function IN(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?IN(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function AN(){for(var e=window,t=cp();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=cp(e.document)}return t}function ob(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 yU(e){var t=AN(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&IN(n.ownerDocument.documentElement,n)){if(r!==null&&ob(n)){if
vendor: 5,775 bytes, line 37
37(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=qS(n,s);var o=qS(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var xU=us&&"documentMode"in document&&11>=document.documentMode,dl=null,f0=null,Ru=null,h0=!1;function HS(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;h0||dl==null||dl!==cp(r)||(r=dl,"selectionStart"in r&&ob(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}),Ru&&id(Ru,r)||(Ru=r,r=gp(f0,"onSelect"),0<r.length&&(t=new rb("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=dl)))}function Vf(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var fl={animationend:Vf("Animation","AnimationEnd"),animationiteration:Vf("Animation","AnimationIteration"),animationstart:Vf("Animation","AnimationStart"),transitionend:Vf("Transition","TransitionEnd")},pv={},ON={};us&&(ON=document.createElement("div").style,"AnimationEvent"in window||(delete fl.animationend.animation,delete fl.animationiteration.animation,delete fl.animationstart.animation),"TransitionEvent"in window||delete fl.transitionend.transition);function Vm(e){if(pv[e])return pv[e];if(!fl[e])return e;var t=fl[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ON)return pv[e]=t[n];return e}var DN=Vm("animationend"),MN=Vm("animationiteration"),LN=Vm("animationstart"),FN=Vm("transitionend"),$N=new Map,GS="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 Io(e,t){$N.set(e,t),La(t,[e])}for(var mv=0;mv<GS.length;mv++){var gv=GS[mv],wU=gv.toLowerCase(),bU=gv[0].toUpperCase()+gv.slice(1);Io(wU,"on"+bU)}Io(DN,"onAnimationEnd");Io(MN,"onAnimationIteration");Io(LN,"onAnimationStart");Io("dblclick","onDoubleClick");Io("focusin","onFocus");Io("focusout","onBlur");Io(FN,"onTransitionEnd");tc("onMouseEnter",["mouseout","mouseover"]);tc("onMouseLeave",["mouseout","mouseover"]);tc("onPointerEnter",["pointerout","pointerover"]);tc("onPointerLeave",["pointerout","pointerover"]);La("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));La("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));La("onBeforeInput",["compositionend","keypress","textInput","paste"]);La("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));La("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));La("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var wu="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(" "),_U=new Set("cancel close invalid load scroll toggle".split(" ").concat(wu));function KS(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,w5(r,t,void 0,e),e.currentTarget=null}function UN(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,u=a.currentTarget;if(a=a.listener,l!==s&&i.isPropagationStopped())break e;KS(i,a,u),s=l}else for(o=0;o<r.length;o++){if(a=r[o],l=a.instance,u=a.currentTarget,a=a.listener,l!==s&&i.isPropagationStopped())break e;KS(i,a,u),s=l}}}if(dp)throw e=l0,dp=!1,l0=null,e}function lt(e,t){var n=t[y0];n===void 0&&(n=t[y0]=new Set);var r=e+"__bubble";n.has(r)||(VN(t,e,2,!1),n.add(r))}function vv(e,t,n){var r=0;t&&(r|=4),VN(n,e,r,t)}var zf="_reactListening"+Math.random().toString(36).slice(2);function sd(e){if(!e[zf]){e[zf]=!0,KP.forEach(function(n){n!=="selectionchange"&&(_U.has(n)||vv(n,!1,e),vv(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[zf]||(t[zf]=!0,vv("selectionchange",!1,t))}}function VN(e,t,n,r){switch(EN(t)){case 1:var i=M5;break;case 4:i=L5;break;default:i=tb}n=i.bind(null,t,n,e),i=void 0,!a0||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function yv(e,t,n,r,i){var s=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;
vendor: 21,411 bytes, lines 37-38
37if(a===i||a.nodeType===8&&a.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;o=o.return}for(;a!==null;){if(o=ta(a),o===null)return;if(l=o.tag,l===5||l===6){r=s=o;continue e}a=a.parentNode}}r=r.return}uN(function(){var u=s,d=Xw(n),f=[];e:{var h=$N.get(e);if(h!==void 0){var p=rb,g=e;switch(e){case"keypress":if(Oh(n)===0)break e;case"keydown":case"keyup":p=Z5;break;case"focusin":g="focus",p=dv;break;case"focusout":g="blur",p=dv;break;case"beforeblur":case"afterblur":p=dv;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=MS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=U5;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=tU;break;case DN:case MN:case LN:p=B5;break;case FN:p=rU;break;case"scroll":p=F5;break;case"wheel":p=sU;break;case"copy":case"cut":case"paste":p=q5;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=FS}var v=(t&4)!==0,w=!v&&e==="scroll",y=v?h!==null?h+"Capture":null:h;v=[];for(var x=u,b;x!==null;){b=x;var _=b.stateNode;if(b.tag===5&&_!==null&&(b=_,y!==null&&(_=Ju(x,y),_!=null&&v.push(od(x,_,b)))),w)break;x=x.return}0<v.length&&(h=new p(h,g,null,n,d),f.push({event:h,listeners:v}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&n!==s0&&(g=n.relatedTarget||n.fromElement)&&(ta(g)||g[ds]))break e;if((p||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,p?(g=n.relatedTarget||n.toElement,p=u,g=g?ta(g):null,g!==null&&(w=Fa(g),g!==w||g.tag!==5&&g.tag!==6)&&(g=null)):(p=null,g=u),p!==g)){if(v=MS,_="onMouseLeave",y="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(v=FS,_="onPointerLeave",y="onPointerEnter",x="pointer"),w=p==null?h:hl(p),b=g==null?h:hl(g),h=new v(_,x+"leave",p,n,d),h.target=w,h.relatedTarget=b,_=null,ta(d)===u&&(v=new v(y,x+"enter",g,n,d),v.target=b,v.relatedTarget=w,_=v),w=_,p&&g)t:{for(v=p,y=g,x=0,b=v;b;b=Ha(b))x++;for(b=0,_=y;_;_=Ha(_))b++;for(;0<x-b;)v=Ha(v),x--;for(;0<b-x;)y=Ha(y),b--;for(;x--;){if(v===y||y!==null&&v===y.alternate)break t;v=Ha(v),y=Ha(y)}v=null}else v=null;p!==null&&YS(f,h,p,v,!1),g!==null&&w!==null&&YS(f,w,g,v,!0)}}e:{if(h=u?hl(u):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var S=fU;else if(VS(h))if(NN)S=gU;else{S=pU;var E=hU}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(S=mU);if(S&&(S=S(e,u))){PN(f,S,n,d);break e}E&&E(e,h,u),e==="focusout"&&(E=h._wrapperState)&&E.controlled&&h.type==="number"&&e0(h,"number",h.value)}switch(E=u?hl(u):window,e){case"focusin":(VS(E)||E.contentEditable==="true")&&(dl=E,f0=u,Ru=null);break;case"focusout":Ru=f0=dl=null;break;case"mousedown":h0=!0;break;case"contextmenu":case"mouseup":case"dragend":h0=!1,HS(f,n,d);break;case"selectionchange":if(xU)break;case"keydown":case"keyup":HS(f,n,d)}var k;if(sb)e:{switch(e){case"compositionstart":var C="onCompositionStart";break e;case"compositionend":C="onCompositionEnd";break e;case"compositionupdate":C="onCompositionUpdate";break e}C=void 0}else ul?TN(e,n)&&(C="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(C="onCompositionStart");C&&(CN&&n.locale!=="ko"&&(ul||C!=="onCompositionStart"?C==="onCompositionEnd"&&ul&&(k=kN()):(Js=d,nb="value"in Js?Js.value:Js.textContent,ul=!0)),E=gp(u,C),0<E.length&&(C=new LS(C,e,null,n,d),f.push({event:C,listeners:E}),k?C.data=k:(k=jN(n),k!==null&&(C.data=k)))),(k=aU?lU(e,n):cU(e,n))&&(u=gp(u,"onBeforeInput"),0<u.length&&(d=new LS("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:u}),d.data=k))}UN(f,t)})}function od(e,t,n){return{instance:e,listener:t,currentTarget:n}}function gp(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=Ju(e,n),s!=null&&r.unshift(od(e,s,i)),s=Ju(e,t),s!=null&&r.push(od(e,s,i))),e=e.return}return r}function Ha(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function YS(e,t,n,r,i){for(var s=t._reactName,o=[];n!==null&&n!==r;){var a=n,l=a.alternate,u=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&u!==null&&(a=u,i?(l=Ju(n,s),l!=null&&o.unshift(od(n,l,a))):i||(l=Ju(n,s),l!=null&&o.push(od(n,l,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var SU=/\r\n?/g,EU=/\u0000|\uFFFD/g;function QS(e){return(typeof e=="string"?e:""+e).replace(SU,`
38`).replace(EU,"")}function Bf(e,t,n){if(t=QS(t),QS(e)!==t&&n)throw Error(Z(425))}function vp(){}var p0=null,m0=null;function g0(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 v0=typeof setTimeout=="function"?setTimeout:void 0,kU=typeof clearTimeout=="function"?clearTimeout:void 0,XS=typeof Promise=="function"?Promise:void 0,CU=typeof queueMicrotask=="function"?queueMicrotask:typeof XS<"u"?function(e){return XS.resolve(null).then(e).catch(TU)}:v0;function TU(e){setTimeout(function(){throw e})}function xv(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),nd(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);nd(t)}function so(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 ZS(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 Ec=Math.random().toString(36).slice(2),ki="__reactFiber$"+Ec,ad="__reactProps$"+Ec,ds="__reactContainer$"+Ec,y0="__reactEvents$"+Ec,jU="__reactListeners$"+Ec,PU="__reactHandles$"+Ec;function ta(e){var t=e[ki];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ds]||n[ki]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ZS(e);e!==null;){if(n=e[ki])return n;e=ZS(e)}return t}e=n,n=e.parentNode}return null}function cf(e){return e=e[ki]||e[ds],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function hl(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Z(33))}function zm(e){return e[ad]||null}var x0=[],pl=-1;function Ao(e){return{current:e}}function ut(e){0>pl||(e.current=x0[pl],x0[pl]=null,pl--)}function st(e,t){pl++,x0[pl]=e.current,e.current=t}var wo={},vn=Ao(wo),Yn=Ao(!1),Sa=wo;function nc(e,t){var n=e.type.contextTypes;if(!n)return wo;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Qn(e){return e=e.childContextTypes,e!=null}function yp(){ut(Yn),ut(vn)}function JS(e,t,n){if(vn.current!==wo)throw Error(Z(168));st(vn,t),st(Yn,n)}function zN(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(Z(108,h5(e)||"Unknown",i));return xt({},n,r)}function xp(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||wo,Sa=vn.current,st(vn,e),st(Yn,Yn.current),!0}function eE(e,t,n){var r=e.stateNode;if(!r)throw Error(Z(169));n?(e=zN(e,t,Sa),r.__reactInternalMemoizedMergedChildContext=e,ut(Yn),ut(vn),st(vn,e)):ut(Yn),st(Yn,n)}var ts=null,Bm=!1,wv=!1;function BN(e){ts===null?ts=[e]:ts.push(e)}function NU(e){Bm=!0,BN(e)}function Oo(){if(!wv&&ts!==null){wv=!0;var e=0,t=Xe;try{var n=ts;for(Xe=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}ts=null,Bm=!1}catch(i){throw ts!==null&&(ts=ts.slice(e+1)),pN(Zw,Oo),i}finally{Xe=t,wv=!1}}return null}var ml=[],gl=0,wp=null,bp=0,Sr=[],Er=0,Ea=null,is=1,ss="";function Go(e,t){ml[gl++]=bp,ml[gl++]=wp,wp=e,bp=t}function WN(e,t,n){Sr[Er++]=is,Sr[Er++]=ss,Sr[Er++]=Ea,Ea=e;var r=is;e=ss;var i=32-ni(r)-1;r&=~(1<<i),n+=1;var s=32-ni(t)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,is=1<<32-ni(t)+i|n<<i|r,ss=s+e}else is=1<<s|n<<i|r,ss=e}function ab(e){e.return!==null&&(Go(e,1),WN(e,1,0))}function lb(e){for(;e===wp;)wp=ml[--gl],ml[gl]=null,bp=ml[--gl],ml[gl]=null;for(;e===Ea;)Ea=Sr[--Er],Sr[Er]=null,ss=Sr[--Er],Sr[Er]=null,is=Sr[--Er],Sr[Er]=null}var cr=null,lr=null,dt=!1,Qr=null;function qN(e,t){var n=Cr(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 tE(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,cr=e,lr=so(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,cr=e,lr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Ea!==null?{id:is,overflow:ss}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Cr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,cr=e,lr=null,!0):!1;default:return!1}}function w0(e){return(e.mode&1)!==0&&(e.flags&128)===0}function b0(e){if(dt){var t=lr;if(t){var n=t;if(!tE(e,t)){if(w0(e))throw Error(Z(418));t=so(n.nextSibling);var r=cr;t&&tE(e,t)?qN(r,n):(e.flags=e.flags&-4097|2,dt=!1,cr=e)}}else{if(w0(e))throw Error(Z(418));e.flags=e.flags&-4097|2,dt=!1,cr=e}}}function nE(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;cr=e}function Wf(e){if(e!==cr)return!1;if(!dt)return nE(e),dt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!g0(e.type,e.memoizedProps)),t&&(t=lr)){if(w0(e))throw HN(),Error(Z(418));for(;t;)qN(e,t),t=so(t.nextSibling)}if(nE(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Z(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){lr=so(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}lr=null}}else lr=cr?so(e.stateNode.nextSibling):null;return!0}function HN(){for(var e=lr;e;)e=so(e.nextSibling)}function rc(){lr=cr=null,dt=!1}function cb(e){Qr===null?Qr=[e]:Qr.push(e)}var RU=xs.ReactCurrentBatchConfig;function Jc(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(Z(309));var r=n.stateNode}if(!r)throw Error(Z(147,e));var i=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(o){var a=i.refs;o===null?delete a[s]:a[s]=o},t._stringRef=s,t)}if(typeof e!="string")throw Error(Z(284));if(!n._owner)throw Error(Z(290,e))}return e}function qf(e,t){throw e=Object.prototype.toString.call(t),Error(Z(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function rE(e){var t=e._init;return t(e._payload)}function GN(e){function t(y,x){if(e){var b=y.deletions;b===null?(y.deletions=[x],y.flags|=16):b.push(x)}}function n(y,x){if(!e)return null;for(;x!==null;)t(y,x),x=x.sibling;return null}function r(y,x){for(y=new Map;x!==null;)x.key!==null?y.set(x.key,x):y.set(x.index,x),x=x.sibling;return y}function i(y,x){return y=co(y,x),y.index=0,y.sibling=null,y}function s(y,x,b){return y.index=b,e?(b=y.alternate,b!==null?(b=b.index,b<x?(y.flags|=2,x):b):(y.flags|=2,x)):(y.flags|=1048576,x)}function o(y){return e&&y.alternate===null&&(y.flags|=2),y}function a(y,x,b,_){return x===null||x.tag!==6?(x=Tv(b,y.mode,_),x.return=y,x):(x=i(x,b),x.return=y,x)}function l(y,x,b,_){var S=b.type;return S===cl?d(y,x,b.props.children,_,b.key):x!==null&&(x.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Os&&rE(S)===x.type)?(_=i(x,b.props),_.ref=Jc(y,x,b),_.return=y,_):(_=Vh(b.type,b.key,b.props,null,y.mode,_),_.ref=Jc(y,x,b),_.return=y,_)}function u(y,x,b,_){return x===null||x.tag!==4||x.stateNode.containerInfo!==b.containerInfo||x.stateNode.implementation!==b.implementation?(x=jv(b,y.mode,_),x.return=y,x):(x=i(x,b.children||[]),x.return=y,x)}function d(y,x,b,_,S){return x===null||x.tag!==7?(x=va(b,y.mode,_,S),x.return=y,x):(x=i(x,b),x.return=y,x)}function f(y,x,b){if(typeof x=="string"&&x!==""||typeof x=="number")return x=Tv(""+x,y.mode,b),x.return=y,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Of:return b=Vh(x.type,x.key,x.props,null,y.mode,b),b.ref=Jc(y,null,x),b.return=y,b;case ll:return x=jv(x,y.mode,b),x.return=y,x;case Os:var _=x._init;return f(y,_(x._payload),b)}if(yu(x)||Kc(x))return x=va(x,y.mode,b,null),x.return=y,x;qf(y,x)}return null}function h(y,x,b,_){var S=x!==null?x.key:null;if(typeof b=="string"&&b!==""||typeof b=="number")return S!==null?null:a(y,x,""+b,_);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Of:return b.key===S?l(y,x,b,_):null;case ll:return b.key===S?u(y,x,b,_):null;case Os:return S=b._init,h(y,x,S(b._payload),_)}if(yu(b)||Kc(b))return S!==null?null:d(y,x,b,_,null);qf(y,b)}return null}function p(y,x,b,_,S){if(typeof _=="string"&&_!==""||typeof _=="number")return y=y.get(b)||null,a(x,y,""+_,S);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case Of:return y=y.get(_.key===null?b:_.key)||null,l(x,y,_,S);case ll:return y=y.get(_.key===null?b:_.key)||null,u(x,y,_,S);case Os:var E=_._init;return p(y,x,b,E(_._payload),S)}if(yu(_)||Kc(_))return y=y.get(b)||null,d(x,y,_,S,null);qf(x,_)}return null}function g(y,x,b,_){for(var S=null,E=null,k=x,C=x=0,P=null;k!==null&&C<b.length;C++){k.index>C?(P=k,k=null):P=k.sibling;var T=h(y,k,b[C],_);if(T===null){k===null&&(k=P);break}e&&k&&T.alternate===null&&t(y,k),x=s(T,x,C),E===null?S=T:E.sibling=T,E=T,k=P}if(C===b.length)return n(y,k),dt&&Go(y,C),S;if(k===null){for(;C<b.length;C++)k=f(y,b[C],_),k!==null&&(x=s(k,x,C),E===null?S=k:E.sibling=k,E=k);return dt&&Go(y,C),S}for(k=r(y,k);C<b.length;C++)P=p(k,y,C,b[C],_),P!==null&&(e&&P.alternate!==null&&k.delete(P.key===null?C:P.key),x=s(P,x,C),E===null?S=P:E.sibling=P,E=P);return e&&k.forEach(function(N){return t(y,N)}),dt&&Go(y,C),S}function v(y,x,b,_){var S=Kc(b);if(typeof S!="function")throw Error(Z(150));if(b=S.call(b),b==null)throw Error(Z(151));for(var E=S=null,k=x,C=x=0,P=null,T=b.next();k!==null&&!T.done;C++,T=b.next()){k.index>C?(P=k,k=null):P=k.sibling;var N=h(y,k,T.value,_);if(N===null){k===null&&(k=P);break}e&&k&&N.alternate===null&&t(y,k),x=s(N,x,C),E===null?S=N:E.sibling=N,E=N,k=P}if(T.done)return n(y,k),dt&&Go(y,C),S;if(k===null){for(;!T.done;C++,T=b.next())T=f(y,T.value,_),T!==null&&(x=s(T,x,C),E===null?S=T:E.sibling=T,E=T);return dt&&Go(y,C),S}for(k=r(y,k);!T.done;C++,T=b.next())T=p(k,y,C,T.value,_),T!==null&&(e&&T.alternate!==null&&k.delete(T.key===null?C:T.key),x=s(T,x,C),E===null?S=T:E.sibling=T,E=T);return e&&k.forEach(function(I){return t(y,I)}),dt&&Go(y,C),S}function w(y,x,b,_){if(typeof b=="object"&&b!==null&&b.type===cl&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case Of:e:{for(var S=b.key,E=x;E!==null;){if(E.key===S){if(S=b.type,S===cl){if(E.tag===7){n(y,E.sibling),x=i(E,b.props.children),x.return=y,y=x;break e}}else if(E.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Os&&rE(S)===E.type){n(y,E.sibling),x=i(E,b.props),x.ref=Jc(y,E,b),x.return=y,y=x;break e}n(y,E);break}else t(y,E);E=E.sibling}b.type===cl?(x=va(b.props.children,y.mode,_,b.key),x.return=y,y=x):(_=Vh(b.type,b.key,b.props,null,y.mode,_),_.ref=Jc(y,x,b),_.return=y,y=_)}return o(y);case ll:e:{for(E=b.key;x!==null;){if(x.key===E)if(x.tag===4&&x.stateNode.containerInfo===b.containerInfo&&x.stateNode.implementation===b.implementation){n(y,x.sibling),x=i(x,b.children||[]),x.return=y,y=x;break e}else{n(y,x);break}else t(y,x);x=x.sibling}x=jv(b,y.mode,_),x.return=y,y=x}return o(y);case Os:return E=b._init,w(y,x,E(b._payload),_)}if(yu(b))return g(y,x,b,_);if(Kc(b))return v(y,x,b,_);qf(y,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,x!==null&&x.tag===6?(n(y,x.sibling),x=i(x,b),x.return=y,y=x):(n(y,x),x=Tv(b,y.mode,_),x.return=y,y=x),o(y)):n(y,x)}return w}var ic=GN(!0),KN=GN(!1),_p=Ao(null),Sp=null,vl=null,ub=null;function db(){ub=vl=Sp=null}function fb(e){var t=_p.current;ut(_p),e._currentValue=t}function _0(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 Al(e,t){Sp=e,ub=vl=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Gn=!0),e.firstContext=null)}function Ar(e){var t=e._currentValue;if(ub!==e)if(e={context:e,memoizedValue:t,next:null},vl===null){if(Sp===null)throw Error(Z(308));vl=e,Sp.dependencies={lanes:0,firstContext:e}}else vl=vl.next=e;return t}var na=null;function hb(e){na===null?na=[e]:na.push(e)}function YN(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,hb(t)):(n.next=i.next,i.next=n),t.interleaved=n,fs(e,r)}function fs(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 Ds=!1;function pb(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function QN(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 as(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function oo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,He&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,fs(e,n)}return i=r.interleaved,i===null?(t.next=t,hb(r)):(t.next=i.next,i.next=t),r.interleaved=t,fs(e,n)}function Dh(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,Jw(e,n)}}function iE(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ep(e,t,n,r){var i=e.updateQueue;Ds=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,u=l.next;l.next=null,o===null?s=u:o.next=u,o=l;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=u:a.next=u,d.lastBaseUpdate=l))}if(s!==null){var f=i.baseState;o=0,d=u=l=null,a=s;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 g=e,v=a;switch(h=t,p=n,v.tag){case 1:if(g=v.payload,typeof g=="function"){f=g.call(p,f,h);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=v.payload,h=typeof g=="function"?g.call(p,f,h):g,h==null)break e;f=xt({},f,h);break e;case 2:Ds=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[a]:h.push(a))}else p={eventTime:p,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(u=d=p,l=f):d=d.next=p,o|=h;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;h=a,a=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(d===null&&(l=f),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);Ca|=o,e.lanes=o,e.memoizedState=f}}function sE(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(Z(191,i));i.call(r)}}}var uf={},Pi=Ao(uf),ld=Ao(uf),cd=Ao(uf);function ra(e){if(e===uf)throw Error(Z(174));return e}function mb(e,t){switch(st(cd,t),st(ld,e),st(Pi,uf),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:n0(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=n0(t,e)}ut(Pi),st(Pi,t)}function sc(){ut(Pi),ut(ld),ut(cd)}function XN(e){ra(cd.current);var t=ra(Pi.current),n=n0(t,e.type);t!==n&&(st(ld,e),st(Pi,n))}function gb(e){ld.current===e&&(ut(Pi),ut(ld))}var mt=Ao(0);function kp(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 bv=[];function vb(){for(var e=0;e<bv.length;e++)bv[e]._workInProgressVersionPrimary=null;bv.length=0}var Mh=xs.ReactCurrentDispatcher,_v=xs.ReactCurrentBatchConfig,ka=0,yt=null,Vt=null,Yt=null,Cp=!1,Iu=!1,ud=0,IU=0;
vendor: 5,855 bytes, line 38
38function cn(){throw Error(Z(321))}function yb(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!si(e[n],t[n]))return!1;return!0}function xb(e,t,n,r,i,s){if(ka=s,yt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Mh.current=e===null||e.memoizedState===null?MU:LU,e=n(r,i),Iu){s=0;do{if(Iu=!1,ud=0,25<=s)throw Error(Z(301));s+=1,Yt=Vt=null,t.updateQueue=null,Mh.current=FU,e=n(r,i)}while(Iu)}if(Mh.current=Tp,t=Vt!==null&&Vt.next!==null,ka=0,Yt=Vt=yt=null,Cp=!1,t)throw Error(Z(300));return e}function wb(){var e=ud!==0;return ud=0,e}function xi(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Yt===null?yt.memoizedState=Yt=e:Yt=Yt.next=e,Yt}function Or(){if(Vt===null){var e=yt.alternate;e=e!==null?e.memoizedState:null}else e=Vt.next;var t=Yt===null?yt.memoizedState:Yt.next;if(t!==null)Yt=t,Vt=e;else{if(e===null)throw Error(Z(310));Vt=e,e={memoizedState:Vt.memoizedState,baseState:Vt.baseState,baseQueue:Vt.baseQueue,queue:Vt.queue,next:null},Yt===null?yt.memoizedState=Yt=e:Yt=Yt.next=e}return Yt}function dd(e,t){return typeof t=="function"?t(e):t}function Sv(e){var t=Or(),n=t.queue;if(n===null)throw Error(Z(311));n.lastRenderedReducer=e;var r=Vt,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var a=o=null,l=null,u=s;do{var d=u.lane;if((ka&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(a=l=f,o=r):l=l.next=f,yt.lanes|=d,Ca|=d}u=u.next}while(u!==null&&u!==s);l===null?o=r:l.next=a,si(r,t.memoizedState)||(Gn=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do s=i.lane,yt.lanes|=s,Ca|=s,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ev(e){var t=Or(),n=t.queue;if(n===null)throw Error(Z(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,s=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do s=e(s,o.action),o=o.next;while(o!==i);si(s,t.memoizedState)||(Gn=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function ZN(){}function JN(e,t){var n=yt,r=Or(),i=t(),s=!si(r.memoizedState,i);if(s&&(r.memoizedState=i,Gn=!0),r=r.queue,bb(n2.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||Yt!==null&&Yt.memoizedState.tag&1){if(n.flags|=2048,fd(9,t2.bind(null,n,r,i,t),void 0,null),Qt===null)throw Error(Z(349));ka&30||e2(n,t,i)}return i}function e2(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=yt.updateQueue,t===null?(t={lastEffect:null,stores:null},yt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function t2(e,t,n,r){t.value=n,t.getSnapshot=r,r2(t)&&i2(e)}function n2(e,t,n){return n(function(){r2(t)&&i2(e)})}function r2(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!si(e,n)}catch{return!0}}function i2(e){var t=fs(e,1);t!==null&&ri(t,e,1,-1)}function oE(e){var t=xi();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:dd,lastRenderedState:e},t.queue=e,e=e.dispatch=DU.bind(null,yt,e),[t.memoizedState,e]}function fd(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=yt.updateQueue,t===null?(t={lastEffect:null,stores:null},yt.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 s2(){return Or().memoizedState}function Lh(e,t,n,r){var i=xi();yt.flags|=e,i.memoizedState=fd(1|t,n,void 0,r===void 0?null:r)}function Wm(e,t,n,r){var i=Or();r=r===void 0?null:r;var s=void 0;if(Vt!==null){var o=Vt.memoizedState;if(s=o.destroy,r!==null&&yb(r,o.deps)){i.memoizedState=fd(t,n,s,r);return}}yt.flags|=e,i.memoizedState=fd(1|t,n,s,r)}function aE(e,t){return Lh(8390656,8,e,t)}function bb(e,t){return Wm(2048,8,e,t)}function o2(e,t){return Wm(4,2,e,t)}function a2(e,t){return Wm(4,4,e,t)}function l2(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 c2(e,t,n){return n=n!=null?n.concat([e]):null,Wm(4,4,l2.bind(null,t,e),n)}function _b(){}function u2(e,t){var n=Or();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&yb(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function d2(e,t){var n=Or();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&yb(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function f2(e,t,n){return ka&21?(si(n,t)||(n=vN(),yt.lanes|=n,Ca|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Gn=!0),e.memoizedState=n)}function AU(e,t){var n=Xe;Xe=n!==0&&4>n?n:4,e(!0);var r=_v.transition;_v.transition={};try{e(!1),t()}finally{Xe=n,_v.transition=r}}function h2(){return Or().memoizedState}function OU(e,t,n){var r=lo(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},p2(e))m2(t,n);else if(n=YN(e,t,n,r),n!==null){var i=In();ri(n,e,r,i),g2(n,t,r)}}function DU(e,t,n){var r=lo(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(p2(e))m2(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,si(a,o)){var l=t.interleaved;l===null?(i.next=i,hb(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=YN(e,t,i,r),n!==null&&(i=In(),ri(n,e,r,i),g2(n,t,r))}}function p2(e){var t=e.alternate;return e===yt||t!==null&&t===yt}function m2(e,t){Iu=Cp=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function g2(e,t,n){if(n&4194240){var r=t.lanes;
vendor: 6,238 bytes, lines 38-40
38r&=e.pendingLanes,n|=r,t.lanes=n,Jw(e,n)}}var Tp={readContext:Ar,useCallback:cn,useContext:cn,useEffect:cn,useImperativeHandle:cn,useInsertionEffect:cn,useLayoutEffect:cn,useMemo:cn,useReducer:cn,useRef:cn,useState:cn,useDebugValue:cn,useDeferredValue:cn,useTransition:cn,useMutableSource:cn,useSyncExternalStore:cn,useId:cn,unstable_isNewReconciler:!1},MU={readContext:Ar,useCallback:function(e,t){return xi().memoizedState=[e,t===void 0?null:t],e},useContext:Ar,useEffect:aE,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Lh(4194308,4,l2.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Lh(4194308,4,e,t)},useInsertionEffect:function(e,t){return Lh(4,2,e,t)},useMemo:function(e,t){var n=xi();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=xi();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=OU.bind(null,yt,e),[r.memoizedState,e]},useRef:function(e){var t=xi();return e={current:e},t.memoizedState=e},useState:oE,useDebugValue:_b,useDeferredValue:function(e){return xi().memoizedState=e},useTransition:function(){var e=oE(!1),t=e[0];return e=AU.bind(null,e[1]),xi().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=yt,i=xi();if(dt){if(n===void 0)throw Error(Z(407));n=n()}else{if(n=t(),Qt===null)throw Error(Z(349));ka&30||e2(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,aE(n2.bind(null,r,s,e),[e]),r.flags|=2048,fd(9,t2.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=xi(),t=Qt.identifierPrefix;if(dt){var n=ss,r=is;n=(r&~(1<<32-ni(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ud++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=IU++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},LU={readContext:Ar,useCallback:u2,useContext:Ar,useEffect:bb,useImperativeHandle:c2,useInsertionEffect:o2,useLayoutEffect:a2,useMemo:d2,useReducer:Sv,useRef:s2,useState:function(){return Sv(dd)},useDebugValue:_b,useDeferredValue:function(e){var t=Or();return f2(t,Vt.memoizedState,e)},useTransition:function(){var e=Sv(dd)[0],t=Or().memoizedState;return[e,t]},useMutableSource:ZN,useSyncExternalStore:JN,useId:h2,unstable_isNewReconciler:!1},FU={readContext:Ar,useCallback:u2,useContext:Ar,useEffect:bb,useImperativeHandle:c2,useInsertionEffect:o2,useLayoutEffect:a2,useMemo:d2,useReducer:Ev,useRef:s2,useState:function(){return Ev(dd)},useDebugValue:_b,useDeferredValue:function(e){var t=Or();return Vt===null?t.memoizedState=e:f2(t,Vt.memoizedState,e)},useTransition:function(){var e=Ev(dd)[0],t=Or().memoizedState;return[e,t]},useMutableSource:ZN,useSyncExternalStore:JN,useId:h2,unstable_isNewReconciler:!1};function qr(e,t){if(e&&e.defaultProps){t=xt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function S0(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:xt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var qm={isMounted:function(e){return(e=e._reactInternals)?Fa(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=In(),i=lo(e),s=as(r,i);s.payload=t,n!=null&&(s.callback=n),t=oo(e,s,i),t!==null&&(ri(t,e,i,r),Dh(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=In(),i=lo(e),s=as(r,i);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=oo(e,s,i),t!==null&&(ri(t,e,i,r),Dh(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=In(),r=lo(e),i=as(n,r);i.tag=2,t!=null&&(i.callback=t),t=oo(e,i,r),t!==null&&(ri(t,e,r,n),Dh(t,e,r))}};function lE(e,t,n,r,i,s,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,o):t.prototype&&t.prototype.isPureReactComponent?!id(n,r)||!id(i,s):!0}function v2(e,t,n){var r=!1,i=wo,s=t.contextType;return typeof s=="object"&&s!==null?s=Ar(s):(i=Qn(t)?Sa:vn.current,r=t.contextTypes,s=(r=r!=null)?nc(e,i):wo),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=qm,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function cE(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&&qm.enqueueReplaceState(t,t.state,null)}function E0(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},pb(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=Ar(s):(s=Qn(t)?Sa:vn.current,i.context=nc(e,s)),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(S0(e,t,s,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&qm.enqueueReplaceState(i,i.state,null),Ep(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function oc(e,t){try{var n="",r=t;do n+=f5(r),r=r.return;while(r);var i=n}catch(s){i=`
39Error generating stack: `+s.message+`
40`+s.stack}return{value:e,source:t,stack:i,digest:null}}function kv(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function k0(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var $U=typeof WeakMap=="function"?WeakMap:Map;function y2(e,t,n){n=as(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Pp||(Pp=!0,D0=r),k0(e,t)},n}function x2(e,t,n){n=as(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){k0(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){k0(e,t),typeof r!="function"&&(ao===null?ao=new Set([this]):ao.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}
vendor: 8,870 bytes, line 40
40function uE(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new $U;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=JU.bind(null,e,t,n),t.then(e,e))}function dE(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 fE(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,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=as(-1,1),t.tag=2,oo(n,t,1))),n.lanes|=1),e)}var UU=xs.ReactCurrentOwner,Gn=!1;function kn(e,t,n,r){t.child=e===null?KN(t,null,n,r):ic(t,e.child,n,r)}function hE(e,t,n,r,i){n=n.render;var s=t.ref;return Al(t,i),r=xb(e,t,n,r,s,i),n=wb(),e!==null&&!Gn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,hs(e,t,i)):(dt&&n&&ab(t),t.flags|=1,kn(e,t,r,i),t.child)}function pE(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!Nb(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,w2(e,t,s,r,i)):(e=Vh(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&i)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:id,n(o,r)&&e.ref===t.ref)return hs(e,t,i)}return t.flags|=1,e=co(s,r),e.ref=t.ref,e.return=t,t.child=e}function w2(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(id(s,r)&&e.ref===t.ref)if(Gn=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(Gn=!0);else return t.lanes=e.lanes,hs(e,t,i)}return C0(e,t,n,r,i)}function b2(e,t,n){var r=t.pendingProps,i=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},st(xl,ir),ir|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,st(xl,ir),ir|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,st(xl,ir),ir|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,st(xl,ir),ir|=r;return kn(e,t,i,n),t.child}function _2(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function C0(e,t,n,r,i){var s=Qn(n)?Sa:vn.current;return s=nc(t,s),Al(t,i),n=xb(e,t,n,r,s,i),r=wb(),e!==null&&!Gn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,hs(e,t,i)):(dt&&r&&ab(t),t.flags|=1,kn(e,t,n,i),t.child)}function mE(e,t,n,r,i){if(Qn(n)){var s=!0;xp(t)}else s=!1;if(Al(t,i),t.stateNode===null)Fh(e,t),v2(t,n,r),E0(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var l=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=Ar(u):(u=Qn(n)?Sa:vn.current,u=nc(t,u));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!==u)&&cE(t,o,r,u),Ds=!1;var h=t.memoizedState;o.state=h,Ep(t,r,o,i),l=t.memoizedState,a!==r||h!==l||Yn.current||Ds?(typeof d=="function"&&(S0(t,n,d,r),l=t.memoizedState),(a=Ds||lE(t,n,a,r,h,l,u))?(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=u,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,QN(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:qr(t.type,a),o.props=u,f=t.pendingProps,h=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=Ar(l):(l=Qn(n)?Sa:vn.current,l=nc(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)&&cE(t,o,r,l),Ds=!1,h=t.memoizedState,o.state=h,Ep(t,r,o,i);var g=t.memoizedState;a!==f||h!==g||Yn.current||Ds?(typeof p=="function"&&(S0(t,n,p,r),g=t.memoizedState),(u=Ds||lE(t,n,u,r,h,g,l)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,g,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,g,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=g),o.props=r,o.state=g,o.context=l,r=u):(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 T0(e,t,n,r,s,i)}function T0(e,t,n,r,i,s){_2(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&eE(t,n,!1),hs(e,t,s);r=t.stateNode,UU.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=ic(t,e.child,null,s),t.child=ic(t,null,a,s)):kn(e,t,a,s),t.memoizedState=r.state,i&&eE(t,n,!0),t.child}function S2(e){var t=e.stateNode;t.pendingContext?JS(e,t.pendingContext,t.pendingContext!==t.context):t.context&&JS(e,t.context,!1),mb(e,t.containerInfo)}function gE(e,t,n,r,i){return rc(),cb(i),t.flags|=256,kn(e,t,n,r),t.child}var j0={dehydrated:null,treeContext:null,retryLane:0};function P0(e){return{baseLanes:e,cachePool:null,transitions:null}}function E2(e,t,n){var r=t.pendingProps,i=mt.current,s=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(i&2)!==0),a?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),st(mt,i&1),e===null)return b0(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,s?(r=t.mode,s=t.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=Km(o,r,0,null),e=va(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=P0(n),t.memoizedState=j0,e):Sb(t,o));if(i=e.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return VU(e,t,o,r,a,i,n);if(s){s=r.fallback,o=t.mode,i=e.child,a=i.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=co(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=co(a,s):(s=va(s,o,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,o=e.child.memoizedState,o=o===null?P0(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~n,t.memoizedState=j0,r}return s=e.child,e=s.sibling,r=co(s,{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 Sb(e,t){return t=Km({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Hf(e,t,n,r){return r!==null&&cb(r),ic(t,e.child,null,n),e=Sb(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function VU(e,t,n,r,i,s,o){if(n)return t.flags&256?(t.flags&=-257,r=kv(Error(Z(422))),Hf(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=Km({mode:"visible",children:r.children},i,0,null),s=va(s,i,o,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&ic(t,e.child,null,o),t.child.memoizedState=P0(o),t.memoizedState=j0,s);if(!(t.mode&1))return Hf(e,t,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(Z(419)),r=kv(s,r,void 0),Hf(e,t,o,r)}if(a=(o&e.childLanes)!==0,Gn||a){if(r=Qt,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=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:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,fs(e,i),ri(r,e,i,-1))}return Pb(),r=kv(Error(Z(421))),Hf(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=eV.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,lr=so(i.nextSibling),cr=t,dt=!0,Qr=null,e!==null&&(Sr[Er++]=is,Sr[Er++]=ss,Sr[Er++]=Ea,is=e.id,ss=e.overflow,Ea=t),t=Sb(t,r.children),t.flags|=4096,t)}
vendor: 6,286 bytes, line 40
40function vE(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),_0(e.return,t,n)}function Cv(e,t,n,r,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function k2(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(kn(e,t,r.children,n),r=mt.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&&vE(e,n,t);else if(e.tag===19)vE(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(st(mt,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&kp(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Cv(t,!1,i,n,s);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&kp(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Cv(t,!0,n,null,s);break;case"together":Cv(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Fh(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function hs(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ca|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Z(153));if(t.child!==null){for(e=t.child,n=co(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=co(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function zU(e,t,n){switch(t.tag){case 3:S2(t),rc();break;case 5:XN(t);break;case 1:Qn(t.type)&&xp(t);break;case 4:mb(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;st(_p,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(st(mt,mt.current&1),t.flags|=128,null):n&t.child.childLanes?E2(e,t,n):(st(mt,mt.current&1),e=hs(e,t,n),e!==null?e.sibling:null);st(mt,mt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return k2(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),st(mt,mt.current),r)break;return null;case 22:case 23:return t.lanes=0,b2(e,t,n)}return hs(e,t,n)}var C2,N0,T2,j2;C2=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}};N0=function(){};T2=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,ra(Pi.current);var s=null;switch(n){case"input":i=Zy(e,i),r=Zy(e,r),s=[];break;case"select":i=xt({},i,{value:void 0}),r=xt({},r,{value:void 0}),s=[];break;case"textarea":i=t0(e,i),r=t0(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=vp)}r0(n,r);var o;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var a=i[u];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Xu.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in r){var l=r[u];if(a=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="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||(s||(s=[]),s.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Xu.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&lt("scroll",e),s||a===l||(s=[])):(s=s||[]).push(u,l))}n&&(s=s||[]).push("style",n);var u=s;(t.updateQueue=u)&&(t.flags|=4)}};j2=function(e,t,n,r){n!==r&&(t.flags|=4)};function eu(e,t){if(!dt)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 un(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function BU(e,t,n){var r=t.pendingProps;switch(lb(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return un(t),null;case 1:return Qn(t.type)&&yp(),un(t),null;case 3:return r=t.stateNode,sc(),ut(Yn),ut(vn),vb(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Wf(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Qr!==null&&(F0(Qr),Qr=null))),N0(e,t),un(t),null;case 5:gb(t);var i=ra(cd.current);if(n=t.type,e!==null&&t.stateNode!=null)T2(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(Z(166));return un(t),null}if(e=ra(Pi.current),Wf(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[ki]=t,r[ad]=s,e=(t.mode&1)!==0,n){case"dialog":lt("cancel",r),lt("close",r);break;case"iframe":case"object":case"embed":lt("load",r);break;case"video":case"audio":for(i=0;i<wu.length;i++)lt(wu[i],r);break;case"source":lt("error",r);break;case"img":case"image":case"link":lt("error",r),lt("load",r);break;case"details":lt("toggle",r);break;case"input":CS(r,s),lt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},lt("invalid",r);break;case"textarea":jS(r,s),lt("invalid",r)}r0(n,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];
vendor: 28,817 bytes, line 40
40o==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&Bf(r.textContent,a,e),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&Bf(r.textContent,a,e),i=["children",""+a]):Xu.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&lt("scroll",r)}switch(n){case"input":Df(r),TS(r,s,!0);break;case"textarea":Df(r),PS(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=vp)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=nN(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[ki]=t,e[ad]=r,C2(e,t,!1,!1),t.stateNode=e;e:{switch(o=i0(n,r),n){case"dialog":lt("cancel",e),lt("close",e),i=r;break;case"iframe":case"object":case"embed":lt("load",e),i=r;break;case"video":case"audio":for(i=0;i<wu.length;i++)lt(wu[i],e);i=r;break;case"source":lt("error",e),i=r;break;case"img":case"image":case"link":lt("error",e),lt("load",e),i=r;break;case"details":lt("toggle",e),i=r;break;case"input":CS(e,r),i=Zy(e,r),lt("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=xt({},r,{value:void 0}),lt("invalid",e);break;case"textarea":jS(e,r),i=t0(e,r),lt("invalid",e);break;default:i=r}r0(n,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?sN(e,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&rN(e,l)):s==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Zu(e,l):typeof l=="number"&&Zu(e,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Xu.hasOwnProperty(s)?l!=null&&s==="onScroll"&&lt("scroll",e):l!=null&&Gw(e,s,l,o))}switch(n){case"input":Df(e),TS(e,r,!1);break;case"textarea":Df(e),PS(e);break;case"option":r.value!=null&&e.setAttribute("value",""+xo(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?Pl(e,!!r.multiple,s,!1):r.defaultValue!=null&&Pl(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=vp)}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 un(t),null;case 6:if(e&&t.stateNode!=null)j2(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(Z(166));if(n=ra(cd.current),ra(Pi.current),Wf(t)){if(r=t.stateNode,n=t.memoizedProps,r[ki]=t,(s=r.nodeValue!==n)&&(e=cr,e!==null))switch(e.tag){case 3:Bf(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Bf(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[ki]=t,t.stateNode=r}return un(t),null;case 13:if(ut(mt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(dt&&lr!==null&&t.mode&1&&!(t.flags&128))HN(),rc(),t.flags|=98560,s=!1;else if(s=Wf(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(Z(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(Z(317));s[ki]=t}else rc(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;un(t),s=!1}else Qr!==null&&(F0(Qr),Qr=null),s=!0;if(!s)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||mt.current&1?Bt===0&&(Bt=3):Pb())),t.updateQueue!==null&&(t.flags|=4),un(t),null);case 4:return sc(),N0(e,t),e===null&&sd(t.stateNode.containerInfo),un(t),null;case 10:return fb(t.type._context),un(t),null;case 17:return Qn(t.type)&&yp(),un(t),null;case 19:if(ut(mt),s=t.memoizedState,s===null)return un(t),null;if(r=(t.flags&128)!==0,o=s.rendering,o===null)if(r)eu(s,!1);else{if(Bt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=kp(e),o!==null){for(t.flags|=128,eu(s,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,e=o.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return st(mt,mt.current&1|2),t.child}e=e.sibling}s.tail!==null&&Rt()>ac&&(t.flags|=128,r=!0,eu(s,!1),t.lanes=4194304)}else{if(!r)if(e=kp(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),eu(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!dt)return un(t),null}else 2*Rt()-s.renderingStartTime>ac&&n!==1073741824&&(t.flags|=128,r=!0,eu(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Rt(),t.sibling=null,n=mt.current,st(mt,r?n&1|2:n&1),t):(un(t),null);case 22:case 23:return jb(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ir&1073741824&&(un(t),t.subtreeFlags&6&&(t.flags|=8192)):un(t),null;case 24:return null;case 25:return null}throw Error(Z(156,t.tag))}function WU(e,t){switch(lb(t),t.tag){case 1:return Qn(t.type)&&yp(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return sc(),ut(Yn),ut(vn),vb(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return gb(t),null;case 13:if(ut(mt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Z(340));rc()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ut(mt),null;case 4:return sc(),null;case 10:return fb(t.type._context),null;case 22:case 23:return jb(),null;case 24:return null;default:return null}}var Gf=!1,mn=!1,qU=typeof WeakSet=="function"?WeakSet:Set,pe=null;function yl(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ct(e,t,r)}else n.current=null}function R0(e,t,n){try{n()}catch(r){Ct(e,t,r)}}var yE=!1;function HU(e,t){if(p0=pp,e=AN(),ob(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var p;f!==n||i!==0&&f.nodeType!==3||(a=o+i),f!==s||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&&++u===i&&(a=o),h===s&&++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(m0={focusedElem:e,selectionRange:n},pp=!1,pe=t;pe!==null;)if(t=pe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,pe=e;else for(;pe!==null;){t=pe;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var v=g.memoizedProps,w=g.memoizedState,y=t.stateNode,x=y.getSnapshotBeforeUpdate(t.elementType===t.type?v:qr(t.type,v),w);y.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Z(163))}}catch(_){Ct(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,pe=e;break}pe=t.return}return g=yE,yE=!1,g}function Au(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&R0(t,n,s)}i=i.next}while(i!==r)}}function Hm(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 I0(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 P2(e){var t=e.alternate;t!==null&&(e.alternate=null,P2(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ki],delete t[ad],delete t[y0],delete t[jU],delete t[PU])),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 N2(e){return e.tag===5||e.tag===3||e.tag===4}function xE(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||N2(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 A0(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=vp));else if(r!==4&&(e=e.child,e!==null))for(A0(e,t,n),e=e.sibling;e!==null;)A0(e,t,n),e=e.sibling}function O0(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(O0(e,t,n),e=e.sibling;e!==null;)O0(e,t,n),e=e.sibling}var rn=null,Kr=!1;function Ss(e,t,n){for(n=n.child;n!==null;)R2(e,t,n),n=n.sibling}function R2(e,t,n){if(ji&&typeof ji.onCommitFiberUnmount=="function")try{ji.onCommitFiberUnmount(Fm,n)}catch{}switch(n.tag){case 5:mn||yl(n,t);case 6:var r=rn,i=Kr;rn=null,Ss(e,t,n),rn=r,Kr=i,rn!==null&&(Kr?(e=rn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):rn.removeChild(n.stateNode));break;case 18:rn!==null&&(Kr?(e=rn,n=n.stateNode,e.nodeType===8?xv(e.parentNode,n):e.nodeType===1&&xv(e,n),nd(e)):xv(rn,n.stateNode));break;case 4:r=rn,i=Kr,rn=n.stateNode.containerInfo,Kr=!0,Ss(e,t,n),rn=r,Kr=i;break;case 0:case 11:case 14:case 15:if(!mn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&R0(n,t,o),i=i.next}while(i!==r)}Ss(e,t,n);break;case 1:if(!mn&&(yl(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Ct(n,t,a)}Ss(e,t,n);break;case 21:Ss(e,t,n);break;case 22:n.mode&1?(mn=(r=mn)||n.memoizedState!==null,Ss(e,t,n),mn=r):Ss(e,t,n);break;default:Ss(e,t,n)}}function wE(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new qU),t.forEach(function(r){var i=tV.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function zr(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:rn=a.stateNode,Kr=!1;break e;case 3:rn=a.stateNode.containerInfo,Kr=!0;break e;case 4:rn=a.stateNode.containerInfo,Kr=!0;break e}a=a.return}if(rn===null)throw Error(Z(160));R2(s,o,i),rn=null,Kr=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(u){Ct(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)I2(t,e),t=t.sibling}function I2(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(zr(t,e),vi(e),r&4){try{Au(3,e,e.return),Hm(3,e)}catch(v){Ct(e,e.return,v)}try{Au(5,e,e.return)}catch(v){Ct(e,e.return,v)}}break;case 1:zr(t,e),vi(e),r&512&&n!==null&&yl(n,n.return);break;case 5:if(zr(t,e),vi(e),r&512&&n!==null&&yl(n,n.return),e.flags&32){var i=e.stateNode;try{Zu(i,"")}catch(v){Ct(e,e.return,v)}}if(r&4&&(i=e.stateNode,i!=null)){var s=e.memoizedProps,o=n!==null?n.memoizedProps:s,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&eN(i,s),i0(a,o);var u=i0(a,s);for(o=0;o<l.length;o+=2){var d=l[o],f=l[o+1];d==="style"?sN(i,f):d==="dangerouslySetInnerHTML"?rN(i,f):d==="children"?Zu(i,f):Gw(i,d,f,u)}switch(a){case"input":Jy(i,s);break;case"textarea":tN(i,s);break;case"select":var h=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var p=s.value;p!=null?Pl(i,!!s.multiple,p,!1):h!==!!s.multiple&&(s.defaultValue!=null?Pl(i,!!s.multiple,s.defaultValue,!0):Pl(i,!!s.multiple,s.multiple?[]:"",!1))}i[ad]=s}catch(v){Ct(e,e.return,v)}}break;case 6:if(zr(t,e),vi(e),r&4){if(e.stateNode===null)throw Error(Z(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(v){Ct(e,e.return,v)}}break;case 3:if(zr(t,e),vi(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{nd(t.containerInfo)}catch(v){Ct(e,e.return,v)}break;case 4:zr(t,e),vi(e);break;case 13:zr(t,e),vi(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(Cb=Rt())),r&4&&wE(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(mn=(u=mn)||d,zr(t,e),mn=u):zr(t,e),vi(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(pe=e,d=e.child;d!==null;){for(f=pe=d;pe!==null;){switch(h=pe,p=h.child,h.tag){case 0:case 11:case 14:case 15:Au(4,h,h.return);break;case 1:yl(h,h.return);var g=h.stateNode;if(typeof g.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(v){Ct(r,n,v)}}break;case 5:yl(h,h.return);break;case 22:if(h.memoizedState!==null){_E(f);continue}}p!==null?(p.return=h,pe=p):_E(f)}d=d.sibling}e:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{i=f.stateNode,u?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=f.stateNode,l=f.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=iN("display",o))}catch(v){Ct(e,e.return,v)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(v){Ct(e,e.return,v)}}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:zr(t,e),vi(e),r&4&&wE(e);break;case 21:break;default:zr(t,e),vi(e)}}function vi(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(N2(n)){var r=n;break e}n=n.return}throw Error(Z(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Zu(i,""),r.flags&=-33);var s=xE(e);O0(e,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,a=xE(e);A0(e,a,o);break;default:throw Error(Z(161))}}catch(l){Ct(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function GU(e,t,n){pe=e,A2(e)}function A2(e,t,n){for(var r=(e.mode&1)!==0;pe!==null;){var i=pe,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||Gf;if(!o){var a=i.alternate,l=a!==null&&a.memoizedState!==null||mn;a=Gf;var u=mn;if(Gf=o,(mn=l)&&!u)for(pe=i;pe!==null;)o=pe,l=o.child,o.tag===22&&o.memoizedState!==null?SE(i):l!==null?(l.return=o,pe=l):SE(i);for(;s!==null;)pe=s,A2(s),s=s.sibling;pe=i,Gf=a,mn=u}bE(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,pe=s):bE(e)}}function bE(e){for(;pe!==null;){var t=pe;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:mn||Hm(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!mn)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:qr(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&sE(t,s,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}sE(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 u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&nd(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Z(163))}mn||t.flags&512&&I0(t)}catch(h){Ct(t,t.return,h)}}if(t===e){pe=null;break}if(n=t.sibling,n!==null){n.return=t.return,pe=n;break}pe=t.return}}function _E(e){for(;pe!==null;){var t=pe;if(t===e){pe=null;break}var n=t.sibling;if(n!==null){n.return=t.return,pe=n;break}pe=t.return}}function SE(e){for(;pe!==null;){var t=pe;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Hm(4,t)}catch(l){Ct(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){Ct(t,i,l)}}var s=t.return;try{I0(t)}catch(l){Ct(t,s,l)}break;case 5:var o=t.return;try{I0(t)}catch(l){Ct(t,o,l)}}}catch(l){Ct(t,t.return,l)}if(t===e){pe=null;break}var a=t.sibling;if(a!==null){a.return=t.return,pe=a;break}pe=t.return}}var KU=Math.ceil,jp=xs.ReactCurrentDispatcher,Eb=xs.ReactCurrentOwner,jr=xs.ReactCurrentBatchConfig,He=0,Qt=null,Mt=null,sn=0,ir=0,xl=Ao(0),Bt=0,hd=null,Ca=0,Gm=0,kb=0,Ou=null,Wn=null,Cb=0,ac=1/0,Ji=null,Pp=!1,D0=null,ao=null,Kf=!1,eo=null,Np=0,Du=0,M0=null,$h=-1,Uh=0;function In(){return He&6?Rt():$h!==-1?$h:$h=Rt()}function lo(e){return e.mode&1?He&2&&sn!==0?sn&-sn:RU.transition!==null?(Uh===0&&(Uh=vN()),Uh):(e=Xe,e!==0||(e=window.event,e=e===void 0?16:EN(e.type)),e):1}function ri(e,t,n,r){if(50<Du)throw Du=0,M0=null,Error(Z(185));af(e,n,r),(!(He&2)||e!==Qt)&&(e===Qt&&(!(He&2)&&(Gm|=n),Bt===4&&$s(e,sn)),Xn(e,r),n===1&&He===0&&!(t.mode&1)&&(ac=Rt()+500,Bm&&Oo()))}function Xn(e,t){var n=e.callbackNode;R5(e,t);var r=hp(e,e===Qt?sn:0);if(r===0)n!==null&&IS(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&IS(n),t===1)e.tag===0?NU(EE.bind(null,e)):BN(EE.bind(null,e)),CU(function(){!(He&6)&&Oo()}),n=null;else{switch(yN(r)){case 1:n=Zw;break;case 4:n=mN;break;case 16:n=fp;break;case 536870912:n=gN;break;default:n=fp}n=V2(n,O2.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function O2(e,t){if($h=-1,Uh=0,He&6)throw Error(Z(327));var n=e.callbackNode;if(Ol()&&e.callbackNode!==n)return null;var r=hp(e,e===Qt?sn:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Rp(e,r);else{t=r;var i=He;He|=2;var s=M2();(Qt!==e||sn!==t)&&(Ji=null,ac=Rt()+500,ga(e,t));do try{XU();break}catch(a){D2(e,a)}while(!0);db(),jp.current=s,He=i,Mt!==null?t=0:(Qt=null,sn=0,t=Bt)}if(t!==0){if(t===2&&(i=c0(e),i!==0&&(r=i,t=L0(e,i))),t===1)throw n=hd,ga(e,0),$s(e,r),Xn(e,Rt()),n;if(t===6)$s(e,r);else{if(i=e.current.alternate,!(r&30)&&!YU(i)&&(t=Rp(e,r),t===2&&(s=c0(e),s!==0&&(r=s,t=L0(e,s))),t===1))throw n=hd,ga(e,0),$s(e,r),Xn(e,Rt()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(Z(345));case 2:Ko(e,Wn,Ji);break;case 3:if($s(e,r),(r&130023424)===r&&(t=Cb+500-Rt(),10<t)){if(hp(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){In(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=v0(Ko.bind(null,e,Wn,Ji),t);break}Ko(e,Wn,Ji);break;case 4:if($s(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var o=31-ni(r);s=1<<o,o=t[o],o>i&&(i=o),r&=~s}if(r=i,r=Rt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*KU(r/1960))-r,10<r){e.timeoutHandle=v0(Ko.bind(null,e,Wn,Ji),r);break}Ko(e,Wn,Ji);break;case 5:Ko(e,Wn,Ji);break;default:throw Error(Z(329))}}}return Xn(e,Rt()),e.callbackNode===n?O2.bind(null,e):null}function L0(e,t){var n=Ou;return e.current.memoizedState.isDehydrated&&(ga(e,t).flags|=256),e=Rp(e,t),e!==2&&(t=Wn,Wn=n,t!==null&&F0(t)),e}function F0(e){Wn===null?Wn=e:Wn.push.apply(Wn,e)}function YU(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 i=n[r],s=i.getSnapshot;i=i.value;try{if(!si(s(),i))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 $s(e,t){for(t&=~kb,t&=~Gm,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-ni(t),r=1<<n;e[n]=-1,t&=~r}}function EE(e){if(He&6)throw Error(Z(327));Ol();var t=hp(e,0);if(!(t&1))return Xn(e,Rt()),null;var n=Rp(e,t);if(e.tag!==0&&n===2){var r=c0(e);r!==0&&(t=r,n=L0(e,r))}if(n===1)throw n=hd,ga(e,0),$s(e,t),Xn(e,Rt()),n;if(n===6)throw Error(Z(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ko(e,Wn,Ji),Xn(e,Rt()),null}function Tb(e,t){var n=He;He|=1;try{return e(t)}finally{He=n,He===0&&(ac=Rt()+500,Bm&&Oo())}}function Ta(e){eo!==null&&eo.tag===0&&!(He&6)&&Ol();var t=He;He|=1;var n=jr.transition,r=Xe;try{if(jr.transition=null,Xe=1,e)return e()}finally{Xe=r,jr.transition=n,He=t,!(He&6)&&Oo()}}function jb(){ir=xl.current,ut(xl)}function ga(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,kU(n)),Mt!==null)for(n=Mt.return;n!==null;){var r=n;switch(lb(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&yp();break;case 3:sc(),ut(Yn),ut(vn),vb();break;case 5:gb(r);break;case 4:sc();break;case 13:ut(mt);break;case 19:ut(mt);break;case 10:fb(r.type._context);break;case 22:case 23:jb()}n=n.return}if(Qt=e,Mt=e=co(e.current,null),sn=ir=t,Bt=0,hd=null,kb=Gm=Ca=0,Wn=Ou=null,na!==null){for(t=0;t<na.length;t++)if(n=na[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var o=s.next;s.next=i,r.next=o}n.pending=r}na=null}return e}function D2(e,t){do{var n=Mt;try{if(db(),Mh.current=Tp,Cp){for(var r=yt.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Cp=!1}if(ka=0,Yt=Vt=yt=null,Iu=!1,ud=0,Eb.current=null,n===null||n.return===null){Bt=1,hd=t,Mt=null;break}e:{var s=e,o=n.return,a=n,l=t;if(t=sn,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=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=dE(o);if(p!==null){p.flags&=-257,fE(p,o,a,s,t),p.mode&1&&uE(s,u,t),t=p,l=u;var g=t.updateQueue;if(g===null){var v=new Set;v.add(l),t.updateQueue=v}else g.add(l);break e}else{if(!(t&1)){uE(s,u,t),Pb();break e}l=Error(Z(426))}}else if(dt&&a.mode&1){var w=dE(o);if(w!==null){!(w.flags&65536)&&(w.flags|=256),fE(w,o,a,s,t),cb(oc(l,a));break e}}s=l=oc(l,a),Bt!==4&&(Bt=2),Ou===null?Ou=[s]:Ou.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var y=y2(s,l,t);iE(s,y);break e;case 1:a=l;var x=s.type,b=s.stateNode;if(!(s.flags&128)&&(typeof x.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(ao===null||!ao.has(b)))){s.flags|=65536,t&=-t,s.lanes|=t;var _=x2(s,a,t);iE(s,_);break e}}s=s.return}while(s!==null)}F2(n)}catch(S){t=S,Mt===n&&n!==null&&(Mt=n=n.return);continue}break}while(!0)}function M2(){var e=jp.current;return jp.current=Tp,e===null?Tp:e}function Pb(){(Bt===0||Bt===3||Bt===2)&&(Bt=4),Qt===null||!(Ca&268435455)&&!(Gm&268435455)||$s(Qt,sn)}function Rp(e,t){var n=He;He|=2;var r=M2();(Qt!==e||sn!==t)&&(Ji=null,ga(e,t));do try{QU();break}catch(i){D2(e,i)}while(!0);if(db(),He=n,jp.current=r,Mt!==null)throw Error(Z(261));return Qt=null,sn=0,Bt}function QU(){for(;Mt!==null;)L2(Mt)}function XU(){for(;Mt!==null&&!_5();)L2(Mt)}function L2(e){var t=U2(e.alternate,e,ir);e.memoizedProps=e.pendingProps,t===null?F2(e):Mt=t,Eb.current=null}function F2(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=WU(n,t),n!==null){n.flags&=32767,Mt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Bt=6,Mt=null;return}}else if(n=BU(n,t,ir),n!==null){Mt=n;return}if(t=t.sibling,t!==null){Mt=t;return}Mt=t=e}while(t!==null);Bt===0&&(Bt=5)}function Ko(e,t,n){var r=Xe,i=jr.transition;try{jr.transition=null,Xe=1,ZU(e,t,n,r)}finally{jr.transition=i,Xe=r}return null}function ZU(e,t,n,r){do Ol();while(eo!==null);if(He&6)throw Error(Z(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(Z(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(I5(e,s),e===Qt&&(Mt=Qt=null,sn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Kf||(Kf=!0,V2(fp,function(){return Ol(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=jr.transition,jr.transition=null;var o=Xe;Xe=1;var a=He;He|=4,Eb.current=null,HU(e,n),I2(n,e),yU(m0),pp=!!p0,m0=p0=null,e.current=n,GU(n),S5(),He=a,Xe=o,jr.transition=s}else e.current=n;if(Kf&&(Kf=!1,eo=e,Np=i),s=e.pendingLanes,s===0&&(ao=null),C5(n.stateNode),Xn(e,Rt()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Pp)throw Pp=!1,e=D0,D0=null,e;return Np&1&&e.tag!==0&&Ol(),s=e.pendingLanes,s&1?e===M0?Du++:(Du=0,M0=e):Du=0,Oo(),null}function Ol(){if(eo!==null){var e=yN(Np),t=jr.transition,n=Xe;try{if(jr.transition=null,Xe=16>e?16:e,eo===null)var r=!1;else{if(e=eo,eo=null,Np=0,He&6)throw Error(Z(331));var i=He;for(He|=4,pe=e.current;pe!==null;){var s=pe,o=s.child;if(pe.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(pe=u;pe!==null;){var d=pe;switch(d.tag){case 0:case 11:case 15:Au(8,d,s)}var f=d.child;if(f!==null)f.return=d,pe=f;else for(;pe!==null;){d=pe;var h=d.sibling,p=d.return;if(P2(d),d===u){pe=null;break}if(h!==null){h.return=p,pe=h;break}pe=p}}}var g=s.alternate;if(g!==null){var v=g.child;if(v!==null){g.child=null;do{var w=v.sibling;v.sibling=null,v=w}while(v!==null)}}pe=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,pe=o;else e:for(;pe!==null;){if(s=pe,s.flags&2048)switch(s.tag){case 0:case 11:case 15:Au(9,s,s.return)}var y=s.sibling;if(y!==null){y.return=s.return,pe=y;break e}pe=s.return}}var x=e.current;for(pe=x;pe!==null;){o=pe;var b=o.child;if(o.subtreeFlags&2064&&b!==null)b.return=o,pe=b;else e:for(o=x;pe!==null;){if(a=pe,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Hm(9,a)}}catch(S){Ct(a,a.return,S)}if(a===o){pe=null;break e}var _=a.sibling;if(_!==null){_.return=a.return,pe=_;break e}pe=a.return}}if(He=i,Oo(),ji&&typeof ji.onPostCommitFiberRoot=="function")try{ji.onPostCommitFiberRoot(Fm,e)}catch{}r=!0}return r}finally{Xe=n,jr.transition=t}}return!1}function kE(e,t,n){t=oc(n,t),t=y2(e,t,1),e=oo(e,t,1),t=In(),e!==null&&(af(e,1,t),Xn(e,t))}function Ct(e,t,n){if(e.tag===3)kE(e,e,n);else for(;t!==null;){if(t.tag===3){kE(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ao===null||!ao.has(r))){e=oc(n,e),e=x2(t,e,1),t=oo(t,e,1),e=In(),t!==null&&(af(t,1,e),Xn(t,e));break}}t=t.return}}function JU(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=In(),e.pingedLanes|=e.suspendedLanes&n,Qt===e&&(sn&n)===n&&(Bt===4||Bt===3&&(sn&130023424)===sn&&500>Rt()-Cb?ga(e,0):kb|=n),Xn(e,t)}function $2(e,t){t===0&&(e.mode&1?(t=Ff,Ff<<=1,!(Ff&130023424)&&(Ff=4194304)):t=1);var n=In();e=fs(e,t),e!==null&&(af(e,t,n),Xn(e,n))}function eV(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),$2(e,n)}function tV(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(Z(314))}r!==null&&r.delete(t),$2(e,n)}var U2;U2=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Yn.current)Gn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Gn=!1,zU(e,t,n);Gn=!!(e.flags&131072)}else Gn=!1,dt&&t.flags&1048576&&WN(t,bp,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Fh(e,t),e=t.pendingProps;var i=nc(t,vn.current);Al(t,n),i=xb(null,t,r,e,i,n);var s=wb();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Qn(r)?(s=!0,xp(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,pb(t),i.updater=qm,t.stateNode=i,i._reactInternals=t,E0(t,r,e,n),t=T0(null,t,r,!0,s,n)):(t.tag=0,dt&&s&&ab(t),kn(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Fh(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=rV(r),e=qr(r,e),i){case 0:t=C0(null,t,r,e,n);break e;case 1:t=mE(null,t,r,e,n);break e;case 11:t=hE(null,t,r,e,n);break e;case 14:t=pE(null,t,r,qr(r.type,e),n);break e}throw Error(Z(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:qr(r,i),
vendor: 8,785 bytes, line 40
40C0(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:qr(r,i),mE(e,t,r,i,n);case 3:e:{if(S2(t),e===null)throw Error(Z(387));r=t.pendingProps,s=t.memoizedState,i=s.element,QN(e,t),Ep(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=oc(Error(Z(423)),t),t=gE(e,t,r,n,i);break e}else if(r!==i){i=oc(Error(Z(424)),t),t=gE(e,t,r,n,i);break e}else for(lr=so(t.stateNode.containerInfo.firstChild),cr=t,dt=!0,Qr=null,n=KN(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(rc(),r===i){t=hs(e,t,n);break e}kn(e,t,r,n)}t=t.child}return t;case 5:return XN(t),e===null&&b0(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,g0(r,i)?o=null:s!==null&&g0(r,s)&&(t.flags|=32),_2(e,t),kn(e,t,o,n),t.child;case 6:return e===null&&b0(t),null;case 13:return E2(e,t,n);case 4:return mb(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ic(t,null,r,n):kn(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:qr(r,i),hE(e,t,r,i,n);case 7:return kn(e,t,t.pendingProps,n),t.child;case 8:return kn(e,t,t.pendingProps.children,n),t.child;case 12:return kn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,st(_p,r._currentValue),r._currentValue=o,s!==null)if(si(s.value,o)){if(s.children===i.children&&!Yn.current){t=hs(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=as(-1,n&-n),l.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),_0(s.return,n,t),a.lanes|=n;break}l=l.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(Z(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),_0(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}kn(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Al(t,n),i=Ar(i),r=r(i),t.flags|=1,kn(e,t,r,n),t.child;case 14:return r=t.type,i=qr(r,t.pendingProps),i=qr(r.type,i),pE(e,t,r,i,n);case 15:return w2(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:qr(r,i),Fh(e,t),t.tag=1,Qn(r)?(e=!0,xp(t)):e=!1,Al(t,n),v2(t,r,i),E0(t,r,i,n),T0(null,t,r,!0,e,n);case 19:return k2(e,t,n);case 22:return b2(e,t,n)}throw Error(Z(156,t.tag))};function V2(e,t){return pN(e,t)}function nV(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 Cr(e,t,n,r){return new nV(e,t,n,r)}function Nb(e){return e=e.prototype,!(!e||!e.isReactComponent)}function rV(e){if(typeof e=="function")return Nb(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Yw)return 11;if(e===Qw)return 14}return 2}function co(e,t){var n=e.alternate;return n===null?(n=Cr(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 Vh(e,t,n,r,i,s){var o=2;if(r=e,typeof e=="function")Nb(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case cl:return va(n.children,i,s,t);case Kw:o=8,i|=8;break;case Ky:return e=Cr(12,n,t,i|2),e.elementType=Ky,e.lanes=s,e;case Yy:return e=Cr(13,n,t,i),e.elementType=Yy,e.lanes=s,e;case Qy:return e=Cr(19,n,t,i),e.elementType=Qy,e.lanes=s,e;case XP:return Km(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case YP:o=10;break e;case QP:o=9;break e;case Yw:o=11;break e;case Qw:o=14;break e;case Os:o=16,r=null;break e}throw Error(Z(130,e==null?e:typeof e,""))}return t=Cr(o,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function va(e,t,n,r){return e=Cr(7,e,r,t),e.lanes=n,e}function Km(e,t,n,r){return e=Cr(22,e,r,t),e.elementType=XP,e.lanes=n,e.stateNode={isHidden:!1},e}function Tv(e,t,n){return e=Cr(6,e,null,t),e.lanes=n,e}function jv(e,t,n){return t=Cr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function iV(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=lv(0),this.expirationTimes=lv(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=lv(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Rb(e,t,n,r,i,s,o,a,l){return e=new iV(e,t,n,a,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Cr(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},pb(s),e}function sV(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ll,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function z2(e){if(!e)return wo;e=e._reactInternals;e:{if(Fa(e)!==e||e.tag!==1)throw Error(Z(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Qn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(Z(171))}if(e.tag===1){var n=e.type;if(Qn(n))return zN(e,n,t)}return t}function B2(e,t,n,r,i,s,o,a,l){return e=Rb(n,r,!0,e,i,s,o,a,l),e.context=z2(null),n=e.current,r=In(),i=lo(n),s=as(r,i),s.callback=t??null,oo(n,s,i),e.current.lanes=i,af(e,i,r),Xn(e,r),e}function Ym(e,t,n,r){var i=t.current,s=In(),o=lo(i);return n=z2(n),t.context===null?t.context=n:t.pendingContext=n,t=as(s,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=oo(i,t,o),e!==null&&(ri(e,i,o,s),Dh(e,i,o)),o}function Ip(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 CE(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Ib(e,t){CE(e,t),(e=e.alternate)&&CE(e,t)}function oV(){return null}var W2=typeof reportError=="function"?reportError:function(e){console.error(e)};function Ab(e){this._internalRoot=e}Qm.prototype.render=Ab.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Z(409));Ym(e,t,null,null)};Qm.prototype.unmount=Ab.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ta(function(){Ym(null,e,null,null)}),t[ds]=null}};function Qm(e){this._internalRoot=e}Qm.prototype.unstable_scheduleHydration=function(e){if(e){var t=bN();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Fs.length&&t!==0&&t<Fs[n].priority;n++);Fs.splice(n,0,e),n===0&&SN(e)}};function Ob(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Xm(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function TE(){}function aV(e,t,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var u=Ip(o);s.call(u)}}var o=B2(t,r,e,0,null,!1,!1,"",TE);return e._reactRootContainer=o,e[ds]=o.current,sd(e.nodeType===8?e.parentNode:e),Ta(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var u=Ip(l);a.call(u)}}var l=Rb(e,0,!1,null,null,!1,!1,"",TE);return e._reactRootContainer=l,e[ds]=l.current,sd(e.nodeType===8?e.parentNode:e),Ta(function(){Ym(t,l,n,r)}),l}function Zm(e,t,n,r,i){var s=n._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var a=i;i=function(){var l=Ip(o);a.call(l)}}Ym(t,o,e,i)}else o=aV(n,t,e,i,r);return Ip(o)}xN=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=xu(t.pendingLanes);
40n!==0&&(Jw(t,n|1),Xn(t,Rt()),!(He&6)&&(ac=Rt()+500,Oo()))}break;case 13:Ta(function(){var r=fs(e,1);if(r!==null){var i=In();ri(r,e,1,i)}}),Ib(e,1)}};eb=function(e){if(e.tag===13){var t=fs(e,134217728);if(t!==null){var n=In();ri(t,e,134217728,n)}Ib(e,134217728)}};wN=function(e){if(e.tag===13){var t=lo(e),n=fs(e,t);if(n!==null){var r=In();ri(n,e,t,r)}Ib(e,t)}};bN=function(){return Xe};_N=function(e,t){var n=Xe;try{return Xe=e,t()}finally{Xe=n}};o0=function(e,t,n){switch(t){case"input":if(Jy(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 i=zm(r);if(!i)throw Error(Z(90));JP(r),Jy(r,i)}}}break;case"textarea":tN(e,n);break;case"select":t=n.value,t!=null&&Pl(e,!!n.multiple,t,!1)}};lN=Tb;cN=Ta;var lV={usingClientEntryPoint:!1,Events:[cf,hl,zm,oN,aN,Tb]},tu={findFiberByHostInstance:ta,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},cV={bundleType:tu.bundleType,version:tu.version,rendererPackageName:tu.rendererPackageName,rendererConfig:tu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:xs.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=fN(e),e===null?null:e.stateNode},findFiberByHostInstance:tu.findFiberByHostInstance||oV,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 Yf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yf.isDisabled&&Yf.supportsFiber)try{Fm=Yf.inject(cV),ji=Yf}catch{}}pr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=lV;pr.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ob(t))throw Error(Z(200));return sV(e,t,null,n)};pr.createRoot=function(e,t){if(!Ob(e))throw Error(Z(299));var n=!1,r="",i=W2;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=Rb(e,1,!1,null,null,n,!1,r,i),e[ds]=t.current,sd(e.nodeType===8?e.parentNode:e),new Ab(t)};pr.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(Z(188)):(e=Object.keys(e).join(","),Error(Z(268,e)));return e=fN(t),e=e===null?null:e.stateNode,e};pr.flushSync=function(e){return Ta(e)};pr.hydrate=function(e,t,n){if(!Xm(t))throw Error(Z(200));return Zm(null,e,t,!0,n)};pr.hydrateRoot=function(e,t,n){if(!Ob(e))throw Error(Z(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",o=W2;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=B2(t,null,e,1,n??null,i,!1,s,o),e[ds]=t.current,sd(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new Qm(t)};pr.render=function(e,t,n){if(!Xm(t))throw Error(Z(200));return Zm(null,e,t,!1,n)};pr.unmountComponentAtNode=function(e){if(!Xm(e))throw Error(Z(40));return e._reactRootContainer?(Ta(function(){Zm(null,null,e,!1,function(){e._reactRootContainer=null,e[ds]=null})}),!0):!1};pr.unstable_batchedUpdates=Tb;pr.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Xm(n))throw Error(Z(200));if(e==null||e._reactInternals===void 0)throw Error(Z(38));return Zm(e,t,n,!1,r)};pr.version="18.3.1-next-f1338f8080-20240426";function q2(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(q2)}catch(e){console.error(e)}}q2(),qP.exports=pr;var kc=qP.exports;const H2=Uw(kc);var G2,jE=kc;G2=jE.createRoot,jE.hydrateRoot;/**
41 * @remix-run/router v1.20.0
42 *
43 * Copyright (c) Remix Software Inc.
44 *
45 * This source code is licensed under the MIT license found in the
46 * LICENSE.md file in the root directory of this source tree.
47 *
48 * @license MIT
49 */function pd(){return pd=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},pd.apply(this,arguments)}var to;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(to||(to={}));const PE="popstate";function uV(e){e===void 0&&(e={});function t(r,i){let{pathname:s,search:o,hash:a}=r.location;return $0("",{pathname:s,search:o,hash:a},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:Ap(i)}return fV(t,n,null,e)}function It(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function K2(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function dV(){return Math.random().toString(36).substr(2,8)}function NE(e,t){return{usr:e.state,key:e.key,idx:t}}function $0(e,t,n,r){return n===void 0&&(n=null),pd({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Cc(t):t,{state:n,key:t&&t.key||r||dV()})}function Ap(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 Cc(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 fV(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:s=!1}=r,o=i.history,a=to.Pop,l=null,u=d();u==null&&(u=0,o.replaceState(pd({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function f(){a=to.Pop;let w=d(),y=w==null?null:w-u;u=w,l&&l({action:a,location:v.location,delta:y})}function h(w,y){a=to.Push;let x=$0(v.location,w,y);u=d()+1;let b=NE(x,u),_=v.createHref(x);try{o.pushState(b,"",_)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;i.location.assign(_)}s&&l&&l({action:a,location:v.location,delta:1})}function p(w,y){a=to.Replace;let x=$0(v.location,w,y);u=d();let b=NE(x,u),_=v.createHref(x);o.replaceState(b,"",_),s&&l&&l({action:a,location:v.location,delta:0})}function g(w){let y=i.location.origin!=="null"?i.location.origin:i.location.href,x=typeof w=="string"?w:Ap(w);return x=x.replace(/ $/,"%20"),It(y,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,y)}let v={get action(){return a},get location(){return e(i,o)},listen(w){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(PE,f),l=w,()=>{i.removeEventListener(PE,f),l=null}},createHref(w){return t(i,w)},createURL:g,encodeLocation(w){let y=g(w);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:h,replace:p,go(w){return o.go(w)}};return v}var RE;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(RE||(RE={}));function hV(e,t,n){return n===void 0&&(n="/"),pV(e,t,n,!1)}function pV(e,t,n,r){let i=typeof t=="string"?Cc(t):t,s=Db(i.pathname||"/",n);if(s==null)return null;let o=Y2(e);mV(o);let a=null;for(let l=0;a==null&&l<o.length;++l){let u=CV(s);a=EV(o[l],u,r)}return a}function Y2(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(s,o,a)=>{let l={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};l.relativePath.startsWith("/")&&(It(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not val
49id. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=uo([r,l.relativePath]),d=n.concat(l);s.children&&s.children.length>0&&(It(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Y2(s.children,t,d,u)),!(s.path==null&&!s.index)&&t.push({path:u,score:_V(u,s.index),routesMeta:d})};return e.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))i(s,o);else for(let l of Q2(s.path))i(s,o,l)}),t}function Q2(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let o=Q2(r.join("/")),a=[];return a.push(...o.map(l=>l===""?s:[s,l].join("/"))),i&&a.push(...o),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function mV(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:SV(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const gV=/^:[\w-]+$/,vV=3,yV=2,xV=1,wV=10,bV=-2,IE=e=>e==="*";function _V(e,t){let n=e.split("/"),r=n.length;return n.some(IE)&&(r+=bV),t&&(r+=yV),n.filter(i=>!IE(i)).reduce((i,s)=>i+(gV.test(s)?vV:s===""?xV:wV),r)}function SV(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function EV(e,t,n){let{routesMeta:r}=e,i={},s="/",o=[];for(let a=0;a<r.length;++a){let l=r[a],u=a===r.length-1,d=s==="/"?t:t.slice(s.length)||"/",f=AE({path:l.relativePath,caseSensitive:l.caseSensitive,end:u},d),h=l.route;if(!f&&u&&n&&!r[r.length-1].route.index&&(f=AE({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},d)),!f)return null;
vendor: 24,068 bytes, lines 49-67
49Object.assign(i,f.params),o.push({params:i,pathname:uo([s,f.pathname]),pathnameBase:NV(uo([s,f.pathnameBase])),route:h}),f.pathnameBase!=="/"&&(s=uo([s,f.pathnameBase]))}return o}function AE(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=kV(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let s=i[0],o=s.replace(/(.)\/+$/,"$1"),a=i.slice(1);return{params:r.reduce((u,d,f)=>{let{paramName:h,isOptional:p}=d;if(h==="*"){let v=a[f]||"";o=s.slice(0,s.length-v.length).replace(/(.)\/+$/,"$1")}const g=a[f];return p&&!g?u[h]=void 0:u[h]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:s,pathnameBase:o,pattern:e}}function kV(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),K2(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function CV(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return K2(!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 Db(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function TV(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Cc(e):e;return{pathname:n?n.startsWith("/")?n:jV(n,t):t,search:RV(r),hash:IV(i)}}function jV(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Pv(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 PV(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Mb(e,t){let n=PV(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Lb(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Cc(e):(i=pd({},e),It(!i.pathname||!i.pathname.includes("?"),Pv("?","pathname","search",i)),It(!i.pathname||!i.pathname.includes("#"),Pv("#","pathname","hash",i)),It(!i.search||!i.search.includes("#"),Pv("#","search","hash",i)));let s=e===""||i.pathname==="",o=s?"/":i.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;i.pathname=h.join("/")}a=f>=0?t[f]:"/"}let l=TV(i,a),u=o&&o!=="/"&&o.endsWith("/"),d=(s||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||d)&&(l.pathname+="/"),l}const uo=e=>e.join("/").replace(/\/\/+/g,"/"),NV=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),RV=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,IV=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function AV(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const X2=["post","put","patch","delete"];new Set(X2);const OV=["get",...X2];new Set(OV);/**
50 * React Router v6.27.0
51 *
52 * Copyright (c) Remix Software Inc.
53 *
54 * This source code is licensed under the MIT license found in the
55 * LICENSE.md file in the root directory of this source tree.
56 *
57 * @license MIT
58 */function md(){return md=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},md.apply(this,arguments)}const Fb=m.createContext(null),DV=m.createContext(null),Do=m.createContext(null),Jm=m.createContext(null),Vi=m.createContext({outlet:null,matches:[],isDataRoute:!1}),Z2=m.createContext(null);function MV(e,t){let{relative:n}=t===void 0?{}:t;Tc()||It(!1);let{basename:r,navigator:i}=m.useContext(Do),{hash:s,pathname:o,search:a}=eR(e,{relative:n}),l=o;return r!=="/"&&(l=o==="/"?r:uo([r,o])),i.createHref({pathname:l,search:a,hash:s})}function Tc(){return m.useContext(Jm)!=null}function ws(){return Tc()||It(!1),m.useContext(Jm).location}function J2(e){m.useContext(Do).static||m.useLayoutEffect(e)}function wn(){let{isDataRoute:e}=m.useContext(Vi);return e?ZV():LV()}function LV(){Tc()||It(!1);let e=m.useContext(Fb),{basename:t,future:n,navigator:r}=m.useContext(Do),{matches:i}=m.useContext(Vi),{pathname:s}=ws(),o=JSON.stringify(Mb(i,n.v7_relativeSplatPath)),a=m.useRef(!1);return J2(()=>{a.current=!0}),m.useCallback(function(u,d){if(d===void 0&&(d={}),!a.current)return;if(typeof u=="number"){r.go(u);return}let f=Lb(u,JSON.parse(o),s,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:uo([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,o,s,e])}const FV=m.createContext(null);function $V(e){let t=m.useContext(Vi).outlet;return t&&m.createElement(FV.Provider,{value:e},t)}function UV(){let{matches:e}=m.useContext(Vi),t=e[e.length-1];return t?t.params:{}}function eR(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=m.useContext(Do),{matches:i}=m.useContext(Vi),{pathname:s}=ws(),o=JSON.stringify(Mb(i,r.v7_relativeSplatPath));return m.useMemo(()=>Lb(e,JSON.parse(o),s,n==="path"),[e,o,s,n])}function VV(e,t){return zV(e,t)}function zV(e,t,n,r){Tc()||It(!1);let{navigator:i}=m.useContext(Do),{matches:s}=m.useContext(Vi),o=s[s.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=ws(),d;if(t){var f;let w=typeof t=="string"?Cc(t):t;l==="/"||(f=w.pathname)!=null&&f.startsWith(l)||It(!1),d=w}else d=u;let h=d.pathname||"/",p=h;if(l!=="/"){let w=l.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(w.length).join("/")}let g=hV(e,{pathname:p}),v=GV(g&&g.map(w=>Object.assign({},w,{params:Object.assign({},a,w.params),pathname:uo([l,i.encodeLocation?i.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?l:uo([l,i.encodeLocation?i.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),s,n,r);return t&&v?m.createElement(Jm.Provider,{value:{location:md({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:to.Pop}},v):v}function BV(){let e=XV(),t=AV(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},t),n?m.createElement("pre",{style:i},n):null,null)}const WV=m.createElement(BV,null);class qV 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(Vi.Provider,{value:this.props.routeContext},m.createElement(Z2.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function HV(e){let{routeContext:t,match:n,children:r}=e,i=m.useContext(Fb);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),m.createElement(Vi.Provider,{value:t},r)}function GV(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var s;if(!n)return null;if(n.errors)e=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,a=(i=n)==null?void 0:i.errors;if(a!=null){let d=o.findIndex(f=>f.route.id&&(a==null?void 0:a[f.route.id])!==void 0);d>=0||It(!1),o=o.slice(0,Math.min(o.length,d+1))}let l=!1,u=-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)&&(u=d),f.route.id){let{loaderData:h,errors:p}=n,g=f.route.loader&&h[f.route.id]===void 0&&(!p||p[f.route.id]===void 0);if(f.route.lazy||g){l=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,f,h)=>{let p,g=!1,v=null,w=null;n&&(p=a&&f.route.id?a[f.route.id]:void 0,v=f.route.errorElement||WV,l&&(u<0&&h===0?(g=!0,w=null):u===h&&(g=!0,w=f.route.hydrateFallbackElement||null)));let y=t.concat(o.slice(0,h+1)),x=()=>{let b;return p?b=v:g?b=w:f.route.Component?b=m.createElement(f.route.Component,null):f.route.element?b=f.route.element:b=d,m.createElement(HV,{match:f,routeContext:{outlet:d,matches:y,isDataRoute:n!=null},children:b})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?m.createElement(qV,{location:n.location,revalidation:n.revalidation,component:v,error:p,children:x(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):x()},null)}var tR=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(tR||{}),Op=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}(Op||{});function KV(e){let t=m.useContext(Fb);return t||It(!1),t}function YV(e){let t=m.useContext(DV);return t||It(!1),t}function QV(e){let t=m.useContext(Vi);return t||It(!1),t}function nR(e){let t=QV(),n=t.matches[t.matches.length-1];return n.route.id||It(!1),n.route.id}function XV(){var e;let t=m.useContext(Z2),n=YV(Op.UseRouteError),r=nR(Op.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function ZV(){let{router:e}=KV(tR.UseNavigateStable),t=nR(Op.UseNavigateStable),n=m.useRef(!1);return J2(()=>{n.current=!0}),m.useCallback(function(i,s){s===void 0&&(s={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,md({fromRouteId:t},s)))},[e,t])}function U0(e){let{to:t,replace:n,state:r,relative:i}=e;Tc()||It(!1);let{future:s,static:o}=m.useContext(Do),{matches:a}=m.useContext(Vi),{pathname:l}=ws(),u=wn(),d=Lb(t,Mb(a,s.v7_relativeSplatPath),l,i==="path"),f=JSON.stringify(d);return m.useEffect(()=>u(JSON.parse(f),{replace:n,state:r,relative:i}),[u,f,i,n,r]),null}function rR(e){return $V(e.context)}function Ot(e){It(!1)}function JV(e){let{basename:t="/",children:n=null,location:r,navigationType:i=to.Pop,navigator:s,static:o=!1,future:a}=e;Tc()&&It(!1);let l=t.replace(/^\/*/,"/"),u=m.useMemo(()=>({basename:l,navigator:s,static:o,future:md({v7_relativeSplatPath:!1},a)}),[l,a,s,o]);typeof r=="string"&&(r=Cc(r));let{pathname:d="/",search:f="",hash:h="",state:p=null,key:g="default"}=r,v=m.useMemo(()=>{let w=Db(d,l);return w==null?null:{location:{pathname:w,search:f,hash:h,state:p,key:g},navigationType:i}},[l,d,f,h,p,g,i]);return v==null?null:m.createElement(Do.Provider,{value:u},m.createElement(Jm.Provider,{children:n,value:v}))}function e6(e){let{children:t,location:n}=e;return VV(V0(t),n)}new Promise(()=>{});function V0(e,t){t===void 0&&(t=[]);let n=[];return m.Children.forEach(e,(r,i)=>{if(!m.isValidElement(r))return;let s=[...t,i];if(r.type===m.Fragment){n.push.apply(n,V0(r.props.children,s));return}r.type!==Ot&&It(!1),!r.props.index||!r.props.children||It(!1);let o={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=V0(r.props.children,s)),n.push(o)}),n}/**
59 * React Router DOM v6.27.0
60 *
61 * Copyright (c) Remix Software Inc.
62 *
63 * This source code is licensed under the MIT license found in the
64 * LICENSE.md file in the root directory of this source tree.
65 *
66 * @license MIT
67 */function z0(){return z0=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},z0.apply(this,arguments)}function t6(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function n6(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function r6(e,t){return e.button===0&&(!t||t==="_self")&&!n6(e)}const i6=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],s6="6";try{window.__reactRouterVersion=s6}catch{}const o6="startTransition",OE=BP[o6];function a6(e){let{basename:t,children:n,future:r,window:i}=e,s=m.useRef();s.current==null&&(s.current=uV({window:i,v5Compat:!0}));let o=s.current,[a,l]=m.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},d=m.useCallback(f=>{u&&OE?OE(()=>l(f)):l(f)},[l,u]);return m.useLayoutEffect(()=>o.listen(d),[o,d]),m.createElement(JV,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:o,future:r})}const l6=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",c6=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Nt=m.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:s,replace:o,state:a,target:l,to:u,preventScrollReset:d,viewTransition:f}=t,h=t6(t,i6),{basename:p}=m.useContext(Do),g,v=!1;if(typeof u=="string"&&c6.test(u)&&(g=u,l6))try{let b=new URL(window.location.href),_=u.startsWith("//")?new URL(b.protocol+u):new URL(u),S=Db(_.pathname,p);_.origin===b.origin&&S!=null?u=S+_.search+_.hash:v=!0}catch{}let w=MV(u,{relative:i}),y=u6(u,{replace:o,state:a,target:l,preventScrollReset:d,relative:i,viewTransition:f});function x(b){r&&r(b),b.defaultPrevented||y(b)}return m.createElement("a",z0({},h,{href:g||w,onClick:v||s?r:x,ref:n,target:l}))});var DE;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(DE||(DE={}));var ME;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(ME||(ME={}));function u6(e,t){let{target:n,replace:r,state:i,preventScrollReset:s,relative:o,viewTransition:a}=t===void 0?{}:t,l=wn(),u=ws(),d=eR(e,{relative:o});return m.useCallback(f=>{if(r6(f,n)){f.preventDefault();let h=r!==void 0?r:Ap(u)===Ap(d);l(e,{replace:h,state:i,preventScrollReset:s,relative:o,viewTransition:a})}},[u,l,d,r,i,n,e,s,o,a])}var jc=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(){}},ja=typeof window>"u"||"Deno"in globalThis;function Cn(){}function d6(e,t){return typeof e=="function"?e(t):e}function B0(e){return typeof e=="number"&&e>=0&&e!==1/0}function iR(e,t){return Math.max(e+(t||0)-Date.now(),0)}function fo(e,t){return typeof e=="function"?e(t):e}function Xr(e,t){return typeof e=="function"?e(t):e}function LE(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:a}=e;if(o){if(r){if(t.queryHash!==$b(o,t.options))return!1}else if(!gd(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||i&&i!==t.state.fetchStatus||s&&!s(t))}function FE(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Pa(t.options.mutationKey)!==Pa(s))return!1}else if(!gd(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function $b(e,t){return((t==null?void 0:t.queryKeyHashFn)||Pa)(e)}function Pa(e){return JSON.stringify(e,(t,n)=>W0(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function gd(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>gd(e[n],t[n])):!1}function sR(e,t){if(e===t)return e;const n=$E(e)&&$E(t);if(n||W0(e)&&W0(t)){const r=n?e:Object.keys(e),i=r.length,s=n?t:Object.keys(t),o=s.length,a=n?[]:{},l=new Set(r);let u=0;for(let d=0;d<o;d++){const f=n?d:s[d];(!n&&l.has(f)||n)&&e[f]===void 0&&t[f]===void 0?(a[f]=void 0,u++):(a[f]=sR(e[f],t[f]),a[f]===e[f]&&e[f]!==void 0&&u++)}return i===o&&u===i?e:a}return t}function Dp(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function $E(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function W0(e){if(!UE(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!UE(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function UE(e){return Object.prototype.toString.call(e)==="[object Object]"}function f6(e){return new Promise(t=>{setTimeout(t,e)})}function q0(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?sR(e,t):t}function h6(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function p6(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Ub=Symbol();function oR(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Ub?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function aR(e,t){return typeof e=="function"?e(...t):!!e}var aa,Bs,Bl,SP,m6=(SP=class extends jc{constructor(){super();we(this,aa);we(this,Bs);we(this,Bl);ue(this,Bl,t=>{if(!ja&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){M(this,Bs)||this.setEventListener(M(this,Bl))}onUnsubscribe(){var t;this.hasListeners()||((t=M(this,Bs))==null||t.call(this),ue(this,Bs,void 0))}setEventListener(t){var n;ue(this,Bl,t),(n=M(this,Bs))==null||n.call(this),ue(this,Bs,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){M(this,aa)!==t&&(ue(this,aa,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof M(this,aa)=="boolean"?M(this,aa):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},aa=new WeakMap,Bs=new WeakMap,Bl=new WeakMap,SP),Vb=new m6,Wl,Ws,ql,EP,g6=(EP=class extends jc{constructor(){super();we(this,Wl,!0);we(this,Ws);we(this,ql);ue(this,ql,t=>{if(!ja&&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(){M(this,Ws)||this.setEventListener(M(this,ql))}onUnsubscribe(){var t;this.hasListeners()||((t=M(this,Ws))==null||t.call(this),ue(this,Ws,void 0))}setEventListener(t){var n;ue(this,ql,t),(n=M(this,Ws))==null||n.call(this),ue(this,Ws,t(this.setOnline.bind(this)))}setOnline(t){M(this,Wl)!==t&&(ue(this,Wl,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return M(this,Wl)}},Wl=new WeakMap,Ws=new WeakMap,ql=new WeakMap,EP),Mp=new g6;function H0(){let e,t;const n=new Promise((i,s)=>{e=i,t=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}function v6(e){return Math.min(1e3*2**e,3e4)}function lR(e){return(e??"online")==="online"?Mp.isOnline():!0}var cR=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Nv(e){return e instanceof cR}function uR(e){let t=!1,n=0,r=!1,i;const s=H0(),o=v=>{var w;r||(h(new cR(v)),(w=e.abort)==null||w.call(e))},a=()=>{t=!0},l=()=>{t=!1},u=()=>Vb.isFocused()&&(e.networkMode==="always"||Mp.isOnline())&&e.canRun(),d=()=>lR(e.networkMode)&&e.canRun(),f=v=>{var w;r||(r=!0,(w=e.onSuccess)==null||w.call(e,v),i==null||i(),s.resolve(v))},h=v=>{var w;r||(r=!0,(w=e.onError)==null||w.call(e,v),i==null||i(),s.reject(v))},p=()=>new Promise(v=>{var w;i=y=>{(r||u())&&v(y)},(w=e.onPause)==null||w.call(e)}).then(()=>{var v;i=void 0,r||(v=e.onContinue)==null||v.call(e)}),g=()=>{if(r)return;let v;const w=n===0?e.initialPromise:void 0;try{v=w??e.fn()}catch(y){v=Promise.reject(y)}Promise.resolve(v).then(f).catch(y=>{var E;if(r)return;const x=e.retry??(ja?0:3),b=e.retryDelay??v6,_=typeof b=="function"?b(n,y):b,S=x===!0||typeof x=="number"&&n<x||typeof x=="function"&&x(n,y);if(t||!S){h(y);return}n++,(E=e.onFail)==null||E.call(e,n,y),f6(_).then(()=>u()?void 0:p()).then(()=>{t?h(y):g()})})};return{promise:s,cancel:o,continue:()=>(i==null||i(),s),cancelRetry:a,continueRetry:l,canStart:d,start:()=>(d()?g():p().then(g),s)}}var y6=e=>setTimeout(e,0);function x6(){let e=[],t=0,n=a=>{a()},r=a=>{a()},i=y6;const s=a=>{t?e.push(a):i(()=>{n(a)})},o=()=>{const a=e;e=[],a.length&&i(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||o()}return l},batchCalls:a=>(...l)=>{s(()=>{a(...l)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{i=a}}}var zt=x6(),la,kP,dR=(kP=class{constructor(){we(this,la)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),B0(this.gcTime)&&ue(this,la,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ja?1/0:5*60*1e3))}clearGcTimeout(){M(this,la)&&(clearTimeout(M(this,la)),ue(this,la,void 0))}},la=new WeakMap,kP),Hl,ca,br,ua,fn,tf,da,Hr,Qi,CP,w6=(CP=class extends dR{constructor(t){super();we(this,Hr);we(this,Hl);we(this,ca);we(this,br);we(this,ua);we(this,fn);we(this,tf);we(this,da);ue(this,da,!1),ue(this,tf,t.defaultOptions),this.setOptions(t.options),this.observers=[],ue(this,ua,t.client),ue(this,br,M(this,ua).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ue(this,Hl,b6(this.options)),this.state=t.state??M(this,Hl),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=M(this,fn))==null?void 0:t.promise}setOptions(t){this.options={...M(this,tf),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&M(this,br).remove(this)}setData(t,n){const r=q0(this.state.data,t,this.options);return Oe(this,Hr,Qi).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Oe(this,Hr,Qi).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=M(this,fn))==null?void 0:r.promise;return(i=M(this,fn))==null||i.cancel(t),n?n.then(Cn).catch(Cn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(M(this,Hl))}isActive(){return this.observers.some(t=>Xr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ub||this.state.dataUpdateCount+this.state.errorUpdate
vendor: 1,274 bytes, line 67
67Count===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>fo(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:!iR(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=M(this,fn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=M(this,fn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),M(this,br).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(M(this,fn)&&(M(this,da)?M(this,fn).cancel({revert:!0}):M(this,fn).cancelRetry()),this.scheduleGc()),M(this,br).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Oe(this,Hr,Qi).call(this,{type:"invalidate"})}
vendor: 6,533 bytes, line 67
67fetch(t,n){var u,d,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(M(this,fn))return M(this,fn).continueRetry(),M(this,fn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const h=this.observers.find(p=>p.options.queryFn);h&&this.setOptions(h.options)}const r=new AbortController,i=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(ue(this,da,!0),r.signal)})},s=()=>{const h=oR(this.options,n),g=(()=>{const v={client:M(this,ua),queryKey:this.queryKey,meta:this.meta};return i(v),v})();return ue(this,da,!1),this.options.persister?this.options.persister(h,g,this):h(g)},a=(()=>{const h={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:M(this,ua),state:this.state,fetchFn:s};return i(h),h})();(u=this.options.behavior)==null||u.onFetch(a,this),ue(this,ca,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=a.fetchOptions)==null?void 0:d.meta))&&Oe(this,Hr,Qi).call(this,{type:"fetch",meta:(f=a.fetchOptions)==null?void 0:f.meta});const l=h=>{var p,g,v,w;Nv(h)&&h.silent||Oe(this,Hr,Qi).call(this,{type:"error",error:h}),Nv(h)||((g=(p=M(this,br).config).onError)==null||g.call(p,h,this),(w=(v=M(this,br).config).onSettled)==null||w.call(v,this.state.data,h,this)),this.scheduleGc()};return ue(this,fn,uR({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:h=>{var p,g,v,w;if(h===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(h)}catch(y){l(y);return}(g=(p=M(this,br).config).onSuccess)==null||g.call(p,h,this),(w=(v=M(this,br).config).onSettled)==null||w.call(v,h,this.state.error,this),this.scheduleGc()},onError:l,onFail:(h,p)=>{Oe(this,Hr,Qi).call(this,{type:"failed",failureCount:h,error:p})},onPause:()=>{Oe(this,Hr,Qi).call(this,{type:"pause"})},onContinue:()=>{Oe(this,Hr,Qi).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),M(this,fn).start()}},Hl=new WeakMap,ca=new WeakMap,br=new WeakMap,ua=new WeakMap,fn=new WeakMap,tf=new WeakMap,da=new WeakMap,Hr=new WeakSet,Qi=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,...fR(r.data,this.options),fetchMeta:t.meta??null};case"success":return ue(this,ca,void 0),{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return Nv(i)&&i.revert&&M(this,ca)?{...M(this,ca),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),zt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),M(this,br).notify({query:this,type:"updated",action:t})})},CP);function fR(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:lR(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function b6(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var bi,TP,_6=(TP=class extends jc{constructor(t={}){super();we(this,bi);this.config=t,ue(this,bi,new Map)}build(t,n,r){const i=n.queryKey,s=n.queryHash??$b(i,n);let o=this.get(s);return o||(o=new w6({client:t,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){M(this,bi).has(t.queryHash)||(M(this,bi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=M(this,bi).get(t.queryHash);n&&(t.destroy(),n===t&&M(this,bi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){zt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return M(this,bi).get(t)}getAll(){return[...M(this,bi).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>LE(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>LE(t,r)):n}notify(t){zt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){zt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){zt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},bi=new WeakMap,TP),_i,Sn,fa,Si,Ps,jP,S6=(jP=class extends dR{constructor(t){super();we(this,Si);we(this,_i);we(this,Sn);we(this,fa);this.mutationId=t.mutationId,ue(this,Sn,t.mutationCache),ue(this,_i,[]),this.state=t.state||hR(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){M(this,_i).includes(t)||(M(this,_i).push(t),this.clearGcTimeout(),M(this,Sn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ue(this,_i,M(this,_i).filter(n=>n!==t)),this.scheduleGc(),M(this,Sn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){M(this,_i).length||(this.state.status==="pending"?this.scheduleGc():M(this,Sn).remove(this))}continue(){var t;return((t=M(this,fa))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var s,o,a,l,u,d,f,h,p,g,v,w,y,x,b,_,S,E,k,C;const n=()=>{Oe(this,Si,Ps).call(this,{type:"continue"})};ue(this,fa,uR({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(P,T)=>{Oe(this,Si,Ps).call(this,{type:"failed",failureCount:P,error:T})},onPause:()=>{Oe(this,Si,Ps).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>M(this,Sn).canRun(this)}));const r=this.state.status==="pending",i=!M(this,fa).canStart();try{if(r)n();else{Oe(this,Si,Ps).call(this,{type:"pending",variables:t,isPaused:i}),await((o=(s=M(this,Sn).config).onMutate)==null?void 0:o.call(s,t,this));
67const T=await((l=(a=this.options).onMutate)==null?void 0:l.call(a,t));T!==this.state.context&&Oe(this,Si,Ps).call(this,{type:"pending",context:T,variables:t,isPaused:i})}const P=await M(this,fa).start();return await((d=(u=M(this,Sn).config).onSuccess)==null?void 0:d.call(u,P,t,this.state.context,this)),await((h=(f=this.options).onSuccess)==null?void 0:h.call(f,P,t,this.state.context)),await((g=(p=M(this,Sn).config).onSettled)==null?void 0:g.call(p,P,null,this.state.variables,this.state.context,this)),await((w=(v=this.options).onSettled)==null?void 0:w.call(v,P,null,t,this.state.context)),Oe(this,Si,Ps).call(this,{type:"success",data:P}),P}catch(P){try{throw await((x=(y=M(this,Sn).config).onError)==null?void 0:x.call(y,P,t,this.state.context,this)),await((_=(b=this.options).onError)==null?void 0:_.call(b,P,t,this.state.context)),await((E=(S=M(this,Sn).config).onSettled)==null?void 0:E.call(S,void 0,P,this.state.variables,this.state.context,this)),await((C=(k=this.options).onSettled)==null?void 0:C.call(k,void 0,P,t,this.state.context)),P}finally{Oe(this,Si,Ps).call(this,{type:"error",error:P})}}finally{M(this,Sn).runNext(this)}}},_i=new WeakMap,Sn=new WeakMap,fa=new WeakMap,Si=new WeakSet,Ps=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),zt.batch(()=>{M(this,_i).forEach(r=>{r.onMutationUpdate(t)}),M(this,Sn).notify({mutation:this,type:"updated",action:t})})},jP);function hR(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ns,Gr,nf,PP,E6=(PP=class extends jc{constructor(t={}){super();we(this,ns);we(this,Gr);we(this,nf);this.config=t,ue(this,ns,new Set),ue(this,Gr,new Map),ue(this,nf,0)}build(t,n,r){const i=new S6({mutationCache:this,mutationId:++If(this,nf)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){M(this,ns).add(t);const n=Qf(t);if(typeof n=="string"){const r=M(this,Gr).get(n);r?r.push(t):M(this,Gr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(M(this,ns).delete(t)){const n=Qf(t);if(typeof n=="string"){const r=M(this,Gr).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&M(this,Gr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Qf(t);if(typeof n=="string"){const r=M(this,Gr).get(n),i=r==null?void 0:r.find(s=>s.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r;const n=Qf(t);if(typeof n=="string"){const i=(r=M(this,Gr).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){zt.batch(()=>{M(this,ns).forEach(t=>{this.notify({type:"removed",mutation:t})}),M(this,ns).clear(),M(this,Gr).clear()})}getAll(){return Array.from(M(this,ns))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>FE(n,r))}findAll(t={}){return this.getAll().filter(n=>FE(t,n))}notify(t){zt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return zt.batch(()=>Promise.all(t.map(n=>n.continue().catch(Cn))))}},ns=new WeakMap,Gr=new WeakMap,nf=new WeakMap,PP);function Qf(e){var t;return(t=e.options.scope)==null?void 0:t.id}function VE(e){return{onFetch:(t,n)=>{var d,f,h,p,g;const r=t.options,i=(h=(f=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:h.direction,s=((p=t.state.data)==null?void 0:p.pages)||[],o=((g=t.state.data)==null?void 0:g.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let v=!1;const w=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(t.signal.aborted?v=!0:t.signal.addEventListener("abort",()=>{v=!0}),t.signal)}
vendor: 12,915 bytes, line 67
67)},y=oR(t.options,t.fetchOptions),x=async(b,_,S)=>{if(v)return Promise.reject();if(_==null&&b.pages.length)return Promise.resolve(b);const k=(()=>{const N={client:t.client,queryKey:t.queryKey,pageParam:_,direction:S?"backward":"forward",meta:t.options.meta};return w(N),N})(),C=await y(k),{maxPages:P}=t.options,T=S?p6:h6;return{pages:T(b.pages,C,P),pageParams:T(b.pageParams,_,P)}};if(i&&s.length){const b=i==="backward",_=b?k6:zE,S={pages:s,pageParams:o},E=_(r,S);a=await x(S,E,b)}else{const b=e??s.length;do{const _=l===0?o[0]??r.initialPageParam:zE(r,a);if(l>0&&_==null)break;a=await x(a,_),l++}while(l<b)}return a};t.options.persister?t.fetchFn=()=>{var v,w;return(w=(v=t.options).persister)==null?void 0:w.call(v,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function zE(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 k6(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 St,qs,Hs,Gl,Kl,Gs,Yl,Ql,NP,C6=(NP=class{constructor(e={}){we(this,St);we(this,qs);we(this,Hs);we(this,Gl);we(this,Kl);we(this,Gs);we(this,Yl);we(this,Ql);ue(this,St,e.queryCache||new _6),ue(this,qs,e.mutationCache||new E6),ue(this,Hs,e.defaultOptions||{}),ue(this,Gl,new Map),ue(this,Kl,new Map),ue(this,Gs,0)}mount(){If(this,Gs)._++,M(this,Gs)===1&&(ue(this,Yl,Vb.subscribe(async e=>{e&&(await this.resumePausedMutations(),M(this,St).onFocus())})),ue(this,Ql,Mp.subscribe(async e=>{e&&(await this.resumePausedMutations(),M(this,St).onOnline())})))}unmount(){var e,t;If(this,Gs)._--,M(this,Gs)===0&&((e=M(this,Yl))==null||e.call(this),ue(this,Yl,void 0),(t=M(this,Ql))==null||t.call(this),ue(this,Ql,void 0))}isFetching(e){return M(this,St).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return M(this,qs).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=M(this,St).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=M(this,St).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(fo(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return M(this,St).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=M(this,St).get(r.queryHash),s=i==null?void 0:i.state.data,o=d6(t,s);if(o!==void 0)return M(this,St).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return zt.batch(()=>M(this,St).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=M(this,St).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=M(this,St);zt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=M(this,St);return zt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=zt.batch(()=>M(this,St).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Cn).catch(Cn)}invalidateQueries(e,t={}){return zt.batch(()=>(M(this,St).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=zt.batch(()=>M(this,St).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(Cn)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Cn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=M(this,St).build(this,t);return n.isStaleByTime(fo(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Cn).catch(Cn)}fetchInfiniteQuery(e){return e.behavior=VE(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Cn).catch(Cn)}ensureInfiniteQueryData(e){return e.behavior=VE(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Mp.isOnline()?M(this,qs).resumePausedMutations():Promise.resolve()}getQueryCache(){return M(this,St)}getMutationCache(){return M(this,qs)}getDefaultOptions(){return M(this,Hs)}setDefaultOptions(e){ue(this,Hs,e)}setQueryDefaults(e,t){M(this,Gl).set(Pa(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...M(this,Gl).values()],n={};return t.forEach(r=>{gd(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){M(this,Kl).set(Pa(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...M(this,Kl).values()],n={};return t.forEach(r=>{gd(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...M(this,Hs).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=$b(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===Ub&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...M(this,Hs).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){M(this,St).clear(),M(this,qs).clear()}},St=new WeakMap,qs=new WeakMap,Hs=new WeakMap,Gl=new WeakMap,Kl=new WeakMap,Gs=new WeakMap,Yl=new WeakMap,Ql=new WeakMap,NP),Vn,We,rf,En,ha,Xl,Ks,Ys,sf,Zl,Jl,pa,ma,Qs,ec,Ye,bu,G0,K0,Y0,Q0,X0,Z0,J0,pR,RP,T6=(RP=class extends jc{constructor(t,n){super();we(this,Ye);we(this,Vn);we(this,We);we(this,rf);we(this,En);we(this,ha);we(this,Xl);we(this,Ks);we(this,Ys);we(this,sf);we(this,Zl);we(this,Jl);we(this,pa);we(this,ma);we(this,Qs);we(this,ec,new Set);this.options=n,ue(this,Vn,t),ue(this,Ys,null),ue(this,Ks,H0()),this.options.experimental_prefetchInRender||M(this,Ks).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(M(this,We).addObserver(this),BE(M(this,We),this.options)?Oe(this,Ye,bu).call(this):this.updateResult(),Oe(this,Ye,Q0).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ex(M(this,We),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ex(M(this,We),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Oe(this,Ye,X0).call(this),Oe(this,Ye,Z0).call(this),M(this,We).removeObserver(this)}setOptions(t){const n=this.options,r=M(this,We);if(this.options=M(this,Vn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Xr(this.options.enabled,M(this,We))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Oe(this,Ye,J0).call(this),M(this,We).setOptions(this.options),n._defaulted&&!Dp(this.options,n)&&M(this,Vn).getQueryCache().notify({type:"observerOptionsUpdated",query:M(this,We),observer:this});const i=this.hasListeners();i&&WE(M(this,We),r,this.options,n)&&Oe(this,Ye,bu).call(this),this.updateResult(),i&&(M(this,We)!==r||Xr(this.options.enabled,M(this,We))!==Xr(n.enabled,M(this,We))||fo(this.options.staleTime,M(this,We))!==fo(n.staleTime,M(this,We)))&&Oe(this,Ye,G0).call(this);const s=Oe(this,Ye,K0).call(this);i&&(M(this,We)!==r||Xr(this.options.enabled,M(this,We))!==Xr(n.enabled,M(this,We))||s!==M(this,Qs))&&Oe(this,Ye,Y0).call(this,s)}getOptimisticResult(t){const n=M(this,Vn).getQueryCache().build(M(this,Vn),t),r=this.createResult(n,t);return P6(this,r)&&(ue(this,En,r),ue(this,Xl,this.options),ue(this,ha,M(this,We).state)),r}getCurrentResult(){return M(this,En)}trackResult(t,n){return new Proxy(t,{get:(r,i)=>(this.trackProp(i),n==null||n(i),Reflect.get(r,i))})}trackProp(t){M(this,ec).add(t)}getCurrentQuery(){return M(this,We)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=M(this,Vn).defaultQueryOptions(t),r=M(this,Vn).getQueryCache().build(M(this,Vn),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Oe(this,Ye,bu).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),M(this,En)))}createResult(t,n){var P;const r=M(this,We),i=this.options,s=M(this,En),o=M(this,ha),a=M(this,Xl),u=t!==r?t.state:M(this,rf),{state:d}=t;let f={...d},h=!1,p;if(n._optimisticResults){const T=this.hasListeners(),N=!T&&BE(t,n),I=T&&WE(t,r,n,i);(N||I)&&(f={...f,...fR(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:g,errorUpdatedAt:v,status:w}=f;p=f.data;let y=!1;if(n.placeholderData!==void 0&&p===void 0&&w==="pending"){let T;s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData)?(T=s.data,y=!0):T=typeof n.placeholderData=="function"?n.placeholderData((P=M(this,Jl))==null?void 0:P.state.data,M(this,Jl)):n.placeholderData,T!==void 0&&(w="success",p=q0(s==null?void 0:s.data,T,n),h=!0)}if(n.select&&p!==void 0&&!y)if(s&&p===(o==null?void 0:o.data)&&n.select===M(this,sf))p=M(this,Zl);else try{ue(this,sf,n.select),p=n.select(p),p=q0(s==null?void 0:s.data,p,n),ue(this,Zl,p),ue(this,Ys,null)}catch(T){ue(this,Ys,T)}M(this,Ys)&&(g=M(this,Ys),p=M(this,Zl),v=Date.now(),w="error");const x=f.fetchStatus==="fetching",b=w==="pending",_=w==="error",S=b&&x,E=p!==void 0,C={status:w,fetchStatus:f.fetchStatus,isPending:b,isSuccess:w==="success",isError:_,isInitialLoading:S,isLoading:S,data:p,dataUpdatedAt:f.dataUpdatedAt,error:g,errorUpdatedAt:v,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:x,isRefetching:x&&!b,isLoadingError:_&&!E,isPaused:f.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:_&&E,isStale:zb(t,n),refetch:this.refetch,promise:M(this,Ks)};if(this.options.experimental_prefetchInRender){const T=O=>{C.status==="error"?O.reject(C.error):C.data!==void 0&&O.resolve(C.data)},N=()=>{const O=ue(this,Ks,C.promise=H0());T(O)},I=M(this,Ks);switch(I.status){case"pending":t.queryHash===r.queryHash&&T(I);break;case"fulfilled":(C.status==="error"||C.data!==I.value)&&N();break;case"rejected":(C.status!=="error"||C.error!==I.reason)&&N();break}}return C}updateResult(){const t=M(this,En),n=this.createResult(M(this,We),this.options);if(ue(this,ha,M(this,We).state),ue(this,Xl,this.options),M(this,ha).data!==void 0&&ue(this,Jl,M(this,We)),Dp(n,t))return;ue(this,En,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!M(this,ec).size)return!0;const o=new Set(s??M(this,ec));return this.options.throwOnError&&o.add("error"),Object.keys(M(this,En)).some(a=>{const l=a;return M(this,En)[l]!==t[l]&&o.has(l)})};Oe(this,Ye,pR).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Oe(this,Ye,Q0).call(this)}},Vn=new WeakMap,We=new WeakMap,rf=new WeakMap,En=new WeakMap,ha=new WeakMap,Xl=new WeakMap,Ks=new WeakMap,Ys=new WeakMap,sf=new WeakMap,Zl=new WeakMap,Jl=new WeakMap,pa=new WeakMap,ma=new WeakMap,Qs=new WeakMap,ec=new WeakMap,Ye=new WeakSet,bu=function(t){Oe(this,Ye,J0).call(this);let n=M(this,We).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Cn)),n},G0=function(){Oe(this,Ye,X0).call(this);const t=fo(this.options.staleTime,M(this,We));if(ja||M(this,En).isStale||!B0(t))return;const r=iR(M(this,En).dataUpdatedAt,t)+1;ue(this,pa,setTimeout(()=>{M(this,En).isStale||this.updateResult()},r))},K0=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(M(this,We)):this.options.refetchInterval)??!1},Y0=function(t){Oe(this,Ye,Z0).call(this),ue(this,Qs,t),!(ja||Xr(this.options.enabled,M(this,We))===!1||!B0(M(this,Qs))||M(this,Qs)===0)&&ue(this,ma,setInterval(()=>{(this.options.refetchIntervalInBackground||Vb.isFocused())&&Oe(this,Ye,bu).call(this)},M(this,Qs)))},Q0=function(){Oe(this,Ye,G0).call(this),Oe(this,Ye,Y0).call(this,Oe(this,Ye,K0).call(this))},X0=function(){M(this,pa)&&(clearTimeout(M(this,pa)),ue(this,pa,void 0))},Z0=function(){M(this,ma)&&(clearInterval(M(this,ma)),ue(this,ma,void 0))},J0=function(){const t=M(this,Vn).getQueryCache().build(M(this,Vn),this.options);if(t===M(this,We))return;const n=M(this,We);ue(this,We,t),ue(this,rf,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},pR=function(t){zt.batch(()=>
67{t.listeners&&this.listeners.forEach(n=>{n(M(this,En))}),M(this,Vn).getQueryCache().notify({query:M(this,We),type:"observerResultsUpdated"})})},RP);function j6(e,t){return Xr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function BE(e,t){return j6(e,t)||e.state.data!==void 0&&ex(e,t,t.refetchOnMount)}function ex(e,t,n){if(Xr(t.enabled,e)!==!1&&fo(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&zb(e,t)}return!1}function WE(e,t,n,r){return(e!==t||Xr(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&zb(e,n)}function zb(e,t){return Xr(t.enabled,e)!==!1&&e.isStaleByTime(fo(t.staleTime,e))}function P6(e,t){return!Dp(e.getCurrentResult(),t)}var Xs,Zs,zn,rs,cs,zh,tx,IP,N6=(IP=class extends jc{constructor(n,r){super();we(this,cs);we(this,Xs);we(this,Zs);we(this,zn);we(this,rs);ue(this,Xs,n),this.setOptions(r),this.bindMethods(),Oe(this,cs,zh).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=M(this,Xs).defaultMutationOptions(n),Dp(this.options,r)||M(this,Xs).getMutationCache().notify({type:"observerOptionsUpdated",mutation:M(this,zn),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Pa(r.mutationKey)!==Pa(this.options.mutationKey)?this.reset():((i=M(this,zn))==null?void 0:i.state.status)==="pending"&&M(this,zn).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=M(this,zn))==null||n.removeObserver(this)}onMutationUpdate(n){Oe(this,cs,zh).call(this),Oe(this,cs,tx).call(this,n)}getCurrentResult(){return M(this,Zs)}reset(){var n;(n=M(this,zn))==null||n.removeObserver(this),ue(this,zn,void 0),Oe(this,cs,zh).call(this),Oe(this,cs,tx).call(this)}mutate(n,r){var i;return ue(this,rs,r),(i=M(this,zn))==null||i.removeObserver(this),ue(this,zn,M(this,Xs).getMutationCache().build(M(this,Xs),this.options)),M(this,zn).addObserver(this),M(this,zn).execute(n)}},Xs=new WeakMap,Zs=new WeakMap,zn=new WeakMap,rs=new WeakMap,cs=new WeakSet,zh=function(){var r;const n=((r=M(this,zn))==null?void 0:r.state)??hR();ue(this,Zs,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},tx=function(n){zt.batch(()=>{var r,i,s,o,a,l,u,d;if(M(this,rs)&&this.hasListeners()){const f=M(this,Zs).variables,h=M(this,Zs).context;(n==null?void 0:n.type)==="success"?((i=(r=M(this,rs)).onSuccess)==null||i.call(r,n.data,f,h),(o=(s=M(this,rs)).onSettled)==null||o.call(s,n.data,null,f,h)):(n==null?void 0:n.type)==="error"&&((l=(a=M(this,rs)).onError)==null||l.call(a,n.error,f,h),(d=(u=M(this,rs)).onSettled)==null||d.call(u,void 0,n.error,f,h))}this.listeners.forEach(f=>{f(M(this,Zs))})})},IP),mR=m.createContext(void 0),Bb=e=>{const t=m.useContext(mR);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},R6=({client:e,children:t})=>(m.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx(mR.Provider,{value:e,children:t})),gR=m.createContext(!1),I6=()=>m.useContext(gR);gR.Provider;function A6(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var O6=m.createContext(A6()),D6=()=>m.useContext(O6),M6=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},L6=e=>{m.useEffect(()=>{e.clearReset()},[e])},F6=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||aR(n,[e.error,r])),$6=e=>{if(e.suspense){const t=r=>r==="static"?r:Math.max(r??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...r)=>t(n(...r)):t(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},U6=(e,t)=>e.isLoading&&e.isFetching&&!t,V6=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,qE=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function z6(e,t,n){var f,h,p,g,v;const r=I6(),i=D6(),s=Bb(),o=s.defaultQueryOptions(e);(h=(f=s.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||h.call(f,o),o._optimisticResults=r?"isRestoring":"optimistic",$6(o),M6(o,i),L6(i);const a=!s.getQueryCache().get(o.queryHash),[l]=m.useState(()=>new t(s,o)),u=l.getOptimisticResult(o),d=!r&&e.subscribed!==!1;if(m.useSyncExternalStore(m.useCallback(w=>{const y=d?l.subscribe(zt.batchCalls(w)):Cn;return l.updateResult(),y},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),m.useEffect(()=>{l.setOptions(o)},[o,l]),V6(o,u))throw qE(o,l,i);if(F6({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw u.error;if((g=(p=s.getDefaultOptions().queries)==null?void 0:p._experimental_afterQuery)==null||g.call(p,o,u),o.experimental_prefetchInRender&&!ja&&U6(u,r)){const w=a?qE(o,l,i):(v=s.getQueryCache().get(o.queryHash))==null?void 0:v.promise;w==null||w.catch(Cn).finally(()=>{l.updateResult()})}return o.notifyOnChangeProps?u:l.trackResult(u)}function B6(e,t){return z6(e,T6)}function Rv(e,t){const n=Bb(),[r]=m.useState(()=>new N6(n,e));m.useEffect(()=>{r.setOptions(e)},[r,e]);const i=m.useSyncExternalStore(m.useCallback(o=>r.subscribe(zt.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=m.useCallback((o,a)=>{r.mutate(o,a).catch(Cn)},[r]);if(i.error&&aR(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}const W6="modulepreload",q6=function(e){return"/"+e},HE={},ho=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.allSettled(n.map(l=>{if(l=q6(l),l in HE)return;HE[l]=!0;const u=l.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":W6,u||(f.as="script"),f.crossOrigin="",f.href=l,a&&f.setAttribute("nonce",a),document.head.appendChild(f),u)return new Promise((h,p)=>{f.addEventListener("load",h),f.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${l}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return t().catch(s)})},H6=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...n)=>ho(async()=>{const{default:r}=await Promise.resolve().then(()=>Pc);return{default:r}},void 0).then(({default:r})=>r(...n)):t=fetch,(...n)=>t(...n)};
67class Wb extends Error{constructor(t,n="FunctionsError",r){super(t),this.name=n,this.context=r}}class G6 extends Wb{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class GE extends Wb{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class KE extends Wb{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var nx;(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"})(nx||(nx={}));var K6=function(e,t,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(d){try{u(r.next(d))}catch(f){o(f)}}function l(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?s(d.value):i(d.value).then(a,l)}u((r=r.apply(e,t||[])).next())})};class Y6{constructor(t,{headers:n={},customFetch:r,region:i=nx.Any}={}){this.url=t,this.headers=n,this.region=i,this.fetch=H6(r)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t,n={}){var r;return K6(this,void 0,void 0,function*(){try{const{headers:i,method:s,body:o}=n;let a={},{region:l}=n;l||(l=this.region);const u=new URL(`${this.url}/${t}`);l&&l!=="any"&&(a["x-region"]=l,u.searchParams.set("forceFunctionRegion",l));let d;o&&(i&&!Object.prototype.hasOwnProperty.call(i,"Content-Type")||!i)&&(typeof Blob<"u"&&o instanceof Blob||o instanceof ArrayBuffer?(a["Content-Type"]="application/octet-stream",d=o):typeof o=="string"?(a["Content-Type"]="text/plain",d=o):typeof FormData<"u"&&o instanceof FormData?d=o:(a["Content-Type"]="application/json",d=JSON.stringify(o)));const f=yield this.fetch(u.toString(),{method:s||"POST",headers:Object.assign(Object.assign(Object.assign({},a),this.headers),i),body:d}).catch(v=>{throw new G6(v)}),h=f.headers.get("x-relay-error");if(h&&h==="true")throw new GE(f);if(!f.ok)throw new KE(f);let p=((r=f.headers.get("Content-Type"))!==null&&r!==void 0?r:"text/plain").split(";")[0].trim(),g;return p==="application/json"?g=yield f.json():p==="application/octet-stream"?g=yield f.blob():p==="text/event-stream"?g=f:p==="multipart/form-data"?g=yield f.formData():g=yield f.text(),{data:g,error:null,response:f}}catch(i){return{data:null,error:i,response:i instanceof KE||i instanceof GE?i.context:void 0}}})}}var qn={},qb={},eg={},df={},tg={},ng={},Q6=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")},lc=Q6();const X6=lc.fetch,vR=lc.fetch.bind(lc),yR=lc.Headers,Z6=lc.Request,J6=lc.Response,Pc=Object.freeze(Object.defineProperty({__proto__:null,Headers:yR,Request:Z6,Response:J6,default:vR,fetch:X6},Symbol.toStringTag,{value:"Module"})),ez=F$(Pc);var rg={};Object.defineProperty(rg,"__esModule",{value:!0});let tz=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.co
67de=t.code}};rg.default=tz;var xR=Ir&&Ir.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ng,"__esModule",{value:!0});const nz=xR(ez),rz=xR(rg);let iz=class{constructor(t){this.shouldThrowOnError=!1,this.method=t.method,this.url=t.url,this.headers=t.headers,this.schema=t.schema,this.body=t.body,this.shouldThrowOnError=t.shouldThrowOnError,this.signal=t.signal,this.isMaybeSingle=t.isMaybeSingle,t.fetch?this.fetch=t.fetch:typeof fetch>"u"?this.fetch=nz.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,n){return this.headers=Object.assign({},this.headers),this.headers[t]=n,this}then(t,n){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),this.method!=="GET"&&this.method!=="HEAD"&&(this.headers["Content-Type"]="application/json");const r=this.fetch;let i=r(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async s=>{var o,a,l;let u=null,d=null,f=null,h=s.status,p=s.statusText;if(s.ok){if(this.method!=="HEAD"){const y=await s.text();y===""||(this.headers.Accept==="text/csv"||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?d=y:d=JSON.parse(y))}const v=(o=this.headers.Prefer)===null||o===void 0?void 0:o.match(/count=(exact|planned|estimated)/),w=(a=s.headers.get("content-range"))===null||a===void 0?void 0:a.split("/");v&&w&&w.length>1&&(f=parseInt(w[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(d)&&(d.length>1?(u={code:"PGRST116",details:`Results contain ${d.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},d=null,f=null,h=406,p="Not Acceptable"):d.length===1?d=d[0]:d=null)}else{const v=await s.text();try{u=JSON.parse(v),Array.isArray(u)&&s.status===404&&(d=[],u=null,h=200,p="OK")}catch{s.status===404&&v===""?(h=204,p="No Content"):u={message:v}}if(u&&this.isMaybeSingle&&(!((l=u==null?void 0:u.details)===null||l===void 0)&&l.includes("0 rows"))&&(u=null,h=200,p="OK"),u&&this.shouldThrowOnError)throw new rz.default(u)}return{error:u,data:d,count:f,status:h,statusText:p}});return this.shouldThrowOnError||(i=i.catch(s=>{var o,a,l;return{error:{message:`${(o=s==null?void 0:s.name)!==null&&o!==void 0?o:"FetchError"}: ${s==null?void 0:s.message}`,details:`${(a=s==null?void 0:s.stack)!==null&&a!==void 0?a:""}`,hint:"",code:`${(l=s==null?void 0:s.code)!==null&&l!==void 0?l:""}`},data:null,count:null,status:0,statusText:""}})),i.then(t,n)}returns(){return this}overrideTypes(){return this}};ng.default=iz;var sz=Ir&&Ir.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(tg,"__esModule",{value:!0});const oz=sz(ng);let az=class extends oz.default{select(t){let n=!1;const r=(t??"*").split("").map(i=>/\s/.test(i)&&!n?"":(i==='"'&&(n=!n),i)).join("");return this.url.searchParams.set("select",r),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(t,{ascending:n=!0,nullsFirst:r,foreignTable:i,referencedTable:s=i}={}){const o=s?`${s}.order`:"order",a=this.url.searchParams.get(o);return this.url.searchParams.set(o,`${a?`${a},`:""}${t}.${n?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(t,{foreignTable:n,referencedTable:r=n}={}){const i=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(i,`${t}`),this}range(t,n,{foreignTable:r,referencedTable:i=r}={}){const s=typeof i>"u"?"offset":`${i}.offset`,o=typeof i>"u"?"limit":`${i}.limit`;return this.url.searchParams.set(s,`${t}`),this.url.searchParams.set(o,`${n-t+1}`),this}abortSignal(t){return this.signal=t,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return this.method==="GET"?this.headers.Accept="application/json":this.headers.Accept="application/vnd.pgrst.object+json",this.isMaybeSingle=!0,this}csv(){return this.headers.Accept="text/csv",this}geojson(){return this.headers.Accept="application/geo+json",this}
67explain({analyze:t=!1,verbose:n=!1,settings:r=!1,buffers:i=!1,wal:s=!1,format:o="text"}={}){var a;const l=[t?"analyze":null,n?"verbose":null,r?"settings":null,i?"buffers":null,s?"wal":null].filter(Boolean).join("|"),u=(a=this.headers.Accept)!==null&&a!==void 0?a:"application/json";return this.headers.Accept=`application/vnd.pgrst.plan+${o}; for="${u}"; options=${l};`,o==="json"?this:this}rollback(){var t;return((t=this.headers.Prefer)!==null&&t!==void 0?t:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}};tg.default=az;var lz=Ir&&Ir.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(df,"__esModule",{value:!0});const cz=lz(tg);let uz=class extends cz.default{eq(t,n){return this.url.searchParams.append(t,`eq.${n}`),this}neq(t,n){return this.url.searchParams.append(t,`neq.${n}`),this}gt(t,n){return this.url.searchParams.append(t,`gt.${n}`),this}gte(t,n){return this.url.searchParams.append(t,`gte.${n}`),this}lt(t,n){return this.url.searchParams.append(t,`lt.${n}`),this}lte(t,n){return this.url.searchParams.append(t,`lte.${n}`),this}like(t,n){return this.url.searchParams.append(t,`like.${n}`),this}likeAllOf(t,n){return this.url.searchParams.append(t,`like(all).{${n.join(",")}}`),this}likeAnyOf(t,n){return this.url.searchParams.append(t,`like(any).{${n.join(",")}}`),this}ilike(t,n){return this.url.searchParams.append(t,`ilike.${n}`),this}ilikeAllOf(t,n){return this.url.searchParams.append(t,`ilike(all).{${n.join(",")}}`),this}ilikeAnyOf(t,n){return this.url.searchParams.append(t,`ilike(any).{${n.join(",")}}`),this}is(t,n){return this.url.searchParams.append(t,`is.${n}`),this}in(t,n){const r=Array.from(new Set(n)).map(i=>typeof i=="string"&&new RegExp("[,()]").test(i)?`"${i}"`:`${i}`).join(",");return this.url.searchParams.append(t,`in.(${r})`),this}contains(t,n){return typeof n=="string"?this.url.searchParams.append(t,`cs.${n}`):Array.isArray(n)?this.url.searchParams.append(t,`cs.{${n.join(",")}}`):this.url.searchParams.append(t,`cs.${JSON.stringify(n)}`),this}containedBy(t,n){return typeof n=="string"?this.url.searchParams.append(t,`cd.${n}`):Array.isArray(n)?this.url.searchParams.append(t,`cd.{${n.join(",")}}`):this.url.searchParams.append(t,`cd.${JSON.stringify(n)}`),this}rangeGt(t,n){return this.url.searchParams.append(t,`sr.${n}`),this}rangeGte(t,n){return this.url.searchParams.append(t,`nxl.${n}`),this}rangeLt(t,n){return this.url.searchParams.append(t,`sl.${n}`),this}rangeLte(t,n){return this.url.searchParams.append(t,`nxr.${n}`),this}rangeAdjacent(t,n){return this.url.searchParams.append(t,`adj.${n}`),this}overlaps(t,n){return typeof n=="string"?this.url.searchParams.append(t,`ov.${n}`):this.url.searchParams.append(t,`ov.{${n.join(",")}}`),this}textSearch(t,n,{config:r,type:i}={}){let s="";i==="plain"?s="pl":i==="phrase"?s="ph":i==="websearch"&&(s="w");const o=r===void 0?"":`(${r})`;return this.url.searchParams.append(t,`${s}fts${o}.${n}`),this}match(t){return Object.entries(t).forEach(([n,r])=>{this.url.searchParams.append(n,`eq.${r}`)}),this}not(t,n,r){return this.url.searchParams.append(t,`not.${n}.${r}`),this}or(t,{foreignTable:n,referencedTable:r=n}={}){const i=r?`${r}.or`:"or";return this.url.searchParams.append(i,`(${t})`),this}filter(t,n,r){return this.url.searchParams.append(t,`${n}.${r}`),this}};df.default=uz;var dz=Ir&&Ir.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(eg,"__esModule",{value:!0});const nu=dz(df);let fz=class{constructor(t,{headers:n={},schema:r,fetch:i}){this.url=t,this.headers=n,this.schema=r,this.fetch=i}select(t,{head:n=!1,count:r}={}){const i=n?"HEAD":"GET";let s=!1;const o=(t??"*").split("").map(a=>/\s/.test(a)&&!s?"":(a==='"'&&(s=!s),a)).join("");return this.url.searchParams.set("select",o),r&&(this.headers.Prefer=`count=${r}`),new nu.default({method:i,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}insert(t,{count:n,defaultToNull:r=!0}={}){const i="POST",s=[];if(this.headers.Prefer&&s.push(this.headers.Prefer),n&&s.push(`count=${n}`),r||s.push("missing=default"),this.headers.Prefer=s.join(","),Array.isArray(t)){const o=t.reduce((a,l)=>a.concat(Object.keys(l)),[]);if(o.length>
670){const a=[...new Set(o)].map(l=>`"${l}"`);this.url.searchParams.set("columns",a.join(","))}}return new nu.default({method:i,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:this.fetch,allowEmpty:!1})}upsert(t,{onConflict:n,ignoreDuplicates:r=!1,count:i,defaultToNull:s=!0}={}){const o="POST",a=[`resolution=${r?"ignore":"merge"}-duplicates`];if(n!==void 0&&this.url.searchParams.set("on_conflict",n),this.headers.Prefer&&a.push(this.headers.Prefer),i&&a.push(`count=${i}`),s||a.push("missing=default"),this.headers.Prefer=a.join(","),Array.isArray(t)){const l=t.reduce((u,d)=>u.concat(Object.keys(d)),[]);if(l.length>0){const u=[...new Set(l)].map(d=>`"${d}"`);this.url.searchParams.set("columns",u.join(","))}}return new nu.default({method:o,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:this.fetch,allowEmpty:!1})}update(t,{count:n}={}){const r="PATCH",i=[];return this.headers.Prefer&&i.push(this.headers.Prefer),n&&i.push(`count=${n}`),this.headers.Prefer=i.join(","),new nu.default({method:r,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:this.fetch,allowEmpty:!1})}delete({count:t}={}){const n="DELETE",r=[];return t&&r.push(`count=${t}`),this.headers.Prefer&&r.unshift(this.headers.Prefer),this.headers.Prefer=r.join(","),new nu.default({method:n,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}};eg.default=fz;var ig={},sg={};Object.defineProperty(sg,"__esModule",{value:!0});sg.version=void 0;sg.version="0.0.0-automated";Object.defineProperty(ig,"__esModule",{value:!0});ig.DEFAULT_HEADERS=void 0;const hz=sg;ig.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${hz.version}`};var wR=Ir&&Ir.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(qb,"__esModule",{value:!0});const pz=wR(eg),mz=wR(df),gz=ig;let vz=class bR{constructor(t,{headers:n={},schema:r,fetch:i}={}){this.url=t,this.headers=Object.assign(Object.assign({},gz.DEFAULT_HEADERS),n),this.schemaName=r,this.fetch=i}from(t){const n=new URL(`${this.url}/${t}`);return new pz.default(n,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(t){return new bR(this.url,{headers:this.headers,schema:t,fetch:this.fetch})}rpc(t,n={},{head:r=!1,get:i=!1,count:s}={}){let o;const a=new URL(`${this.url}/rpc/${t}`);let l;r||i?(o=r?"HEAD":"GET",Object.entries(n).filter(([d,f])=>f!==void 0).map(([d,f])=>[d,Array.isArray(f)?`{${f.join(",")}}`:`${f}`]).forEach(([d,f])=>{a.searchParams.append(d,f)})):(o="POST",l=n);const u=Object.assign({},this.headers);return s&&(u.Prefer=`count=${s}`),new mz.default({method:o,url:a,headers:u,schema:this.schemaName,body:l,fetch:this.fetch,allowEmpty:!1})}};qb.default=vz;var Nc=Ir&&Ir.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(qn,"__esModule",{value:!0});qn.PostgrestError=qn.PostgrestBuilder=qn.PostgrestTransformBuilder=qn.PostgrestFilterBuilder=qn.PostgrestQueryBuilder=qn.PostgrestClient=void 0;const _R=Nc(qb);qn.PostgrestClient=_R.default;const SR=Nc(eg);qn.PostgrestQueryBuilder=SR.default;const ER=Nc(df);qn.PostgrestFilterBuilder=ER.default;const kR=Nc(tg);qn.PostgrestTransformBuilder=kR.default;const CR=Nc(ng);qn.PostgrestBuilder=CR.default;const TR=Nc(rg);qn.PostgrestError=TR.default;var yz=qn.default={PostgrestClient:_R.default,PostgrestQueryBuilder:SR.default,PostgrestFilterBuilder:ER.default,PostgrestTransformBuilder:kR.default,PostgrestBuilder:CR.default,PostgrestError:TR.default};const{PostgrestClient:xz,PostgrestQueryBuilder:Cpe,PostgrestFilterBuilder:Tpe,PostgrestTransformBuilder:jpe,PostgrestBuilder:Ppe,PostgrestError:Npe}=yz;function wz(){if(typeof WebSocket<"u")return WebSocket;if(typeof global.WebSocket<"u")return global.WebSocket;if(typeof window.WebSocket<"u")return window.WebSocket;if(typeof self.WebSocket<"u")return self.WebSocket;throw new Error("`WebSocket` is not supported in this environment")}const bz=wz(),_z="2.11.15",Sz=`realtime-js/${_z}`,Ez="1.0.0",jR=1e4,kz=1e3;var Mu;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(Mu||(Mu={}));var dn;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(dn||(dn={}));var Yr;(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"})(Yr||(Yr={}));var rx;(function(e){e.websocket="websocket"})(rx||(rx={}));var Zo;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(Zo||(Zo={}));class Cz{constructor(){this.HEADER_LENGTH=1}decode(t,n){return t.constructor===ArrayBuffer?n(this._binaryDecode(t)):n(typeof t=="string"?JSON.parse(t):{})}_binaryDecode(t){const n=new DataView(t),r=new TextDecoder;return this._decodeBroadcast(t,n,r)}_decodeBroadcast(t,n,r){const i=n.getUint8(1),s=n.getUint8(2);let o=this.HEADER_LENGTH+2;const a=r.decode(t.slice(o,o+i));o=o+i;const l=r.decode(t.slice(o,o+s));o=o+s;const u=JSON.parse(r.decode(t.slice(o,t.byteLength)));return{ref:null,topic:a,event:l,payload:u}}}class PR{constructor(t,n){this.callback=t,this.timerCalc=n,this.timer=void 0,this.tries=0,this.callback=t,this.timerCalc=n}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var rt;(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"})(rt||(rt={}));const YE=(e,t,n={})=>{var r;const i=(r=n.skipTypes)!==null&&r!==void 0?r:[];return Object.keys(t).reduce((s,o)=>(s[o]=Tz(o,e,t,i),s),{})},Tz=(e,t,n,r)=>{const i=t.find(a=>a.name===e),s=i==null?void 0:i.type,o=n[e];
vendor: 14,323 bytes, lines 67-72
67return s&&!r.includes(s)?NR(s,o):ix(o)},NR=(e,t)=>{if(e.charAt(0)==="_"){const n=e.slice(1,e.length);return Rz(t,n)}switch(e){case rt.bool:return jz(t);case rt.float4:case rt.float8:case rt.int2:case rt.int4:case rt.int8:case rt.numeric:case rt.oid:return Pz(t);case rt.json:case rt.jsonb:return Nz(t);case rt.timestamp:return Iz(t);case rt.abstime:case rt.date:case rt.daterange:case rt.int4range:case rt.int8range:case rt.money:case rt.reltime:case rt.text:case rt.time:case rt.timestamptz:case rt.timetz:case rt.tsrange:case rt.tstzrange:return ix(t);default:return ix(t)}},ix=e=>e,jz=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},Pz=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},Nz=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch(t){return console.log(`JSON parse error: ${t}`),e}return e},Rz=(e,t)=>{if(typeof e!="string")return e;const n=e.length-1,r=e[n];if(e[0]==="{"&&r==="}"){let s;const o=e.slice(1,n);try{s=JSON.parse("["+o+"]")}catch{s=o?o.split(","):[]}return s.map(a=>NR(t,a))}return e},Iz=e=>typeof e=="string"?e.replace(" ","T"):e,RR=e=>{let t=e;return t=t.replace(/^ws/i,"http"),t=t.replace(/(\/socket\/websocket|\/socket|\/websocket)\/?$/i,""),t.replace(/\/+$/,"")};class Iv{constructor(t,n,r={},i=jR){this.channel=t,this.event=n,this.payload=r,this.timeout=i,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(t){this.timeout=t,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(t){this.payload=Object.assign(Object.assign({},this.payload),t)}receive(t,n){var r;return this._hasReceived(t)&&n((r=this.receivedResp)===null||r===void 0?void 0:r.response),this.recHooks.push({status:t,callback:n}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const t=n=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=n,this._matchReceive(n)};this.channel._on(this.refEvent,{},t),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(t,n){this.refEvent&&this.channel._trigger(this.refEvent,{status:t,response:n})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:t,response:n}){this.recHooks.filter(r=>r.status===t).forEach(r=>r.callback(n))}_hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}}var QE;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(QE||(QE={}));class Lu{constructor(t,n){this.channel=t,this.state={},this.pendingDiffs=[],this.joinRef=null,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const r=(n==null?void 0:n.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(r.state,{},i=>{const{onJoin:s,onLeave:o,onSync:a}=this.caller;this.joinRef=this.channel._joinRef(),this.state=Lu.syncState(this.state,i,s,o),this.pendingDiffs.forEach(l=>{this.state=Lu.syncDiff(this.state,l,s,o)}),this.pendingDiffs=[],a()}),this.channel._on(r.diff,{},i=>{const{onJoin:s,onLeave:o,onSync:a}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(i):(this.state=Lu.syncDiff(this.state,i,s,o),a())}),this.onJoin((i,s,o)=>{this.channel._trigger("presence",{event:"join",key:i,currentPresences:s,newPresences:o})}),this.onLeave((i,s,o)=>{this.channel._trigger("presence",{event:"leave",key:i,currentPresences:s,leftPresences:o})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(t,n,r,i){const s=this.cloneDeep(t),o=this.transformState(n),a={},l={};return this.map(s,(u,d)=>{o[u]||(l[u]=d)}),this.map(o,(u,d)=>{const f=s[u];if(f){const h=d.map(w=>w.presence_ref),p=f.map(w=>w.presence_ref),g=d.filter(w=>p.indexOf(w.presence_ref)<0),v=f.filter(w=>h.indexOf(w.presence_ref)<0);g.length>0&&(a[u]=g),v.length>0&&(l[u]=v)}else a[u]=d}),this.syncDiff(s,{joins:a,leaves:l},r,i)}static syncDiff(t,n,r,i){const{joins:s,leaves:o}={joins:this.transformState(n.joins),leaves:this.transformState(n.leaves)};return r||(r=()=>{}),i||(i=()=>{}),this.map(s,(a,l)=>{var u;const d=(u=t[a])!==null&&u!==void 0?u:[];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 u=t[a];if(!u)return;const d=l.map(f=>f.presence_ref);u=u.filter(f=>d.indexOf(f.presence_ref)<0),t[a]=u,i(a,u,l),u.length===0&&delete t[a]}),t}static map(t,n){return Object.getOwnPropertyNames(t).map(r=>n(r,t[r]))}static transformState(t){return t=this.cloneDeep(t),Object.getOwnPropertyNames(t).reduce((n,r)=>{const i=t[r];return"metas"in i?n[r]=i.metas.map(s=>(s.presence_ref=s.phx_ref,delete s.phx_ref,delete s.phx_ref_prev,s)):n[r]=i,n},{})}static cloneDeep(t){return JSON.parse(JSON.stringify(t))}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var XE;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(XE||(XE={}));var ZE;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(ZE||(ZE={}));var es;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(es||(es={}));class Hb{constructor(t,n={config:{}},r){this.topic=t,this.params=n,this.socket=r,this.bindings={},this.state=dn.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:""},private:!1},n.config),this.timeout=this.socket.timeout,this.joinPush=new Iv(this,Yr.join,this.params,this.timeout),this.rejoinTimer=new PR(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=dn.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(i=>i.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=dn.closed,this.socket._remove(this)}),this._onError(i=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,i),this.state=dn.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=dn.errored,this.rejoinTimer.scheduleTimeout())}),this._on(Yr.reply,{},(i,s)=>{this._trigger(this._replyEventName(s),i)}),this.presence=new Lu(this),this.broadcastEndpointURL=RR(this.socket.endPoint)+"/api/broadcast",this.private=this.params.config.private||!1}subscribe(t,n=this.timeout){var r,i;if(this.socket.isConnected()||this.socket.connect(),this.state==dn.closed){const{config:{broadcast:s,presence:o,private:a}}=this.params;this._onError(d=>t==null?void 0:t(es.CHANNEL_ERROR,d)),this._onClose(()=>t==null?void 0:t(es.CLOSED));const l={},u={broadcast:s,presence:o,postgres_changes:(i=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(d=>d.filter))!==null&&i!==void 0?i:[],private:a};this.socket.accessTokenValue&&(l.access_token=this.socket.accessTokenValue),this.updateJoinPayload(Object.assign({config:u},l)),this.joinedOnce=!0,this._rejoin(n),this.joinPush.receive("ok",async({postgres_changes:d})=>{var f;if(this.socket.setAuth(),d===void 0){t==null||t(es.SUBSCRIBED);return}else{const h=this.bindings.postgres_changes,p=(f=h==null?void 0:h.length)!==null&&f!==void 0?f:0,g=[];for(let v=0;v<p;v++){const w=h[v],{filter:{event:y,schema:x,table:b,filter:_}}=w,S=d&&d[v];if(S&&S.event===y&&S.schema===x&&S.table===b&&S.filter===_)g.push(Object.assign(Object.assign({},w),{id:S.id}));else{this.unsubscribe(),this.state=dn.errored,t==null||t(es.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=g,t&&t(es.SUBSCRIBED);return}}).receive("error",d=>{this.state=dn.errored,t==null||t(es.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(d).join(", ")||"error")))}).receive("timeout",()=>{t==null||t(es.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(t,n={}){return await this.send({type:"presence",event:"track",payload:t},n.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,n,r){return this._on(t,n,r)}async send(t,n={}){var r,i;if(!this._canPush()&&t.type==="broadcast"){const{event:s,payload:o}=t,l={method:"POST",headers:{Authorization:this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"",apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:s,payload:o,private:this.private}]})};try{const u=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(r=n.timeout)!==null&&r!==void 0?r:this.timeout);return await((i=u.body)===null||i===void 0?void 0:i.cancel()),u.ok?"ok":"error"}catch(u){return u.name==="AbortError"?"timed out":"error"}}else return new Promise(s=>{var o,a,l;const u=this._push(t.type,t,n.timeout||this.timeout);t.type==="broadcast"&&!(!((l=(a=(o=this.params)===null||o===void 0?void 0:o.config)===null||a===void 0?void 0:a.broadcast)===null||l===void 0)&&l.ack)&&s("ok"),u.receive("ok",()=>s("ok")),u.receive("error",()=>s("error")),u.receive("timeout",()=>s("timed out"))})}updateJoinPayload(t){this.joinPush.updatePayload(t)}unsubscribe(t=this.timeout){this.state=dn.leaving;const n=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(Yr.close,"leave",this._joinRef())};this.joinPush.destroy();let r=null;return new Promise(i=>{r=new Iv(this,Yr.leave,{},t),r.receive("ok",()=>{n(),i("ok")}).receive("timeout",()=>{n(),i("timed out")}).receive("error",()=>{i("error")}),r.send(),this._canPush()||r.trigger("ok",{})}).finally(()=>{r==null||r.destroy()})}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.rejoinTimer&&clearTimeout(this.rejoinTimer.timer),this.joinPush.destroy()}async _fetchWithTimeout(t,n,r){const i=new AbortController,s=setTimeout(()=>i.abort(),r),o=await this.socket.fetch(t,Object.assign(Object.assign({},n),{signal:i.signal}));return clearTimeout(s),o}_push(t,n,r=this.timeout){if(!this.joinedOnce)throw`tried to push '${t}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let i=new Iv(this,t,n,r);return this._canPush()?i.send():(i.startTimeout(),this.pushBuffer.push(i)),i}_onMessage(t,n,r){return n}_isMember(t){return this.topic===t}_joinRef(){return this.joinPush.ref}_trigger(t,n,r){var i,s;const o=t.toLocaleLowerCase(),{close:a,error:l,leave:u,join:d}=Yr;if(r&&[a,l,u,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)?(i=this.bindings.postgres_changes)===null||i===void 0||i.filter(p=>{var g,v,w;return((g=p.filter)===null||g===void 0?void 0:g.event)==="*"||((w=(v=p.filter)===null||v===void 0?void 0:v.event)===null||w===void 0?void 0:w.toLocaleLowerCase())===o}).map(p=>p.callback(h,r)):(s=this.bindings[o])===null||s===void 0||s.filter(p=>{var g,v,w,y,x,b;if(["broadcast","presence","postgres_changes"].includes(o))if("id"in p){const _=p.id,S=(g=p.filter)===null||g===void 0?void 0:g.event;return _&&((v=n.ids)===null||v===void 0?void 0:v.includes(_))&&(S==="*"||(S==null?void 0:S.toLocaleLowerCase())===((w=n.data)===null||w===void 0?void 0:w.type.toLocaleLowerCase()))}else{const _=(x=(y=p==null?void 0:p.filter)===null||y===void 0?void 0:y.event)===null||x===void 0?void 0:x.toLocaleLowerCase();return _==="*"||_===((b=n==null?void 0:n.event)===null||b===void 0?void 0:b.toLocaleLowerCase())}else return p.type.toLocaleLowerCase()===o}).map(p=>{if(typeof h=="object"&&"ids"in h){const g=h.data,{schema:v,table:w,commit_timestamp:y,type:x,errors:b}=g;h=Object.assign(Object.assign({},{schema:v,table:w,commit_timestamp:y,eventType:x,new:{},old:{},errors:b}),this._getPayloadRecords(g))}p.callback(h,r)})}_isClosed(){return this.state===dn.closed}_isJoined(){return this.state===dn.joined}_isJoining(){return this.state===dn.joining}_isLeaving(){return this.state===dn.leaving}_replyEventName(t){return`chan_reply_${t}`}_on(t,n,r){const i=t.toLocaleLowerCase(),s={type:i,filter:n,callback:r};return this.bindings[i]?this.bindings[i].push(s):this.bindings[i]=[s],this}_off(t,n){const r=t.toLocaleLowerCase();return this.bindings[r]=this.bindings[r].filter(i=>{var s;return!(((s=i.type)===null||s===void 0?void 0:s.toLocaleLowerCase())===r&&Hb.isEqual(i.filter,n))}),this}static isEqual(t,n){if(Object.keys(t).length!==Object.keys(n).length)return!1;for(const r in t)if(t[r]!==n[r])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(t){this._on(Yr.close,{},t)}_onError(t){this._on(Yr.error,{},n=>t(n))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(t=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=dn.joining,this.joinPush.resend(t))}_getPayloadRecords(t){const n={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(n.new=YE(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(n.old=YE(t.columns,t.old_record)),n}}const JE=()=>{},Az=`
68  addEventListener("message", (e) => {
69    if (e.data.event === "start") {
70      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
71    }
72  });`;class Oz{constructor(t,n){var r;this.accessTokenValue=null,this.apiKey=null,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=jR,this.heartbeatIntervalMs=25e3,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=JE,this.ref=0,this.logger=JE,this.conn=null,this.sendBuffer=[],this.serializer
72=new Cz,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._resolveFetch=s=>{let o;return s?o=s:typeof fetch>"u"?o=(...a)=>ho(async()=>{const{default:l}=await Promise.resolve().then(()=>Pc);return{default:l}},void 0).then(({default:l})=>l(...a)):o=fetch,(...a)=>o(...a)},this.endPoint=`${t}/${rx.websocket}`,this.httpEndpoint=RR(t),n!=null&&n.transport?this.transport=n.transport:this.transport=null,n!=null&&n.params&&(this.params=n.params),n!=null&&n.timeout&&(this.timeout=n.timeout),n!=null&&n.logger&&(this.logger=n.logger),(n!=null&&n.logLevel||n!=null&&n.log_level)&&(this.logLevel=n.logLevel||n.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),n!=null&&n.heartbeatIntervalMs&&(this.heartbeatIntervalMs=n.heartbeatIntervalMs);const i=(r=n==null?void 0:n.params)===null||r===void 0?void 0:r.apikey;if(i&&(this.accessTokenValue=i,this.apiKey=i),this.reconnectAfterMs=n!=null&&n.reconnectAfterMs?n.reconnectAfterMs:s=>[1e3,2e3,5e3,1e4][s-1]||1e4,this.encode=n!=null&&n.encode?n.encode:(s,o)=>o(JSON.stringify(s)),this.decode=n!=null&&n.decode?n.decode:this.serializer.decode.bind(this.serializer),this.reconnectTimer=new PR(async()=>{this.disconnect(),this.connect()},this.reconnectAfterMs),this.fetch=this._resolveFetch(n==null?void 0:n.fetch),n!=null&&n.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.worker=(n==null?void 0:n.worker)||!1,this.workerUrl=n==null?void 0:n.workerUrl}this.accessToken=(n==null?void 0:n.accessToken)||null}connect(){if(!this.conn){if(this.transport||(this.transport=bz),!this.transport)throw new Error("No transport provided");this.conn=new this.transport(this.endpointURL()),this.setupConnection()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:Ez}))}disconnect(t,n){this.conn&&(this.conn.onclose=function(){},t?this.conn.close(t,n??""):this.conn.close(),this.conn=null,this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.reset(),this.channels.forEach(r=>r.teardown()))}getChannels(){return this.channels}async removeChannel(t){const n=await t.unsubscribe();return this.channels.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 Mu.connecting:return Zo.Connecting;case Mu.open:return Zo.Open;case Mu.closing:return Zo.Closing;default:return Zo.Closed}}isConnected(){return this.connectionState()===Zo.Open}channel(t,n={config:{}}){const r=`realtime:${t}`,i=this.getChannels().find(s=>s.topic===r);if(i)return i;{const s=new Hb(`realtime:${t}`,n,this);return this.channels.push(s),s}}push(t){const{topic:n,event:r,payload:i,ref:s}=t,o=()=>{this.encode(t,a=>{var l;(l=this.conn)===null||l===void 0||l.send(a)})};this.log("push",`${n} ${r} (${s})`,i),this.isConnected()?o():this.sendBuffer.push(o)}async setAuth(t=null){let n=t||this.accessToken&&await this.accessToken()||this.accessTokenValue;this.accessTokenValue!=n&&(this.accessTokenValue=n,this.channels.forEach(r=>{const i={access_token:n,version:Sz};n&&r.updateJoinPayload(i),r.joinedOnce&&r._isJoined()&&r._push(Yr.access_token,{access_token:n})}))}async sendHeartbeat(){var t;if(!this.isConnected()){this.heartbeatCallback("disconnected");return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection"),this.heartbeatCallback("timeout"),(t=this.conn)===null||t===void 0||t.close(kz,"hearbeat timeout");return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.heartbeatCallback("sent"),await this.setAuth()}onHeartbeat(t){this.heartbeatCallback=t}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}_makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}_leaveOpenTopic(t){let n=this.channels.find(r=>r.topic===t&&(r._isJoined()||r._isJoining()));n&&(this.log("transport",`leaving duplicate topic "${t}"`),n.unsubscribe())}_remove(t){this.channels=this.channels.filter(n=>n.topic!==t.topic)}setupConnection(){this.conn&&(this.conn.binaryType="arraybuffer",this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=t=>this._onConnError(t),this.conn.onmessage=t=>
72this._onConnMessage(t),this.conn.onclose=t=>this._onConnClose(t))}_onConnMessage(t){this.decode(t.data,n=>{let{topic:r,event:i,payload:s,ref:o}=n;r==="phoenix"&&i==="phx_reply"&&this.heartbeatCallback(n.payload.status=="ok"?"ok":"error"),o&&o===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null),this.log("receive",`${s.status||""} ${r} ${i} ${o&&"("+o+")"||""}`,s),Array.from(this.channels).filter(a=>a._isMember(r)).forEach(a=>a._trigger(i,s,o)),this.stateChangeCallbacks.message.forEach(a=>a(n))})}_onConnOpen(){this.log("transport",`connected to ${this.endpointURL()}`),this.flushSendBuffer(),this.reconnectTimer.reset(),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this.stateChangeCallbacks.open.forEach(t=>t())}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=n=>{this.log("worker","worker error",n.message),this.workerRef.terminate()},this.workerRef.onmessage=n=>{n.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_onConnClose(t){this.log("transport","close",t),this._triggerChanError(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(n=>n(t))}_onConnError(t){this.log("transport",`${t}`),this._triggerChanError(),this.stateChangeCallbacks.error.forEach(n=>n(t))}_triggerChanError(){this.channels.forEach(t=>t._trigger(Yr.error))}_appendParams(t,n){if(Object.keys(n).length===0)return t;const r=t.match(/\?/)?"&":"?",i=new URLSearchParams(n);return`${t}${r}${i}`}_workerObjectUrl(t){let n;if(t)n=t;else{const r=new Blob([Az],{type:"application/javascript"});n=URL.createObjectURL(r)}return n}}class Gb extends Error{constructor(t){super(t),this.__isStorageError=!0,this.name="StorageError"}}function Ht(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}class Dz extends Gb{constructor(t,n){super(t),this.name="StorageApiError",this.status=n}toJSON(){return{name:this.name,message:this.message,status:this.status}}}class sx extends Gb{constructor(t,n){super(t),this.name="StorageUnknownError",this.originalError=n}}var Mz=function(e,t,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(d){try{u(r.next(d))}catch(f){o(f)}}function l(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?s(d.value):i(d.value).then(a,l)}u((r=r.apply(e,t||[])).next())})};const IR=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...n)=>ho(async()=>{const{default:r}=await Promise.resolve().then(()=>Pc);return{default:r}},void 0).then(({default:r})=>r(...n)):t=fetch,(...n)=>t(...n)},Lz=()=>Mz(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield ho(()=>Promise.resolve().then(()=>Pc),void 0)).Response:Response}),ox=e=>{if(Array.isArray(e))return e.map(n=>ox(n));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([n,r])=>{const i=n.replace(/([-_][a-z])/gi,s=>s.toUpperCase().replace(/[-_]/g,""));t[i]=ox(r)}),t};var $a=function(e,t,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(d){try{u(r.next(d))}catch(f){o(f)}}function l(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?s(d.value):i(d.value).then(a,l)}u((r=r.apply(e,t||[])).next())})};const Av=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),Fz=(e,t,n)=>$a(void 0,void 0,void 0,function*(){const r=yield Lz();e instanceof r&&!(n!=null&&n.noResolveJson)?e.json().then(i=>{t(new Dz(Av(i),e.status||500))}).catch(i=>{t(new sx(Av(i),i))}):t(new sx(Av(e),e))}),$z=(e,t,n,r)=>{const i={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?i:(i.headers=Object.assign({"Content-Type":"application/json"},t==null?void 0:t.headers),r&&(i.body=JSON.stringify(r)),Object.assign(Object.assign({},i),n))};function ff(e,t,n,r,i,s){return $a(this,void 0,void 0,function*(){return new Promise((o,a)=>{e(n,$z(t,r,i,s)).then(l=>{if(!l.ok)throw l;return r!=null&&r.noResolveJson?l:l.json()}).then(l=>o(l)).catch(l=>Fz(l,a,r))})})}function Lp(e,t,n,r){return $a(this,void 0,void 0,function*(){return ff(e,"GET",t,n,r)})}function Ms(e,t,n,r,i){return $a(this,void 0,void 0,function*(){return ff(e,"POST",t,r,i,n)})}function Uz(e,t,n,r,i){return $a(this,void 0,void 0,function*(){return ff(e,"PUT",t,r,i,n)})}function Vz(e,t,n,r){return $a(this,void 0,void 0,function*(){return ff(e,"HEAD",t,Object.assign(Object.assign({},n),{noResolveJson:!0}),r)})}function AR(e,t,n,r,i){return $a(this,void 0,void 0,function*(){return ff(e,"DELETE",t,r,i,n)})}var $n=function(e,t,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}
72return new(n||(n=Promise))(function(s,o){function a(d){try{u(r.next(d))}catch(f){o(f)}}function l(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?s(d.value):i(d.value).then(a,l)}u((r=r.apply(e,t||[])).next())})};const zz={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},ek={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class Bz{constructor(t,n={},r,i){this.url=t,this.headers=n,this.bucketId=r,this.fetch=IR(i)}uploadOrUpdate(t,n,r,i){return $n(this,void 0,void 0,function*(){try{let s;const o=Object.assign(Object.assign({},ek),i);let a=Object.assign(Object.assign({},this.headers),t==="POST"&&{"x-upsert":String(o.upsert)});const l=o.metadata;typeof Blob<"u"&&r instanceof Blob?(s=new FormData,s.append("cacheControl",o.cacheControl),l&&s.append("metadata",this.encodeMetadata(l)),s.append("",r)):typeof FormData<"u"&&r instanceof FormData?(s=r,s.append("cacheControl",o.cacheControl),l&&s.append("metadata",this.encodeMetadata(l))):(s=r,a["cache-control"]=`max-age=${o.cacheControl}`,a["content-type"]=o.contentType,l&&(a["x-metadata"]=this.toBase64(this.encodeMetadata(l)))),i!=null&&i.headers&&(a=Object.assign(Object.assign({},a),i.headers));const u=this._removeEmptyFolders(n),d=this._getFinalPath(u),f=yield this.fetch(`${this.url}/object/${d}`,Object.assign({method:t,body:s,headers:a},o!=null&&o.duplex?{duplex:o.duplex}:{})),h=yield f.json();return f.ok?{data:{path:u,id:h.Id,fullPath:h.Key},error:null}:{data:null,error:h}}catch(s){if(Ht(s))return{data:null,error:s};throw s}})}upload(t,n,r){return $n(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",t,n,r)})}uploadToSignedUrl(t,n,r,i){return $n(this,void 0,void 0,function*(){const s=this._removeEmptyFolders(t),o=this._getFinalPath(s),a=new URL(this.url+`/object/upload/sign/${o}`);a.searchParams.set("token",n);try{let l;const u=Object.assign({upsert:ek.upsert},i),d=Object.assign(Object.assign({},this.headers),{"x-upsert":String(u.upsert)});typeof Blob<"u"&&r instanceof Blob?(l=new FormData,l.append("cacheControl",u.cacheControl),l.append("",r)):typeof FormData<"u"&&r instanceof FormData?(l=r,l.append("cacheControl",u.cacheControl)):(l=r,d["cache-control"]=`max-age=${u.cacheControl}`,d["content-type"]=u.contentType);const f=yield this.fetch(a.toString(),{method:"PUT",body:l,headers:d}),h=yield f.json();return f.ok?{data:{path:s,fullPath:h.Key},error:null}:{data:null,error:h}}catch(l){if(Ht(l))return{data:null,error:l};throw l}})}createSignedUploadUrl(t,n){return $n(this,void 0,void 0,function*(){try{let r=this._getFinalPath(t);const i=Object.assign({},this.headers);n!=null&&n.upsert&&(i["x-upsert"]="true");const s=yield Ms(this.fetch,`${this.url}/object/upload/sign/${r}`,{},{headers:i}),o=new URL(this.url+s.url),a=o.searchParams.get("token");if(!a)throw new Gb("No token returned by API");return{data:{signedUrl:o.toString(),path:t,token:a},error:null}}catch(r){if(Ht(r))return{data:null,error:r};throw r}})}update(t,n,r){return $n(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",t,n,r)})}move(t,n,r){return $n(this,void 0,void 0,function*(){try{return{data:yield Ms(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:t,destinationKey:n,destinationBucket:r==null?void 0:r.destinationBucket},{headers:this.headers}),error:null}}catch(i){if(Ht(i))return{data:null,error:i};throw i}})}copy(t,n,r){return $n(this,void 0,void 0,function*(){try{return{data:{path:(yield Ms(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:t,destinationKey:n,destinationBucket:r==null?void 0:r.destinationBucket},{headers:this.headers})).Key},error:null}}catch(i){if(Ht(i))return{data:null,error:i};throw i}})}createSignedUrl(t,n,r){return $n(this,void 0,void 0,function*(){try{let i=this._getFinalPath(t),s=yield Ms(this.fetch,`${this.url}/object/sign/${i}`,Object.assign({expiresIn:n},r!=null&&r.transform?{transform:r.transform}:{}),{headers:this.headers});const o=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return s={signedUrl:encodeURI(`${this.url}${s.signedURL}${o}`)},{data:s,error:null}}catch(i){if(Ht(i))return{data:null,error:i};throw i}})}createSignedUrls(t,n,r){return $n(this,void 0,void 0,function*(){try{const i=yield Ms(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:n,paths:t},{headers:this.headers}),s=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return{data:i.map(o=>Object.assign(Object.assign({},o),{signedUrl:o.signedURL?encodeURI(`${this.url}${o.signedURL}${s}`):null})),error:null}}catch(i){if(Ht(i))return{data:null,error:i};throw i}})}download(t,n){return $n(this,void 0,void 0,function*(){const i=typeof(n==null?void 0:n.transform)<"u"?"render/image/authenticated":"object",s=this.transformOptsToQueryString((n==null?void 0:n.transform)||{}),o=s?`?${s}`:"";try{const a=this._getFinalPath(t);return{data:yield(yield Lp(this.fetch,`${this.url}/${i}/${a}${o}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(a){if(Ht(a))return{data:null,error:a};throw a}})}info(t){return $n(this,void 0,void 0,function*(){const n=this._getFinalPath(t);try{const r=yield Lp(this.fetch,`${this.url}/object/info/${n}`,{headers:this.headers});return{data:ox(r),error:null}}catch(r){if(Ht(r))return{data:null,error:r};throw r}})}exists(t){return $n(this,void 0,void 0,function*(){const n=this._getFinalPath(t);try{return yield Vz(this.fetch,`${this.url}/object/${n}`,{headers:this.headers}),{data:!0,error:null}}catch(r){if(Ht(r)&&r instanceof sx){const i=r.originalError;if([400,404].includes(i==null?void 0:i.status))return{data:!1,error:r}}throw r}})}getPublicUrl(t,n){const r=this._getFinalPath(t),i=[],s=n!=null&&n.download?`download=${n.download===!0?"":n.download}`:"";s!==""&&i.push(s);const a=typeof(n==null?void 0:n.transform)<"u"?"render/image":"object",l=this.transformOptsToQueryString((n==null?void 0:n.transform)||{});l!==""&&i.push(l);let u=i.join("&");return u!==""&&(u=`?${u}`),{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${r}${u}`)}}}remove(t){return $n(this,void 0,void 0,function*(){try{return{data:yield AR(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:t},{headers:this.headers}),error:null}}catch(n){if(Ht(n))return{data:null,error:n};throw n}})}list(t,n,r){return $n(this,void 0,void 0,function*(){try{const i=Object.assign(Object.assign(Object.assign({},zz),n),{prefix:t||""});return{data:yield Ms(this.fetch,`${this.url}/object/list/${this.bucketId}`,i,{headers:this.headers},r),error:null}}catch(i){if(Ht(i))return{data:null,error:i};throw i}})}encodeMetadata(t){return JSON.stringify(t)}toBase64(t){return typeof Buffer<"u"?Buffer.from(t).toString("base64"):btoa(t)}_getFinalPath(t){return`${this.bucketId}/${t}`}_removeEmptyFolders(t){return t.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(t){const n=[];return t.width&&n.push(`width=${t.width}`),t.height&&n.push(`height=${t.height}`),t.resize&&n.push(`resize=${t.resize}`),t.format&&n.push(`format=${t.format}`),t.quality&&n.push(`quality=${t.quality}`),n.join("&")}}const Wz="2.7.1",qz={"X-Client-Info":`storage-js/${Wz}`};var Ga=function(e,t,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}
72return new(n||(n=Promise))(function(s,o){function a(d){try{u(r.next(d))}catch(f){o(f)}}function l(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?s(d.value):i(d.value).then(a,l)}u((r=r.apply(e,t||[])).next())})};class Hz{constructor(t,n={},r){this.url=t,this.headers=Object.assign(Object.assign({},qz),n),this.fetch=IR(r)}listBuckets(){return Ga(this,void 0,void 0,function*(){try{return{data:yield Lp(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(t){if(Ht(t))return{data:null,error:t};throw t}})}getBucket(t){return Ga(this,void 0,void 0,function*(){try{return{data:yield Lp(this.fetch,`${this.url}/bucket/${t}`,{headers:this.headers}),error:null}}catch(n){if(Ht(n))return{data:null,error:n};throw n}})}createBucket(t,n={public:!1}){return Ga(this,void 0,void 0,function*(){try{return{data:yield Ms(this.fetch,`${this.url}/bucket`,{id:t,name:t,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:this.headers}),error:null}}catch(r){if(Ht(r))return{data:null,error:r};throw r}})}updateBucket(t,n){return Ga(this,void 0,void 0,function*(){try{return{data:yield Uz(this.fetch,`${this.url}/bucket/${t}`,{id:t,name:t,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:this.headers}),error:null}}catch(r){if(Ht(r))return{data:null,error:r};throw r}})}emptyBucket(t){return Ga(this,void 0,void 0,function*(){try{return{data:yield Ms(this.fetch,`${this.url}/bucket/${t}/empty`,{},{headers:this.headers}),error:null}}catch(n){if(Ht(n))return{data:null,error:n};throw n}})}deleteBucket(t){return Ga(this,void 0,void 0,function*(){try{return{data:yield AR(this.fetch,`${this.url}/bucket/${t}`,{},{headers:this.headers}),error:null}}catch(n){if(Ht(n))return{data:null,error:n};throw n}})}}class Gz extends Hz{constructor(t,n={},r){super(t,n,r)}from(t){return new Bz(this.url,this.headers,t,this.fetch)}}const Kz="2.50.3";let _u="";typeof Deno<"u"?_u="deno":typeof document<"u"?_u="web":typeof navigator<"u"&&navigator.product==="ReactNative"?_u="react-native":_u="node";const Yz={"X-Client-Info":`supabase-js-${_u}/${Kz}`},Qz={headers:Yz},Xz={schema:"public"},Zz={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},Jz={};var eB=function(e,t,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(d){try{u(r.next(d))}catch(f){o(f)}}function l(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?s(d.value):i(d.value).then(a,l)}u((r=r.apply(e,t||[])).next())})};const tB=e=>{let t;return e?t=e:typeof fetch>"u"?t=vR:t=fetch,(...n)=>t(...n)},nB=()=>typeof Headers>"u"?yR:Headers,rB=(e,t,n)=>{const r=tB(n),i=nB();return(s,o)=>eB(void 0,void 0,void 0,function*(){var a;const l=(a=yield t())!==null&&a!==void 0?a:e;let u=new i(o==null?void 0:o.headers);return u.has("apikey")||u.set("apikey",e),u.has("Authorization")||u.set("Authorization",`Bearer ${l}`),r(s,Object.assign(Object.assign({},o),{headers:u}))})};var iB=function(e,t,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(d){try{u(r.next(d))}catch(f){o(f)}}function l(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?s(d.value):i(d.value).then(a,l)}u((r=r.apply(e,t||[])).next())})};function sB(e){return e.endsWith("/")?e:e+"/"}function oB(e,t){var n,r;const{db:i,auth:s,realtime:o,global:a}=e,{db:l,auth:u,realtime:d,global:f}=t,h={db:Object.assign(Object.assign({},l),i),auth:Object.assign(Object.assign({},u),s),realtime:Object.assign(Object.assign({},d),o),global:Object.assign(Object.assign(Object.assign({},f),a),{headers:Object.assign(Object.assign({},(n=f==null?void 0:f.headers)!==null&&n!==void 0?n:{}),(r=a==null?void 0:a.headers)!==null&&r!==void 0?r:{})}),accessToken:()=>iB(this,void 0,void 0,function*(){return""})};return e.accessToken?h.accessToken=e.accessToken:delete h.accessToken,h}const OR="2.70.0",ol=30*1e3,ax=3,Ov=ax*ol,aB="http://localhost:9999",lB="supabase.auth.token",cB={"X-Client-Info":`gotrue-js/${OR}`},lx="X-Supabase-Api-Version",DR={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},uB=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,dB=6e5;
72class Kb extends Error{constructor(t,n,r){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=r}}function Ne(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class fB extends Kb{constructor(t,n,r){super(t,n,r),this.name="AuthApiError",this.status=n,this.code=r}}function hB(e){return Ne(e)&&e.name==="AuthApiError"}class MR extends Kb{constructor(t,n){super(t),this.name="AuthUnknownError",this.originalError=n}}class Mo extends Kb{constructor(t,n,r,i){super(t,r,i),this.name=n,this.status=r}}class Ns extends Mo{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function pB(e){return Ne(e)&&e.name==="AuthSessionMissingError"}class Xf extends Mo{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class Zf extends Mo{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class Jf extends Mo{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 mB(e){return Ne(e)&&e.name==="AuthImplicitGrantRedirectError"}class tk extends Mo{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 cx extends Mo{constructor(t,n){super(t,"AuthRetryableFetchError",n,void 0)}}function Dv(e){return Ne(e)&&e.name==="AuthRetryableFetchError"}class nk extends Mo{constructor(t,n,r){super(t,"AuthWeakPasswordError",n,"weak_password"),this.reasons=r}}class Fu extends Mo{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const Fp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),rk=` 	
73\r=`.split(""),gB=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<rk.length;t+=1)e[rk[t].charCodeAt(0)]=-2;for(let t=0;t<Fp.length;t+=1)e[Fp[t].charCodeAt(0)]=t;return e})();function ik(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(Fp[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(Fp[r]),t.queuedBits-=6}}function LR(e,t,n){const r=gB[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 sk(e){const t=[],n=o=>{t.push(String.fromCodePoint(o))},r={utf8seq:0,codepoint:0},i={queue:0,queuedBits:0},s=o=>{xB(o,r,n)};for(let o=0;o<e.length;o+=1)LR(e.charCodeAt(o),i,s);return t.join("")}function vB(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 yB(e,t){for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(r>55295&&r<=56319){const i=(r-55296)*1024&65535;r=(e.charCodeAt(n+1)-56320&65535|i)+65536,n+=1}vB(r,t)}}function xB(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 wB(e){const t=[],n={queue:0,queuedBits:0},r=i=>{t.push(i)};for(let i=0;i<e.length;i+=1)LR(e.charCodeAt(i),n,r);return new Uint8Array(t)}function bB(e){const t=[];return yB(e,n=>t.push(n)),new Uint8Array(t)}function _B(e){const t=[],n={queue:0,queuedBits:0},r=i=>{t.push(i)};return e.forEach(i=>ik(i,n,r)),ik(null,n,r),t.join("")}function SB(e){return Math.round(Date.now()/1e3)+e}function EB(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}const Br=()=>typeof window<"u"&&typeof document<"u",Wo={tested:!1,writable:!1},$u=()=>{if(!Br())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Wo.tested)return Wo.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),Wo.tested=!0,Wo.writable=!0}catch{Wo.tested=!0,Wo.writable=!1}return Wo.writable};function kB(e){const t={},n=new URL(e);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEac
73h((i,s)=>{t[s]=i})}catch{}return n.searchParams.forEach((r,i)=>{t[i]=r}),t}const FR=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...n)=>ho(async()=>{const{default:r}=await Promise.resolve().then(()=>Pc);return{default:r}},void 0).then(({default:r})=>r(...n)):t=fetch,(...n)=>t(...n)},CB=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",$R=async(e,t,n)=>{await e.setItem(t,JSON.stringify(n))},eh=async(e,t)=>{const n=await e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch{return n}},th=async(e,t)=>{await e.removeItem(t)};class og{constructor(){this.promise=new og.promiseConstructor((t,n)=>{this.resolve=t,this.reject=n})}}og.promiseConstructor=Promise;function Mv(e){const t=e.split(".");if(t.length!==3)throw new Fu("Invalid JWT structure");for(let r=0;r<t.length;r++)if(!uB.test(t[r]))throw new Fu("JWT not in base64url format");return{header:JSON.parse(sk(t[0])),payload:JSON.parse(sk(t[1])),signature:wB(t[2]),raw:{header:t[0],payload:t[1]}}}async function TB(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function jB(e,t){return new Promise((r,i)=>{(async()=>{for(let s=0;s<1/0;s++)try{const o=await e(s);if(!t(s,null,o)){r(o);return}}catch(o){if(!t(s,o)){i(o);return}}})()})}function PB(e){return("0"+e.toString(16)).substr(-2)}function NB(){const t=new Uint32Array(56);if(typeof crypto>"u"){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=n.length;let i="";for(let s=0;s<56;s++)i+=n.charAt(Math.floor(Math.random()*r));return i}return crypto.getRandomValues(t),Array.from(t,PB).join("")}async function RB(e){const n=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",n),i=new Uint8Array(r);return Array.from(i).map(s=>String.fromCharCode(s)).join("")}async function IB(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 RB(e);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Ka(e,t,n=!1){const r=NB();let i=r;n&&(i+="/PASSWORD_RECOVERY"),await $R(e,`${t}-code-verifier`,i);const s=await IB(r);return[s,r===s?"plain":"s256"]}const AB=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function OB(e){const t=e.headers.get(lx);if(!t||!t.match(AB))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function DB(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 MB(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 LB=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Ya(e){if(!LB.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}var FB=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};const Yo=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),$B=[502,503,504];async function ok(e){var t;if(!CB(e))throw new cx(Yo(e),0);if($B.includes(e.status))throw new cx(Yo(e),e.status);let n;try{n=await e.json()}catch(s){throw new MR(Yo(s),s)}let r;const i=OB(e);if(i&&i.getTime()>=DR["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 nk(Yo(n),e.status,((t=n.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(r==="session_not_found")throw new Ns}else if(typeof n=="object"&&n&&typeof n.weak_password=="object"&&n.weak_password&&Array.isArray(n.weak_password.reasons)&&n.weak_password.reasons.length&&n.weak_password.reasons.reduce((s,o)=>
73s&&typeof o=="string",!0))throw new nk(Yo(n),e.status,n.weak_password.reasons);throw new fB(Yo(n),e.status||500,r)}const UB=(e,t,n,r)=>{const i={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?i:(i.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),i.body=JSON.stringify(r),Object.assign(Object.assign({},i),n))};async function Ve(e,t,n,r){var i;const s=Object.assign({},r==null?void 0:r.headers);s[lx]||(s[lx]=DR["2024-01-01"].name),r!=null&&r.jwt&&(s.Authorization=`Bearer ${r.jwt}`);const o=(i=r==null?void 0:r.query)!==null&&i!==void 0?i:{};r!=null&&r.redirectTo&&(o.redirect_to=r.redirectTo);const a=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",l=await VB(e,t,n+a,{headers:s,noResolveJson:r==null?void 0:r.noResolveJson},{},r==null?void 0:r.body);return r!=null&&r.xform?r==null?void 0:r.xform(l):{data:Object.assign({},l),error:null}}async function VB(e,t,n,r,i,s){const o=UB(t,r,i,s);let a;try{a=await e(n,Object.assign({},o))}catch(l){throw console.error(l),new cx(Yo(l),0)}if(a.ok||await ok(a),r!=null&&r.noResolveJson)return a;try{return await a.json()}catch(l){await ok(l)}}function Xi(e){var t;let n=null;qB(e)&&(n=Object.assign({},e),e.expires_at||(n.expires_at=SB(e.expires_in)));const r=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:n,user:r},error:null}}function ak(e){const t=Xi(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 Us(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function zB(e){return{data:e,error:null}}function BB(e){const{action_link:t,email_otp:n,hashed_token:r,redirect_to:i,verification_type:s}=e,o=FB(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),a={action_link:t,email_otp:n,hashed_token:r,redirect_to:i,verification_type:s},l=Object.assign({},o);return{data:{properties:a,user:l},error:null}}function WB(e){return e}function qB(e){return e.access_token&&e.refresh_token&&e.expires_in}const Lv=["global","local","others"];var HB=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};class GB{constructor({url:t="",headers:n={},fetch:r}){this.url=t,this.headers=n,this.fetch=FR(r),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)}}async signOut(t,n=Lv[0]){if(Lv.indexOf(n)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Lv.join(", ")}`);try{return await Ve(this.fetch,"POST",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(r){if(Ne(r))return{data:null,error:r};throw r}}async inviteUserByEmail(t,n={}){try{return await Ve(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:Us})}catch(r){if(Ne(r))return{data:{user:null},error:r};throw r}}async generateLink(t){try{const{options:n}=t,r=HB(t,["options"]),i=Object.assign(Object.assign({},r),n);return"newEmail"in r&&(i.new_email=r==null?void 0:r.newEmail,delete i.newEmail),await Ve(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:i,headers:this.headers,xform:BB,redirectTo:n==null?void 0:n.redirectTo})}catch(n){if(Ne(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(t){try{return await Ve(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:Us})}catch(n){if(Ne(n))return{data:{user:null},error:n};throw n}}async listUsers(t){var n,r,i,s,o,a,l;try{const u={nextPage:null,lastPage:0,total:0},d=await Ve(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:(s=(i=t==null?void 0:t.perPage)===null||i===void 0?void 0:i.toString())!==null&&s!==void 0?s:""},xform:WB});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>
730&&(p.forEach(g=>{const v=parseInt(g.split(";")[0].split("=")[1].substring(0,1)),w=JSON.parse(g.split(";")[1].split("=")[1]);u[`${w}Page`]=v}),u.total=parseInt(h)),{data:Object.assign(Object.assign({},f),u),error:null}}catch(u){if(Ne(u))return{data:{users:[]},error:u};throw u}}async getUserById(t){Ya(t);try{return await Ve(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:Us})}catch(n){if(Ne(n))return{data:{user:null},error:n};throw n}}async updateUserById(t,n){Ya(t);try{return await Ve(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:n,headers:this.headers,xform:Us})}catch(r){if(Ne(r))return{data:{user:null},error:r};throw r}}async deleteUser(t,n=!1){Ya(t);try{return await Ve(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:n},xform:Us})}catch(r){if(Ne(r))return{data:{user:null},error:r};throw r}}async _listFactors(t){Ya(t.userId);try{const{data:n,error:r}=await Ve(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:i=>({data:{factors:i},error:null})});return{data:n,error:r}}catch(n){if(Ne(n))return{data:null,error:n};throw n}}async _deleteFactor(t){Ya(t.userId),Ya(t.id);try{return{data:await Ve(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(n){if(Ne(n))return{data:null,error:n};throw n}}}const KB={getItem:e=>$u()?globalThis.localStorage.getItem(e):null,setItem:(e,t)=>{$u()&&globalThis.localStorage.setItem(e,t)},removeItem:e=>{$u()&&globalThis.localStorage.removeItem(e)}};function lk(e={}){return{getItem:t=>e[t]||null,setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}}function YB(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}const Qa={debug:!!(globalThis&&$u()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class UR extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class QB extends UR{}async function XB(e,t,n){Qa.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const r=new globalThis.AbortController;return t>0&&setTimeout(()=>{r.abort(),Qa.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal},async i=>{if(i){Qa.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,i.name);try{return await n()}finally{Qa.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,i.name)}}else{if(t===0)throw Qa.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new QB(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(Qa.debug)try{const s=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(s,null,"  "))}catch(s){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",s)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await n()}}))}YB();const ZB={url:aB,storageKey:lB,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:cB,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1};async function ck(e,t,n){return await n()}class vd{constructor(t){var n,r;this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=vd.nextInstanceID,vd.nextInstanceID+=1,this.instanceID>0&&Br()&&console.warn("Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.");const i=Object.assign(Object.assign({},ZB),t);if(this.logDebugMessages=!!i.debug,typeof i.debug=="function"&&(this.logger=i.debug),this.persistSession=i.persistSession,this.storageKey=i.storageKey,this.autoRefreshToken=i.autoRefreshToken,this.admin=new GB({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=FR(i.fetch),this.lock=i.lock||ck,this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,i.lock?this.lock=i.lock:Br()&&(!((n=globalThis==null?void 0:globalThis.navigator)===null||n===void 0)&&n.locks)?this.lock=XB:this.lock=ck,this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER,this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this)},this.persistSession?i.storage?this.storage=i.storage:$u()?this.storage=KB:(this.memoryStorage={},this.storage=lk(this.memoryStorage)):(this.memoryStorage={},this.storage=lk(this.memoryStorage)),Br()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(s){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",s)}(r=this.broadcastChannel)===null||r===void 0||r.addEventListener("message",async s=>{this._debug("received broadcast notification from other tab or client",s),await this._notifyAllSubscribers(s.data.event,s.data.session,!1)})}this.initialize()}_debug(...t){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${OR}) ${new Date().toISOString()}`,...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{const n=kB(window.location.href);let r="none";if(this._isImplicitGrantCallback(n)?r="implicit":await this._isPKCECallback(n)&&(r="pkce"),Br()&&this.detectSessionInUrl&&r!=="none"){const{data:i,error:s}=await this._getSessionFromURL(n,r);if(s){if(this._debug("#_initialize()","error detecting session from URL",s),mB(s)){const l=(t=s.details)===null||t===void 0?void 0:t.code;if(l==="identity_already_exists"||l==="identity_not_found"||l==="single_identity_not_deletable")return{error:s}}return await this._removeSession(),{error:s}}const{session:o,redirectType:a}=i;return this._debug("#_initialize()","detected session in URL",o,"redirect type",a),await this._saveSession(o),setTimeout(async()=>{a==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",o):await this._notifyAllSubscribers("SIGNED_IN",o)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(n){return Ne(n)?{error:n}:{error:new MR("Unexpected error during initialization",n)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var n,r,i;try{const s=await Ve(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(r=(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:(i=t==null?void 0:t.options)===null||i===void 0?void 0:i.captchaToken}},xform:Xi}),{data:o,error:a}=s;
73if(a||!o)return{data:{user:null,session:null},error:a};const l=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",l)),{data:{user:u,session:l},error:null}}catch(s){if(Ne(s))return{data:{user:null,session:null},error:s};throw s}}async signUp(t){var n,r,i;try{let s;if("email"in t){const{email:d,password:f,options:h}=t;let p=null,g=null;this.flowType==="pkce"&&([p,g]=await Ka(this.storage,this.storageKey)),s=await Ve(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:g},xform:Xi})}else if("phone"in t){const{phone:d,password:f,options:h}=t;s=await Ve(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:(i=h==null?void 0:h.channel)!==null&&i!==void 0?i:"sms",gotrue_meta_security:{captcha_token:h==null?void 0:h.captchaToken}},xform:Xi})}else throw new Zf("You must provide either an email or phone number and a password");const{data:o,error:a}=s;
73if(a||!o)return{data:{user:null,session:null},error:a};const l=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",l)),{data:{user:u,session:l},error:null}}catch(s){if(Ne(s))return{data:{user:null,session:null},error:s};throw s}}async signInWithPassword(t){try{let n;if("email"in t){const{email:s,password:o,options:a}=t;n=await Ve(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:s,password:o,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:ak})}else if("phone"in t){const{phone:s,password:o,options:a}=t;n=await Ve(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:s,password:o,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:ak})}else throw new Zf("You must provide either an email or phone number and a password");const{data:r,error:i}=n;return i?{data:{user:null,session:null},error:i}:!r||!r.session||!r.user?{data:{user:null,session:null},error:new Xf}:(r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),{data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:i})}catch(n){if(Ne(n))return{data:{user:null,session:null},error:n};throw n}}async signInWithOAuth(t){var n,r,i,s;return await this._handleProviderSignIn(t.provider,{redirectTo:(n=t.options)===null||n===void 0?void 0:n.redirectTo,scopes:(r=t.options)===null||r===void 0?void 0:r.scopes,queryParams:(i=t.options)===null||i===void 0?void 0:i.queryParams,skipBrowserRedirect:(s=t.options)===null||s===void 0?void 0:s.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){const{chain:n}=t;if(n==="solana")return await this.signInWithSolana(t);throw new Error(`@supabase/auth-js: Unsupported chain "${n}"`)}async signInWithSolana(t){var n,r,i,s,o,a,l,u,d,f,h,p;let g,v;if("message"in t)g=t.message,v=t.signature;else{const{chain:w,wallet:y,statement:x,options:b}=t;let _;if(Br())if(typeof y=="object")_=y;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"))_=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 y!="object"||!(b!=null&&b.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");_=y}const S=new URL((n=b==null?void 0:b.url)!==null&&n!==void 0?n:window.location.href);if("signIn"in _&&_.signIn){const E=await _.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},b==null?void 0:b.signInWithSolana),{version:"1",domain:S.host,uri:S.href}),x?{statement:x}:null));let k;if(Array.isArray(E)&&E[0]&&typeof E[0]=="object")k=E[0];else if(E&&typeof E=="object"&&"signedMessage"in E&&"signature"in E)k=E;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in k&&"signature"in k&&(typeof k.signedMessage=="string"||k.signedMessage instanceof Uint8Array)&&k.signature instanceof Uint8Array)g=typeof k.signedMessage=="string"?k.signedMessage:new TextDecoder().decode(k.signedMessage),v=k.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in _)||typeof _.signMessage!="function"||!("publicKey"in _)||typeof _!="object"||!_.publicKey||!("toBase58"in _.publicKey)||typeof _.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");g=[`${S.host} wants you to sign in with your Solana account:`,_.publicKey.toBase58(),...x?["",x,""]:[""],"Version: 1",`URI: ${S.href}`,`Issued At: ${(i=(r=b==null?void 0:b.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&i!==void 0?i:new Date().toISOString()}`,...!((s=b==null?void 0:b.signInWithSolana)===null||s===void 0)&&s.notBefore?[`Not Before: ${b.signInWithSolana.notBefore}`]:[],...!((o=b==null?void 0:b.signInWithSolana)===null||o===void 0)&&o.expirationTime?[`Expiration Time: ${b.signInWithSolana.expirationTime}`]:[],...!((a=b==null?void 0:b.signInWithSolana)===null||a===void 0)&&a.chainId?[`Chain ID: ${b.signInWithSolana.chainId}`]:[],...!((l=b==null?void 0:b.signInWithSolana)===null||l===void 0)&&l.nonce?[`Nonce: ${b.signInWithSolana.nonce}`]:[],...!((u=b==null?void 0:b.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${b.signInWithSolana.requestId}`]:[],...!((f=(d=b==null?void 0:b.signInWithSolana)===null||d===void 0?void 0:d.resources)===null||f===void 0)&&f.length?["Resources",...b.signInWithSolana.resources.map(k=>`- ${k}`)]:[]].join(`
74`);const E=await _.signMessage(new TextEncoder().encode(g),"utf8");if(!E||!(E instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");v=E}}try{const{data:w,error:y}=await Ve(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:g,signature:_B(v)}
74,!((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:Xi});if(y)throw y;return!w||!w.session||!w.user?{data:{user:null,session:null},error:new Xf}:(w.session&&(await this._saveSession(w.session),await this._notifyAllSubscribers("SIGNED_IN",w.session)),{data:Object.assign({},w),error:y})}catch(w){if(Ne(w))return{data:{user:null,session:null},error:w};throw w}}async _exchangeCodeForSession(t){const n=await eh(this.storage,`${this.storageKey}-code-verifier`),[r,i]=(n??"").split("/");try{const{data:s,error:o}=await Ve(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:r},xform:Xi});if(await th(this.storage,`${this.storageKey}-code-verifier`),o)throw o;return!s||!s.session||!s.user?{data:{user:null,session:null,redirectType:null},error:new Xf}:(s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",s.session)),{data:Object.assign(Object.assign({},s),{redirectType:i??null}),error:o})}catch(s){if(Ne(s))return{data:{user:null,session:null,redirectType:null},error:s};throw s}}async signInWithIdToken(t){try{const{options:n,provider:r,token:i,access_token:s,nonce:o}=t,a=await Ve(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:i,access_token:s,nonce:o,gotrue_meta_security:{captcha_token:n==null?void 0:n.captchaToken}},xform:Xi}),{data:l,error:u}=a;return u?{data:{user:null,session:null},error:u}:!l||!l.session||!l.user?{data:{user:null,session:null},error:new Xf}:(l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),{data:l,error:u})}catch(n){if(Ne(n))return{data:{user:null,session:null},error:n};throw n}}async signInWithOtp(t){var n,r,i,s,o;try{if("email"in t){const{email:a,options:l}=t;let u=null,d=null;this.flowType==="pkce"&&([u,d]=await Ka(this.storage,this.storageKey));const{error:f}=await Ve(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:a,data:(n=l==null?void 0:l.data)!==null&&n!==void 0?n:{},create_user:(r=l==null?void 0:l.shouldCreateUser)!==null&&r!==void 0?r:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},code_challenge:u,code_challenge_method:d},redirectTo:l==null?void 0:l.emailRedirectTo});return{data:{user:null,session:null},error:f}}if("phone"in t){const{phone:a,options:l}=t,{data:u,error:d}=await Ve(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:a,data:(i=l==null?void 0:l.data)!==null&&i!==void 0?i:{},create_user:(s=l==null?void 0:l.shouldCreateUser)!==null&&s!==void 0?s:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},channel:(o=l==null?void 0:l.channel)!==null&&o!==void 0?o:"sms"}});return{data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:d}}throw new Zf("You must provide either an email or phone number.")}catch(a){if(Ne(a))return{data:{user:null,session:null},error:a};throw a}}async verifyOtp(t){var n,r;try{let i,s;"options"in t&&(i=(n=t.options)===null||n===void 0?void 0:n.redirectTo,s=(r=t.options)===null||r===void 0?void 0:r.captchaToken);const{data:o,error:a}=await Ve(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:s}}),redirectTo:i,xform:Xi});if(a)throw a;if(!o)throw new Error("An error occurred on token verification.");const l=o.session,u=o.user;return l!=null&&l.access_token&&(await this._saveSession(l),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",l)),{data:{user:u,session:l},error:null}}catch(i){if(Ne(i))return{data:{user:null,session:null},error:i};throw i}}async signInWithSSO(t){var n,r,i;try{let s=null,o=null;return this.flowType==="pkce"&&([s,o]=await Ka(this.storage,this.storageKey)),await Ve(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(r=(n=t.options)===null||n===void 0?void 0:n.redirectTo)!==null&&r!==void 0?r:void 0}),!((i=t==null?void 0:t.options)===null||i===void 0)&&i.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:s,code_challenge_method:o}),headers:this.headers,xform:zB})}catch(s){if(Ne(s))return{data:null,error:s};throw s}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;if(r)throw r;if(!n)throw new Ns;const{error:i}=await Ve(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:n.access_token});return{data:{user:null,session:null},error:i}})}catch(t){if(Ne(t))return{data:{user:null,session:null},error:t};throw t}}async resend(t){try{const n=`${this.url}/resend`;if("email"in t){const{email:r,type:i,options:s}=t,{error:o}=await Ve(this.fetch,"POST",n,{headers:this.headers,body:{email:r,type:i,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken}},redirectTo:s==null?void 0:s.emailRedirectTo});return{data:{user:null,session:null},error:o}}else if("phone"in t){const{phone:r,type:i,options:s}=t,{data:o,error:a}=await Ve(this.fetch,"POST",n,{headers:this.headers,body:{phone:r,type:i,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken}}});return{data:{user:null,session:null,messageId:o==null?void 0:o.message_id},error:a}}throw new Zf("You must provide either an email or phone number and a type")}catch(n){if(Ne(n))return{data:{user:null,session:null},error:n};throw n}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async n=>n))}async _acquireLock(t,n){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),i=(async()=>(await r,await n()))();return this.pendingInLock.push((async()=>{try{await i}catch{}})()),i}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const r=n();for(this.pendingInLock.push((async()=>{try{await r}catch{}})()),await r;this.pendingInLock.length;){const i=[...this.pendingInLock];await Promise.all(i),this.pendingInLock.splice(0,i.length)}return await r}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(t){this._debug("#_useSession","begin");try{const n=await this.__loadSession();return await t(n)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let t=null;const n=await eh(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
74id"),await this._removeSession())),!t)return{data:{session:null},error:null};const r=t.expires_at?t.expires_at*1e3-Date.now()<Ov:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",t.expires_at),!r){if(this.storage.isServer){let o=this.suppressGetSessionWarning;t=new Proxy(t,{get:(l,u,d)=>(!o&&u==="user"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),o=!0,this.suppressGetSessionWarning=!0),Reflect.get(l,u,d))})}return{data:{session:t},error:null}}const{session:i,error:s}=await this._callRefreshToken(t.refresh_token);return s?{data:{session:null},error:s}:{data:{session:i},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(t){return t?await this._getUser(t):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(t){try{return t?await Ve(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:Us}):await this._useSession(async n=>{var r,i,s;const{data:o,error:a}=n;if(a)throw a;return!(!((r=o.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Ns}:await Ve(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(s=(i=o.session)===null||i===void 0?void 0:i.access_token)!==null&&s!==void 0?s:void 0,xform:Us})})}catch(n){if(Ne(n))return pB(n)&&(await this._removeSession(),await th(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:n};throw n}}async updateUser(t,n={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(t,n))}async _updateUser(t,n={}){try{return await this._useSession(async r=>{const{data:i,error:s}=r;if(s)throw s;if(!i.session)throw new Ns;const o=i.session;let a=null,l=null;this.flowType==="pkce"&&t.email!=null&&([a,l]=await Ka(this.storage,this.storageKey));const{data:u,error:d}=await Ve(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:Us});if(d)throw d;return o.user=u.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),{data:{user:o.user},error:null}})}catch(r){if(Ne(r))return{data:{user:null},error:r};throw r}}async setSession(t){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new Ns;const n=Date.now()/1e3;let r=n,i=!0,s=null;const{payload:o}=Mv(t.access_token);if(o.exp&&(r=o.exp,i=r<=n),i){const{session:a,error:l}=await this._callRefreshToken(t.refresh_token);if(l)return{data:{user:null,session:null},error:l};if(!a)return{data:{user:null,session:null},error:null};s=a}else{const{data:a,error:l}=await this._getUser(t.access_token);if(l)throw l;s={access_token:t.access_token,refresh_token:t.refresh_token,user:a.user,token_type:"bearer",expires_in:r-n,expires_at:r},await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)}return{data:{user:s.user,session:s},error:null}}catch(n){if(Ne(n))return{data:{session:null,user:null},error:n};throw n}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async n=>{var r;if(!t){const{data:o,error:a}=n;if(a)throw a;t=(r=o.session)!==null&&r!==void 0?r:void 0}if(!(t!=null&&t.refresh_token))throw new Ns;const{session:i,error:s}=await this._callRefreshToken(t.refresh_token);return s?{data:{user:null,session:null},error:s}:i?{data:{user:i.user,session:i},error:null}:{data:{user:null,session:null},error:null}})}catch(n){if(Ne(n))return{data:{user:null,session:null},error:n};throw n}}async _getSessionFromURL(t,n){try{if(!Br())throw new Jf("No browser detected.");
74if(t.error||t.error_description||t.error_code)throw new Jf(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 tk("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Jf("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 tk("No code detected.");const{data:x,error:b}=await this._exchangeCodeForSession(t.code);if(b)throw b;const _=new URL(window.location.href);return _.searchParams.delete("code"),window.history.replaceState(window.history.state,"",_.toString()),{data:{session:x.session,redirectType:null},error:null}}const{provider_token:r,provider_refresh_token:i,access_token:s,refresh_token:o,expires_in:a,expires_at:l,token_type:u}=t;if(!s||!a||!o||!u)throw new Jf("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<=ol&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${p}s, should have been closer to ${f}s`);const g=h-f;d-g>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",g,h,d):d-g<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",g,h,d);const{data:v,error:w}=await this._getUser(s);if(w)throw w;const y={provider_token:r,provider_refresh_token:i,access_token:s,expires_in:f,expires_at:h,refresh_token:o,token_type:u,user:v.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:y,redirectType:t.type},error:null}}catch(r){if(Ne(r))return{data:{session:null,redirectType:null},error:r};throw r}}_isImplicitGrantCallback(t){return!!(t.access_token||t.error_description)}async _isPKCECallback(t){const n=await eh(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&n)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async n=>{var r;const{data:i,error:s}=n;if(s)return{error:s};const o=(r=i.session)===null||r===void 0?void 0:r.access_token;if(o){const{error:a}=await this.admin.signOut(o,t);if(a&&!(hB(a)&&(a.status===404||a.status===401||a.status===403)))return{error:a}}return t!=="others"&&(await this._removeSession(),await th(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(t){const n=EB(),r={id:n,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",n),this.stateChangeEmitters.delete(n)}};return this._debug("#onAuthStateChange()","registered callback with id",n),this.stateChangeEmitters.set(n,r),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(n)})))(),{data:{subscription:r}}}async _emitInitialSession(t){return await this._useSession(async n=>{var r,i;try{const{data:{session:s},error:o}=n;if(o)throw o;await((r=this.stateChangeEmitters.get(t))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",s)),this._debug("INITIAL_SESSION","callback id",t,"session",s)}catch(s){await((i=this.stateChangeEmitters.get(t))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",s),console.error(s)}})}async resetPasswordForEmail(t,n={}){let r=null,i=null;this.flowType==="pkce"&&([r,i]=await Ka(this.storage,this.storageKey,!0));try{return await Ve(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:r,code_challenge_method:i,gotrue_meta_security:{captcha_token:n.captchaToken}},headers:this.headers,redirectTo:n.redirectTo})}catch(s){if(Ne(s))return{data:null,error:s};throw s}}async getUserIdentities(){var t;try{const{data:n,error:r}=await this.getUser();if(r)throw r;return{data:{identities:(t=n.user.identities)!==null&&t!==void 0?t:[]},error:null}}catch(n){if(Ne(n))return{data:null,error:n};throw n}}async linkIdentity(t){var n;try{const{data:r,error:i}=await this._useSession(async s=>{var o,a,l,u,d;const{data:f,error:h}=s;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 Ve(this.fetch,"GET",p,{headers:this.headers,jwt:(d=(u=f.session)===null||u===void 0?void 0:u.access_token)!==null&&d!==void 0?d:void 0})});if(i)throw i;return Br()&&!(!((n=t.options)===null||n===void 0)&&n.skipBrowserRedirect)&&window.location.assign(r==null?void 0:r.url),{data:{provider:t.provider,url:r==null?void 0:r.url},error:null}}catch(r){if(Ne(r))return{data:{provider:t.provider,url:null},error:r};throw r}}async unlinkIdentity(t){try{return await this._useSession(async n=>{var r,i;const{data:s,error:o}=n;
74if(o)throw o;return await Ve(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(i=(r=s.session)===null||r===void 0?void 0:r.access_token)!==null&&i!==void 0?i:void 0})})}catch(n){if(Ne(n))return{data:null,error:n};throw n}}async _refreshAccessToken(t){const n=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(n,"begin");try{const r=Date.now();return await jB(async i=>(i>0&&await TB(200*Math.pow(2,i-1)),this._debug(n,"refreshing attempt",i),await Ve(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:Xi})),(i,s)=>{const o=200*Math.pow(2,i);return s&&Dv(s)&&Date.now()+o-r<ol})}catch(r){if(this._debug(n,"error",r),Ne(r))return{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),Br()&&!n.skipBrowserRedirect&&window.location.assign(r),{data:{provider:t,url:r},error:null}}async _recoverAndRefresh(){var t;const n="#_recoverAndRefresh()";this._debug(n,"begin");try{const r=await eh(this.storage,this.storageKey);if(this._debug(n,"session from storage",r),!this._isValidSession(r)){this._debug(n,"session is not valid"),r!==null&&await this._removeSession();return}const i=((t=r.expires_at)!==null&&t!==void 0?t:1/0)*1e3-Date.now()<Ov;if(this._debug(n,`session has${i?"":" not"} expired with margin of ${Ov}s`),i){if(this.autoRefreshToken&&r.refresh_token){const{error:s}=await this._callRefreshToken(r.refresh_token);s&&(console.error(s),Dv(s)||(this._debug(n,"refresh failed with a non-retryable error, removing the session",s),await this._removeSession()))}}else await this._notifyAllSubscribers("SIGNED_IN",r)}catch(r){this._debug(n,"error",r),console.error(r);return}finally{this._debug(n,"end")}}async _callRefreshToken(t){var n,r;if(!t)throw new Ns;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const i=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(i,"begin");try{this.refreshingDeferred=new og;const{data:s,error:o}=await this._refreshAccessToken(t);if(o)throw o;if(!s.session)throw new Ns;await this._saveSession(s.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",s.session);const a={session:s.session,error:null};return this.refreshingDeferred.resolve(a),a}catch(s){if(this._debug(i,"error",s),Ne(s)){const o={session:null,error:s};return Dv(s)||await this._removeSession(),(n=this.refreshingDeferred)===null||n===void 0||n.resolve(o),o}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(s),s}finally{this.refreshingDeferred=null,this._debug(i,"end")}}async _notifyAllSubscribers(t,n,r=!0){const i=`#_notifyAllSubscribers(${t})`;this._debug(i,"begin",n,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:t,session:n});const s=[],o=Array.from(this.stateChangeEmitters.values()).map(async a=>{try{await a.callback(t,n)}catch(l){s.push(l)}});if(await Promise.all(o),s.length>0){for(let a=0;a<s.length;a+=1)console.error(s[a]);throw s[0]}}finally{this._debug(i,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0,await $R(this.storage,this.storageKey,t)}async _removeSession(){this._debug("#_removeSession()"),await th(this.storage,this.storageKey),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&Br()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",t)}catch(n){console.error("removing visibilitychange callback failed",n)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),ol);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const t=Date.now();try{return await this._useSession(async n=>{const{data:{session:r}}=n;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const i=Math.floor((r.expires_at*1e3-t)/ol);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${ol}ms, refresh threshold is ${ax} ticks`),i<=ax&&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 UR)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Br()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const n=`#_onVisibilityChanged(${t})`;this._debug(n,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(-1,async()=>
74{if(document.visibilityState!=="visible"){this._debug(n,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(t,n,r){const i=[`provider=${encodeURIComponent(n)}`];if(r!=null&&r.redirectTo&&i.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r!=null&&r.scopes&&i.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const[s,o]=await Ka(this.storage,this.storageKey),a=new URLSearchParams({code_challenge:`${encodeURIComponent(s)}`,code_challenge_method:`${encodeURIComponent(o)}`});i.push(a.toString())}if(r!=null&&r.queryParams){const s=new URLSearchParams(r.queryParams);i.push(s.toString())}return r!=null&&r.skipBrowserRedirect&&i.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${t}?${i.join("&")}`}async _unenroll(t){try{return await this._useSession(async n=>{var r;const{data:i,error:s}=n;return s?{data:null,error:s}:await Ve(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(Ne(n))return{data:null,error:n};throw n}}async _enroll(t){try{return await this._useSession(async n=>{var r,i;const{data:s,error:o}=n;if(o)return{data:null,error:o};const a=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:{issuer:t.issuer}),{data:l,error:u}=await Ve(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token});return u?{data:null,error:u}:(t.factorType==="totp"&&(!((i=l==null?void 0:l.totp)===null||i===void 0)&&i.qr_code)&&(l.totp.qr_code=`data:image/svg+xml;utf-8,${l.totp.qr_code}`),{data:l,error:null})})}catch(n){if(Ne(n))return{data:null,error:n};throw n}}async _verify(t){return this._acquireLock(-1,async()=>{try{return await this._useSession(async n=>{var r;const{data:i,error:s}=n;if(s)return{data:null,error:s};const{data:o,error:a}=await Ve(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:{code:t.code,challenge_id:t.challengeId},headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token});return a?{data:null,error:a}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+o.expires_in},o)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",o),{data:o,error:a})})}catch(n){if(Ne(n))return{data:null,error:n};throw n}})}async _challenge(t){return this._acquireLock(-1,async()=>{try{return await this._useSession(async n=>{var r;const{data:i,error:s}=n;return s?{data:null,error:s}:await Ve(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:{channel:t.channel},headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(Ne(n))return{data:null,error:n};throw n}})}async _challengeAndVerify(t){const{data:n,error:r}=await this._challenge({factorId:t.factorId});return r?{data:null,error:r}:await this._verify({factorId:t.factorId,challengeId:n.id,code:t.code})}async _listFactors(){const{data:{user:t},error:n}=await this.getUser();if(n)return{data:null,error:n};const r=(t==null?void 0:t.factors)||[],i=r.filter(o=>o.factor_type==="totp"&&o.status==="verified"),s=r.filter(o=>o.factor_type==="phone"&&o.status==="verified");return{data:{all:r,totp:i,phone:s},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async t=>{var n,r;const{data:{session:i},error:s}=t;if(s)return{data:null,error:s};if(!i)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:o}=Mv(i.access_token);let a=null;o.aal&&(a=o.aal);let l=a;((r=(n=i.user.factors)===null||n===void 0?void 0:n.filter(f=>f.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(l="aal2");const d=o.amr||[];return{data:{currentLevel:a,nextLevel:l,currentAuthenticationMethods:d},error:null}}))}async fetchJwk(t,n={keys:[]}){let r=n.keys.find(o=>o.kid===t);if(r||(r=this.jwks.keys.find(o=>o.kid===t),r&&this.jwks_cached_at+dB>Date.now()))return r;const{data:i,error:s}=await Ve(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(s)throw s;if(!i.keys||i.keys.length===0)throw new Fu("JWKS is empty");if(this.jwks=i,this.jwks_cached_at=Date.now(),r=i.keys.find(o=>o.kid===t),!r)throw new Fu("No matching signing key found in JWKS");return r}async getClaims(t,n={keys:[]}){try{let r=t;if(!r){const{data:p,error:g}
74=await this.getSession();if(g||!p.session)return{data:null,error:g};r=p.session.access_token}const{header:i,payload:s,signature:o,raw:{header:a,payload:l}}=Mv(r);if(DB(s.exp),!i.kid||i.alg==="HS256"||!("crypto"in globalThis&&"subtle"in globalThis.crypto)){const{error:p}=await this.getUser(r);if(p)throw p;return{data:{claims:s,header:i,signature:o},error:null}}const u=MB(i.alg),d=await this.fetchJwk(i.kid,n),f=await crypto.subtle.importKey("jwk",d,u,!0,["verify"]);if(!await crypto.subtle.verify(u,f,o,bB(`${a}.${l}`)))throw new Fu("Invalid JWT signature");return{data:{claims:s,header:i,signature:o},error:null}}catch(r){if(Ne(r))return{data:null,error:r};throw r}}}vd.nextInstanceID=0;const JB=vd;class e8 extends JB{constructor(t){super(t)}}var t8=function(e,t,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(d){try{u(r.next(d))}catch(f){o(f)}}function l(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?s(d.value):i(d.value).then(a,l)}u((r=r.apply(e,t||[])).next())})};class n8{constructor(t,n,r){var i,s,o;if(this.supabaseUrl=t,this.supabaseKey=n,!t)throw new Error("supabaseUrl is required.");if(!n)throw new Error("supabaseKey is required.");const a=sB(t),l=new URL(a);this.realtimeUrl=new URL("realtime/v1",l),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",l),this.storageUrl=new URL("storage/v1",l),this.functionsUrl=new URL("functions/v1",l);const u=`sb-${l.hostname.split(".")[0]}-auth-token`,d={db:Xz,realtime:Jz,auth:Object.assign(Object.assign({},Zz),{storageKey:u}),global:Qz},f=oB(r??{},d);this.storageKey=(i=f.auth.storageKey)!==null&&i!==void 0?i:"",this.headers=(s=f.global.headers)!==null&&s!==void 0?s:{},f.accessToken?(this.accessToken=f.accessToken,this.auth=new Proxy({},{get:(h,p)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(p)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((o=f.auth)!==null&&o!==void 0?o:{},this.headers,f.global.fetch),this.fetch=rB(n,this._getAccessToken.bind(this),f.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},f.realtime)),this.rest=new xz(new URL("rest/v1",l).href,{headers:this.headers,schema:f.db.schema,fetch:this.fetch}),f.accessToken||this._listenForAuthEvents()}get functions(){return new Y6(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}get storage(){return new Gz(this.storageUrl.href,this.headers,this.fetch)}from(t){return this.rest.from(t)}schema(t){return this.rest.schema(t)}rpc(t,n={},r={}){return this.rest.rpc(t,n,r)}channel(t,n={config:{}}){return this.realtime.channel(t,n)}getChannels(){return this.realtime.getChannels()}removeChannel(t){return this.realtime.removeChannel(t)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){var t,n;return t8(this,void 0,void 0,function*(){if(this.accessToken)return yield this.accessToken();const{data:r}=yield this.auth.getSession();return(n=(t=r.session)===null||t===void 0?void 0:t.access_token)!==null&&n!==void 0?n:null})}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:n,detectSessionInUrl:r,storage:i,storageKey:s,flowType:o,lock:a,debug:l},u,d){const f={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new e8({url:this.authUrl.href,headers:Object.assign(Object.assign({},f),u),storageKey:s,autoRefreshToken:t,persistSession:n,detectSessionInUrl:r,storage:i,flowType:o,lock:a,debug:l,fetch:d,hasCustomAuthorizationHeader:"Authorization"in this.headers})}_initRealtimeClient(t){return new Oz(this.realtimeUrl.href,Object.assign(Object.assign({},t),{params:Object.assign({apikey:this.supabaseKey},t==null?void 0:t.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((n,r)=>{this._handleTokenChanged(n,"CLIENT",r==null?void 0:r.access_token)})}_handleTokenChanged(t,n,r){(t==="TOKEN_REFRESHED"||t==="SIGNED_IN")&&this.changedAccessToken!==r?this.changedAccessToken=r:t==="SIGNED_OUT"&&(this.realtime.setAuth(),n=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}}
74const r8=(e,t,n)=>new n8(e,t,n),i8="https://znfdhxoristtdztjrzcn.supabase.co",s8="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InpuZmRoeG9yaXN0dGR6dGpyemNuIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDI1MzQ0MTMsImV4cCI6MjA1ODExMDQxM30.5ZmWH6aFZyW3d0j2LHZrdaG7jxqMII4vvTMY3qg2Zts",_e=r8(i8,s8),o8=3,a8=3e3;let Fv=0;function l8(){return Fv=(Fv+1)%Number.MAX_SAFE_INTEGER,Fv.toString()}const $v=new Map,uk=e=>{if($v.has(e))return;const t=setTimeout(()=>{$v.delete(e),Uu({type:"REMOVE_TOAST",toastId:e})},a8);$v.set(e,t)},c8=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,o8)};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?uk(n):e.toasts.forEach(r=>{uk(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)}}},Bh=[];let Wh={toasts:[]};function Uu(e){Wh=c8(Wh,e),Bh.forEach(t=>{t(Wh)})}function Dl({...e}){const t=l8(),n=i=>Uu({type:"UPDATE_TOAST",toast:{...i,id:t}}),r=()=>Uu({type:"DISMISS_TOAST",toastId:t});return Uu({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:i=>{i||r()}}}),{id:t,dismiss:r,update:n}}function zi(){const[e,t]=m.useState(Wh);return m.useEffect(()=>(Bh.push(t),()=>{const n=Bh.indexOf(t);n>-1&&Bh.splice(n,1)}),[e]),{...e,toast:Dl,dismiss:n=>Uu({type:"DISMISS_TOAST",toastId:n})}}async function u8(e){try{const{data:t,error:n}=await _e.from("profiles").select("*").eq("id",e).single();if(n)throw n;const r={id:t.id,first_name:t.first_name,last_name:t.last_name,avatar_url:t.avatar_url,dietary_preferences:t.dietary_preferences,cuisine_preferences:t.cuisine_preferences,spice_tolerance:t.spice_tolerance,default_servings:t.default_servings,created_at:t.created_at},i=!t.dietary_preferences&&!t.cuisine_preferences&&!t.spice_tolerance;return{profile:r,needsOnboarding:i}}catch(t){return console.error("Error fetching profile:",t),{profile:null,needsOnboarding:!0}}}async function d8(e,t){try{const n={...t,updated_at:new Date().toISOString()},{error:r}=await _e.from("profiles").update(n).eq("id",e);if(r)throw r;return{success:!0}}catch(n){return console.error("Error updating profile:",n),{success:!1,error:n}}}async function f8(e,t){return await _e.auth.signInWithPassword({email:e,password:t})}async function h8(e,t,n,r){return await _e.auth.signUp({email:e,password:t,options:{data:{first_name:n,last_name:r}}})}async function p8(){return await _e.auth.signOut()}async function m8(e,t=!1){return await _e.auth.signInWithOAuth({provider:e,options:{redirectTo:window.location.origin,queryParams:t?{prompt:"select_account"}:{}}})}async function dk(){return await _e.auth.getSession()}async function g8(){return await _e.auth.getUser()}var ux=function(e,t){return ux=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},ux(e,t)};function Xt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");ux(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Y=function(){return Y=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Y.apply(this,arguments)};function yd(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function W(e,t,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(d){try{u(r.next(d))}catch(f){o(f)}}function l(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?s(d.value):i(d.value).then(a,l)}u((r=r.apply(e,t||[])).next())})}function q(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(d){return l([u,d])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(d){u=[6,d],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function De(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);
74if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Te(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s}function Ke(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r<i;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}function Ml(e){return this instanceof Ml?(this.v=e,this):new Ml(e)}function v8(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(p){return function(g){return Promise.resolve(g).then(p,f)}}function a(p,g){r[p]&&(i[p]=function(v){return new Promise(function(w,y){s.push([p,v,w,y])>1||l(p,v)})},g&&(i[p]=g(i[p])))}function l(p,g){try{u(r[p](g))}catch(v){h(s[0][3],v)}}function u(p){p.value instanceof Ml?Promise.resolve(p.value.v).then(d,f):h(s[0][2],p)}function d(p){l("next",p)}function f(p){l("throw",p)}function h(p,g){p(g),s.shift(),s.length&&l(s[0][0],s[0][1])}}function y8(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof De=="function"?De(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(s){n[s]=e[s]&&function(o){return new Promise(function(a,l){o=e[s](o),i(a,l,o.done,o.value)})}}function i(s,o,a,l){Promise.resolve(l).then(function(u){s({value:u,done:a})},o)}}var wl;(function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"})(wl||(wl={}));var bo;(function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"})(bo||(bo={}));var fk="-",ag="AMP",VR="".concat(ag,"_unsent"),zR="https://api2.amplitude.com/2/httpapi",x8="https://api.eu.amplitude.com/2/httpapi",w8="https://api2.amplitude.com/batch",b8="https://api.eu.amplitude.com/batch",_8=1e3,dx=function(e){if(Object.keys(e).length>_8)return!1;for(var t in e){var n=e[t];if(!BR(t,n))return!1}return!0},BR=function(e,t){var n,r;if(typeof e!="string")return!1;if(Array.isArray(t)){var i=!0;try{for(var s=De(t),o=s.next();!o.done;o=s.next()){var a=o.value;if(Array.isArray(a))return!1;if(typeof a=="object")i=i&&dx(a);else if(!["number","string"].includes(typeof a))return!1;if(!i)return!1}}catch(l){n={error:l}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}}else{if(t==null)return!1;if(typeof t=="object")return dx(t);if(!["number","string","boolean"].includes(typeof t))return!1}return!0},xd=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return Y({},this._properties)},e.prototype.set=function(t,n){return this._safeSet(it.SET,t,n),this},e.prototype.setOnce=function(t,n){return this._safeSet(it.SET_ONCE,t,n),this},e.prototype.append=function(t,n){return this._safeSet(it.APPEND,t,n),this},e.prototype.prepend=function(t,n){return this._safeSet(it.PREPEND,t,n),this},e.prototype.postInsert=function(t,n){return this._safeSet(it.POSTINSERT,t,n),this},e.prototype.preInsert=function(t,n){return this._safeSet(it.PREINSERT,t,n),this},e.prototype.remove=function(t,n){return this._safeSet(it.REMOVE,t,n),this},e.prototype.add=function(t,n){return this._safeSet(it.ADD,t,n),this},e.prototype.unset=function(t){return this._safeSet(it.UNSET,t,fk),this},e.prototype.clearAll=function(){return this._properties={},this._properties[it.CLEAR_ALL]=fk,this}
74,e.prototype._safeSet=function(t,n,r){if(this._validate(t,n,r)){var i=this._properties[t];return i===void 0&&(i={},this._properties[t]=i),i[n]=r,this._propertySet.add(n),!0}return!1},e.prototype._validate=function(t,n,r){return this._properties[it.CLEAR_ALL]!==void 0||this._propertySet.has(n)?!1:t===it.ADD?typeof r=="number":t!==it.UNSET&&t!==it.REMOVE?BR(n,r):!0},e}(),it;(function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"})(it||(it={}));var S8=[it.CLEAR_ALL,it.UNSET,it.SET,it.SET_ONCE,it.ADD,it.APPEND,it.PREPEND,it.PREINSERT,it.POSTINSERT,it.REMOVE],E8="Event tracked successfully",k8="Unexpected error occurred",C8="Event rejected due to exceeded retry count",T8="Event skipped due to optOut config",j8="Event rejected due to missing API key",P8="Invalid API key",N8="Client not initialized",Et;(function(e){e.Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.PayloadTooLarge="payload_too_large",e.Invalid="invalid",e.Failed="failed",e.Timeout="Timeout",e.SystemError="SystemError"})(Et||(Et={}));var Ll=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Et.Unknown),{event:e,code:t,message:n}},et=function(){var e="ampIntegrationContext";if(typeof globalThis<"u"&&typeof globalThis[e]<"u")return globalThis[e];if(typeof globalThis<"u")return globalThis;if(typeof window<"u")return window;if(typeof self<"u")return self;if(typeof global<"u")return global},R8=function(e){return e?(e^Math.random()*16>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,Ua)},hk=Ke([],Te(Array(256).keys()),!1).map(function(e){return e.toString(16).padStart(2,"0")}),Ua=function(e){var t,n=et();if(!(!((t=n==null?void 0:n.crypto)===null||t===void 0)&&t.getRandomValues))return R8(e);var r=n.crypto.getRandomValues(new Uint8Array(16));return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Ke([],Te(r.entries()),!1).map(function(i){var s=Te(i,2),o=s[0],a=s[1];return[4,6,8,10].includes(o)?"-".concat(hk[a]):hk[a]}).join("")},I8=function(){function e(t){this.client=t,this.queue=[],this.applying=!1,this.plugins=[]}return e.prototype.register=function(t,n){var r,i;return W(this,void 0,void 0,function(){return q(this,function(s){switch(s.label){case 0:return this.plugins.some(function(o){return o.name===t.name})?(this.loggerProvider.warn("Plugin with name ".concat(t.name," already exists, skipping registration")),[2]):(t.name===void 0&&(t.name=Ua(),this.loggerProvider.warn(`Plugin name is undefined. 
75      Generating a random UUID for plugin name: `.concat(t.name,`. 
76      Set a name for the plugin to prevent it from being added multiple times.`))),t.type=(r=t.type)!==null&&r!==void 0?r:"enrichment",[4,(i=t.setup)===null||i===void 0?void 0:i.call(t,n,this.client)]);case 1:return s.sent(),this.plugins.push(t),[2]}})})},e.prototype.deregister=function(t,n){var r;return W(this,void 0,void 0,function(){var i,s;return q(this,function(o){switch(o.label){case 0:return i=this.plugins.findIndex(function(a){return a.name===t}),i===-1?(n.loggerProvider.warn("Plugin with name ".concat(t," does not exist, skipping deregistration")),[2]):(s=this.plugins[i],this.plugins.splice(i,1),[4,(r=s.teardown)===null||r===void 0?void 0:r.call(s)]);case 1:return o.sent(),[2]}})})},e.prototype.reset=function(t){this.applying=!1;var n=this.plugins;n.map(function(r){var i;return(i=r.teardown)===null||i===void 0?void 0:i.call(r)}),this.plugins=[],this.client=t},e.prototype.push=function(t){var n=this;return new Promise(function(r){n.queue.push([t,r]),n.scheduleApply(0)})},e.prototype.scheduleApply=function(t){var n=this;this.applying||(this.applying=!0,setTimeout(function(){n.apply(n.queue.shift()).then(function(){n.applying=!1,n.queue.length>0&&n.scheduleApply(0)})},t))},e.prototype.apply=function(t){return W(this,void 0,void 0,function(){var n,r,i,s,o,a,l,p,g,u,d,f,h,p,g,v,w,y,x,b,_,S;return q(this,function(E){switch(E.label){case 0:if(!t)return[2];n=Te(t,1),r=n[0],i=Te(t,2),s=i[1],this.loggerProvider.log("Timeline.apply: Initial event",r),o=this.plugins.filter(function(k){return k.type==="before"}),E.label=1;case 1:E.trys.push([1,6,7,8]),a=De(o),l=a.next(),E.label=2;case 2:return l.done?[3,5]:(p=l.value,p.execute?[4,p.execute(Y({},r))]:[3,4]);case 3:if(g=E.sent(),g===null)return this.loggerProvider.log("Timeline.apply: Event filtered out by before plugin '".concat(String(p.name),"', event: ").concat(JSON.stringify(r))),s({event:r,code:0,message:""}),[2];r=g,this.loggerProvider.log("Timeline.apply: Event after before plugin '".concat(String(p.name),"', event: ").concat(JSON.stringify(r))),E.label=4;case 4:return l=a.next(),[3,2];case 5:return[3,8];case 6:return u=E.sent(),x={error:u},[3,8];case 7:try{l&&!l.done&&(b=a.return)&&b.call(a)}finally{if(x)throw x.error}
76return[7];case 8:d=this.plugins.filter(function(k){return k.type==="enrichment"||k.type===void 0}),E.label=9;case 9:E.trys.push([9,14,15,16]),f=De(d),h=f.next(),E.label=10;case 10:return h.done?[3,13]:(p=h.value,p.execute?[4,p.execute(Y({},r))]:[3,12]);case 11:if(g=E.sent(),g===null)return this.loggerProvider.log("Timeline.apply: Event filtered out by enrichment plugin '".concat(String(p.name),"', event: ").concat(JSON.stringify(r))),s({event:r,code:0,message:""}),[2];r=g,this.loggerProvider.log("Timeline.apply: Event after enrichment plugin '".concat(String(p.name),"', event: ").concat(JSON.stringify(r))),E.label=12;case 12:return h=f.next(),[3,10];case 13:return[3,16];case 14:return v=E.sent(),_={error:v},[3,16];case 15:try{h&&!h.done&&(S=f.return)&&S.call(f)}finally{if(_)throw _.error}return[7];case 16:return w=this.plugins.filter(function(k){return k.type==="destination"}),this.loggerProvider.log("Timeline.apply: Final event before destinations, event: ".concat(JSON.stringify(r))),y=w.map(function(k){var C=Y({},r);return k.execute(C).catch(function(P){return Ll(C,0,String(P))})}),Promise.all(y).then(function(k){var C=Te(k,1),P=C[0],T=P||Ll(r,100,"Event not tracked, no destination plugins on the instance");s(T)}),[2]}})})},e.prototype.flush=function(){return W(this,void 0,void 0,function(){var t,n,r,i=this;return q(this,function(s){switch(s.label){case 0:return t=this.queue,this.queue=[],[4,Promise.all(t.map(function(o){return i.apply(o)}))];case 1:return s.sent(),n=this.plugins.filter(function(o){return o.type==="destination"}),r=n.map(function(o){return o.flush&&o.flush()}),[4,Promise.all(r)];case 2:return s.sent(),[2]}})})},e.prototype.onIdentityChanged=function(t){this.plugins.forEach(function(n){var r;(r=n.onIdentityChanged)===null||r===void 0||r.call(n,t)})},e.prototype.onSessionIdChanged=function(t){this.plugins.forEach(function(n){var r;(r=n.onSessionIdChanged)===null||r===void 0||r.call(n,t)})},e.prototype.onOptOutChanged=function(t){this.plugins.forEach(function(n){var r;(r=n.onOptOutChanged)===null||r===void 0||r.call(n,t)})},e}(),A8=function(e,t,n){var r=typeof e=="string"?{event_type:e}:e;return Y(Y(Y({},r),n),t&&{event_properties:t})},WR=function(e,t){var n=Y(Y({},t),{event_type:bo.IDENTIFY,user_properties:e.getUserProperties()});return n},O8=function(e,t,n,r){var i,s=Y(Y({},r),{event_type:bo.GROUP_IDENTIFY,group_properties:n.getUserProperties(),groups:(i={},i[e]=t,i)});return s},D8=function(e,t,n){var r,i=new xd;i.set(e,t);var s=Y(Y({},n),{event_type:bo.IDENTIFY,user_properties:i.getUserProperties(),groups:(r={},r[e]=t,r)});return s},M8=function(e,t){return Y(Y({},t),{event_type:bo.REVENUE,event_properties:e.getEventProperties()})},pn=function(e){return{promise:e||Promise.resolve()}},L8=function(){function e(t){t===void 0&&(t="$default"),this.initializing=!1,this.isReady=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new I8(this),this.name=t}return e.prototype._init=function(t){return W(this,void 0,void 0,function(){return q(this,function(n){switch(n.label){case 0:return this.config=t,this.timeline.reset(this),this.timeline.loggerProvider=this.config.loggerProvider,[4,this.runQueuedFunctions("q")];case 1:return n.sent(),this.isReady=!0,[2]}})})},e.prototype.runQueuedFunctions=function(t){return W(this,void 0,void 0,function(){var n,r,i,s,o,a,l,u;return q(this,function(d){switch(d.label){case 0:n=this[t],this[t]=[],d.label=1;case 1:d.trys.push([1,8,9,10]),r=De(n),i=r.next(),d.label=2;case 2:return i.done?[3,7]:(s=i.value,o=s(),o&&"promise"in o?[4,o.promise]:[3,4]);case 3:return d.sent(),[3,6];case 4:return[4,o];case 5:d.sent(),d.label=6;case 6:return i=r.next(),[3,2];case 7:return[3,10];case 8:return a=d.sent(),l={error:a},[3,10];case 9:try{i&&!i.done&&(u=r.return)&&u.call(r)}finally{if(l)throw l.error}return[7];case 10:return this[t].length?[4,this.runQueuedFunctions(t)]:[3,12];case 11:d.sent(),d.label=12;case 12:return[2]}})})},e.prototype.track=function(t,n,r){var i=A8(t,n,r);return pn(this.dispatch(i))},e.prototype.identify=function(t,n){var r=WR(t,n);return pn(this.dispatch(r))},e.prototype.groupIdentify=function(t,n,r,i){var s=O8(t,n,r,i);return pn(this.dispatch(s))},e.prototype.setGroup=function(t,n,r){var i=D8(t,n,r);return pn(this.dispatch(i))},e.prototype.revenue=function(t,n){var r=M8(t,n);return pn(this.dispatch(r))},e.prototype.add=function(t){return this.isReady?this._addPlugin(t):(this.q.push(this._addPlugin.bind(this,t)),pn())},e.prototype._addPlugin=function(t){return pn(this.timeline.register(t,this.config))},e.prototype.remove=function(t){return this.isReady?this._removePlugin(t):(this.q.push(this._removePlugin.bind(this,t)),pn())},e.prototype._removePlugin=function(t){return pn(this.timeline.deregister(t,this.config))},e.prototype.dispatchWithCallback=function(t,n){if(!this.isReady)return n(Ll(t,0,N8));this.process(t).then(n)},e.prototype.dispatch=function(t){return W(this,void 0,void 0,function(){var n=this;return q(this,function(r){return this.isReady?[2,this.process(t)]:[2,new Promise(function(i){n.dispatchQ.push(n.dispatchWithCallback.bind(n,t,i))})]})})},e.prototype.getOperationAppliedUserProperties=function(t){var n={};if(t===void 0)return n;var r={};return Object.keys(t).forEach(function(i){Object.values(wl).includes(i)||(r[i]=t[i])}),S8.forEach(function(i){if(Object.keys(t).includes(i)){var s=t[i];
76switch(i){case wl.CLEAR_ALL:Object.keys(n).forEach(function(o){delete n[o]});break;case wl.UNSET:Object.keys(s).forEach(function(o){delete n[o]});break;case wl.SET:Object.assign(n,s);break}}}),Object.assign(n,r),n},e.prototype.process=function(t){return W(this,void 0,void 0,function(){var n,s,r,i,s;return q(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),this.config.optOut?[2,Ll(t,0,T8)]:(t.event_type===bo.IDENTIFY&&(n=this.getOperationAppliedUserProperties(t.user_properties),this.timeline.onIdentityChanged({userProperties:n})),[4,this.timeline.push(t)]);case 1:return s=o.sent(),s.code===200?this.config.loggerProvider.log(s.message):s.code===100?this.config.loggerProvider.warn(s.message):this.config.loggerProvider.error(s.message),[2,s];case 2:return r=o.sent(),i=String(r),this.config.loggerProvider.error(i),s=Ll(t,0,i),[2,s];case 3:return[2]}})})},e.prototype.setOptOut=function(t){if(!this.isReady){this.q.push(this._setOptOut.bind(this,!!t));return}this._setOptOut(t)},e.prototype._setOptOut=function(t){this.config.optOut!==t&&(this.timeline.onOptOutChanged(t),this.config.optOut=!!t)},e.prototype.flush=function(){return pn(this.timeline.flush())},e.prototype.plugin=function(t){var n=this.timeline.plugins.find(function(r){return r.name===t});if(n===void 0){this.config.loggerProvider.debug("Cannot find plugin with name ".concat(t));return}return n},e.prototype.plugins=function(t){return this.timeline.plugins.filter(function(n){return n instanceof t})},e}(),F8=function(){function e(){this.productId="",this.quantity=1,this.price=0}return e.prototype.setProductId=function(t){return this.productId=t,this},e.prototype.setQuantity=function(t){return t>0&&(this.quantity=t),this},e.prototype.setPrice=function(t){return this.price=t,this},e.prototype.setRevenueType=function(t){return this.revenueType=t,this},e.prototype.setCurrency=function(t){return this.currency=t,this},e.prototype.setRevenue=function(t){return this.revenue=t,this},e.prototype.setReceipt=function(t){return this.receipt=t,this},e.prototype.setReceiptSig=function(t){return this.receiptSig=t,this},e.prototype.setEventProperties=function(t){return dx(t)&&(this.properties=t),this},e.prototype.getEventProperties=function(){var t=this.properties?Y({},this.properties):{};return t[wi.REVENUE_PRODUCT_ID]=this.productId,t[wi.REVENUE_QUANTITY]=this.quantity,t[wi.REVENUE_PRICE]=this.price,t[wi.REVENUE_TYPE]=this.revenueType,t[wi.REVENUE_CURRENCY]=this.currency,t[wi.REVENUE]=this.revenue,t[wi.RECEIPT]=this.receipt,t[wi.RECEIPT_SIG]=this.receiptSig,t},e}(),wi;(function(e){e.REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE_CURRENCY="$currency",e.REVENUE="$revenue",e.RECEIPT="$receipt",e.RECEIPT_SIG="$receiptSig"})(wi||(wi={}));var $8=function(e,t){var n=Math.max(t,1);return e.reduce(function(r,i,s){var o=Math.floor(s/n);return r[o]||(r[o]=[]),r[o].push(i),r},[])},jn;(function(e){e[e.None=0]="None",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Verbose=3]="Verbose",e[e.Debug=4]="Debug"})(jn||(jn={}));var nh="Amplitude Logger ",wd=function(){function e(){this.logLevel=jn.None}return e.prototype.disable=function(){this.logLevel=jn.None},e.prototype.enable=function(t){t===void 0&&(t=jn.Warn),this.logLevel=t},e.prototype.log=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.logLevel<jn.Verbose||console.log("".concat(nh,"[Log]: ").concat(t.join(" ")))},e.prototype.warn=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.logLevel<jn.Warn||console.warn("".concat(nh,"[Warn]: ").concat(t.join(" ")))},e.prototype.error=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.logLevel<jn.Error||console.error("".concat(nh,"[Error]: ").concat(t.join(" ")))},e.prototype.debug=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.logLevel<jn.Debug||console.log("".concat(nh,"[Debug]: ").concat(t.join(" ")))},e}(),qh=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:"$default_instance",logLevel:jn.Warn,loggerProvider:new wd,offline:!1,optOut:!1,serverUrl:zR,serverZone:"US",useBatch:!1}},qR=function(){function e(t){var n,r,i,s;this._optOut=!1;var o=qh();this.apiKey=t.apiKey,this.flushIntervalMillis=(n=t.flushIntervalMillis)!==null&&n!==void 0?n:o.flushIntervalMillis,this.flushMaxRetries=t.flushMaxRetries||o.flushMaxRetries,this.flushQueueSize=t.flushQueueSize||o.flushQueueSize,this.instanceName=t.instanceName||o.instanceName,this.loggerProvider=t.loggerProvider||o.loggerProvider,this.logLevel=(r=t.logLevel)!==null&&r!==void 0?r:o.logLevel,this.minIdLength=t.minIdLength,this.plan=t.plan,this.ingestionMetadata=t.ingestionMetadata,this.offline=t.offline!==void 0?t.offline:o.offline,this.optOut=(i=t.optOut)!==null&&i!==void 0?i:o.optOut,this.serverUrl=t.serverUrl,this.serverZone=t.serverZone||o.serverZone,this.storageProvider=t.storageProvider,this.transportProvider=t.transportProvider,this.useBatch=(s=t.useBatch)!==null&&s!==void 0?s:o.useBatch,this.loggerProvider.enable(this.logLevel);var a=HR(t.serverUrl,t.serverZone,t.useBatch);this.serverZone=a.serverZone,this.serverUrl=a.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(t){this._optOut=t}
76,enumerable:!1,configurable:!0}),e}(),U8=function(e,t){return e==="EU"?t?b8:x8:t?w8:zR},HR=function(e,t,n){if(e===void 0&&(e=""),t===void 0&&(t=qh().serverZone),n===void 0&&(n=qh().useBatch),e)return{serverUrl:e,serverZone:void 0};var r=["US","EU"].includes(t)?t:qh().serverZone;return{serverZone:r,serverUrl:U8(r,n)}},GR=function(){function e(){this.sdk={metrics:{histogram:{}}}}return e.prototype.recordHistogram=function(t,n){this.sdk.metrics.histogram[t]=n},e}();function V8(e){return e instanceof Error?e.message:String(e)}function rh(e){var t="";try{"body"in e&&(t=JSON.stringify(e.body,null,2))}catch{}return t}var z8=function(){function e(){this.name="amplitude",this.type="destination",this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduleId=null,this.scheduledTimeout=0,this.flushId=null,this.queue=[]}return e.prototype.setup=function(t){var n;return W(this,void 0,void 0,function(){var r,i=this;return q(this,function(s){switch(s.label){case 0:return this.config=t,this.storageKey="".concat(VR,"_").concat(this.config.apiKey.substring(0,10)),[4,(n=this.config.storageProvider)===null||n===void 0?void 0:n.get(this.storageKey)];case 1:return r=s.sent(),r&&r.length>0&&Promise.all(r.map(function(o){return i.execute(o)})).catch(),[2,Promise.resolve(void 0)]}})})},e.prototype.execute=function(t){var n=this;return t.insert_id||(t.insert_id=Ua()),new Promise(function(r){var i={event:t,attempts:0,callback:function(s){return r(s)},timeout:0};n.queue.push(i),n.schedule(n.config.flushIntervalMillis),n.saveEvents()})},e.prototype.removeEventsExceedFlushMaxRetries=function(t){var n=this;return t.filter(function(r){return r.attempts+=1,r.attempts<n.config.flushMaxRetries?!0:(n.fulfillRequest([r],500,C8),!1)})},e.prototype.scheduleEvents=function(t){var n=this;t.forEach(function(r){n.schedule(r.timeout===0?n.config.flushIntervalMillis:r.timeout)})},e.prototype.schedule=function(t){var n=this;if(!this.config.offline&&(this.scheduleId===null||this.scheduleId&&t>this.scheduledTimeout)){this.scheduleId&&clearTimeout(this.scheduleId),this.scheduledTimeout=t,this.scheduleId=setTimeout(function(){n.queue=n.queue.map(function(r){return r.timeout=0,r}),n.flush(!0)},t);return}},e.prototype.resetSchedule=function(){this.scheduleId=null,this.scheduledTimeout=0},e.prototype.flush=function(t){return t===void 0&&(t=!1),W(this,void 0,void 0,function(){var n,r,i,s=this;return q(this,function(o){switch(o.label){case 0:return this.config.offline?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush while offline."),[2]):this.flushId?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush because previous flush has not resolved."),[2]):(this.flushId=this.scheduleId,this.resetSchedule(),n=[],r=[],this.queue.forEach(function(a){return a.timeout===0?n.push(a):r.push(a)}),i=$8(n,this.config.flushQueueSize),[4,i.reduce(function(a,l){return W(s,void 0,void 0,function(){return q(this,function(u){switch(u.label){case 0:return[4,a];case 1:return u.sent(),[4,this.send(l,t)];case 2:return[2,u.sent()]}})})},Promise.resolve())]);case 1:return o.sent(),this.flushId=null,this.scheduleEvents(this.queue),[2]}})})},e.prototype.send=function(t,n){return n===void 0&&(n=!0),W(this,void 0,void 0,function(){var r,i,s,o,a;return q(this,function(l){switch(l.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(t,400,j8)];r={api_key:this.config.apiKey,events:t.map(function(u){var d=u.event;d.extra;var f=yd(d,["extra"]);return f}),options:{min_id_length:this.config.minIdLength},client_upload_time:new Date().toISOString(),request_metadata:this.config.requestMetadata},this.config.requestMetadata=new GR,l.label=1;case 1:return l.trys.push([1,3,,4]),i=HR(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(i,r)];case 2:return s=l.sent(),s===null?(this.fulfillRequest(t,0,k8),[2]):n?(this.handleResponse(s,t),[3,4]):("body"in s?this.fulfillRequest(t,s.statusCode,"".concat(s.status,": ").concat(rh(s))):this.fulfillRequest(t,s.statusCode,s.status),[2]);case 3:return o=l.sent(),a=V8(o),this.config.loggerProvider.error(a),this.handleResponse({status:Et.Failed,statusCode:0},t),[3,4];case 4:return[2]}})})},e.prototype.handleResponse=function(t,n){var r=t.status;switch(r){case Et.Success:{this.handleSuccessResponse(t,n);break}case Et.Invalid:{this.handleInvalidResponse(t,n);break}case Et.PayloadTooLarge:{this.handlePayloadTooLargeResponse(t,n);break}case Et.RateLimit:{this.handleRateLimitResponse(t,n);break}default:{this.config.loggerProvider.warn(`{code: 0, error: "Status '`.concat(r,"' provided for ").concat(n.length,' events"}')),this.handleOtherResponse(n);break}}},e.prototype.handleSuccessResponse=function(t,n){this.fulfillRequest(n,t.statusCode,E8)},e.prototype.handleInvalidResponse=function(t,n){var r=this;if(t.body.missingField||t.body.error.startsWith(P8)){this.fulfillRequest(n,t.statusCode,t.body.error);return}var i=Ke(Ke(Ke(Ke([],Te(Object.values(t.body.eventsWithInvalidFields)),!1),Te(Object.values(t.body.eventsWithMissingFields)),!1),Te(Object.values(t.body.eventsWithInvalidIdLengths)),!1),Te(t.body.silencedEvents),!1).flat(),s=new Set(i),o=n.filter(function(l,u){if(s.has(u)){r.fulfillRequest([l],t.statusCode,t.body.error);return}return!0});o.length>0&&this.config.loggerProvider.warn(rh(t));
76var a=this.removeEventsExceedFlushMaxRetries(o);this.scheduleEvents(a)},e.prototype.handlePayloadTooLargeResponse=function(t,n){if(n.length===1){this.fulfillRequest(n,t.statusCode,t.body.error);return}this.config.loggerProvider.warn(rh(t)),this.config.flushQueueSize/=2;var r=this.removeEventsExceedFlushMaxRetries(n);this.scheduleEvents(r)},e.prototype.handleRateLimitResponse=function(t,n){var r=this,i=Object.keys(t.body.exceededDailyQuotaUsers),s=Object.keys(t.body.exceededDailyQuotaDevices),o=t.body.throttledEvents,a=new Set(i),l=new Set(s),u=new Set(o),d=n.filter(function(h,p){if(h.event.user_id&&a.has(h.event.user_id)||h.event.device_id&&l.has(h.event.device_id)){r.fulfillRequest([h],t.statusCode,t.body.error);return}return u.has(p)&&(h.timeout=r.throttleTimeout),!0});d.length>0&&this.config.loggerProvider.warn(rh(t));var f=this.removeEventsExceedFlushMaxRetries(d);this.scheduleEvents(f)},e.prototype.handleOtherResponse=function(t){var n=this,r=t.map(function(s){return s.timeout=s.attempts*n.retryTimeout,s}),i=this.removeEventsExceedFlushMaxRetries(r);this.scheduleEvents(i)},e.prototype.fulfillRequest=function(t,n,r){this.removeEvents(t),t.forEach(function(i){return i.callback(Ll(i.event,n,r))})},e.prototype.saveEvents=function(){if(this.config.storageProvider){var t=this.queue.map(function(n){return n.event});this.config.storageProvider.set(this.storageKey,t)}},e.prototype.removeEvents=function(t){this.queue=this.queue.filter(function(n){return!t.some(function(r){return r.event.insert_id===n.event.insert_id})}),this.saveEvents()},e}(),B8=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:W8(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),W8=function(){return typeof navigator<"u"&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},q8=function(){function e(){this.queue=[]}return e.prototype.logEvent=function(t){this.receiver?this.receiver(t):this.queue.length<512&&this.queue.push(t)},e.prototype.setEventReceiver=function(t){this.receiver=t,this.queue.length>0&&(this.queue.forEach(function(n){t(n)}),this.queue=[])},e}(),Ls=function(){return Ls=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Ls.apply(this,arguments)};function Hh(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function pk(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s}var Gh=function(e,t){var n,r,i=["string","number","boolean","undefined"],s=typeof e,o=typeof t;if(s!==o)return!1;try{for(var a=Hh(i),l=a.next();!l.done;l=a.next()){var u=l.value;if(u===s)return e===t}}catch(w){n={error:w}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}if(e==null&&t==null)return!0;if(e==null||t==null||e.length!==t.length)return!1;var d=Array.isArray(e),f=Array.isArray(t);if(d!==f)return!1;if(d&&f){for(var h=0;h<e.length;h++)if(!Gh(e[h],t[h]))return!1}else{var p=Object.keys(e).sort(),g=Object.keys(t).sort();if(!Gh(p,g))return!1;var v=!0;return Object.keys(e).forEach(function(w){Gh(e[w],t[w])||(v=!1)}),v}return!0},H8="$set",G8="$unset",K8="$clearAll";Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r});var Y8=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var t=this,n=Ls({},this.identity.userProperties),r=Ls(Ls({},this.identity),{userProperties:n});return{setUserId:function(i){return r.userId=i,this},setDeviceId:function(i){return r.deviceId=i,this},setUserProperties:function(i){return r.userProperties=i,this},setOptOut:function(i){return r.optOut=i,this},updateUserProperties:function(i){var s,o,a,l,u,d,f=r.userProperties||{};try{for(var h=Hh(Object.entries(i)),p=h.next();!p.done;p=h.next()){var g=pk(p.value,2),v=g[0],w=g[1];switch(v){case H8:try{for(var y=(a=void 0,Hh(Object.entries(w))),x=y.next();!x.done;x=y.next()){var b=pk(x.value,2),_=b[0],S=b[1];f[_]=S}}catch(C){a={error:C}}finally{try{x&&!x.done&&(l=y.return)&&l.call(y)}finally{if(a)throw a.error}}break;
76case G8:try{for(var E=(u=void 0,Hh(Object.keys(w))),k=E.next();!k.done;k=E.next()){var _=k.value;delete f[_]}}catch(C){u={error:C}}finally{try{k&&!k.done&&(d=E.return)&&d.call(E)}finally{if(u)throw u.error}}break;case K8:f={};break}}}catch(C){s={error:C}}finally{try{p&&!p.done&&(o=h.return)&&o.call(h)}finally{if(s)throw s.error}}return r.userProperties=f,this},commit:function(){return t.setIdentity(r),this}}},e.prototype.getIdentity=function(){return Ls({},this.identity)},e.prototype.setIdentity=function(t){var n=Ls({},this.identity);this.identity=Ls({},t),Gh(n,this.identity)||this.listeners.forEach(function(r){r(t)})},e.prototype.addIdentityListener=function(t){this.listeners.add(t)},e.prototype.removeIdentityListener=function(t){this.listeners.delete(t)},e}(),ru=typeof globalThis<"u"?globalThis:typeof global<"u"?global:self,Q8=function(){function e(){this.identityStore=new Y8,this.eventBridge=new q8,this.applicationContextProvider=new B8}return e.getInstance=function(t){return ru.analyticsConnectorInstances||(ru.analyticsConnectorInstances={}),ru.analyticsConnectorInstances[t]||(ru.analyticsConnectorInstances[t]=new e),ru.analyticsConnectorInstances[t]},e}(),cc=function(e){return e===void 0&&(e="$default_instance"),Q8.getInstance(e)},X8=function(e,t){cc(t).identityStore.editIdentity().setUserId(e).commit()},Z8=function(e,t){cc(t).identityStore.editIdentity().setDeviceId(e).commit()},J8=function(){function e(){this.name="identity",this.type="before",this.identityStore=cc().identityStore}return e.prototype.execute=function(t){return W(this,void 0,void 0,function(){var n;return q(this,function(r){return n=t.user_properties,n&&this.identityStore.editIdentity().updateUserProperties(n).commit(),[2,t]})})},e.prototype.setup=function(t){return W(this,void 0,void 0,function(){return q(this,function(n){return t.instanceName&&(this.identityStore=cc(t.instanceName).identityStore),[2]})})},e}(),KR=function(e,t){t===void 0&&(t=Date.now());var n=Date.now(),r=n-t;return r>e},YR=function(e,t,n){return t===void 0&&(t=""),n===void 0&&(n=10),[ag,t,e.substring(0,n)].filter(Boolean).join("_")},e7=function(e){return"".concat(ag.toLowerCase(),"_").concat(e.substring(0,6))},t7=function(){var e,t,n,r;if(typeof navigator>"u")return"";var i=navigator.userLanguage;return(r=(n=(t=(e=navigator.languages)===null||e===void 0?void 0:e[0])!==null&&t!==void 0?t:navigator.language)!==null&&n!==void 0?n:i)!==null&&r!==void 0?r:""},$p=function(){var e,t=et();if(!(!((e=t==null?void 0:t.location)===null||e===void 0)&&e.search))return{};var n=t.location.search.substring(1).split("&").filter(Boolean),r=n.reduce(function(i,s){var o=s.split("=",2),a=mk(o[0]),l=mk(o[1]);return l&&(i[a]=l),i},{});return r},mk=function(e){e===void 0&&(e="");try{return decodeURIComponent(e)}catch{return""}},n7=function(e){var t=new Error().stack||"";return t.split(`
77`).slice(2+e).map(function(n){return n.trim()})},bt=function(e){return function(){var t=Y({},e.config),n=t.loggerProvider,r=t.logLevel;return{logger:n,logLevel:r}}},r7=function(e,t){var n,r;t=t.replace(/\[(\w+)\]/g,".$1"),t=t.replace(/^\./,"");try{for(var i=De(t.split(".")),s=i.next();!s.done;s=i.next()){var o=s.value;if(o in e)e=e[o];else return}}catch(a){n={error:a}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return e},_t=function(e,t){return function(){var n,r,i={};try{for(var s=De(t),o=s.next();!o.done;o=s.next()){var a=o.value;i[a]=r7(e,a)}}catch(l){n={error:l}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return i}},Ze=function(e,t,n,r,i){return i===void 0&&(i=null),function(){for(var s=[],o=0;o<arguments.length;o++)s[o]=arguments[o];var a=n(),l=a.logger,u=a.logLevel;if(u&&u<jn.Debug||!u||!l)return e.apply(i,s);var d={type:"invoke public method",name:t,args:s,stacktrace:n7(1),time:{start:new Date().toISOString()},states:{}};r&&d.states&&(d.states.before=r());var f=e.apply(i,s);return f&&f.promise?f.promise.then(function(){r&&d.states&&(d.states.after=r()),d.time&&(d.time.end=new Date().toISOString()),l.debug(JSON.stringify(d,null,2))}):(r&&d.states&&(d.states.after=r()),d.time&&(d.time.end=new Date().toISOString()),l.debug(JSON.stringify(d,null,2))),f}},Yb=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return W(this,void 0,void 0,function(){return q(this,function(t){return[2,!0]})})},e.prototype.get=function(t){return W(this,void 0,void 0,function(){return q(this,function(n){return[2,this.memoryStorage.get(t)]})})},e.prototype.getRaw=function(t){return W(this,void 0,void 0,function(){var n;return q(this,function(r){switch(r.label){case 0:return[4,this.get(t)];case 1:return n=r.sent(),[2,n?JSON.stringify(n):void 0]}})})},e.prototype.set=function(t,n){return W(this,void 0,void 0,function(){return q(this,function(r){return this.memoryStorage.set(t,n),[2]})})},e.prototype.remove=function(t){return W(this,void 0,void 0,function(){return q(this,function(n){return this.memoryStorage.delete(t),[2]})})},e.prototype.reset=function(){return W(this,void 0,void 0,function(){return q(this,function(t){return this.memoryStorage.clear(),[2]})})},e}(),fx=function(){function e(t){this.options=Y({},t)}return e.prototype.isEnabled=function(){return W(this,void 0,void 0,function(){var t,n,r;return q(this,function(i){switch(i.label){case 0:if(!et())return[2,!1];e.testValue=String(Date.now()),t=new e(this.options),n="AMP_TEST",i.label=1;case 1:return i.trys.push([1,4,5,7]),[4,t.set(n,e.testValue)];case 2:return i.sent(),[4,t.get(n)];case 3:return r=i.sent(),[2,r===e.testValue];case 4:return i.sent(),[2,!1];case 5:return[4,t.remove(n)];case 6:return i.sent(),[7];case 7:return[2]}})})},e.prototype.get=function(t){var n;return W(this,void 0,void 0,function(){var r,i;return q(this,function(s){switch(s.label){case 0:return[4,this.getRaw(t)];case 1:if(r=s.sent(),!r)return[2,void 0];try{return i=(n=i7(r))!==null&&n!==void 0?n:s7(r),i===void 0?(console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(t,", value: ").concat(r)),[2,void 0]):[2,JSON.parse(i)]}catch{return console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(t,", value: ").concat(r)),[2,void 0]}return[2]}})})},e.prototype.getRaw=function(t){var n,r;return W(this,void 0,void 0,function(){var i,s,o;return q(this,function(a){return i=et(),s=(r=(n=i==null?void 0:i.document)===null||n===void 0?void 0:n.cookie.split("; "))!==null&&r!==void 0?r:[],o=s.find(function(l){return l.indexOf(t+"=")===0}),o?[2,o.substring(t.length+1)]:[2,void 0]})})},e.prototype.set=function(t,n){var r;return W(this,void 0,void 0,function(){var i,s,o,a,l,u,d;return q(this,function(f){try{i=(r=this.options.expirationDays)!==null&&r!==void 0?r:0,s=n!==null?i:-1,o=void 0,s&&(a=new Date,a.setTime(a.getTime()+s*24*60*60*1e3),o=a),l="".concat(t,"=").concat(btoa(encodeURIComponent(JSON.stringify(n)))),o&&(l+="; expires=".concat(o.toUTCString())),l+="; path=/",this.options.domain&&(l+="; domain=".concat(this.options.domain)),this.options.secure&&(l+="; Secure"),this.options.sameSite&&(l+="; SameSite=".concat(this.options.sameSite)),u=et(),u&&(u.document.cookie=l)}catch(h){d=h instanceof Error?h.message:String(h),console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(t,". Error: ").concat(d))}return[2]})})},e.prototype.remove=function(t){return W(this,void 0,void 0,function(){return q(this,function(n){switch(n.label){case 0:return[4,this.set(t,null)];case 1:return n.sent(),[2]}})})},e.prototype.reset=function(){return W(this,void 0,void 0,function(){return q(this,function(t){return[2]})})},e}(),i7=function(e){try{return decodeURIComponent(atob(e))}catch{return}},s7=function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch{return}},o7=function(e,t,n){return n===void 0&&(n=10),[ag,t,e.substring(0,n)].filter(
77Boolean).join("_")},hf=function(){function e(){}return e.prototype.send=function(t,n){return Promise.resolve(null)},e.prototype.buildResponse=function(t){var n,r,i,s,o,a,l,u,d,f,h,p,g,v,w,y,x,b,_,S,E,k;if(typeof t!="object")return null;var C=t.code||0,P=this.buildStatus(C);switch(P){case Et.Success:return{status:P,statusCode:C,body:{eventsIngested:(n=t.events_ingested)!==null&&n!==void 0?n:0,payloadSizeBytes:(r=t.payload_size_bytes)!==null&&r!==void 0?r:0,serverUploadTime:(i=t.server_upload_time)!==null&&i!==void 0?i:0}};case Et.Invalid:return{status:P,statusCode:C,body:{error:(s=t.error)!==null&&s!==void 0?s:"",missingField:(o=t.missing_field)!==null&&o!==void 0?o:"",eventsWithInvalidFields:(a=t.events_with_invalid_fields)!==null&&a!==void 0?a:{},eventsWithMissingFields:(l=t.events_with_missing_fields)!==null&&l!==void 0?l:{},eventsWithInvalidIdLengths:(u=t.events_with_invalid_id_lengths)!==null&&u!==void 0?u:{},epsThreshold:(d=t.eps_threshold)!==null&&d!==void 0?d:0,exceededDailyQuotaDevices:(f=t.exceeded_daily_quota_devices)!==null&&f!==void 0?f:{},silencedDevices:(h=t.silenced_devices)!==null&&h!==void 0?h:[],silencedEvents:(p=t.silenced_events)!==null&&p!==void 0?p:[],throttledDevices:(g=t.throttled_devices)!==null&&g!==void 0?g:{},throttledEvents:(v=t.throttled_events)!==null&&v!==void 0?v:[]}};case Et.PayloadTooLarge:return{status:P,statusCode:C,body:{error:(w=t.error)!==null&&w!==void 0?w:""}};case Et.RateLimit:return{status:P,statusCode:C,body:{error:(y=t.error)!==null&&y!==void 0?y:"",epsThreshold:(x=t.eps_threshold)!==null&&x!==void 0?x:0,throttledDevices:(b=t.throttled_devices)!==null&&b!==void 0?b:{},throttledUsers:(_=t.throttled_users)!==null&&_!==void 0?_:{},exceededDailyQuotaDevices:(S=t.exceeded_daily_quota_devices)!==null&&S!==void 0?S:{},exceededDailyQuotaUsers:(E=t.exceeded_daily_quota_users)!==null&&E!==void 0?E:{},throttledEvents:(k=t.throttled_events)!==null&&k!==void 0?k:[]}};case Et.Timeout:default:return{status:P,statusCode:C}}},e.prototype.buildStatus=function(t){return t>=200&&t<300?Et.Success:t===429?Et.RateLimit:t===413?Et.PayloadTooLarge:t===408?Et.Timeout:t>=400&&t<500?Et.Invalid:t>=500?Et.Failed:Et.Unknown},e}(),QR=function(e){Xt(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.send=function(n,r){return W(this,void 0,void 0,function(){var i,s,o;return q(this,function(a){switch(a.label){case 0:if(typeof fetch>"u")throw new Error("FetchTransport is not supported");return i={headers:{"Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify(r),method:"POST"},[4,fetch(n,i)];case 1:return s=a.sent(),[4,s.text()];case 2:o=a.sent();try{return[2,this.buildResponse(JSON.parse(o))]}catch{return[2,this.buildResponse({code:s.status})]}return[2]}})})},t}(hf),bd;(function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"})(bd||(bd={}));var a7=null,l7=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],c7="data-amp-track-",u7=["div","span","h1","h2","h3","h4","h5","h6"],XR=100,d7=function(){function e(t){this.request=t}return Object.defineProperty(e.prototype,"headers",{get:function(){if(this._headers)return this._headers;var t=this.request.headers;if(Array.isArray(t)){var n=t;this._headers=n.reduce(function(s,o){var a=Te(o,2),l=a[0],u=a[1];return s[l]=u,s},{})}else if(t instanceof Headers){var r=t,i={};r.forEach(function(s,o){i[o]=s}),this._headers=i}else typeof t=="object"&&(this._headers=t);return this._headers},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bodySize",{get:function(){if(typeof this._bodySize=="number")return this._bodySize;var t=et();if(t!=null&&t.TextEncoder){var n=this.request.body;return this._bodySize=ZR(n,XR),this._bodySize}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"method",{get:function(){return this.request.method},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return typeof this.request.body=="string"?this.request.body:null},enumerable:!1,configurable:!0}),e}(),f7=function(){function e(t){this.body=t}return Object.defineProperty(e.prototype,"bodySize",{get:function(){return ZR(this.body,XR)}
77,enumerable:!1,configurable:!0}),e}();function ZR(e,t){var n,r,i,s=et(),o=s==null?void 0:s.TextEncoder;if(o){var a;if(typeof e=="string")a=e,i=new o().encode(a).length;else if(e instanceof Blob)a=e,i=a.size;else if(e instanceof URLSearchParams)a=e,i=new o().encode(a.toString()).length;else if(ArrayBuffer.isView(e))a=e,i=a.byteLength;else if(e instanceof ArrayBuffer)a=e,i=a.byteLength;else if(e instanceof FormData){var l=e,u=0,d=0;try{for(var f=De(l.entries()),h=f.next();!h.done;h=f.next()){var p=Te(h.value,2),g=p[0],v=p[1];if(u+=g.length,typeof v=="string")u+=new o().encode(v).length;else if(v instanceof Blob)u+=v.size;else return;if(++d>=t)return}}catch(w){n={error:w}}finally{try{h&&!h.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}i=u}else if(e instanceof ReadableStream){a=e;return}return i}}var h7=function(){function e(t){this.response=t}return Object.defineProperty(e.prototype,"headers",{get:function(){var t;if(this._headers)return this._headers;if(this.response.headers instanceof Headers){var n=this.response.headers,r={};return(t=n==null?void 0:n.forEach)===null||t===void 0||t.call(n,function(i,s){r[s]=i}),this._headers=r,r}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bodySize",{get:function(){var t,n;if(this._bodySize!==void 0)return this._bodySize;var r=(n=(t=this.response.headers)===null||t===void 0?void 0:t.get)===null||n===void 0?void 0:n.call(t,"content-length"),i=r?parseInt(r,10):void 0;return this._bodySize=i,i},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.response.status},enumerable:!1,configurable:!0}),e}(),p7=function(){function e(t,n,r){this.statusCode=t,this.headersString=n,this.size=r}return Object.defineProperty(e.prototype,"bodySize",{get:function(){return this.size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.statusCode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"headers",{get:function(){var t,n;if(this.headersString){var r={},i=this.headersString.split(`\r
78`);try{for(var s=De(i),o=s.next();!o.done;o=s.next()){var a=o.value,l=Te(a.split(": "),2),u=l[0],d=l[1];u&&d&&(r[u]=d)}}catch(f){t={error:f}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return r}},enumerable:!1,configurable:!0}),e}(),m7=function(){function e(t,n,r,i,s,o,a,l,u,d,f){a===void 0&&(a=0),this.type=t,this.method=n,this.timestamp=r,this.startTime=i,this.url=s,this.requestWrapper=o,this.status=a,this.duration=l,this.responseWrapper=u,this.error=d,this.endTime=f}return e.prototype.toSerializable=function(){var t,n,r,i,s={type:this.type,method:this.method,url:this.url,timestamp:this.timestamp,status:this.status,duration:this.duration,error:this.error,startTime:this.startTime,endTime:this.endTime,requestHeaders:(t=this.requestWrapper)===null||t===void 0?void 0:t.headers,requestBodySize:(n=this.requestWrapper)===null||n===void 0?void 0:n.bodySize,responseHeaders:(r=this.responseWrapper)===null||r===void 0?void 0:r.headers,responseBodySize:(i=this.responseWrapper)===null||i===void 0?void 0:i.bodySize};return Object.fromEntries(Object.entries(s).filter(function(o){var a=Te(o,2);a[0];var l=a[1];return l!==void 0}))},e}();function g7(e){return typeof e=="object"&&e!==null&&"url"in e&&"method"in e}var v7=function(){function e(t,n){n===void 0&&(n=Ua()),this.callback=t,this.id=n}return e}(),y7=function(){function e(t){this.eventCallbacks=new Map,this.isObserving=!1,this.logger=t;var n=et();e.isSupported()&&(this.globalScope=n)}return e.isSupported=function(){var t=et();return!!t&&!!t.fetch},e.prototype.subscribe=function(t,n){var r,i,s,o,a,l,u;if(this.logger||(this.logger=n),this.eventCallbacks.set(t.id,t),!this.isObserving){var d=(s=(i=(r=this.globalScope)===null||r===void 0?void 0:r.XMLHttpRequest)===null||i===void 0?void 0:i.prototype)===null||s===void 0?void 0:s.open,f=(l=(a=(o=this.globalScope)===null||o===void 0?void 0:o.XMLHttpRequest)===null||a===void 0?void 0:a.prototype)===null||l===void 0?void 0:l.send;d&&f&&this.observeXhr(d,f);var h=(u=this.globalScope)===null||u===void 0?void 0:u.fetch;h&&this.observeFetch(h),this.isObserving=!0}},e.prototype.unsubscribe=function(t){this.eventCallbacks.delete(t.id)},e.prototype.triggerEventCallbacks=function(t){var n=this;this.eventCallbacks.forEach(function(r){var i;try{r.callback(t)}catch(s){(i=n.logger)===null||i===void 0||i.debug("an unexpected error occurred while triggering event callbacks",s)}})},e.prototype.handleNetworkRequestEvent=function(t,n,r,i,s,o,a){var l;if(!(o===void 0||a===void 0)){var u,d="GET";g7(n)?(u=n.url,d=n.method):u=(l=n==null?void 0:n.toString)===null||l===void 0?void 0:l.call(n),d=(r==null?void 0:r.method)||d;var f,h;i&&(f=i.status),s&&(h={name:s.name||"UnknownError",message:s.message||"An unknown error occurred"},f=0);var p=Math.floor(performance.now()-a),g=Math.floor(o+p),v=new m7(t,d,o,o,u,r,f,p,i,h,g);this.triggerEventCallbacks(v)}},e.prototype.getTimestamps=function(){var t,n;return{startTime:(t=Date.now)===null||t===void 0?void 0:t.call(Date),durationStart:(n=performance==null?void 0:performance.now)===null||n===void 0?void 0:n.call(performance)}},e.prototype.observeFetch=function(t){var n=this;!this.globalScope||!t||(this.globalScope.fetch=function(r,i){return W(n,void 0,void 0,function(){var s,o,a,l,u,d;return q(this,function(f){switch(f.label){case 0:try{s=this.getTimestamps()}catch(h){(u=this.logger)===null||u===void 0||u.debug("an unexpected error occurred while retrieving timestamps",h)}f.label=1;case 1:return f.trys.push([1,3,,4]),[4,t(r,i)];case 2:return o=f.sent(),[3,4];case 3:return l=f.sent(),a=l,[3,4];case 4:try{this.handleNetworkRequestEvent("fetch",r,i?new d7(i):void 0,o?new h7(o):void 0,a,s==null?void 0:s.startTime,s==null?void 0:s.durationStart)}catch(h){(d=this.logger)===null||d===void 0||d.debug("an unexpected error occurred while handling fetch",h)}if(o)return[2,o];throw a}})})})},e.prototype.observeXhr=function(t,n){if(!(!this.globalScope||!t||!n)){var r=this.globalScope.XMLHttpRequest.prototype,i=this;r.open=function(){for(var s,o,a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];var u=this,d=Te(a,2),f=d[0],h=d[1];try{u.$$AmplitudeAnalyticsEvent=Y({method:f,url:(s=h==null?void 0:h.toString)===null||s===void 0?void 0:s.call(h)},i.getTimestamps())}catch(p){(o=i.logger)===null||o===void 0||o.debug("an unexpected error occurred while calling xhr open",p)}return t.apply(u,a)},r.send=function(){for(var s=[],o=0;o<arguments.length;o++)s[o]=arguments[o];var a=this,l=s[0],u=a.$$AmplitudeAnalyticsEvent;return a.addEventListener("loadend",function(){var d;try{var f=a.getAllResponseHeaders(),h=a.getResponseHeader("content-length"),p=new p7(a.status,f,h?parseInt(h,10):void 0),g=new f7(l);u.status=a.status,i.handleNetworkRequestEvent("xhr",{url:u.url,method:u.method},g,p,void 0,u.startTime,u.durationStart)}catch(v){(d=i.logger)===null||d===void 0||d.debug("an unexpected error occurred while handling xhr send",v)}}),n.apply(a,s)}}},e}(),gk=new y7,pf=function(e,t){return typeof e=="boolean"?e:(e==null?void 0:e[t])!==!1},JR=function(e){return pf(e,"attribution")},x7=function(e){return pf(e,"fileDownloads")},w7=function(e){return pf(e,"formInteractions")},eI=function(e){return pf(e,"pageViews")},vk=function(e){return pf(e,"sessions")},tI=function(e){return typeof e=="object"&&(e.networkTracking===!0||typeof e.networkTracking=="object")},nI=function(e){return typeof e=="boolean"?e:typeof e=="object"&&(e.elementInteractions===!0||typeof e.elementInteractions=="object")},b7=function(e){if(nI(e.autocapture)&&typeof e.autocapture=="object"&&typeof e.autocapture.elementInteractions=="object")return e.autocapture.elementInteractions},_7=function(e){if(tI(e.autocapture)){if(typeof e.autocapture=="object"&&typeof e.autocapture.
78networkTracking=="object")return e.autocapture.networkTracking;if(e.networkTrackingOptions)return e.networkTrackingOptions}},S7=function(e){var t=function(){return!1},n=void 0,r,i=e.pageCounter,s=eI(e.defaultTracking);return s&&(t=void 0,r=void 0,e.defaultTracking&&typeof e.defaultTracking=="object"&&e.defaultTracking.pageViews&&typeof e.defaultTracking.pageViews=="object"&&("trackOn"in e.defaultTracking.pageViews&&(t=e.defaultTracking.pageViews.trackOn),"trackHistoryChanges"in e.defaultTracking.pageViews&&(n=e.defaultTracking.pageViews.trackHistoryChanges),"eventType"in e.defaultTracking.pageViews&&e.defaultTracking.pageViews.eventType&&(r=e.defaultTracking.pageViews.eventType))),{trackOn:t,trackHistoryChanges:n,eventType:r,pageCounter:i}},E7=function(e){return JR(e.defaultTracking)&&e.defaultTracking&&typeof e.defaultTracking=="object"&&e.defaultTracking.attribution&&typeof e.defaultTracking.attribution=="object"?Y({},e.defaultTracking.attribution):{}},Uv=function(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.name,s=r.args,o=r.resolve,a=e&&e[i];if(typeof a=="function"){var l=a.apply(e,s);typeof o=="function"&&o(l==null?void 0:l.promise)}}return e},Vv=function(e){var t=e;return t&&t._q!==void 0},rI="2.18.0",k7="amplitude-ts",C7="Web",T7="$remote",j7=function(){function e(){this.name="@amplitude/plugin-context-browser",this.type="before",this.library="".concat(k7,"/").concat(rI),typeof navigator<"u"&&(this.userAgent=navigator.userAgent)}return e.prototype.setup=function(t){return this.config=t,Promise.resolve(void 0)},e.prototype.execute=function(t){var n,r;return W(this,void 0,void 0,function(){var i,s,o,a;return q(this,function(l){return i=new Date().getTime(),s=(n=this.config.lastEventId)!==null&&n!==void 0?n:-1,o=(r=t.event_id)!==null&&r!==void 0?r:s+1,this.config.lastEventId=o,t.time||(this.config.lastEventTime=i),a=Y(Y(Y(Y(Y(Y(Y(Y({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:i},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:C7}),this.config.trackingOptions.language&&{language:t7()}),this.config.trackingOptions.ipAddress&&{ip:T7}),{insert_id:Ua(),partner_id:this.config.partnerId,plan:this.config.plan}),this.config.ingestionMetadata&&{ingestion_metadata:{source_name:this.config.ingestionMetadata.sourceName,source_version:this.config.ingestionMetadata.sourceVersion}}),t),{event_id:o,library:this.library,user_agent:this.userAgent}),[2,a]})})},e}(),iI=function(){function e(t){this.storage=t}return e.prototype.isEnabled=function(){return W(this,void 0,void 0,function(){var t,n,r,i;return q(this,function(s){switch(s.label){case 0:if(!this.storage)return[2,!1];t=String(Date.now()),n=new e(this.storage),r="AMP_TEST",s.label=1;case 1:return s.trys.push([1,4,5,7]),[4,n.set(r,t)];case 2:return s.sent(),[4,n.get(r)];case 3:return i=s.sent(),[2,i===t];case 4:return s.sent(),[2,!1];case 5:return[4,n.remove(r)];case 6:return s.sent(),[7];case 7:return[2]}})})},e.prototype.get=function(t){return W(this,void 0,void 0,function(){var n;return q(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getRaw(t)];case 1:return n=r.sent(),n?[2,JSON.parse(n)]:[2,void 0];case 2:return r.sent(),console.error("[Amplitude] Error: Could not get value from storage"),[2,void 0];case 3:return[2]}})})},e.prototype.getRaw=function(t){var n;return W(this,void 0,void 0,function(){return q(this,function(r){return[2,((n=this.storage)===null||n===void 0?void 0:n.getItem(t))||void 0]})})},e.prototype.set=function(t,n){var r;return W(this,void 0,void 0,function(){return q(this,function(i){try{(r=this.storage)===null||r===void 0||r.setItem(t,JSON.stringify(n))}catch{}return[2]})})},e.prototype.remove=function(t){var n;return W(this,void 0,void 0,function(){return q(this,function(r){try{(n=this.storage)===null||n===void 0||n.removeItem(t)}catch{}return[2]})})},e.prototype.reset=function(){var t;return W(this,void 0,void 0,function(){return q(this,function(n){try{(t=this.storage)===null||t===void 0||t.clear()}catch{}return[2]})})},e}(),ih=1e3,sI=function(e){Xt(t,e);function t(n){var r=this,i,s,o;try{o=(i=et())===null||i===void 0?void 0:i.localStorage}catch(a){(s=n==null?void 0:n.loggerProvider)===null||s===void 0||s.debug("Failed to access localStorage. error=".concat(JSON.stringify(a))),o=void 0}return r=e.call(this,o)||this,r.loggerProvider=n==null?void 0:n.loggerProvider,r}return t.prototype.set=function(n,r){var i;return W(this,void 0,void 0,function(){var s;return q(this,function(o){switch(o.label){case 0:return Array.isArray(r)&&r.length>ih?(s=r.length-ih,[4,e.prototype.set.call(this,n,r.slice(0,ih))]):[3,2];case 1:return o.sent(),(i=this.loggerProvider)===null||i===void 0||i.error("Failed to save ".concat(s," events because the queue length exceeded ").concat(ih,".")),[3,4];case 2:return[4,e.prototype.set.call(this,n,r)];case 3:o.sent(),o.label=4;case 4:return[2]}})})},t}(iI),P7=function(e){Xt(t,e);function t(){var n;return e.call(this,(n=et())===null||n===void 0?void 0:n.sessionStorage)||this}return t}(iI),N7=function(e){Xt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.state={done:4},n}return t.prototype.send=function(n,r){return W(this,void 0,void 0,function(){var i=this;return q(this,function(s){return[2,new Promise(function(o,a){typeof XMLHttpRequest>"u"&&a(new Error("XHRTransport is not supported."));var l=new XMLHttpRequest;l.open("POST",n,!0),l.onreadystatechange=function(){if(l.readyState===i.state.done){var u=l.responseText;try{o(i.buildResponse(JSON.parse(u)))}catch{o(i.buildResponse({code:l.status}))}}},l.setRequestHeader("Content-Type","application/json"),l.setRequestHeader("Accept","*/*"),l.send(JSON.stringify(r))})]})})},t}(hf),R7=function(e){Xt(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.send=function(n,r){return W(this,void 0,void 0,function(){var i=this;return q(this,function(s){return[2,new Promise(function(o,a){var l=et();if(!(l!=null&&l.navigator.sendBeacon))throw new Error("SendBeaconTransport is not supported");try{var u=JSON.stringify(r),d=l.navigator.sendBeacon(n,JSON.stringify(r));return o(d?i.buildResponse({code:200,events_ingested:r.events.length,payload_size_bytes:u.length,server_upload_time:Date.now()}):i.buildResponse({code:500}))}catch(f){a(f)}})]})})},t}(hf),I7=function(e,t,n){return n===void 0&&(n=!0),W(void 0,void 0,void 0,function(){var r,i,s,o,a,l,u,d,f;return q(this,function(h){switch(h.label){case 0:return r=e7(e),[4,t.getRaw(r)];case 1:return i=h.sent(),i?n?[4,t.remove(r)]:[3,3]:[2,{optOut:!1}];case 2:h.sent(),h.label=3;
78case 3:return s=Te(i.split("."),6),o=s[0],a=s[1],l=s[2],u=s[3],d=s[4],f=s[5],[2,{deviceId:o,userId:A7(a),sessionId:zv(u),lastEventId:zv(f),lastEventTime:zv(d),optOut:!!l}]}})})},zv=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},A7=function(e){if(!(!atob||!escape||!e))try{return decodeURIComponent(escape(atob(e)))}catch{return}},ci="[Amplitude]",yk="".concat(ci," Form Started"),O7="".concat(ci," Form Submitted"),D7="".concat(ci," File Downloaded"),xk="session_start",wk="session_end",M7="".concat(ci," File Extension"),L7="".concat(ci," File Name"),F7="".concat(ci," Link ID"),$7="".concat(ci," Link Text"),U7="".concat(ci," Link URL"),Bv="".concat(ci," Form ID"),Wv="".concat(ci," Form Name"),qv="".concat(ci," Form Destination"),Up="cookie",V7="US",z7=function(e){Xt(t,e);function t(n,r,i,s,o,a,l,u,d,f,h,p,g,v,w,y,x,b,_,S,E,k,C,P,T,N,I,O,j,A,V,$,R,L,H){i===void 0&&(i=new Yb),s===void 0&&(s={domain:"",expiration:365,sameSite:"Lax",secure:!1,upgrade:!0}),u===void 0&&(u=1e3),d===void 0&&(d=5),f===void 0&&(f=30),h===void 0&&(h=Up),y===void 0&&(y=new wd),x===void 0&&(x=jn.Warn),_===void 0&&(_=!1),S===void 0&&(S=!1),C===void 0&&(C=""),P===void 0&&(P=V7),N===void 0&&(N=30*60*1e3),I===void 0&&(I=new sI({loggerProvider:y})),O===void 0&&(O={ipAddress:!0,language:!0,platform:!0}),j===void 0&&(j="fetch"),A===void 0&&(A=!1),V===void 0&&(V=!0);var z=e.call(this,{apiKey:n,storageProvider:I,transportProvider:oI(j)})||this;return z.apiKey=n,z.appVersion=r,z.cookieOptions=s,z.defaultTracking=o,z.autocapture=a,z.flushIntervalMillis=u,z.flushMaxRetries=d,z.flushQueueSize=f,z.identityStorage=h,z.ingestionMetadata=p,z.instanceName=g,z.loggerProvider=y,z.logLevel=x,z.minIdLength=b,z.offline=_,z.partnerId=E,z.plan=k,z.serverUrl=C,z.serverZone=P,z.sessionTimeout=N,z.storageProvider=I,z.trackingOptions=O,z.transport=j,z.useBatch=A,z.fetchRemoteConfig=V,z.networkTrackingOptions=H,z.version=rI,z._optOut=!1,z._cookieStorage=i,z.deviceId=l,z.lastEventId=v,z.lastEventTime=w,z.optOut=S,z.sessionId=T,z.pageCounter=R,z.userId=$,z.debugLogsEnabled=L,z.loggerProvider.enable(L?jn.Debug:z.logLevel),z.networkTrackingOptions=H,z}return Object.defineProperty(t.prototype,"cookieStorage",{get:function(){return this._cookieStorage},set:function(n){this._cookieStorage!==n&&(this._cookieStorage=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deviceId",{get:function(){return this._deviceId},set:function(n){this._deviceId!==n&&(this._deviceId=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userId",{get:function(){return this._userId},set:function(n){this._userId!==n&&(this._userId=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this._sessionId},set:function(n){this._sessionId!==n&&(this._sessionId=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(n){this._optOut!==n&&(this._optOut=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventTime",{get:function(){return this._lastEventTime},set:function(n){this._lastEventTime!==n&&(this._lastEventTime=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventId",{get:function(){return this._lastEventId},set:function(n){this._lastEventId!==n&&(this._lastEventId=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageCounter",{get:function(){return this._pageCounter},set:function(n){this._pageCounter!==n&&(this._pageCounter=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"debugLogsEnabled",{set:function(n){this._debugLogsEnabled!==n&&(this._debugLogsEnabled=n,this.updateStorage())},enumerable:!1,configurable:!0}),t.prototype.updateStorage=function(){var n={deviceId:this._deviceId,userId:this._userId,sessionId:this._sessionId,optOut:this._optOut,lastEventTime:this._lastEventTime,lastEventId:this._lastEventId,pageCounter:this._pageCounter,debugLogsEnabled:this._debugLogsEnabled};this.cookieStorage.set(YR(this.apiKey),n)},t}(qR),B7=function(e,t,n){return t===void 0&&(t={}),W(void 0,void 0,void 0,function(){var r,i,s,o,a,l,u,d,f,h,p,g,v,w,y,x,b,_,S,E,k,C,P,T,N,I,O,j,A,V,$,R,L,H,z,Q,de,ne,ye,he,Pe,Ue,Ae;return q(this,function(Fe){switch(Fe.label){case 0:return r=t.identityStorage||Up,S={},r===Up?[3,1]:(s="",[3,5]);case 1:return(k=(E=t.cookieOptions)===null||E===void 0?void 0:E.domain)!==null&&k!==void 0?(o=k,[3,4]):[3,2];case 2:return[4,q7()];case 3:o=Fe.sent(),Fe.label=4;case 4:s=o,Fe.label=5;case 5:return i=Y.apply(void 0,[(S.domain=s,S.expiration=365,S.sameSite="Lax",S.secure=!1,S.upgrade=!0,S),t.cookieOptions]),a=W7(t.identityStorage,i),[4,I7(e,a,(P=(C=t.cookieOptions)===null||C===void 0?void 0:C.upgrade)!==null&&P!==void 0?P:!0)];case 6:return l=Fe.sent(),[4,a.get(YR(e))];case 7:return u=Fe.sent(),d=$p(),f=(j=(O=(I=(N=(T=t.deviceId)!==null&&T!==void 0?T:d.ampDeviceId)!==null&&N!==void 0?N:d.deviceId)!==null&&I!==void 0?I:u==null?void 0:u.deviceId)!==null&&O!==void 0?O:l.deviceId)!==null&&j!==void 0?j:Ua(),h=(A=u==null?void 0:u.lastEventId)!==null&&A!==void 0?A:l.lastEventId,p=(V=u==null?void 0:u.lastEventTime)!==null&&V!==void 0?V:l.lastEventTime,g=(R=($=t.optOut)!==null&&$!==void 0?$:u==null?void 0:u.optOut)!==null&&R!==void 0?R:l.optOut,v=(L=u==null?void 0:u.sessionId)!==null&&L!==void 0?L:l.sessionId,w=(z=(H=t.userId)!==null&&H!==void 0?H:u==null?void 0:u.userId)!==null&&z!==void 0?z:l.userId,n.previousSessionDeviceId=(Q=u==null?void 0:u.deviceId)!==null&&Q!==void 0?Q:l.deviceId,n.previousSessionUserId=(de=u==null?void 0:u.userId)!==null&&de!==void 0?de:l.userId,y={ipAddress:(ye=(ne=t.trackingOptions)===null||ne===void 0?void 0:ne.ipAddress)!==null&&ye!==void 0?ye:!0,language:(Pe=(he=t.trackingOptions)===null||he===void 0?void 0:he.language)!==null&&Pe!==void 0?Pe:!0,platform:(Ae=(Ue=t.trackingOptions)===null||Ue===void 0?void 0:Ue.platform)!==null&&Ae!==void 0?Ae:!0},x=u==null?void 0:u.pageCounter,b=u==null?void 0:u.debugLogsEnabled,t.autocapture!==void 0&&(t.defaultTracking=t.autocapture),_=new z7(e,t.appVersion,a,i,t.defaultTracking,t.autocapture,f,t.flushIntervalMillis,t.flushMaxRetries,t.flushQueueSize,r,t.ingestionMetadata,t.instanceName,h,p,t.loggerProvider,t.logLevel,t.minIdLength,t.offline,g,t.partnerId,t.plan,t.serverUrl,t.serverZone,v,t.sessionTimeout,t.storageProvider,y,t.transport,t.useBatch,t.fetchRemoteConfig,w,x,b,t.networkTrackingOptions),[4,_.storageProvider.isEnabled()];case 8:return Fe.sent()||(_.loggerProvider.warn("Storage provider ".concat(_.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),_.storageProvider=new Yb),[2,_]}})})},W7=function(e,t){switch(e===void 0&&(e=Up),t===void 0&&(t={}),e){case"localStorage":return new sI;case"sessionStorage":return new P7;case"none":return new Yb;case"cookie":default:return new fx(Y(Y({},t),{expirationDays:t.expiration}))}},oI=function(e){return e==="xhr"?new N7:e==="beacon"?new R7:new QR},q7=function(e){return W(void 0,void 0,void 0,function(){var t,n,r,i,s,s,o,a,l,u;return q(this,function(d){switch(d.label){case 0:return[4,new fx().isEnabled()];case 1:if(!d.sent()||typeof location>"u"||!location.hostname)return[2,""];for(t=location.hostname,n=t.split("."),r=[],i="AMP_TLDTEST",s=n.length-2;s>=0;--s)r.push(n.slice(s).join("."));s=0,d.label=2;case 2:return s<r.length?(o=r[s],a={domain:"."+o},l=new fx(a),[4,l.set(i,1)]):[3,7];case 3:return d.sent(),[4,l.get(i)];case 4:return u=d.sent(),u?[4,l.remove(i)]:[3,6];case 5:return d.sent(),[2,"."+o];case 6:return s++,[3,2];case 7:return[2,""]}})})},aI=function(){var e="ampIntegrationContext";if(typeof globalThis<"u"&&typeof globalThis[e]<"u")return globalThis[e];if(typeof globalThis<"u")return globalThis;if(typeof window<"u")return window;if(typeof self<"u")return self;if(typeof global<"u")return global},bk=function(){var e,t=aI();if(!(!((e=t==null?void 0:t.location)===null||e===void 0)&&e.search))return{};
78var n=t.location.search.substring(1).split("&").filter(Boolean),r=n.reduce(function(i,s){var o=s.split("=",2),a=_k(o[0]),l=_k(o[1]);return l&&(i[a]=l),i},{});return r},_k=function(e){e===void 0&&(e="");try{return decodeURIComponent(e)}catch{return""}},H7="utm_campaign",G7="utm_content",K7="utm_id",Y7="utm_medium",Q7="utm_source",X7="utm_term",Sk="dclid",Ek="fbclid",kk="gbraid",Ck="gclid",Tk="ko_click_id",jk="li_fat_id",Pk="msclkid",Nk="rtd_cid",Rk="ttclid",Ik="twclid",Ak="wbraid",lI={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rtd_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},Z7=function(){function e(){}return e.prototype.parse=function(){return W(this,void 0,void 0,function(){return q(this,function(t){return[2,Y(Y(Y(Y({},lI),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},e.prototype.getUtmParam=function(){var t=bk(),n=t[H7],r=t[G7],i=t[K7],s=t[Y7],o=t[Q7],a=t[X7];return{utm_campaign:n,utm_content:r,utm_id:i,utm_medium:s,utm_source:o,utm_term:a}},e.prototype.getReferrer=function(){var t,n,r={referrer:void 0,referring_domain:void 0};try{r.referrer=document.referrer||void 0,r.referring_domain=(n=(t=r.referrer)===null||t===void 0?void 0:t.split("/")[2])!==null&&n!==void 0?n:void 0}catch{}return r},e.prototype.getClickIds=function(){var t,n=bk();return t={},t[Sk]=n[Sk],t[Ek]=n[Ek],t[kk]=n[kk],t[Ck]=n[Ck],t[Tk]=n[Tk],t[jk]=n[jk],t[Pk]=n[Pk],t[Nk]=n[Nk],t[Rk]=n[Rk],t[Ik]=n[Ik],t[Ak]=n[Ak],t},e}(),Vp;(function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"})(Vp||(Vp={}));var Ok;(function(e){e.REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE_CURRENCY="$currency",e.REVENUE="$revenue"})(Ok||(Ok={}));var Dk;(function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"})(Dk||(Dk={}));var zp;(function(e){e.US="US",e.EU="EU"})(zp||(zp={}));var Bp;(function(e){e.Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.PayloadTooLarge="payload_too_large",e.Invalid="invalid",e.Failed="failed",e.Timeout="Timeout",e.SystemError="SystemError"})(Bp||(Bp={}));var J7=function(e){var t={};for(var n in e){var r=e[n];r&&(t[n]=r)}return t},eW="[Amplitude] Page Viewed",tW=function(e){e===void 0&&(e={});var t,n=aI(),r=void 0,i=!1,s,o=e.trackOn,a=e.trackHistoryChanges,l=e.eventType,u=l===void 0?eW:l,d=function(y){var x=y;try{x=decodeURI(y)}catch(b){r==null||r.error("Malformed URI sequence: ",b)}return x},f=function(){return W(void 0,void 0,void 0,function(){var y,x,b;return q(this,function(_){switch(_.label){case 0:return y=d(typeof location<"u"&&location.href||""),b={event_type:u},x=[{}],[4,nW()];case 1:return[2,(b.event_properties=Y.apply(void 0,[Y.apply(void 0,x.concat([_.sent()])),{"[Amplitude] Page Domain":typeof location<"u"&&location.hostname||"","[Amplitude] Page Location":y,"[Amplitude] Page Path":typeof location<"u"&&d(location.pathname)||"","[Amplitude] Page Title":typeof document<"u"&&document.title||"","[Amplitude] Page URL":y.split("?")[0]}]),b)]}})})},h=function(){return typeof o>"u"||typeof o=="function"&&o()},p=typeof location<"u"?location.href:null,g=function(){return W(void 0,void 0,void 0,function(){var y,x,b,_;return q(this,function(S){switch(S.label){case 0:return y=location.href,x=iW(a,y,p||"")&&h(),p=y,x?(r==null||r.log("Tracking page view event"),t!=null?[3,1]:[3,3]):[3,4];case 1:return _=(b=t).track,[4,f()];case 2:_.apply(b,[S.sent()]),S.label=3;case 3:S.label=4;case 4:return[2]}})})},v=function(){g()},w={name:"@amplitude/plugin-page-view-tracking-browser",type:"enrichment",setup:function(y,x){return W(void 0,void 0,void 0,function(){var b,_;return q(this,function(S){switch(S.label){case 0:return t=x,s=y,r=y.loggerProvider,r.log("Installing @amplitude/plugin-page-view-tracking-browser"),i=!0,n&&(n.addEventListener("popstate",v),n.history.pushState=new Proxy(n.history.pushState,{apply:function(E,k,C){var P=Te(C,3),T=P[0],N=P[1],I=P[2];E.apply(k,[T,N,I]),i&&g()}})),h()?(r.log("Tracking page view event"),_=(b=t).track,[4,f()]):[3,2];case 1:_.apply(b,[S.sent()]),S.label=2;case 2:return[2]}})})},execute:function(y){return W(void 0,void 0,void 0,function(){var x;return q(this,function(b){switch(b.label){case 0:return o==="attribution"&&rW(y)?(r==null||r.log("Enriching c
78ampaign event to page view event with campaign parameters"),[4,f()]):[3,2];case 1:x=b.sent(),y.event_type=x.event_type,y.event_properties=Y(Y({},y.event_properties),x.event_properties),b.label=2;case 2:return s&&y.event_type===u&&(s.pageCounter=s.pageCounter?s.pageCounter+1:1,y.event_properties=Y(Y({},y.event_properties),{"[Amplitude] Page Counter":s.pageCounter})),[2,y]}})})},teardown:function(){return W(void 0,void 0,void 0,function(){return q(this,function(y){return n&&(n.removeEventListener("popstate",v),i=!1),[2]})})}};return w},nW=function(){return W(void 0,void 0,void 0,function(){var e;return q(this,function(t){switch(t.label){case 0:return e=J7,[4,new Z7().parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}})})},rW=function(e){if(e.event_type==="$identify"&&e.user_properties){var t=e.user_properties,n=t[Vp.SET]||{},r=t[Vp.UNSET]||{},i=Ke(Ke([],Te(Object.keys(n)),!1),Te(Object.keys(r)),!1);return Object.keys(lI).every(function(s){return i.includes(s)})}return!1},iW=function(e,t,n){switch(e){case"pathOnly":{if(n=="")return!0;var r=new URL(t),i=new URL(n),s=r.origin+r.pathname,o=i.origin+i.pathname;return s!==o}default:return t!==n}},sW=function(){var e,t=[],n=function(u,d,f){u.addEventListener(d,f),t.push({element:u,type:d,handler:f})},r=function(){t.forEach(function(u){var d=u.element,f=u.type,h=u.handler;d==null||d.removeEventListener(f,h)}),t=[]},i="@amplitude/plugin-form-interaction-tracking-browser",s="enrichment",o=function(u,d){return W(void 0,void 0,void 0,function(){var f,h;return q(this,function(p){return f=function(){if(!d){u.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked.");return}if(!(typeof document>"u")){var g=function(w){var y=!1;n(w,"change",function(){var x,b=Mk(w);y||d.track(yk,(x={},x[Bv]=Xa(w.id),x[Wv]=Xa(w.name),x[qv]=b,x)),y=!0}),n(w,"submit",function(){var x,b,_=Mk(w);y||d.track(yk,(x={},x[Bv]=Xa(w.id),x[Wv]=Xa(w.name),x[qv]=_,x)),d.track(O7,(b={},b[Bv]=Xa(w.id),b[Wv]=Xa(w.name),b[qv]=_,b)),y=!1})},v=Array.from(document.getElementsByTagName("form"));v.forEach(g),typeof MutationObserver<"u"&&(e=new MutationObserver(function(w){w.forEach(function(y){y.addedNodes.forEach(function(x){x.nodeName==="FORM"&&g(x),"querySelectorAll"in x&&typeof x.querySelectorAll=="function"&&Array.from(x.querySelectorAll("form")).map(g)})})}),e.observe(document.body,{subtree:!0,childList:!0}))}},document.readyState==="complete"?f():(h=et(),h?h.addEventListener("load",f):u.loggerProvider.debug("Form interaction tracking is not installed because global is undefined.")),[2]})})},a=function(u){return W(void 0,void 0,void 0,function(){return q(this,function(d){return[2,u]})})},l=function(){return W(void 0,void 0,void 0,function(){return q(this,function(u){return e==null||e.disconnect(),r(),[2]})})};return{name:i,type:s,setup:o,execute:a,teardown:l}},Xa=function(e){if(typeof e=="string")return e},Mk=function(e){var t=e.getAttribute("action");try{t=new URL(encodeURI(t??""),window.location.href).href}catch{}return t},oW=function(){var e,t=[],n=function(u,d,f){u.addEventListener(d,f),t.push({element:u,type:d,handler:f})},r=function(){t.forEach(function(u){var d=u.element,f=u.type,h=u.handler;d==null||d.removeEventListener(f,h)}),t=[]},i="@amplitude/plugin-file-download-tracking-browser",s="enrichment",o=function(u,d){return W(void 0,void 0,void 0,function(){var f,h;return q(this,function(p){return f=function(){if(!d){u.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked.");return}if(!(typeof document>"u")){var g=function(y){var x;try{x=new URL(y.href,window.location.href)}catch{return}var b=v.exec(x.href),_=b==null?void 0:b[1];_&&n(y,"click",function(){var S;_&&d.track(D7,(S={},S[M7]=_,S[L7]=x.pathname,S[F7]=y.id,S[$7]=y.text,S[U7]=y.href,S))})},v=/\.(pdf|xlsx?|docx?|txt|rtf|csv|exe|key|pp(s|t|tx)|7z|pkg|rar|gz|zip|avi|mov|mp4|mpe?g|wmv|midi?|mp3|wav|wma)(\?.+)?$/,w=Array.from(document.getElementsByTagName("a"));w.forEach(g),typeof MutationObserver<"u"&&(e=new MutationObserver(function(y){y.forEac
78h(function(x){x.addedNodes.forEach(function(b){b.nodeName==="A"&&g(b),"querySelectorAll"in b&&typeof b.querySelectorAll=="function"&&Array.from(b.querySelectorAll("a")).map(g)})})}),e.observe(document.body,{subtree:!0,childList:!0}))}},document.readyState==="complete"?f():(h=et(),h?h.addEventListener("load",f):u.loggerProvider.debug("File download tracking is not installed because global is undefined.")),[2]})})},a=function(u){return W(void 0,void 0,void 0,function(){return q(this,function(d){return[2,u]})})},l=function(){return W(void 0,void 0,void 0,function(){return q(this,function(u){return e==null||e.disconnect(),r(),[2]})})};return{name:i,type:s,setup:o,execute:a,teardown:l}},Lk=!1,aW=function(e){if(!(Lk||e.defaultTracking!==void 0)){var t=`\`options.defaultTracking\` is set to undefined. This implicitly configures your Amplitude instance to track Page Views, Sessions, File Downloads, and Form Interactions. You can suppress this warning by explicitly setting a value to \`options.defaultTracking\`. The value must either be a boolean, to enable and disable all default events, or an object, for advanced configuration. For example:
79
80amplitude.init(<YOUR_API_KEY>, {
81  defaultTracking: true,
82});
83
84Visit https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events for more details.`;e.loggerProvider.warn(t),Lk=!0}},lW=function(){var e="@amplitude/plugin-network-checker-browser",t="before",n=et(),r=[],i=function(l,u){n!=null&&n.addEventListener&&(n==null||n.addEventListener(l,u),r.push({type:l,handler:u}))},s=function(){r.forEach(function(l){var u=l.type,d=l.handler;n==null||n.removeEventListener(u,d)}),r=[]},o=function(l,u){return W(void 0,void 0,void 0,function(){return q(this,function(d){return typeof navigator>"u"?(l.loggerProvider.debug("Network connectivity checker plugin is disabled because navigator is not available."),l.offline=!1,[2]):(l.offline=!navigator.onLine,i("online",function(){l.loggerProvider.debug("Network connectivity changed to online."),l.offline=!1,setTimeout(function(){u.flush()},l.flushIntervalMillis)}),i("offline",function(){l.loggerProvider.debug("Network connectivity changed to offline."),l.offline=!0}),[2])})})},a=function(){return W(void 0,void 0,void 0,function(){return q(this,function(l){return s(),[2]})})};return{name:e,type:t,setup:o,teardown:a}},cW="Network error occurred, remote config fetch failed",uW="Remote config successfully fetched",dW="Remote config fetch rejected due to exceeded retry count",Fk="Remote config fetch rejected due to timeout after 5 seconds",$k="Unexpected error occurred",fW="https://sr-client-cfg.amplitude.com/config",hW="https://sr-client-cfg.stag2.amplitude.com/config",pW="https://sr-client-cfg.eu.amplitude.com/config",mW=function(){function e(t){var n=t.localConfig,r=t.configKeys,i=this;this.retryTimeout=1e3,this.attempts=0,this.sessionTargetingMatch=!1,this.metrics={},this.getRemoteConfig=function(s,o,a){return W(i,void 0,void 0,function(){var l,u,d;return q(this,function(f){switch(f.label){case 0:return l=Date.now(),[4,this.fetchWithTimeout(a)];case 1:return u=f.sent(),u&&(d=u.configs&&u.configs[s],d)?(this.metrics.fetchTimeAPISuccess=Date.now()-l,[2,d[o]]):(this.metrics.fetchTimeAPIFail=Date.now()-l,[2,void 0])}})})},this.fetchWithTimeout=function(s){return W(i,void 0,void 0,function(){var o,a,l;return q(this,function(u){switch(u.label){case 0:return o=new AbortController,a=setTimeout(function(){return o.abort()},5e3),[4,this.fetchRemoteConfig(o.signal,s)];case 1:return l=u.sent(),clearTimeout(a),[2,l]}})})},this.fetchRemoteConfig=function(s,o){return W(i,void 0,void 0,function(){var a,l,u,d,f,h,p,g,v,w,y,x,b;return q(this,function(_){switch(_.label){case 0:if(o===this.lastFetchedSessionId&&this.attempts>=this.localConfig.flushMaxRetries)return[2,this.completeRequest({err:dW})];if(s.aborted)return[2,this.completeRequest({err:Fk})];o!==this.lastFetchedSessionId&&(this.lastFetchedSessionId=o,this.attempts=0),_.label=1;case 1:_.trys.push([1,3,,4]),a=new URLSearchParams({api_key:this.localConfig.apiKey});try{for(l=De(this.configKeys),u=l.next();!u.done;u=l.next())d=u.value,a.append("config_keys",d)}catch(S){y={error:S}}finally{try{u&&!u.done&&(x=l.return)&&x.call(l)}finally{if(y)throw y.error}}return o&&a.set("session_id",String(o)),f={headers:{Accept:"*/*"},method:"GET"},h="".concat(this.getServerUrl(),"?").concat(a.toString()),this.attempts+=1,[4,fetch(h,Y(Y({},f),{signal:s}))];case 2:if(p=_.sent(),p===null)return[2,this.completeRequest({err:$k})];switch(g=new hf().buildStatus(p.status),g){case Bp.Success:return this.attempts=0,[2,this.parseAndStore
84Config(p)];case Bp.Failed:return[2,this.retryFetch(s,o)];default:return[2,this.completeRequest({err:cW})]}case 3:return v=_.sent(),w=v,s.aborted?[2,this.completeRequest({err:Fk})]:[2,this.completeRequest({err:(b=w.message)!==null&&b!==void 0?b:$k})];case 4:return[2]}})})},this.retryFetch=function(s,o){return W(i,void 0,void 0,function(){var a=this;return q(this,function(l){switch(l.label){case 0:return[4,new Promise(function(u){return setTimeout(u,a.attempts*a.retryTimeout)})];case 1:return l.sent(),[2,this.fetchRemoteConfig(s,o)]}})})},this.parseAndStoreConfig=function(s){return W(i,void 0,void 0,function(){var o;return q(this,function(a){switch(a.label){case 0:return[4,s.json()];case 1:return o=a.sent(),this.completeRequest({success:uW}),[2,o]}})})},this.localConfig=n,this.configKeys=r}return e.prototype.getServerUrl=function(){return this.localConfig.serverZone===zp.STAGING?hW:this.localConfig.serverZone===zp.EU?pW:fW},e.prototype.completeRequest=function(t){var n=t.err,r=t.success;if(n)throw new Error(n);r&&this.localConfig.loggerProvider.log(r)},e}(),gW=function(e){var t=e.localConfig,n=e.configKeys;return W(void 0,void 0,void 0,function(){return q(this,function(r){return[2,new mW({localConfig:t,configKeys:n})]})})},vW=gW,yW=function(){function e(t){this.config=t,this.config.loggerProvider.debug("Local configuration before merging with remote config",JSON.stringify(this.config,null,2))}return e.prototype.initialize=function(){return W(this,void 0,void 0,function(){var t;return q(this,function(n){switch(n.label){case 0:return t=this,[4,vW({localConfig:this.config,configKeys:["analyticsSDK"]})];case 1:return t.remoteConfigFetch=n.sent(),[2]}})})},e.prototype.generateJoinedConfig=function(){var t,n,r,i,s,o;return W(this,void 0,void 0,function(){var a,l,u,d,f,h,p,g,v,w,y,x,b;return q(this,function(_){switch(_.label){case 0:return _.trys.push([0,3,,4]),l=this.remoteConfigFetch,l?[4,this.remoteConfigFetch.getRemoteConfig("analyticsSDK","browserSDK",this.config.sessionId)]:[3,2];case 1:l=_.sent(),_.label=2;case 2:if(a=l,this.config.loggerProvider.debug("Remote configuration:",JSON.stringify(a,null,2)),a&&"autocapture"in a){if(typeof a.autocapture=="boolean"&&(this.config.autocapture=a.autocapture),typeof a.autocapture=="object"){if(u=Y({},a.autocapture),this.config.autocapture===void 0&&(this.config.autocapture=a.autocapture),typeof a.autocapture.elementInteractions=="object"&&(!((t=a.autocapture.elementInteractions.pageUrlAllowlistRegex)===null||t===void 0)&&t.length)){u.elementInteractions=Y({},a.autocapture.elementInteractions),d=u.elementInteractions,f=(n=d.pageUrlAllowlist)!==null&&n!==void 0?n:[],h=[];try{for(p=De(a.autocapture.elementInteractions.pageUrlAllowlistRegex),g=p.next();!g.done;g=p.next()){v=g.value;try{h.push(new RegExp(v))}catch(S){this.config.loggerProvider.warn("Invalid regex pattern: ".concat(v),S)}}}catch(S){x={error:S}}finally{try{g&&!g.done&&(b=p.return)&&b.call(p)}finally{if(x)throw x.error}}w=f.concat(h),d.pageUrlAllowlist=w,delete d.pageUrlAllowlistRegex}typeof this.config.autocapture=="boolean"&&(this.config.autocapture=Y({attribution:this.config.autocapture,fileDownloads:this.config.autocapture,formInteractions:this.config.autocapture,pageViews:this.config.autocapture,sessions:this.config.autocapture,elementInteractions:this.config.autocapture},u)),typeof this.config.autocapture=="object"&&(this.config.autocapture=Y(Y({},this.config.autocapture),u))}this.config.defaultTracking=this.config.autocapture}return this.config.loggerProvider.debug("Joined configuration: ",JSON.stringify(this.config,null,2)),(r=(o=this.config).requestMetadata)!==null&&r!==void 0||(o.requestMetadata=new GR),!((i=this.remoteConfigFetch)===null||i===void 0)&&i.metrics.fetchTimeAPISuccess&&this.config.requestMetadata.recordHistogram("remote_config_fetch_time_API_success",this.remoteConfigFetch.metrics.fetchTimeAPISuccess),!((s=this.remoteConfigFetch)===null||s===void 0)&&s.metrics.fetchTimeAPIFail&&this.config.requestMetadata.recordHistogram("remote_config_fetch_time_API_fail",this.remoteConfigFetch.metrics.fetchTimeAPIFail),[3,4];case 3:return y=_.sent(),this.config.loggerProvider.error("Failed to fetch remote configuration because of error: ",y),[3,4];case 4:return[2,this.config]}})})},e}(),xW=function(e){return W(void 0,void 0,void 0,function(){var t;return q(this,function(n){switch(n.label){case 0:return t=new yW
vendor: 15,782 bytes, lines 84-86
84(e),[4,t.initialize()];case 1:return n.sent(),[2,t]}})})},wW="@amplitude/plugin-autocapture-browser",hx="[Amplitude] Element Clicked",bW="[Amplitude] Element Changed",_W="[Amplitude] Element ID",SW="[Amplitude] Element Class",cI="[Amplitude] Element Tag",uI="[Amplitude] Element Text",EW="[Amplitude] Element Hierarchy",kW="[Amplitude] Element Href",CW="[Amplitude] Element Position Left",TW="[Amplitude] Element Position Top",jW="[Amplitude] Element Aria Label",PW="[Amplitude] Element Attributes",NW="[Amplitude] Element Parent Label",dI="[Amplitude] Page URL",RW="[Amplitude] Page Title",IW="[Amplitude] Viewport Height",AW="[Amplitude] Viewport Width",Kh="https://app.amplitude.com",OW="https://app.eu.amplitude.com",DW="https://apps.stag2.amplitude.com",MW={US:Kh,EU:OW,STAGING:DW},LW="https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz",FW="amp-visual-tagging-selector-highlight";function ot(e){return typeof e=="function"}function Qb(e){var t=function(r){Error.call(r),r.stack=new Error().stack},n=e(t);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var Hv=Qb(function(e){return function(n){e(this),this.message=n?n.length+` errors occurred during unsubscription:
85`+n.map(function(r,i){return i+1+") "+r.toString()}).join(`
86  `):"",this.name="UnsubscriptionError",this.errors=n}});function Wp(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var mf=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,n,r,i,s;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=De(o),l=a.next();!l.done;l=a.next()){var u=l.value;u.remove(this)}}catch(v){t={error:v}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}else o.remove(this);var d=this.initialTeardown;if(ot(d))try{d()}catch(v){s=v instanceof Hv?v.errors:[v]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var h=De(f),p=h.next();!p.done;p=h.next()){var g=p.value;try{Uk(g)}catch(v){s=s??[],v instanceof Hv?s=Ke(Ke([],Te(s)),Te(v.errors)):s.push(v)}}}catch(v){r={error:v}}finally{try{p&&!p.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}}if(s)throw new Hv(s)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)Uk(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(t)}},e.prototype._hasParent=function(t){var n=this._parentage;return n===t||Array.isArray(n)&&n.includes(t)},e.prototype._addParent=function(t){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(t),n):n?[n,t]:t},e.prototype._removeParent=function(t){var n=this._parentage;n===t?this._parentage=null:Array.isArray(n)&&Wp(n,t)},e.prototype.remove=function(t){var n=this._finalizers;n&&Wp(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}(),fI=mf.EMPTY;function hI(e){return e instanceof mf||e&&"closed"in e&&ot(e.remove)&&ot(e.add)&&ot(e.unsubscribe)}function Uk(e){ot(e)?e():e.unsubscribe()}var pI={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},mI={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,Ke([e,t],Te(n)))},clearTimeout:function(e){var t=mI.delegate;return((t==null?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function gI(e){mI.setTimeout(function(){throw e})}function px(){}function Yh(e){e()}var Xb=function(e){Xt(t,e);function t(n){var r=e.call(this)||this;return r.isStopped=!1,n?(r.destination=n,hI(n)&&n.add(r)):r.destination=zW,r}return t.create=function(n,r,i){return new _d(n,r,i)},t.prototype.next=function(n){this.isStopped||this._next(n)},t.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(n){this.destination.next(n)},t.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(mf),$W=Function.prototype.bind;function Gv(e,t){return $W.call(e,t)}var UW=function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var n=this.partialObserver;if(n.next)try{n.next(t)}catch(r){sh(r)}},e.prototype.error=function(t){var n=this.partialObserver;if(n.error)try{n.error(t)}catch(r){sh(r)}else sh(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(n){sh(n)}},e}(),_d=function(e){Xt(t,e);function t(n,r,i){var s=e.call(this)||this,o;if(ot(n)||!n)o={next:n??void 0,error:r??void 0,complete:i??void 0};else{var a;s&&pI.useDeprecatedNextContext?(a=Object.create(n),a.unsubscribe=function(){return s.unsubscribe()},o={next:n.next&&Gv(n.next,a),error:n.error&&Gv(n.error,a),complete:n.complete&&Gv(n.complete,a)}):o=n}return s.destination=new UW(o),s}return t}(Xb);function sh(e){gI(e)}function VW(e){throw e}var zW={closed:!0,next:px,error:VW,complete:px},Zb=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function vI(e){return e}function BW(e){return e.length===0?vI:e.length===1?e[0]:function(n){return e.reduce(function(r,i){return i(r)},n)}}var yn=function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(t,n,r){var i=this,s=qW(t)?t:new _d(t,n,r);return Yh(function(){var o=i,a=o.operator,l=o.source;s.add(a?a.call(s,l):l?i._subscribe(s):i._trySubscribe(s))}),s},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(n){t.error(n)}},e.prototype.forEach=function(t,n){var r=this;return n=Vk(n),new n(function(i,s){var o=new _d({next:function(a){try{t(a)}catch(l){s(l),o.unsubscribe()}},error:s,complete:i});r.subscribe(o)})},e.prototype._subscribe=function(t){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(t)},e.prototype[Zb]=function(){return this},e.prototype.pipe=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return BW(t)(this)},e.prototype.toPromise=function(t){var n=this;return t=Vk(t),new t(function(r,i){var s;n.subscribe(function(o){return s=o},function(o){return i(o)},function(){return r(s)})})},e.create=function(t){return new e(t)},e}();function Vk(e){var t;return(t=e??pI.Promise)!==null&&t!==void 0?t:Promise}function WW(e){return e&&ot(e.next)&&ot(e.error)&&ot(e.complete)}function qW(e){return e&&e instanceof Xb||WW(e)&&hI(e)}function HW(e){return ot(e==null?void 0:e.lift)}function Mr(e){return function(t){if(HW(t))return t.lift(function(n){try{return e(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function hr(e,t,n,r,i){return new GW(e,t,n,r,i)}var GW=function(e){Xt(t,e);function t(n,r,i,s,o,a){var l=e.call(this,n)||this;return l.onFinalize=o,l.shouldUnsubscribe=a,l._next=r?function(u){try{r(u)}catch(d){n.error(d)}}:e.prototype._next,l._error=s?function(u){try{s(u)}catch(d){n.error(d)}finally{this.unsubscribe()}}:e.prototype._error,l._complete=i?function(){try{i()}catch(u){n.error(u)}finally{this.unsubscribe()}}:e.prototype._complete,l}return t.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),!r&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},t}(Xb),KW=Qb(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),yI=function(e){Xt(t,e);function t(){var n=e.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return t.prototype.lift=function(n){var r=new zk(this,this);return r.operator=n,r},t.prototype._throwIfClosed=function(){if(this.closed)throw new KW},t.prototype.next=function(n){var r=this;Yh(function(){var i,s;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var o=De(r.currentObservers),a=o.next();!a.done;a=o.next()){var l=a.value;l.next(n)}}catch(u){i={error:u}}finally{try{a&&!a.done&&(s=o.return)&&s.call(o)}finally{if(i)throw i.error}}}})},t.prototype.error=function(n){var r=this;Yh(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=n;for(var i=r.observers;i.length;)i.shift().error(n)}})},t.prototype.complete=function(){var n=this;Yh(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var r=n.observers;r.length;)r.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(n){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,n)},t.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},t.prototype._innerSubscribe=function(n){var r=this,i=this,s=i.hasError,o=i.isStopped,a=i.observers;return s||o?fI:(this.currentObservers=null,a.push(n),new mf(function(){r.currentObservers=null,Wp(a,n)}))},t.prototype._checkFinalizedStatuses=function(n){var r=this,i=r.hasError,s=r.thrownError,o=r.isStopped;i?n.error(s):o&&n.complete()},t.prototype.asObservable=function(){var n=new yn;return n.source=this,n},t.create=function(n,r){return new zk(n,r)},t}(yn),zk=function(e){Xt(t,e);function t(n,r){var i=e.call(this)||this;return i.destination=n,i.source=r,i}return t.prototype.next=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.next)===null||i===void 0||i.call(r,n)},t.prototype.error=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.error)===null||i===void 0||i.call(r,n)},t.prototype.complete=function(){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||r===void 0||r.call(n)},t.prototype._subscribe=function(n){var r,i;return(i=(r=this.source)===null||r===void 0?void 0:r.subscribe(n))!==null&&i!==void 0?i:fI},t}(yI),YW={now:function(){return Date.now()},delegate:void 0},QW=function(e){Xt(t,e);function t(n,r){return e.call(this)||this}return t.prototype.schedule=function(n,r){return this},t}(mf),Bk={setInterval:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,Ke([e,t],Te(n)))},clearInterval:function(e){return clearInterval(e)},delegate:void 0},XW=function(e){Xt(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.scheduler=n,i.work=r,i.pending=!1,i}return t.prototype.schedule=function(n,r){var i;if(r===void 0&&(r=0),this.closed)return this;this.state=n;var s=this.id,o=this.scheduler;return s!=null&&(this.id=this.recycleAsyncId(o,s,r)),this.pending=!0,this.delay=r,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(o,this.id,r),this},t.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),Bk.setInterval(n.flush.bind(n,this),i)},t.prototype.recycleAsyncId=function(n,r,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return r;r!=null&&Bk.clearInterval(r)},t.prototype.execute=function(n,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(n,r);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(n,r){var i=!1,s;try{this.work(n)}catch(o){i=!0,s=o||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),s},t.prototype.unsubscribe=function(){if(!this.closed){var n=this,r=n.id,i=n.scheduler,s=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Wp(s,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(QW),Wk=function(){function e(t,n){n===void 0&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(t,n,r){return n===void 0&&(n=0),new this.schedulerActionCtor(this,t).schedule(r,n)},e.now=YW.now,e}(),ZW=function(e){Xt(t,e);function t(n,r){r===void 0&&(r=Wk.now);var i=e.call(this,n,r)||this;return i.actions=[],i._active=!1,i}return t.prototype.flush=function(n){var r=this.actions;if(this._active){r.push(n);return}var i;this._active=!0;do if(i=n.execute(n.state,n.delay))break;while(n=r.shift());if(this._active=!1,i){for(;n=r.shift();)n.unsubscribe();throw i}},t}(Wk),lg=new ZW(XW),JW=lg,Jb=new yn(function(e){return e.complete()});function xI(e){return e&&ot(e.schedule)}function wI(e){return e[e.length-1]}function eq(e){return xI(wI(e))?e.pop():void 0}function tq(e,t){return typeof wI(e)=="number"?e.pop():t}var e_=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};function bI(e){return ot(e==null?void 0:e.then)}function _I(e){return ot(e[Zb])}function SI(e){return Symbol.asyncIterator&&ot(e==null?void 0:e[Symbol.asyncIterator])}function EI(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function nq(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var kI=nq();function CI(e){return ot(e==null?void 0:e[kI])}function TI(e){return v8(this,arguments,function(){var n,r,i,s;return q(this,function(o){switch(o.label){case 0:n=e.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,Ml(n.read())];case 3:return r=o.sent(),i=r.value,s=r.done,s?[4,Ml(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,Ml(i)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return n.releaseLock(),[7];case 10:return[2]}})})}function jI(e){return ot(e==null?void 0:e.getReader)}function gr(e){if(e instanceof yn)return e;if(e!=null){if(_I(e))return rq(e);if(e_(e))return iq(e);if(bI(e))return sq(e);if(SI(e))return PI(e);if(CI(e))return oq(e);if(jI(e))return aq(e)}throw EI(e)}function rq(e){return new yn(function(t){var n=e[Zb]();if(ot(n.subscribe))return n.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function iq(e){return new yn(function(t){for(var n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()})}function sq(e){return new yn(function(t){e.then(function(n){t.closed||(t.next(n),t.complete())},function(n){return t.error(n)}).then(null,gI)})}function oq(e){return new yn(function(t){var n,r;try{for(var i=De(e),s=i.next();!s.done;s=i.next()){var o=s.value;if(t.next(o),t.closed)return}}catch(a){n={error:a}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}t.complete()})}function PI(e){return new yn(function(t){lq(e,t).catch(function(n){return t.error(n)})})}function aq(e){return PI(TI(e))}function lq(e,t){var n,r,i,s;return W(this,void 0,void 0,function(){var o,a;return q(this,function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),n=y8(e),l.label=1;case 1:return[4,n.next()];case 2:if(r=l.sent(),!!r.done)return[3,4];if(o=r.value,t.next(o),t.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=l.sent(),i={error:a},[3,11];case 6:return l.trys.push([6,,9,10]),r&&!r.done&&(s=n.return)?[4,s.call(n)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];
86case 10:return[7];case 11:return t.complete(),[2]}})})}function po(e,t,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var s=t.schedule(function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(s),!i)return s}function NI(e,t){return t===void 0&&(t=0),Mr(function(n,r){n.subscribe(hr(r,function(i){return po(r,e,function(){return r.next(i)},t)},function(){return po(r,e,function(){return r.complete()},t)},function(i){return po(r,e,function(){return r.error(i)},t)}))})}function RI(e,t){return t===void 0&&(t=0),Mr(function(n,r){r.add(e.schedule(function(){return n.subscribe(r)},t))})}function cq(e,t){return gr(e).pipe(RI(t),NI(t))}function uq(e,t){return gr(e).pipe(RI(t),NI(t))}function dq(e,t){return new yn(function(n){var r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})})}function fq(e,t){return new yn(function(n){var r;return po(n,t,function(){r=e[kI](),po(n,t,function(){var i,s,o;try{i=r.next(),s=i.value,o=i.done}catch(a){n.error(a);return}o?n.complete():n.next(s)},0,!0)}),function(){return ot(r==null?void 0:r.return)&&r.return()}})}function II(e,t){if(!e)throw new Error("Iterable cannot be null");return new yn(function(n){po(n,t,function(){var r=e[Symbol.asyncIterator]();po(n,t,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}function hq(e,t){return II(TI(e),t)}function pq(e,t){if(e!=null){if(_I(e))return cq(e,t);if(e_(e))return dq(e,t);if(bI(e))return uq(e,t);if(SI(e))return II(e,t);if(CI(e))return fq(e,t);if(jI(e))return hq(e,t)}throw EI(e)}function mq(e,t){return t?pq(e,t):gr(e)}function AI(e){return e instanceof Date&&!isNaN(e)}var gq=Qb(function(e){return function(n){n===void 0&&(n=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=n}});function vq(e,t){var n=AI(e)?{first:e}:typeof e=="number"?{each:e}:e,r=n.first,i=n.each,s=n.with,o=s===void 0?yq:s,a=n.scheduler,l=a===void 0?lg:a,u=n.meta,d=u===void 0?null:u;if(r==null&&i==null)throw new TypeError("No timeout provided.");return Mr(function(f,h){var p,g,v=null,w=0,y=function(x){g=po(h,l,function(){try{p.unsubscribe(),gr(o({meta:d,lastValue:v,seen:w})).subscribe(h)}catch(b){h.error(b)}},x)};p=f.subscribe(hr(h,function(x){g==null||g.unsubscribe(),w++,h.next(v=x),i>0&&y(i)},void 0,void 0,function(){g!=null&&g.closed||g==null||g.unsubscribe(),v=null})),!w&&y(r!=null?typeof r=="number"?r:+r-l.now():i)})}function yq(e){throw new gq(e)}function Tr(e,t){return Mr(function(n,r){var i=0;n.subscribe(hr(r,function(s){r.next(e.call(t,s,i++))}))})}var xq=Array.isArray;function wq(e,t){return xq(t)?e.apply(void 0,Ke([],Te(t))):e(t)}function bq(e){return Tr(function(t){return wq(e,t)})}function _q(e,t,n,r,i,s,o,a){var l=[],u=0,d=0,f=!1,h=function(){f&&!l.length&&!u&&t.complete()},p=function(v){return u<r?g(v):l.push(v)},g=function(v){u++;var w=!1;gr(n(v,d++)).subscribe(hr(t,function(y){t.next(y)},function(){w=!0},void 0,function(){if(w)try{u--;for(var y=function(){var x=l.shift();o||g(x)};l.length&&u<r;)y();h()}catch(x){t.error(x)}}))};return e.subscribe(hr(t,p,function(){f=!0,h()})),function(){}}function cg(e,t,n){return n===void 0&&(n=1/0),ot(t)?cg(function(r,i){return Tr(function(s,o){return t(r,s,i,o)})(gr(e(r,i)))},n):(typeof t=="number"&&(n=t),Mr(function(r,i){return _q(r,i,e,n)}))}function Sq(e){return e===void 0&&(e=1/0),cg(vI,e)}var Eq=["addListener","removeListener"],kq=["addEventListener","removeEventListener"],Cq=["on","off"];function Sd(e,t,n,r){if(ot(n)&&(r=n,n=void 0),r)return Sd(e,t,n).pipe(bq(r));var i=Te(Pq(e)?kq.map(function(a){return function(l){return e[a](t,l,n)}}):Tq(e)?Eq.map(qk(e,t)):jq(e)?Cq.map(qk(e,t)):[],2),s=i[0],o=i[1];if(!s&&e_(e))return cg(function(a){return Sd(a,t,n)})(gr(e));if(!s)throw new TypeError("Invalid event target");return new yn(function(a){var l=function(){for(var u=[],d=0;d<arguments.length;d++)u[d]=arguments[d];return a.next(1<u.length?u:u[0])};return s(l),function(){return o(l)}})}function qk(e,t){return function(n){return function(r){return e[n](t,r)}}}function Tq(e){return ot(e.addListener)&&ot(e.removeListener)}function jq(e){return ot(e.on)&&ot(e.off)}function Pq(e){return ot(e.addEventListener)&&ot(e.removeEventListener)}function Nq(e,t,n){n===void 0&&(n=JW);var r=-1;return t!=null&&(xI(t)?n=t:r=t),new yn(function(i){var s=AI(e)?+e-n.now():e;s<0&&(s=0);var o=0;return n.schedule(function(){i.closed||(i.next(o++),0<=r?this.schedule(void 0,r):i.complete())},s)})}function OI(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=eq(e),r=tq(e,1/0),i=e;return i.length?i.length===1?gr(i[0]):Sq(r)(mq(i,n)):Jb}function ls(e,t){return Mr(function(n,r){var i=0;n.subscribe(hr(r,function(s){return e.call(t,s,i++)&&r.next(s)}))})}function Rq(e){return Mr(function(t,n){var r=[];return t.subscribe(hr(n,function(i){return r.push(i)},function(){n.next(r),n.complete()}
86)),gr(e).subscribe(hr(n,function(){var i=r;r=[],n.next(i)},px)),function(){r=null}})}function Iq(e,t){return t===void 0&&(t=lg),Mr(function(n,r){var i=null,s=null,o=null,a=function(){if(i){i.unsubscribe(),i=null;var u=s;s=null,r.next(u)}};function l(){var u=o+e,d=t.now();if(d<u){i=this.schedule(void 0,u-d),r.add(i);return}a()}n.subscribe(hr(r,function(u){s=u,o=t.now(),i||(i=t.schedule(l,e),r.add(i))},function(){a(),r.complete()},void 0,function(){s=i=null}))})}function DI(e){return e<=0?function(){return Jb}:Mr(function(t,n){var r=0;t.subscribe(hr(n,function(i){++r<=e&&(n.next(i),e<=r&&n.complete())}))})}function Aq(e){return Tr(function(){return e})}function Oq(e,t){return cg(function(n,r){return gr(e(n,r)).pipe(DI(1),Aq(n))})}function Dq(e,t){t===void 0&&(t=lg);var n=Nq(e,t);return Oq(function(){return n})}function Mq(){return Mr(function(e,t){var n,r=!1;e.subscribe(hr(t,function(i){var s=n;n=i,r&&t.next([s,i]),r=!0}))})}function oh(e){e===void 0&&(e={});var t=e.connector,n=t===void 0?function(){return new yI}:t,r=e.resetOnError,i=r===void 0?!0:r,s=e.resetOnComplete,o=s===void 0?!0:s,a=e.resetOnRefCountZero,l=a===void 0?!0:a;return function(u){var d,f,h,p=0,g=!1,v=!1,w=function(){f==null||f.unsubscribe(),f=void 0},y=function(){w(),d=h=void 0,g=v=!1},x=function(){var b=d;y(),b==null||b.unsubscribe()};return Mr(function(b,_){p++,!v&&!g&&w();var S=h=h??n();_.add(function(){p--,p===0&&!v&&!g&&(f=Kv(x,l))}),S.subscribe(_),!d&&p>0&&(d=new _d({next:function(E){return S.next(E)},error:function(E){v=!0,w(),f=Kv(y,i,E),S.error(E)},complete:function(){g=!0,w(),f=Kv(y,o),S.complete()}}),gr(b).subscribe(d))})(u)}}function Kv(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(t===!0){e();return}if(t!==!1){var i=new _d({next:function(){i.unsubscribe(),e()}});return gr(t.apply(void 0,Ke([],Te(n)))).subscribe(i)}}function Lq(e,t){return Mr(function(n,r){var i=null,s=0,o=!1,a=function(){return o&&!i&&r.complete()};n.subscribe(hr(r,function(l){i==null||i.unsubscribe();var u=0,d=s++;gr(e(l,d)).subscribe(i=hr(r,function(f){return r.next(t?t(l,f,d,u++):f)},function(){i=null,a()}))},function(){o=!0,a()}))})}var Fq=["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot"],$q=["type"],Uq=["svg","path","g"],Vq=["password","hidden"],zq=128,Bq=1024;function Wq(e){var t,n,r,i,s,o;if(e===null)return null;var a=String(e.tagName).toLowerCase(),l={tag:a},u=Array.from((i=(r=e.parentElement)===null||r===void 0?void 0:r.children)!==null&&i!==void 0?i:[]);u.length&&(l.index=u.indexOf(e),l.indexOfType=u.filter(function(_){return _.tagName===e.tagName}).indexOf(e));var d=(o=(s=e.previousElementSibling)===null||s===void 0?void 0:s.tagName)===null||o===void 0?void 0:o.toLowerCase();d&&(l.prevSib=String(d));var f=e.getAttribute("id");f&&(l.id=String(f));var h=Array.from(e.classList);h.length&&(l.classes=h);var p={},g=Array.from(e.attributes),v=g.filter(function(_){return!Fq.includes(_.name)}),w=!FI(e);if(!Vq.includes(String(e.getAttribute("type")))&&!Uq.includes(a))try{for(var y=De(v),x=y.next();!x.done;x=y.next()){var b=x.value;w&&!$q.includes(b.name)||(p[b.name]=String(b.value).substring(0,zq))}}catch(_){t={error:_}}finally{try{x&&!x.done&&(n=y.return)&&n.call(y)}finally{if(t)throw t.error}}return Object.keys(p).length&&(l.attrs=p),l}function qq(e){var t=[];if(!e)return t;
86t.push(e);for(var n=e.parentElement;n&&n.tagName!=="HTML";)t.push(n),n=n.parentElement;return t}var Hq=function(e){var t=[];if(!e)return[];var n=qq(e);return t=Gq(n.map(function(r){return Wq(r)}),Bq),t};function Gq(e,t){for(var n=0,r=0;r<e.length;r++){var i=e[r];if(i===null)n+=4;else{var s=Qh(i);n+=s?Array.from(s).length:4}if(n>t)return e.slice(0,r)}return e}function Qh(e,t){t===void 0&&(t=!1);try{if(e==null)return t?"None":null;if(typeof e=="string")return t?(e=e.replace(/\\/g,"\\\\").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r"),e.includes('"')?"'".concat(e,"'"):e.includes("'")?'"'.concat(e.replace(/'/g,"\\'"),'"'):"'".concat(e,"'")):e;if(typeof e=="boolean")return e?"True":"False";if(Array.isArray(e)){var n=e.map(function(s){return Qh(s,!0)});return"[".concat(n.join(", "),"]")}else if(typeof e=="object"){var r=Object.entries(e).filter(function(s){var o=Te(s,1),a=o[0];return a!=null}).map(function(s){var o=Te(s,2),a=o[0],l=o[1];return"".concat(String(Qh(a,!0)),": ").concat(String(Qh(l,!0)))}),i="{".concat(r.join(", "),"}");return i.includes("\\'")&&(i=i.replace(/'/g,"'").replace(/'/g,"\\'")),i}return e.toString()}catch{return null}}var Kq=["input","select","textarea"],MI=function(e,t){var n,r=(n=window==null?void 0:window.getComputedStyle)===null||n===void 0?void 0:n.call(window,e);return(r==null?void 0:r.getPropertyValue("cursor"))==="pointer"&&t==="click"},Yv=function(e,t,n){return n===void 0&&(n=!1),function(r,i){var s,o,a=e.pageUrlAllowlist,l=e.shouldTrackEventResolver,u=(o=(s=i==null?void 0:i.tagName)===null||s===void 0?void 0:s.toLowerCase)===null||o===void 0?void 0:o.call(s);if(!u)return!1;if(l)return l(r,i);if(!Qq(window.location.href,a))return!1;var d=String(i==null?void 0:i.getAttribute("type"))||"";if(typeof d=="string")switch(d.toLowerCase()){case"hidden":return!1;case"password":return!1}var f=MI(i,r);if(n&&f)return!0;if(t){var h=t.some(function(p){var g;return!!(!((g=i==null?void 0:i.matches)===null||g===void 0)&&g.call(i,p))});if(!h)return!1}switch(u){case"input":case"select":case"textarea":return r==="change"||r==="click";default:return f?!0:r==="click"}}},LI=function(e){if(e==null)return!1;if(typeof e=="string"){var t=/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/;if(t.test((e||"").replace(/[- ]/g,"")))return!1;var n=/(^\d{3}-?\d{2}-?\d{4}$)/;if(n.test(e))return!1}return!0},Yq=function(e){return!!e&&e.nodeType===3},FI=function(e){var t,n,r,i=(n=(t=e==null?void 0:e.tagName)===null||t===void 0?void 0:t.toLowerCase)===null||n===void 0?void 0:n.call(t),s=e instanceof HTMLElement?((r=e.getAttribute("contenteditable"))===null||r===void 0?void 0:r.toLowerCase())==="true":!1;return!Kq.includes(i)&&!s},t_=function(e){var t="";return FI(e)&&e.childNodes&&e.childNodes.length&&e.childNodes.forEach(function(n){var r="";Yq(n)?n.textContent&&(r=n.textContent):r=t_(n),t+=r.split(/(\s+)/).filter(LI).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}),t},Qq=function(e,t){return!t||!t.length?!0:t.some(function(n){return typeof n=="string"?e===n:e.match(n)})},Xq=function(e,t){return e.getAttributeNames().reduce(function(n,r){if(r.startsWith(t)){var i=r.replace(t,""),s=e.getAttribute(r);i&&(n[i]=s||"")}return n},{})},Zq=function(e){return e==null||typeof e=="object"&&Object.keys(e).length===0||typeof e=="string"&&e.trim().length===0},$I=function(e){return Object.keys(e).reduce(function(t,n){var r=e[n];return Zq(r)||(t[n]=r),t},{})},UI=function(e){var t=e.parentElement;if(!t)return"";var n;try{n=t.querySelector(":scope>span,h1,h2,h3,h4,h5,h6")}catch{n=null}if(n){var r=n.textContent||"";return LI(r)?r:""}return UI(t)},n_=function(e,t){return e?t.some(function(n){var r;return(r=e==null?void 0:e.matches)===null||r===void 0?void 0:r.call(e,n)})?e:n_(e==null?void 0:e.parentElement,t):null},Jq=function(e){var t,n,r;if(!e)return{};var i=(r=(n=e==null?void 0:e.tagName)===null||n===void 0?void 0:n.toLowerCase)===null||r===void 0?void 0:r.call(n),s=(t={},t[cI]=i,t[uI]=t_(e),t[dI]=window.location.href.split("?")[0],t);return $I(s)},eH=function(e){return new Promise(function(t,n){var r;try{var i=document.createElement("script");i.type="text/javascript",i.async=!0,i.src=e,i.addEventListener("load",function(){t({status:!0})},{once:!0}),i.addEventListener("error",function(){n({status:!1,message:"Failed to load the script ".concat(e)})}),(r=document.head)===null||r===void 0||r.appendChild(i)}catch(s){n(s)}})};function tH(){return"".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9))}var r_=function(e){return!(e.event.target===null||!e.closestTrackedAncestor)},qp=function(e,t,n){var r,i,s,o=(s=(i=t==null?void 0:t.tagName)===null||i===void 0?void 0:i.toLowerCase)===null||s===void 0?void 0:s.call(i),a=typeof t.getBoundingClientRect=="function"?t.getBoundingClientRect():{left:null,top:null},l=t.getAttribute("aria-label"),u=Xq(t,n),d=UI(t),f=(r={},r[_W]=t.getAttribute("id")||"",r[SW]=t.getAttribute("class"),r[EW]=Hq(t),r[cI]=o,r[uI]=t_(t),r[CW]=a.left==null?null:Math.round(a.left),r[TW]=a.top==null?null:Math.round(a.top),r[jW]=l,r[PW]=u,r[NW]=d,r[dI]=window.location.href.split("?")[0],r[RW]=typeof document<"u"&&document.title||"",r[IW]=window.innerHeight,r[AW]=window.innerWidth,r);return o==="a"&&e==="click"&&t instanceof HTMLAnchorElement&&(f[kW]=t.href),$I(f)},ah=function(e,t,n,r,i){i===void 0&&(i=!1);var s={event:e,timestamp:Date.now(),type:t};if(nH(s)&&s.event.target!==null){if(i){var o=MI(s.event.target,s.type);if(o)return s.closestTrackedAncestor=s.event.target,s.targetElementProperties=qp(s.type,s.closestTrackedAncestor,r),s}var a=n_(s.event.target,n);return a&&(s.closestTrackedAncestor=a,s.targetElementProperties=qp(s.type,a,r)),s}return s};function nH(e){return e.type==="click"||e.type==="change"}var rH=function(){function e(t){var n=t===void 0?{}:t,r=n.origin,i=r===void 0?Kh:r,s=this;this.endpoint=Kh,this.requestCallbacks={},this.onSelect=function(o){s.notify({action:"element-selected",data:o})},this.onTrack=function(o,a){o==="selector-mode-changed"?s.notify({action:"track-selector-mode-changed",data:a}):o==="selector-moved"&&s.notify({action:"track-selector-moved",data:a})},this.endpoint=i}return e.prototype.notify=function(t){var n,r,i,s;(r=(n=this.logger)===null||n===void 0?void 0:n.debug)===null||r===void 0||r.call(n,"Message sent: ",JSON.stringify(t)),(s=(i=window.opener)===null||i===void 0?void 0:i.postMessage)===null||s===void 0||s.call(i,t,this.endpoint)},e.prototype.sendRequest=function(t,n,r){var i=this;r===void 0&&(r={timeout:15e3});var s=tH(),o={id:s,action:t,args:n},a=new Promise(function(l,u){i.requestCallbacks[s]={resolve:l,reject:u},i.notify(o),(r==null?void 0:r.timeout)>0&&setTimeout(function(){u(new Error("".concat(t," timed out (id: ").concat(s,")"))),delete i.requestCallbacks[s]},r.timeout)});return a},e.prototype.handleResponse=function(t){var n;if(!this.requestCallbacks[t.id]){(n=this.logger)===null||n===void 0||n.warn("No callback found for request id: ".concat(t.id));return}this.requestCallbacks[t.id].resolve(t.responseData),delete this.requestCallbacks[t.id]},e.prototype.setup=function(t){var n=this,r=t===void 0?{}:t,i=r.logger,s=r.endpoint,o=r.isElementSelectable,a=r.cssSelectorAllowlist,l=r.actionClickAllowlist;this.logger=i,s&&this.endpoint===Kh&&(this.endpoint=s);var u=null;window.addEventListener("message",function(d){var f,h,p,g,v;
86if((h=(f=n.logger)===null||f===void 0?void 0:f.debug)===null||h===void 0||h.call(f,"Message received: ",JSON.stringify(d)),n.endpoint===d.origin){var w=d==null?void 0:d.data,y=w==null?void 0:w.action;if(y)if("id"in w)(g=(p=n.logger)===null||p===void 0?void 0:p.debug)===null||g===void 0||g.call(p,"Received Response to previous request: ",JSON.stringify(d)),n.handleResponse(w);else if(y==="ping")n.notify({action:"pong"});else if(y==="initialize-visual-tagging-selector"){var x=w==null?void 0:w.data;eH(LW).then(function(){var b;u=(b=window==null?void 0:window.amplitudeVisualTaggingSelector)===null||b===void 0?void 0:b.call(window,{getEventTagProps:Jq,isElementSelectable:function(_){return o?o((x==null?void 0:x.actionType)||"click",_):!0},onTrack:n.onTrack,onSelect:n.onSelect,visualHighlightClass:FW,messenger:n,cssSelectorAllowlist:a,actionClickAllowlist:l}),n.notify({action:"selector-loaded"})}).catch(function(){var b;(b=n.logger)===null||b===void 0||b.warn("Failed to initialize visual tagging selector")})}else y==="close-visual-tagging-selector"&&((v=u==null?void 0:u.close)===null||v===void 0||v.call(u))}}),this.notify({action:"page-loaded"})},e}(),iH=5;function sH(e){var t=e.amplitude,n=e.allObservables,r=e.options,i=e.shouldTrackEvent,s=e.evaluateTriggers,o=n.clickObservable,a=o.pipe(Mq(),ls(function(f){var h=Te(f,2),p=h[0],g=h[1],v=p.event.target!==g.event.target,w=Math.abs(g.event.screenX-p.event.screenX)<=20&&Math.abs(g.event.screenY-p.event.screenY)<=20;return v&&!w})),l=o.pipe(Iq(r.debounceTime),Tr(function(){return"timeout"})),u=OI(a,l),d=o.pipe(Dq(0),ls(r_),ls(function(f){return i("click",f.closestTrackedAncestor)}),Tr(function(f){return s(f)}),Rq(u));return d.subscribe(function(f){var h,p,g=(f.length>=iH,hx);try{for(var v=De(f),w=v.next();!w.done;w=v.next()){var y=w.value;t==null||t.track(g,y.targetElementProperties)}}catch(x){h={error:x}}finally{try{w&&!w.done&&(p=v.return)&&p.call(v)}finally{if(h)throw h.error}}})}function oH(e){var t=e.amplitude,n=e.allObservables,r=e.getEventProperties,i=e.shouldTrackEvent,s=e.evaluateTriggers,o=n.changeObservable,a=o.pipe(ls(r_),ls(function(l){return i("change",l.closestTrackedAncestor)}),Tr(function(l){return s(l)}));return a.subscribe(function(l){t==null||t.track(bW,r("change",l.closestTrackedAncestor))})}function aH(e){var t=e.amplitude,n=e.allObservables,r=e.options,i=e.getEventProperties,s=e.shouldTrackEvent,o=e.shouldTrackActionClick,a=n.clickObservable,l=n.mutationObservable,u=n.navigateObservable,d=a.pipe(ls(function(g){return!s("click",g.closestTrackedAncestor)}),Tr(function(g){var v=n_(g.event.target,r.actionClickAllowlist);return g.closestTrackedAncestor=v,g.closestTrackedAncestor!==null&&(g.targetElementProperties=i(g.type,g.closestTrackedAncestor)),g}),ls(r_),ls(function(g){return o("click",g.closestTrackedAncestor)})),f=[l];u&&f.push(u);var h=OI.apply(void 0,Ke([],Te(f),!1)),p=d.pipe(Lq(function(g){return h.pipe(DI(1),vq({first:500,with:function(){return Jb}}),Tr(function(){return g}))}));return p.subscribe(function(g){t==null||t.track(hx,i("click",g.closestTrackedAncestor))})}var lH=function(){return new yn(function(e){var t=new MutationObserver(function(n){e.next(n)});return t.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return t.disconnect()}})},cH=function(){return Sd(document,"click",{capture:!0})},uH=function(e,t){try{if(t.subprop_key==="[Amplitude] Element Text")return t.subprop_op==="exact"&&t.subprop_value.includes(e.targetElementProperties["[Amplitude] Element Text"]);if(t.subprop_key==="[Amplitude] Element Hierarchy")return t.subprop_op==="autotrack css match"&&!!e.closestTrackedAncestor.closest(t.subprop_value.toString())}catch(n){return console.error("Error matching event to filter",n),!1}return!1},dH=function(e){var t,n,r,i,s,o={click:new Set,change:new Set};if(!e)return o;try{for(var a=De(e),l=a.next();!l.done;l=a.next()){var u=l.value;try{try{for(var d=(r=void 0,De(u.definition)),f=d.next();!f.done;f=d.next()){var h=f.value;(s=o[h.event_type])===null||s===void 0||s.add(u.id)}}catch(p){r={error:p}}finally{try{f&&!f.done&&(i=d.return)&&i.call(d)}finally{if(r)throw r.error}}}catch(p){console.warn("Skipping Labeled Event due to malformed definition",u==null?void 0:u.id,p)}}}catch(p){t={error:p}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return o},fH=function(e){var t,n,r,i,s=new Map;try{for(var o=De(e),a=o.next();!a.done;a=o.next()){var l=a.value;try{for(var u=(r=void 0,De(l.conditions)),d=u.next();!d.done;d=u.next()){var f=d.value;if(f.type==="LABELED_EVENT"){var h=f.match.eventId,p=s.get(h);p||(p=[],s.set(h,p)),p.push(l)}}}catch(g){r={error:g}}finally{try{d&&!d.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}}}catch(g){t={error:g}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return s},hH=function(e,t){return t.filter(function(n){return n.definition.some(function(r){return r.event_type===e.type&&r.filters.every(function(i){return uH(e,i)})})})},pH=function(e,t){var n,r,i=new Set;try{for(var s=De(e),o=s.next();!o.done;o=s.next()){var a=o.value,l=t.get(a.id);l&&l.forEach(function(u){return i.add(u)})}}catch(u){n={error:u}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return Array.from(i)},mH=function(e,t){if(e.sourceType==="DOM_ELEMENT"){var n=document.documentElement;return e.scope&&t&&(n=t.closest(e.scope)),n&&e.selector?n.querySelector(e.selector):n}},gH=function(e,t){if(e.sourceType==="DOM_ELEMENT"){var n=mH(e,t);return n?e.elementExtractType==="TEXT"?n.textContent:e.elementExtractType==="ATTRIBUTE"&&e.attribute?n.getAttribute(e.attribute):void 0:void 0}}
86,vH=function(e,t){e.forEach(function(n){if(typeof n!="string"&&n.actionType==="ATTACH_EVENT_PROPERTY"){var r=gH(n.dataSource,t.closestTrackedAncestor);t.targetElementProperties[n.destinationKey]=r}})},bl;(function(e){e.ClickObservable="clickObservable",e.ChangeObservable="changeObservable",e.NavigateObservable="navigateObservable",e.MutationObservable="mutationObservable"})(bl||(bl={}));var yH=function(e){var t,n,r,i,s,o,a;e===void 0&&(e={});var l=e.dataAttributePrefix,u=l===void 0?c7:l,d=e.visualTaggingOptions,f=d===void 0?{enabled:!0,messenger:new rH}:d;e.cssSelectorAllowlist=(t=e.cssSelectorAllowlist)!==null&&t!==void 0?t:l7,e.actionClickAllowlist=(n=e.actionClickAllowlist)!==null&&n!==void 0?n:u7,e.debounceTime=(r=e.debounceTime)!==null&&r!==void 0?r:0;var h=wW,p="enrichment",g=[],v=function(){var E,k=cH().pipe(Tr(function(N){return ah(N,"click",e.cssSelectorAllowlist,u)}),oh()),C=Sd(document,"change",{capture:!0}).pipe(Tr(function(N){return ah(N,"change",e.cssSelectorAllowlist,u)}),oh()),P;window.navigation&&(P=Sd(window.navigation,"navigate").pipe(Tr(function(N){return ah(N,"navigate",e.cssSelectorAllowlist,u)}),oh()));var T=lH().pipe(Tr(function(N){return ah(N,"mutation",e.cssSelectorAllowlist,u)}),oh());return E={},E[bl.ClickObservable]=k,E[bl.ChangeObservable]=C,E[bl.NavigateObservable]=P,E[bl.MutationObservable]=T,E},w=dH(Object.values((s=(i=e.pageActions)===null||i===void 0?void 0:i.labeledEvents)!==null&&s!==void 0?s:{})),y=fH((a=(o=e.pageActions)===null||o===void 0?void 0:o.triggers)!==null&&a!==void 0?a:[]),x=function(E){var k,C,P=e.pageActions;if(!P)return E;var T=hH(E,Array.from(w[E.type]).map(function(A){return P.labeledEvents[A]})),N=pH(T,y);try{for(var I=De(N),O=I.next();!O.done;O=I.next()){var j=O.value;vH(j.actions,E)}}catch(A){k={error:A}}finally{try{O&&!O.done&&(C=I.return)&&C.call(I)}finally{if(k)throw k.error}}return E},b=function(E,k){return W(void 0,void 0,void 0,function(){var C,P,T,N,I,O,j,A,V,$;return q(this,function(R){return typeof document>"u"?[2]:(C=Yv(e,e.cssSelectorAllowlist),P=Yv(e,e.actionClickAllowlist),T=v(),N=sH({allObservables:T,options:e,amplitude:k,shouldTrackEvent:C,evaluateTriggers:x}),g.push(N),I=oH({allObservables:T,getEventProperties:function(){for(var L=[],H=0;H<arguments.length;H++)L[H]=arguments[H];return qp.apply(void 0,Ke(Ke([],Te(L),!1),[u],!1))},amplitude:k,shouldTrackEvent:C,evaluateTriggers:x}),g.push(I),O=aH({allObservables:T,options:e,getEventProperties:function(){for(var L=[],H=0;H<arguments.length;H++)L[H]=arguments[H];return qp.apply(void 0,Ke(Ke([],Te(L),!1),[u],!1))},amplitude:k,shouldTrackEvent:C,shouldTrackActionClick:P}),g.push(O),(V=E==null?void 0:E.loggerProvider)===null||V===void 0||V.log("".concat(h," has been successfully added.")),window.opener&&f.enabled&&(j=e.cssSelectorAllowlist,A=e.actionClickAllowlist,($=f.messenger)===null||$===void 0||$.setup(Y(Y({logger:E==null?void 0:E.loggerProvider},(E==null?void 0:E.serverZone)&&{endpoint:MW[E.serverZone]}),{isElementSelectable:Yv(e,Ke(Ke([],Te(j),!1),Te(A),!1)),cssSelectorAllowlist:j,actionClickAllowlist:A}))),[2])})})},_=function(E){return W(void 0,void 0,void 0,function(){return q(this,function(k){return[2,E]})})},S=function(){return W(void 0,void 0,void 0,function(){var E,k,C,P,T;return q(this,function(N){try{for(E=De(g),k=E.next();!k.done;k=E.next())C=k.value,C.unsubscribe()}catch(I){P={error:I}}finally{try{k&&!k.done&&(T=E.return)&&T.call(E)}finally{if(P)throw P.error}}return[2]})})};return{name:h,type:p,setup:b,execute:_,teardown:S}},xH="@amplitude/plugin-network-capture-browser",wH="[Amplitude] Network Request",VI="500-599";function Xh(e,t){var n=t.replace(/[-[\]{}()+?.,\\^$|#\s]/g,"\\$&"),r="^"+n.replace(/\*/g,".*")+"$",i=new RegExp(r);return i.test(e)}function zI(e,t){var n,r,i=t.split(",");try{for(var s=De(i),o=s.next();!o.done;o=s.next()){var a=o.value,l=Te(a.split("-").map(Number),2),u=l[0],d=l[1];if(e===u&&d===void 0||e>=u&&e<=d)return!0}}catch(f){n={error:f}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return!1}function bH(e,t,n){if(!(e.hosts&&!e.hosts.find(function(i){return Xh(t,i)}))){if(n||n===0){var r=e.statusCodeRange||VI;if(!zI(n,r))return!1}return!0}}function BI(e){var t;if(e)try{var n=(t=et())===null||t===void 0?void 0:t.location.href,r=new URL(e,n),i=r.searchParams.toString(),s=r.hash.replace("#",""),o=r.href,a=r.host;r.hash="",r.search="";var l=r.href;return{query:i,fragment:s,href:o,hrefWithoutQueryOrHash:l,host:a}}catch{return}}function _H(e,t){var n;t===void 0&&(t={});var r=BI(e.url);if(!r)return!1;var i=r.host;if(t.ignoreAmplitudeRequests!==!1&&(Xh(i,"*.amplitude.com")||Xh(i,"amplitude.com"))||!((n=t.ignoreHosts)===null||n===void 0)&&n.find(function(o){return Xh(i,o)})||!t.captureRules&&e.status!==void 0&&!zI(e.status,VI))return!1;if(t.captureRules){var s;if(Ke([],Te(t.captureRules),!1).reverse().find(function(o){return s=bH(o,i,e.status),s!==void 0}),!s)return!1}return!0}function SH(e){var t=e.allObservables,n=e.networkTrackingOptions,r=e.amplitude,i=t.networkObservable,s=i.pi
86pe(ls(function(o){return _H(o.event,n)}));return s.subscribe(function(o){var a,l,u,d=o.event,f=BI(d.url);if(f){var h=(l=d.responseWrapper)===null||l===void 0?void 0:l.bodySize,p=(u=d.requestWrapper)===null||u===void 0?void 0:u.bodySize,g=(a={},a["[Amplitude] URL"]=f.hrefWithoutQueryOrHash,a["[Amplitude] URL Query"]=f.query,a["[Amplitude] URL Fragment"]=f.fragment,a["[Amplitude] Request Method"]=d.method,a["[Amplitude] Status Code"]=d.status,a["[Amplitude] Start Time"]=d.startTime,a["[Amplitude] Completion Time"]=d.endTime,a["[Amplitude] Duration"]=d.duration,a["[Amplitude] Request Body Size"]=p,a["[Amplitude] Response Body Size"]=h,a["[Amplitude] Request Type"]=d.type,a);r==null||r.track(wH,g)}})}var mx;(function(e){e.NetworkObservable="networkObservable"})(mx||(mx={}));var EH=function(e){e===void 0&&(e={});var t=xH,n="enrichment",r,i=[],s=function(d,f){var h={event:d,timestamp:Date.now(),type:f};return h},o=function(){var d,f=new yn(function(h){var p=new v7(function(g){var v=s(g,"network");h.next(v)});return gk.subscribe(p,r),function(){gk.unsubscribe(p)}});return d={},d[mx.NetworkObservable]=f,d},a=function(d,f){return W(void 0,void 0,void 0,function(){var h,p;return q(this,function(g){return typeof document>"u"?[2]:(h=o(),p=SH({allObservables:h,networkTrackingOptions:e,amplitude:f}),i.push(p),r=d==null?void 0:d.loggerProvider,r==null||r.log("".concat(t," has been successfully added.")),[2])})})},l=function(d){return W(void 0,void 0,void 0,function(){return q(this,function(f){return[2,d]})})},u=function(){return W(void 0,void 0,void 0,function(){var d,f,h,p,g;return q(this,function(v){try{for(d=De(i),f=d.next();!f.done;f=d.next())h=f.value,h.unsubscribe()}catch(w){p={error:w}}finally{try{f&&!f.done&&(g=d.return)&&g.call(d)}finally{if(p)throw p.error}}return[2]})})};return{name:t,type:n,setup:a,execute:l,teardown:u}},kH="utm_campaign",CH="utm_content",TH="utm_id",jH="utm_medium",PH="utm_source",NH="utm_term",Hk="dclid",Gk="fbclid",Kk="gbraid",Yk="gclid",Qk="ko_click_id",Xk="li_fat_id",Zk="msclkid",Jk="rtd_cid",eC="ttclid",tC="twclid",nC="wbraid",i_={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rtd_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},rC=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},RH=function(e){return Object.values(e).every(function(t){return!t})},IH=function(e,t,n,r,i){i===void 0&&(i=!0),e.referrer;var s=e.referring_domain,o=yd(e,["referrer","referring_domain"]),a=t||{};a.referrer;var l=a.referring_domain,u=yd(a,["referrer","referring_domain"]);if(AH(n.excludeReferrers,e.referring_domain))return r.debug("This is not a new campaign because ".concat(e.referring_domain," is in the exclude referrer list.")),!1;if(!i&&RH(e)&&t)return r.debug("This is not a new campaign because this is a direct traffic in the same session."),!1;var d=JSON.stringify(o)!==JSON.stringify(u),f=rC(s||"")!==rC(l||""),h=!t||d||f;return h?r.debug("This is a new campaign. An $identify event will be sent."):r.debug("This is not a new campaign because it's the same as the previous one."),h},AH=function(e,t){return e===void 0&&(e=[]),t===void 0&&(t=""),e.some(function(n){return n instanceof RegExp?n.test(t):n===t})},OH=function(e,t){var n=Y(Y({},i_),e),r=Object.entries(n).reduce(function(i,s){var o,a=Te(s,2),l=a[0],u=a[1];return i.setOnce("initial_".concat(l),(o=u??t.initialEmptyValue)!==null&&o!==void 0?o:"EMPTY"),u?i.set(l,u):i.unset(l)},new xd);return WR(r)},DH=function(e){var t=e;return t?(t.startsWith(".")&&(t=t.substring(1)),[new RegExp("".concat(t.replace(".","\\."),"$"))]):[]},MH=function(){function e(){}return e.prototype.parse=function(){return W(this,void 0,void 0,function(){return q(this,function(t){return[2,Y(Y(Y(Y({},i_),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},e.prototype.getUtmParam=function(){var t=$p(),n=t[kH],r=t[CH],i=t[TH],s=t[jH],o=t[PH],a=t[NH];return{utm_campaign:n,utm_content:r,utm_id:i,utm_medium:s,utm_source:o,utm_term:a}},e.prototype.getReferrer=function(){var t,n,r={referrer:void 0,referring_domain:void 0};try{r.referrer=document.referrer||void 0,r.referring_domain=(n=(t=r.referrer)===null||t===void 0?void 0:t.split("/")[2])!==null&&n!==void 0?n:void 0}catch{}return r},e.prototype.getClickIds=function(){var t,n=$p();return t={},t[Hk]=n[Hk],t[Gk]=n[Gk],t[Kk]=n[Kk],t[Yk]=n[Yk],t[Qk]=n[Qk],t[Xk]=n[Xk],t[Zk]=n[Zk],t[Jk]=n[Jk],t[eC]=n[eC],t[tC]=n[tC],t[nC]=n[nC],t},e}(),LH=function(){function e(t,n){var r;this.shouldTrackNewCampaign=!1,this.options=Y({initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1,excludeReferrers:DH((r=n.cookieOptions)===null||r===void 0?void 0:r.domain)},t),this.storage=n.cookieStorage,this.storageKey=o7(n.apiKey,"MKTG"),this.currentCampaign=i_,this.sessionTimeout=n.sessionTimeout,this.lastEventTime=n.lastEventTime,this.logger=n.loggerProvider,n.loggerProvider.log("Installing web attribution tracking.")}return e.prototype.init=function(){return W(this,void 0,void 0,function(){var t,n;return q(this,function(r){switch(r.label){case 0:return[4,this.fetchCampaign()];case 1:return n=Te.apply(void 0,[r.sent(),2]),this.currentCampaign=n[0],this.previousCampaign=n[1],t=this.lastEventTime?KR(this.sessionTimeout,this.lastEventTime):!0,IH(this.currentCampaign,this.previousCampaign,this.options,this.logger,t)?(this.shouldTrackNewCampaign=!0,[4,this.storage.set(this.storageKey,this.currentCampaign)]):[3,3];case 2:r.sent(),r.label=3;case 3:return[2]}})})},e.prototype.fetchCampaign=function(){return W(this,void 0,void 0,function(){return q(this,function(t){switch(t.label){case 0:return[4,Promise.all([new MH().parse(),this.storage.get(this.storageKey)])];case 1:return[2,t.sent()]}})})},e.prototype.generateCampaignEvent=function(t){this.shouldTrackNewCampaign=!1;var n=OH(this.currentCampaign,this.options);return t&&(n.event_id=t),n},e.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},e}(),FH=function(e){Xt(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.init=function(n,r,i){n===void 0&&(n="");var s,o;return arguments.length>2?(s=r,o=i):typeof r=="string"?(s=r,o=void 0):(s=r==null?void 0:r.userId,o=r),pn(this._init(Y(Y({},o),{userId:s,apiKey:n})))},t.prototype._init=function(n){var r,i,s;return W(this,void 0,void 0,function(){var o,a,l,u,d,f,h=this;return q(this,function(p){switch(p.label){case 0:return this.initializing?[2]:(this.initializing=!0,[4,B7(n.apiKey,n,this)]);case 1:return o=p.sent(),o.fetchRemoteConfig?[4,xW(o)]:[3,4];case 2:return a=p.sent(),[4,a.generateJoinedConfig()];case 3:o=p.sent(),p.label=4;case 4:return[4,e.prototype._init.call(this,o)];case 5:return p.sent(),this.logBrowserOptions(o),JR(this.config.defaultTracking)?(l=E7(this.config),this.webAttribution=new LH(l,this.config),[4,this.webAttribution.init()]):[3,7];case 6:p.sent(),p.label=7;case 7:return u=$p(),d=Number.isNaN(Number(u.ampSessionId))?void 0:Number(u.ampSessionId),this.setSessionId((s=(i=(r=n.sessionId)!==null&&r!==void 0?r:d)!==null&&i!==void 0?i:this.config.sessionId)!==null&&s!==void 0?s:Date.now()),f=cc(n.instanceName),f.identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),this.config.offline===a7?[3,9]:[4,this.add(lW()).promise];case 8:p.sent(),p.label=9;case 9:return[4,this.add(new z8).promise];case 10:return p.sent(),[4,this.add(new j7).promise];case 11:return p.sent(),[4,this.add(new J8).promise];case 12:return p.sent(),aW(this.config),x7(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add(oW()).promise]):[3,14];case 13:p.sent(),p.label=14;case 14:return w7(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add(sW()).promise]):[3,16];case 15:p.sent(),p.label=16;case 16:return eI(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(tW(S7(this.config))).promise]):[3,18];case 17:p.sent(),p.label=18;case 18:return nI(this.config.autocapture)?(this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(yH(b7(this.config))).promise]):[3,20];case 19:p.sent(),p.label=20;case 20:return tI(this.config.autocapture)?(this.config.loggerProvider.debug("Adding network tracking plugin"),[4,this.add(EH(_7(this.config))).promise]):[3,22];case 21:p.sent(),p.label=22;case 22:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 23:return p.sent(),f.eventBridge.setEventReceiver(function(g){h.track(g.eventType,g.eventProperties)}),[2]}})})},t.prototype.getUserId=function(){var n;return(n=this.config)===null||n===void 0?void 0:n.userId},t.prototype.setUserId=function(n){if(!this.config){this.q.push(this.setUserId.bind(this,n));return}
86this.config.loggerProvider.debug("function setUserId: ",n),(n!==this.config.userId||n===void 0)&&(this.config.userId=n,this.timeline.onIdentityChanged({userId:n}),X8(n,this.config.instanceName))},t.prototype.getDeviceId=function(){var n;return(n=this.config)===null||n===void 0?void 0:n.deviceId},t.prototype.setDeviceId=function(n){if(!this.config){this.q.push(this.setDeviceId.bind(this,n));return}this.config.loggerProvider.debug("function setDeviceId: ",n),n!==this.config.deviceId&&(this.config.deviceId=n,this.timeline.onIdentityChanged({deviceId:n}),Z8(n,this.config.instanceName))},t.prototype.reset=function(){this.setDeviceId(Ua()),this.setUserId(void 0)},t.prototype.getIdentity=function(){var n,r;return{deviceId:(n=this.config)===null||n===void 0?void 0:n.deviceId,userId:(r=this.config)===null||r===void 0?void 0:r.userId,userProperties:this.userProperties}},t.prototype.getOptOut=function(){return this.config.optOut},t.prototype.getSessionId=function(){var n;return(n=this.config)===null||n===void 0?void 0:n.sessionId},t.prototype.setSessionId=function(n){var r,i=[];if(!this.config)return this.q.push(this.setSessionId.bind(this,n)),pn(Promise.resolve());if(n===this.config.sessionId)return pn(Promise.resolve());this.config.loggerProvider.debug("function setSessionId: ",n);var s=this.getSessionId();s!==n&&this.timeline.onSessionIdChanged(n);var o=this.config.lastEventTime,a=(r=this.config.lastEventId)!==null&&r!==void 0?r:-1;this.config.sessionId=n,this.config.lastEventTime=void 0,this.config.pageCounter=0,vk(this.config.defaultTracking)&&(s&&o&&i.push(this.track(wk,void 0,{device_id:this.previousSessionDeviceId,event_id:++a,session_id:s,time:o+1,user_id:this.previousSessionUserId}).promise),this.config.lastEventTime=this.config.sessionId);var l=this.trackCampaignEventIfNeeded(++a,i);return vk(this.config.defaultTracking)&&i.push(this.track(xk,void 0,{event_id:l?++a:a,session_id:this.config.sessionId,time:this.config.lastEventTime}).promise),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId,pn(Promise.all(i))},t.prototype.extendSession=function(){if(!this.config){this.q.push(this.extendSession.bind(this));return}this.config.lastEventTime=Date.now()},t.prototype.setTransport=function(n){if(!this.config){this.q.push(this.setTransport.bind(this,n));return}this.config.transportProvider=oI(n)},t.prototype.identify=function(n,r){if(Vv(n)){var i=n._q;n._q=[],n=Uv(new xd,i)}return r!=null&&r.user_id&&this.setUserId(r.user_id),r!=null&&r.device_id&&this.setDeviceId(r.device_id),e.prototype.identify.call(this,n,r)},t.prototype.groupIdentify=function(n,r,i,s){if(Vv(i)){var o=i._q;i._q=[],i=Uv(new xd,o)}return e.prototype.groupIdentify.call(this,n,r,i,s)},t.prototype.revenue=function(n,r){if(Vv(n)){var i=n._q;n._q=[],n=Uv(new F8,i)}return e.prototype.revenue.call(this,n,r)},t.prototype.trackCampaignEventIfNeeded=function(n,r){if(!this.webAttribution||!this.webAttribution.shouldTrackNewCampaign)return!1;var i=this.webAttribution.generateCampaignEvent(n);return r?r.push(this.track(i).promise):this.track(i),this.config.loggerProvider.log("Tracking attribution."),!0},t.prototype.process=function(n){return W(this,void 0,void 0,function(){var r,i,s;return q(this,function(o){return r=Date.now(),i=KR(this.config.sessionTimeout,this.config.lastEventTime),s=this.webAttribution&&this.webAttribution.shouldSetSessionIdOnNewCampaign(),n.event_type!==xk&&n.event_type!==wk&&(!n.session_id||n.session_id===this.getSessionId())&&(i||s?(this.setSessionId(r),s&&this.config.loggerProvider.log("Created a new session for new campaign.")):i||this.trackCampaignEventIfNeeded()),n.event_type===bo.IDENTIFY&&n.user_properties&&(this.userProperties=this.getOperationAppliedUserProperties(n.user_properties)),[2,e.prototype.process.call(this,n)]})})},t.prototype.logBrowserOptions=function(n){try{var r=Y(Y({},n),{apiKey:n.apiKey.substring(0,10)+"********"});this.config.loggerProvider.debug("Initialized Amplitude with BrowserConfig:",JSON.stringify(r))}catch(i){this.config.loggerProvider.error("Error logging browser config",i)}},t}(L8),$H=function(){var e=new FH;return{init:Ze(e.init.bind(e),"init",bt(e),_t(e,["config"])),add:Ze(e.add.bind(e),"add",bt(e),_t(e,["config.apiKey","timeline.plugins"])),remove:Ze(e.remove.bind(e),"remove",bt(e),_t(e,["config.apiKey","timeline.plugins"])),track:Ze(e.track.bind(e),"track",bt(e),_t(e,["config.apiKey","timeline.queue.length"])),logEvent:Ze(e.logEvent.bind(e),"logEvent",bt(e),_t(e,["config.apiKey","timeline.queue.length"])),identify:Ze(e.identify.bind(e),"identify",bt(e),_t(e,["config.apiKey","timeline.queue.length"])),groupIdentify:Ze(e.groupIdentify.bind(e),"groupIdentify",bt(e),_t(e,["config.apiKey","timeline.queue.length"])),setGroup:Ze(e.setGroup.bind(e),"setGroup",bt(e),_t(e,["config.apiKey","timeline.queue.length"])),revenue:Ze(e.revenue.bind(e),"revenue",bt(e),_t(e,["config.apiKey","timeline.queue.length"])),flush:Ze(e.flush.bind(e),"flush",bt(e),_t(e,["config.apiKey","timeline.queue.length"])),getUserId:Ze(e.getUserId.bind(e),"getUserId",bt(e),_t(e,["config","config.userId"])),setUserId:Ze(e.setUserId.bind(e),"setUserId",bt(e),_t(e,["config","config.userId"])),getDeviceId:Ze(e.getDeviceId.bind(e),"getDeviceId",bt(e),_t(e,["config","config.deviceId"])),setDeviceId:Ze(e.setDeviceId.bind(e),"setDeviceId",bt(e),_t(e,["config","config.deviceId"])),reset:Ze(e.reset.bind(e),"reset",bt(e),_t(e,["config","config.userId","config.deviceId"])),getSessionId:Ze(e.getSessionId.bind(e),"getSessionId",bt(e),_t(e,["config"])),setSessionId:Ze(e.setSessionId.bind(e),"setSessionId",bt(e),_t(e,["config"])),extendSession:Ze(e.extendSession.bind(e),"extendSession",bt(e),_t(e,["config"])),setOptOut:Ze(e.setOptOut.bind(e),"setOptOut",bt(e),_t(e,["config"])),setTransport:Ze(e.setTransport.bind(e),"setTransport",bt(e),_t(e,["config"])),getIdentity:Ze(e.getIdentity.bind(e),"getIdentity",bt(e),_t(e,["config"])),getOptOut:Ze(e.getOptOut.bind(e),"getOptOut",bt(e),_t(e,["config"]))}};const Lo=$H();var UH=Lo.add,VH=Lo.flush,zH=Lo.getUserId,BH=Lo.identify,WH=Lo.init,qH=Lo.reset,Qv=Lo.setUserId,HH=Lo.track,WI="[Amplitude]",GH="".concat(WI," Session Replay ID"),KH=0,YH=bd.US,QH={enabled:!0},qI=1e3,XH="".concat(WI," Session Replay Debug"),ZH="amp-block",HI="amp-mask",JH="amp-unmask",e9="https://api-sr.amplitude.com/sessions/v2/track",t9="https://api-sr.eu.amplitude.com/sessions/v2/track",n9="https://api-sr.stag2.amplitude.com/sessions/v2/track",r9=1*1e6,i9=3e4,s9=6e4,o9=500,a9=10*1e3,GI=1024,l9=1e3,Jo;(function(e){e.GET_SR_PROPS="get-sr-props",e.DEBUG_INFO="debug-info",e.FETCH_REQUEST="fetch-request",e.METADATA="metadata"})(Jo||(Jo={}));var gx=function(){function e(t){this.logger=t,this.log=this.getSafeMethod("log"),this.warn=this.getSafeMethod("warn"),this.error=this.getSafeMethod("error"),this.debug=this.getSafeMethod("debug")}return e.prototype.getSafeMethod=function(t){var n;if(!this.logger)return function(){};var r=this.logger[t];if(typeof r=="function"){var i=(n=r.__rrweb_original__)!==null&&n!==void 0?n:r;return i.bind(this.logger)}return function(){}},e.prototype.enable=function(t){this.logger.enable(t)}
vendor: 5,854 bytes, line 86
86,e.prototype.disable=function(){this.logger.disable()},e}(),vx="medium";function c9(e){return e.toLowerCase()}function u9(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?c9(t):null}var KI=function(e,t,n){switch(t){case"light":{if(e!=="input")return!0;var r=n?u9(n):"";return r?!!(["password","hidden","email","tel"].includes(r)||n.autocomplete.startsWith("cc-")):!1}case"medium":case"conservative":return!0;default:return KI(e,vx,n)}},d9=function(e,t,n){var r,i,s;if(t===void 0&&(t={defaultMaskLevel:vx}),n){if(n.closest("."+HI))return!0;var o=((r=t.maskSelector)!==null&&r!==void 0?r:[]).some(function(l){return n.closest(l)});if(o)return!0;if(n.closest("."+JH))return!1;var a=((i=t.unmaskSelector)!==null&&i!==void 0?i:[]).some(function(l){return n.closest(l)});if(a)return!1}return KI(e,(s=t.defaultMaskLevel)!==null&&s!==void 0?s:vx,n)},iC=function(e,t){return function(n,r){return d9(e,t,r)?n.replace(/[^\s]/g,"*"):n}},yx=function(e){var t=0;if(e.length===0)return t;for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);t=(t<<5)-t+r,t|=0}return t},f9=function(e,t){var n=yx(e.toString()),r=Math.abs(n),i=r*31,s=i%1e6;return s/1e6<t},h9=function(){var e=et();return e!=null&&e.location?e.location.href:""},p9=function(e,t){return"".concat(t,"/").concat(e)},YI=function(e,t){return t||(e===bd.STAGING?n9:e===bd.EU?t9:e9)},m9=function(e){if(typeof e!="string"||e.trim()==="")return!1;var t=/^\/|^https?:\/\/[^\s]+$/;return!!t.test(e)},g9=function(e){var t=e.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*").replace(/\?/g,".");return new RegExp("^".concat(t,"$"))},v9=function(e){if(!e.every(function(t){return typeof t.selector=="string"&&typeof t.replacement=="string"}))throw new Error("ugcFilterRules must be an array of objects with selector and replacement properties");if(!e.every(function(t){return m9(t.selector)}))throw new Error("ugcFilterRules must be an array of objects with valid globs")},ug=function(e,t){var n,r;try{for(var i=De(t),s=i.next();!s.done;s=i.next()){var o=s.value,a=g9(o.selector);if(a.test(e))return e.replace(a,o.replacement)}}catch(l){n={error:l}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return e},QI=function(){return W(void 0,void 0,void 0,function(){var e,t,n,r,i,s,o;return q(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),e=et(),e?[4,e.navigator.storage.estimate()]:[3,2];case 1:return t=a.sent(),n=t.usage,r=t.quota,i=t.usageDetails,s=n?Math.round(n/GI):0,o=n&&r?Math.round((n/r+Number.EPSILON)*1e3)/1e3:0,[2,{totalStorageSize:s,percentOfQuota:o,usageDetails:JSON.stringify(i)}];case 2:return[3,4];case 3:return a.sent(),[3,4];case 4:return[2,{totalStorageSize:0,percentOfQuota:0,usageDetails:""}]}})})},XI=function(e){var t=Y({},e),n=t.apiKey;return t.apiKey="****".concat(n.substring(n.length-4)),t},ZI=function(){return{flushMaxRetries:2,logLevel:jn.Warn,loggerProvider:new wd,transportProvider:new QR}},y9=function(e){Xt(t,e);function t(n,r){var i=this,s,o,a,l,u,d=ZI();return i=e.call(this,Y(Y({transportProvider:d.transportProvider,loggerProvider:new gx(r.loggerProvider||d.loggerProvider)},r),{apiKey:n}))||this,i.flushMaxRetries=r.flushMaxRetries!==void 0&&r.flushMaxRetries<=d.flushMaxRetries?r.flushMaxRetries:d.flushMaxRetries,i.apiKey=n,i.sampleRate=r.sampleRate||KH,i.serverZone=r.serverZone||YH,i.configServerUrl=r.configServerUrl,i.trackServerUrl=r.trackServerUrl,i.shouldInlineStylesheet=r.shouldInlineStylesheet,i.version=r.version,i.performanceConfig=r.performanceConfig||QH,i.storeType=(s=r.storeType)!==null&&s!==void 0?s:"idb",i.applyBackgroundColorToBlockedElements=(o=r.applyBackgroundColorToBlockedElements)!==null&&o!==void 0?o:!1,i.enableUrlChangePolling=(a=r.enableUrlChangePolling)!==null&&a!==void 0?a:!1,i.urlChangePollingInterval=(l=r.urlChangePollingInterval)!==null&&l!==void 0?l:qI,i.captureDocumentTitle=(u=r.captureDocumentTitle)!==null&&u!==void 0?u:!1,r.privacyConfig&&(i.privacyConfig=r.privacyConfig),r.interactionConfig&&(i.interactionConfig=r.interactionConfig,i.interactionConfig.ugcFilterRules&&v9(i.interactionConfig.ugcFilterRules)),r.debugMode&&(i.debugMode=r.debugMode),r.experimental&&(i.experimental=r.experimental),r.omitElementTags&&(i.omitElementTags=r.omitElementTags),i}return t}(qR),JI=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(JI||{}),eA=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(eA||{}),Hp;(function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"})(Hp||(Hp={}));var hn;(function(e){e.Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.PayloadTooLarge="payload_too_large",e.Invalid="invalid",e.Failed="failed",e.Timeout="Timeout",e.SystemError="SystemError"})(hn||(hn={}));var x9=function(){function e(){}return e.prototype.send=function(t,n){return Promise.resolve(null)},e.prototype.buildResponse=function(t){var n,r,i,s,o,a,l,u,d,f,h,p,g,v,w,y,x,b,_,S,E,k;if(typeof t!="object")return null;var C=t.code||0,P=this.buildStatus(C);switch(P){case hn.Success:return{status:P,statusCode:C,body:{eventsIngested:(n=t.events_ingested)!==null&&n!==void 0?n:0,payloadSizeBytes:(r=t.payload_size_bytes)!==null&&r!==void 0?r:0,serverUploadTime:(i=t.server_upload_time)!==null&&i!==void 0?i:0}};case hn.Invalid:return{status:P,statusCode:C,body:{error:(s=t.error)!==null&&s!==void 0?s:"",missingField:(o=t.missing_field)!==null&&o!==void 0?o:"",eventsWithInvalidFields:(a=t.events_with_invali
86d_fields)!==null&&a!==void 0?a:{},eventsWithMissingFields:(l=t.events_with_missing_fields)!==null&&l!==void 0?l:{},eventsWithInvalidIdLengths:(u=t.events_with_invalid_id_lengths)!==null&&u!==void 0?u:{},epsThreshold:(d=t.eps_threshold)!==null&&d!==void 0?d:0,exceededDailyQuotaDevices:(f=t.exceeded_daily_quota_devices)!==null&&f!==void 0?f:{},silencedDevices:(h=t.silenced_devices)!==null&&h!==void 0?h:[],silencedEvents:(p=t.silenced_events)!==null&&p!==void 0?p:[],throttledDevices:(g=t.throttled_devices)!==null&&g!==void 0?g:{},throttledEvents:(v=t.throttled_events)!==null&&v!==void 0?v:[]}};case hn.PayloadTooLarge:return{status:P,statusCode:C,body:{error:(w=t.error)!==null&&w!==void 0?w:""}};case hn.RateLimit:return{status:P,statusCode:C,body:{error:(y=t.error)!==null&&y!==void 0?y:"",epsThreshold:(x=t.eps_threshold)!==null&&x!==void 0?x:0,throttledDevices:(b=t.throttled_devices)!==null&&b!==void 0?b:{},throttledUsers:(_=t.throttled_users)!==null&&_!==void 0?_:{},exceededDailyQuotaDevices:(S=t.exceeded_daily_quota_devices)!==null&&S!==void 0?S:{},exceededDailyQuotaUsers:(E=t.exceeded_daily_quota_users)!==null&&E!==void 0?E:{},throttledEvents:(k=t.throttled_events)!==null&&k!==void 0?k:[]}};case hn.Timeout:default:return{status:P,statusCode:C}}},e.prototype.buildStatus=function(t){return t>=200&&t<300?hn.Success:t===429?hn.RateLimit:t===413?hn.PayloadTooLarge:t===408?hn.Timeout:t>=400&&t<500?hn.Invalid:t>=500?hn.Failed:hn.Unknown},e}(),w9="Network error occurred, remote config fetch failed",b9="Remote config successfully fetched",_9="Remote config fetch rejected due to exceeded retry count",sC="Remote config fetch rejected due to timeout after 5 seconds",oC="Unexpected error occurred",S9="https://sr-client-cfg.amplitude.com/config",E9="https://sr-client-cfg.stag2.amplitude.com/config",k9="https://sr-client-cfg.eu.amplitude.com/config",C9=function(){function e(t){var n=t.localConfig,r=t.configKeys,i=this;this.retryTimeout=1e3,this.attempts=0,this.sessionTargetingMatch=!1,this.metrics={},this.getRemoteNamespaceConfig=function(s,o){return W(i,void 0,void 0,function(){var a,l,u;return q(this,function(d){switch(d.label){case 0:return a=Date.now(),[4,this.fetchWithTimeout(o)];case 1:return l=d.sent(),l&&(u=l.configs&&l.configs[s],u)?(this.metrics.fetchTimeAPISuccess=Date.now()-a,[2,u]):(this.metrics.fetchTimeAPIFail=Date.now()-a,[2,void 0])}})})},this.getRemoteConfig=function(s,o,a){return W(i,void 0,void 0,function(){var l;return q(this,function(u){switch(u.label){case 0:return[4,this.getRemoteNamespaceConfig(s,a)];case 1:return l=u.sent(),[2,l==null?void 0:l[o]]}})})},this.fetchWithTimeout=function(s){return W(i,void 0,void 0,function(){var o,a,l;return q(this,function(u){switch(u.label){case 0:return o=new AbortController,a=setTimeout(function(){return o.abort()},5e3),[4,this.fetchRemoteConfig(o.signal,s)];case 1:return l=u.sent(),clearTimeout(a),[2,l]}})})},this.fetchRemoteConfig=function(s,o){return W(i,void 0,void 0,function(){var a,l,u,d,f,h,p,g,v,w,y,x,b;return q(this,function(_){switch(_.label){case 0:if(o===this.lastFetchedSessionId&&this.attempts>=this.localConfig.flushMaxRetries)return[2,this.completeRequest({err:_9})];if(s.aborted)return[2,this.completeRequest({err:sC})];o!==this.lastFetchedSessionId&&(this.lastFetchedSessionId=o,this.attempts=0),_.label=1;case 1:_.trys.push([1,3,,4]),a=new URLSearchParams({api_key:this.localConfig.apiKey});try{for(l=De(this.configKeys),u=l.next();!u.done;u=l.next())d=u.value,a.append("config_keys",d)}catch(S){y={error:S}}finally{try{u&&!u.done&&(x=l.return)&&x.call(l)}finally{if(y)throw y.error}}return o&&a.set("session_id",String(o)),f={headers:{Accept:"*/*"},method:"GET"},h="".concat(this.getServerUrl(),"?").concat(a.toString()),this.attempts+=1,[4,fetch(h,Y(Y({},f),{signal:s}))];case 2:if(p=_.sent(),p===null)return[2,this.completeRequest({err:oC})];switch(g=new x9().buildStatus(p.status),g){case hn.Success:return this.attempts=0,[2,this.parseAndStoreConfig(p)];case hn.Failed:return[2,this.retryFetch(s,o)];default:return[2,this.completeRequest({err:w9})]}case 3:return v=_.sent(),w=v,s.aborted?[2,this.completeRequest({err:sC})]:[2,this.completeRequest({err:(b=w.message)!==null&&b!==void 0?b:oC})];case 4:return[2]}})})},this.retryFetch=function(s,o){return W(i,void 0,void 0,function(){var a=this;return q(this,function(l){switch(l.label){case 0:return[4,new Promise(function(u){return setTimeout(u,a.attempts*a.retryTimeout)})];case 1:return l.sent(),[2,this.fetchRemoteConfig(s,o)]}})})}
86,this.parseAndStoreConfig=function(s){return W(i,void 0,void 0,function(){var o;return q(this,function(a){switch(a.label){case 0:return[4,s.json()];case 1:return o=a.sent(),this.completeRequest({success:b9}),[2,o]}})})},this.localConfig=n,this.configKeys=r}return e.prototype.getServerUrl=function(){return this.localConfig.configServerUrl?this.localConfig.configServerUrl:this.localConfig.serverZone===Hp.STAGING?E9:this.localConfig.serverZone===Hp.EU?k9:S9},e.prototype.completeRequest=function(t){var n=t.err,r=t.success;if(n)throw new Error(n);r&&this.localConfig.loggerProvider.log(r)},e}(),T9=function(e){var t=e.localConfig,n=e.configKeys;return W(void 0,void 0,void 0,function(){return q(this,function(r){return[2,new C9({localConfig:t,configKeys:n})]})})},j9=T9,P9=function(e,t){var n=document.createDocumentFragment(),r=function(i){if(i===void 0&&(i=[]),typeof i=="string"&&(i=[i]),i=i.filter(function(s){try{n.querySelector(s)}catch{return t.warn('[session-replay-browser] omitting selector "'.concat(s,'" because it is invalid')),!1}return!0}),i.length!==0)return i};return e.blockSelector=r(e.blockSelector),e.maskSelector=r(e.maskSelector),e.unmaskSelector=r(e.unmaskSelector),e},N9=function(){function e(t,n){this.localConfig=n,this.remoteConfigFetch=t}return e.prototype.generateJoinedConfig=function(t){var n,r,i,s;return W(this,void 0,void 0,function(){var o,a,l,u,d,f,h,p,g,v,w,y,x,b,_,S,E,k,C,P,T;return q(this,function(N){switch(N.label){case 0:o=Y({},this.localConfig),o.optOut=this.localConfig.optOut,o.captureEnabled=!0,N.label=1;case 1:return N.trys.push([1,3,,4]),[4,this.remoteConfigFetch.getRemoteNamespaceConfig("sessionReplay",t)];case 2:return l=N.sent(),l&&(u=l.sr_sampling_config,d=l.sr_privacy_config,f=(n=o.interactionConfig)===null||n===void 0?void 0:n.ugcFilterRules,o.interactionConfig=l.sr_interaction_config,o.interactionConfig&&f&&(o.interactionConfig.ugcFilterRules=f),o.loggingConfig=l.sr_logging_config,(u||d)&&(a={},u&&(a.sr_sampling_config=u),d&&(a.sr_privacy_config=d))),[3,4];case 3:return h=N.sent(),p=h,this.localConfig.loggerProvider.warn(p.message),o.captureEnabled=!1,[3,4];case 4:if(!a)return[2,{localConfig:this.localConfig,joinedConfig:o,remoteConfig:a}];if(g=a.sr_sampling_config,v=a.sr_privacy_config,g&&Object.keys(g).length>0?(Object.prototype.hasOwnProperty.call(g,"capture_enabled")?o.captureEnabled=g.capture_enabled:o.captureEnabled=!1,Object.prototype.hasOwnProperty.call(g,"sample_rate")&&(o.sampleRate=g.sample_rate)):(o.captureEnabled=!0,this.localConfig.loggerProvider.debug("Remote config successfully fetched, but no values set for project, Session Replay capture enabled.")),v){w=(r=o.privacyConfig)!==null&&r!==void 0?r:{},y={defaultMaskLevel:(s=(i=v.defaultMaskLevel)!==null&&i!==void 0?i:w.defaultMaskLevel)!==null&&s!==void 0?s:"medium",blockSelector:[],maskSelector:[],unmaskSelector:[]},x=function(I){var O,j,A,V,$,R,L,H,z,Q={};typeof I.blockSelector=="string"&&(I.blockSelector=[I.blockSelector]);try{for(var de=De((L=I.blockSelector)!==null&&L!==void 0?L:[]),ne=de.next();!ne.done;ne=de.next()){var ye=ne.value;Q[ye]="block"}}catch(Fe){O={error:Fe}}finally{try{ne&&!ne.done&&(j=de.return)&&j.call(de)}finally{if(O)throw O.error}}try{for(var he=De((H=I.maskSelector)!==null&&H!==void 0?H:[]),Pe=he.next();!Pe.done;Pe=he.next()){var ye=Pe.value;Q[ye]="mask"}}catch(Fe){A={error:Fe}}finally{try{Pe&&!Pe.done&&(V=he.return)&&V.call(he)}finally{if(A)throw A.error}}try{for(var Ue=De((z=I.unmaskSelector)!==null&&z!==void 0?z:[]),Ae=Ue.next();!Ae.done;Ae=Ue.next()){var ye=Ae.value;Q[ye]="unmask"}}catch(Fe){$={error:Fe}}finally{try{Ae&&!Ae.done&&(R=Ue.return)&&R.call(Ue)}finally{if($)throw $.error}}return Q},b=Y(Y({},x(w)),x(v));try{for(_=De(Object.entries(b)),S=_.next();!S.done;S=_.next())E=Te(S.value,2),k=E[0],C=E[1],C==="mask"?y.maskSelector.push(k):C==="block"?y.blockSelector.push(k):C==="unmask"&&y.unmaskSelector.push(k)}catch(I){P={error:I}}finally{try{S&&!S.done&&(T=_.return)&&T.call(_)}finally{if(P)throw P.error}}o.privacyConfig=P9(y,this.localConfig.loggerProvider)}return this.localConfig.loggerProvider.debug(JSON.stringify({name:"session replay joined config",config:XI(o)},null,2)),[2,{localConfig:this.localConfig,joinedConfig:o,remoteConfig:a}]}})})},e}(),R9=function(e,t){return W(void 0,void 0,void 0,function(){var n,r;return q(this,function(i){switch(i.label){case 0:return n=new y9(e,t),[4,j9({localConfig:n,configKeys:["sessionReplay"]})];case 1:return r=i.sent(),[2,new N9(r,n)]}})})},I9="Unexpected error occurred",A9="Network error occurred, event batch rejected",O9="Session replay event batch rejected due to exceeded retry count",Za="Failed to store session replay events in IndexedDB",D9="Session replay event batch not sent due to missing device ID",M9="Session replay event batch not sent due to missing api key",xx="1.27.0",L9=function(){function e(t){var n=t.trackServerUrl,r=t.loggerProvider,i=t.payloadBatcher;this.storageKey="",this.retryTimeout=1e3,this.scheduled=null,this.queue=[],this.loggerProvider=r,this.payloadBatcher=i||function(s){return s},this.trackServerUrl=n}return e.prototype.sendEventsList=function(t){this.addToQueue(Y(Y({},t),{attempts:0,timeout:0}))},e.prototype.addToQueue=function(){for(var t=this,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.filter(function(s){return s.attempts<(s.flushMaxRetries||0)?(s.attempts+=1,!0):(t.completeRequest({context:s,err:O9}),!1)});
vendor: 31,397 bytes, line 86
86i.forEach(function(s){if(t.queue=t.queue.concat(s),s.timeout===0){t.schedule(0);return}setTimeout(function(){s.timeout=0,t.schedule(0)},s.timeout)})},e.prototype.schedule=function(t){var n=this;this.scheduled||(this.scheduled=setTimeout(function(){n.flush(!0).then(function(){n.queue.length>0&&n.schedule(t)})},t))},e.prototype.flush=function(t){return t===void 0&&(t=!1),W(this,void 0,void 0,function(){var n,r,i=this;return q(this,function(s){switch(s.label){case 0:return n=[],r=[],this.queue.forEach(function(o){return o.timeout===0?n.push(o):r.push(o)}),this.queue=r,this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),[4,Promise.all(n.map(function(o){return i.send(o,t)}))];case 1:return s.sent(),[2]}})})},e.prototype.send=function(t,n){var r,i;return n===void 0&&(n=!0),W(this,void 0,void 0,function(){var s,o,a,l,u,d,f,h,p,g,v,w,y;return q(this,function(x){switch(x.label){case 0:if(s=t.apiKey,!s)return[2,this.completeRequest({context:t,err:M9})];if(o=t.deviceId,!o)return[2,this.completeRequest({context:t,err:D9})];if(a=h9(),l=xx,u=t.sampleRate,d=new URLSearchParams({device_id:o,session_id:"".concat(t.sessionId),type:"".concat(t.type)}),f="".concat(((r=t.version)===null||r===void 0?void 0:r.type)||"standalone","/").concat(((i=t.version)===null||i===void 0?void 0:i.version)||l),h=this.payloadBatcher({version:1,events:t.events}),h.events.length===0)return this.completeRequest({context:t}),[2];x.label=1;case 1:return x.trys.push([1,3,,4]),p={headers:{"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(s),"X-Client-Version":l,"X-Client-Library":f,"X-Client-Url":a.substring(0,l9),"X-Client-Sample-Rate":"".concat(u)},body:JSON.stringify(h),method:"POST"},g="".concat(YI(t.serverZone,this.trackServerUrl),"?").concat(d.toString()),[4,fetch(g,p)];case 2:if(v=x.sent(),v===null)return this.completeRequest({context:t,err:I9}),[2];if(n)this.handleReponse(v.status,t);else{w="";try{w=JSON.stringify(v.body,null,2)}catch{}this.completeRequest({context:t,success:"".concat(v.status,": ").concat(w)})}return[3,4];case 3:return y=x.sent(),this.completeRequest({context:t,err:y}),[3,4];case 4:return[2]}})})},e.prototype.handleReponse=function(t,n){var r=new hf().buildStatus(t);switch(r){case Et.Success:this.handleSuccessResponse(n);break;case Et.Failed:this.handleOtherResponse(n);break;default:this.completeRequest({context:n,err:A9})}},e.prototype.handleSuccessResponse=function(t){var n=Math.round(new Blob(t.events).size/GI);this.completeRequest({context:t,success:"Session replay event batch tracked successfully for session id ".concat(t.sessionId,", size of events: ").concat(n," KB")})},e.prototype.handleOtherResponse=function(t){this.addToQueue(Y(Y({},t),{timeout:t.attempts*this.retryTimeout}))},e.prototype.completeRequest=function(t){var n=t.context,r=t.err,i=t.success;n.onComplete(),r?this.loggerProvider.warn(r):i&&this.loggerProvider.log(i)},e}();const wx=(e,t)=>t.some(n=>e instanceof n);let aC,lC;function F9(){return aC||(aC=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function $9(){return lC||(lC=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const bx=new WeakMap,Xv=new WeakMap,dg=new WeakMap;function U9(e){const t=new Promise((n,r)=>{const i=()=>{e.removeEventListener("success",s),e.removeEventListener("error",o)},s=()=>{n(ya(e.result)),i()},o=()=>{r(e.error),i()};e.addEventListener("success",s),e.addEventListener("error",o)});return dg.set(t,e),t}function V9(e){if(bx.has(e))return;const t=new Promise((n,r)=>{const i=()=>{e.removeEventListener("complete",s),e.removeEventListener("error",o),e.removeEventListener("abort",o)},s=()=>{n(),i()},o=()=>{r(e.error||new DOMException("AbortError","AbortError")),i()};e.addEventListener("complete",s),e.addEventListener("error",o),e.addEventListener("abort",o)});bx.set(e,t)}let _x={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return bx.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return ya(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function tA(e){_x=e(_x)}function z9(e){return $9().includes(e)?function(...t){return e.apply(Sx(this),t),ya(this.request)}:function(...t){return ya(e.apply(Sx(this),t))}}function B9(e){return typeof e=="function"?z9(e):(e instanceof IDBTransaction&&V9(e),wx(e,F9())?new Proxy(e,_x):e)}function ya(e){if(e instanceof IDBRequest)return U9(e);if(Xv.has(e))return Xv.get(e);const t=B9(e);return t!==e&&(Xv.set(e,t),dg.set(t,e)),t}const Sx=e=>dg.get(e);function W9(e,t,{blocked:n,upgrade:r,blocking:i,terminated:s}={}){const o=indexedDB.open(e,t),a=ya(o);return r&&o.addEventListener("upgradeneeded",l=>{r(ya(o.result),l.oldVersion,l.newVersion,ya(o.transaction),l)}),n&&o.addEventListener("blocked",l=>n(l.oldVersion,l.newVersion,l)),a.then(l=>{s&&l.addEventListener("close",()=>s()),i&&l.addEventListener("versionchange",u=>i(u.oldVersion,u.newVersion,u))}).catch(()=>{}),a}const q9=["get","getKey","getAll","getAllKeys","count"],H9=["put","add","delete","clear"],Zv=new Map;function cC(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(Zv.get(t))return Zv.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,i=H9.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(i||q9.includes(n)))return;const s=async function(o,...a){const l=this.transaction(o,i?"readwrite":"readonly");let u=l.store;return r&&(u=u.index(a.shift())),(await Promise.all([u[n](...a),i&&l.done]))[0]};return Zv.set(t,s),s}tA(e=>({...e,get:(t,n,r)=>cC(t,n)||e.get(t,n,r),has:(t,n)=>!!cC(t,n)||e.has(t,n)}));const G9=["continue","continuePrimaryKey","advance"],uC={},Ex=new WeakMap,nA=new WeakMap,K9={get(e,t){if(!G9.includes(t))return e[t];let n=uC[t];return n||(n=uC[t]=function(...r){Ex.set(this,nA.get(this)[t](...r))}),n}};async function*Y9(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;t=t;const n=new Proxy(t,K9);for(nA.set(n,t),dg.set(n,Sx(t));t;)yield n,t=await(Ex.get(n)||t.continue()),Ex.delete(n)}function dC(e,t){return t===Symbol.asyncIterator&&wx(e,[IDBIndex,IDBObjectStore,IDBCursor])||t==="iterate"&&wx(e,[IDBIndex,IDBObjectStore])}tA(e=>({...e,get(t,n,r){return dC(t,n)?Y9:e.get(t,n,r)},has(t,n){return dC(t,n)||e.has(t,n)}}));var rA=function(){function e(t){var n=this,r,i,s;this.minInterval=o9,this.maxInterval=a9,this.maxPersistedEventsSize=r9,this.interval=this.minInterval,this._timeAtLastSplit=Date.now(),this.shouldSplitEventsList=function(o,a){var l=n.getStringSize(a),u=n.getEventsArraySize(o);return u+l>=n.maxPersistedEventsSize?!0:Date.now()-n.timeAtLastSplit>n.interval&&o.length?(n.interval=Math.min(n.maxInterval,n.interval+n.minInterval),n._timeAtLastSplit=Date.now(),!0):!1},this.loggerProvider=t.loggerProvider,this.minInterval=(r=t.minInterval)!==null&&r!==void 0?r:this.minInterval,this.maxInterval=(i=t.maxInterval)!==null&&i!==void 0?i:this.maxInterval,this.maxPersistedEventsSize=(s=t.maxPersistedEventsSize)!==null&&s!==void 0?s:this.maxPersistedEventsSize}return Object.defineProperty(e.prototype,"timeAtLastSplit",{get:function(){return this._timeAtLastSplit},enumerable:!1,configurable:!0}),e.prototype.getStringSize=function(t){return t.length},e.prototype.getEventsArraySize=function(t){var n,r,i=0;try{for(var s=De(t),o=s.next();!o.done;o=s.next()){var a=o.value;i+=this.getStringSize(a)}}catch(u){n={error:u}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}var l=2+Math.max(0,t.length-1)+t.length*2;return i+l},e}(),Gp;(function(e){e.RECORDING="recording",e.SENT="sent"})(Gp||(Gp={}));var Vu="sessionCurrentSequence",zu="sequencesToSend",Q9=function(){var e=et();return new Promise(function(t,n){if(!e)return n(new Error("Global scope not found"));if(!e.indexedDB)return n(new Error("Session Replay: cannot find indexedDB"));try{var r=e.indexedDB.open("keyval-store");r.onupgradeneeded=function(){r.result.version===1&&(r.result.close(),r.transaction&&r.transaction.abort(),e.indexedDB.deleteDatabase("keyval-store"),t())},r.onsuccess=function(){t(r.result)},r.onerror=function(){n(r.error)}}catch(i){n(i)}})},fC=function(e){return W(void 0,void 0,void 0,function(){var t,n;return q(this,function(r){switch(r.label){case 0:return e.length>0?(t=10,n=e.splice(0,t),[4,Promise.all(n)]):[3,2];case 1:return r.sent(),[3,0];case 2:return[2]}})})},X9=function(e){var t,n;return e.objectStoreNames.contains(Vu)||(n=e.createObjectStore(Vu,{keyPath:"sessionId"})),e.objectStoreNames.contains(zu)||(t=e.createObjectStore(zu,{keyPath:"sequenceId",autoIncrement:!0}),t.createIndex("sessionId","sessionId")),{sequencesStore:t,currentSequenceStore:n}},Z9=function(e){return W(void 0,void 0,void 0,function(){return q(this,function(t){switch(t.label){case 0:return[4,W9(e,1,{upgrade:X9})];case 1:return[2,t.sent()]}})})},J9=function(e){Xt(t,e);function t(n){var r=e.call(this,n)||this;return r.getSequencesToSend=function(){return W(r,void 0,void 0,function(){var i,s,o,a,l,u;return q(this,function(d){switch(d.label){case 0:return d.trys.push([0,5,,6]),i=[],[4,this.db.transaction("sequencesToSend").store.openCursor()];case 1:s=d.sent(),d.label=2;case 2:return s?(o=s.value,a=o.sessionId,l=o.events,i.push({events:l,sequenceId:s.key,sessionId:a}),[4,s.continue()]):[3,4];case 3:return s=d.sent(),[3,2];case 4:return[2,i];case 5:return u=d.sent(),this.loggerProvider.warn("".concat(Za,": ").concat(u)),[3,6];case 6:return[2,void 0]}})})},r.storeCurrentSequence=function(i){return W(r,void 0,void 0,function(){var s,o,a;return q(this,function(l){switch(l.label){case 0:return l.trys.push([0,4,,5]),[4,this.db.get(Vu,i)];case 1:return s=l.sent(),s?[4,this.db.put(zu,{sessionId:i,events:s.events})]:[2,void 0];case 2:return o=l.sent(),[4,this.db.put(Vu,{sessionId:i,events:[]})];case 3:return l.sent(),[2,Y(Y({},s),{sessionId:i,sequenceId:o})];case 4:return a=l.sent(),this.loggerProvider.warn("".concat(Za,": ").concat(a)),[3,5];case 5:return[2,void 0]}})})},r.addEventToCurrentSequence=function(i,s){return W(r,void 0,void 0,function(){var o,a,l,u,d,f;return q(this,function(h){switch(h.label){case 0:return h.trys.push([0,10,,11]),o=this.db.transaction(Vu,"readwrite"),[4,o.store.get(i)];case 1:return a=h.sent(),a?[3,3]:[4,o.store.put({sessionId:i,events:[s]})];case 2:return h.sent(),[2];case 3:return l=void 0,this.shouldSplitEventsList(a.events,s)?(l=a.events,[4,o.store.put({sessionId:i,events:[s]})]):[3,5];case 4:return h.sent(),[3,7];case 5:return u=a.events.concat(s),[4,o.store.put({sessionId:i,events:u})];case 6:h.sent(),h.label=7;case 7:return[4,o.done];case 8:return h.sent(),l?[4,this.storeSendingEvents(i,l)]:[2,void 0];case 9:return d=h.sent(),d?[2,{events:l,sessionId:i,sequenceId:d}]:[2,void 0];case 10:return f=h.sent(),this.loggerProvider.warn("".concat(Za,": ").concat(f)),[3,11];case 11:return[2,void 0]}})})},r.storeSendingEvents=function(i,s){return W(r,void 0,void 0,function(){var o,a;return q(this,function(l){switch(l.label){case 0:return l.trys.push([0,2,,3]),[4,this.db.put(zu,{sessionId:i,events:s})];case 1:return o=l.sent(),[2,o];case 2:return a=l.sent(),this.loggerProvider.warn("".concat(Za,": ").concat(a)),[3,3];case 3:return[2,void 0]}})})},r.cleanUpSessionEventsStore=function(i,s){return W(r,void 0,void 0,function(){var o;return q(this,function(a){switch(a.label){case 0:if(!s)return[2];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.db.delete(zu,s)];case 2:return a.sent(),[3,4];case 3:return o=a.sent(),this.loggerProvider.warn("".concat(Za,": ").concat(o)),[3,4];case 4:return[2]}})})},r.transitionFromKeyValStore=function(i){return W(r,void 0,void 0,function(){var s,o,a,l,u,d,f,h,p=this;return q(this,function(g){switch(g.label){case 0:return g.trys.push([0,6,,7]),[4,Q9()];case 1:if(s=g.sent(),!s)return[2];o=function(v,w){return W(p,void 0,void 0,function(){var y,x,b=this;return q(this,function(_){switch(_.label){case 0:return y=w.sessionSequences,x=[],Object.keys(y).forEach(function(S){var E=parseInt(S,10),k=y[E];if(E===w.currentSequenceId){var C=k.events.map(function(P){return W(b,void 0,void 0,function(){return q(this,function(T){return[2,this.addEventToCurrentSequence(v,P)]})})});x.push.apply(x,Ke([],Te(C),!1))}else k.status!==Gp.SENT&&x.push(b.storeSendingEvents(v,k.events))}),[4,fC(x)];case 1:return _.sent(),[2]}})})},a="".concat(VR,"_").concat(this.apiKey.substring(0,10)),g.label=2;case 2:return g.trys.push([2,4,,5]),l=s.transaction("keyval").objectStore("keyval").getAll(a),u=new Promise(function(v){l.onsuccess=function(w){return W(p,void 0,void 0,function(){var y,x,b,_=this;return q(this,function(S){switch(S.label){case 0:return y=w&&w.target.result,x=y&&y[0],x?(b=[],Object.keys(x).forEach(function(E){var k=parseInt(E,10),C=x[k];if(i===k)b.push(o(k,C));else{var P=C.sessionSequences;Object.keys(P).forEach(function(T){var N=parseInt(T,10);P[N].status!==Gp.SENT&&b.push(_.storeSendingEvents(k,P[N].events))})}}),[4,fC(b)]):[3,2];case 1:S.sent(),S.label=2;case 2:return v(),[2]}})})}}),[4,u];case 3:return g.sent(),d=et(),d&&d.indexedDB.deleteDatabase("keyval-store"),[3,5];case 4:return f=g.sent(),this.loggerProvider.warn("Failed to transition session replay events from keyval to new store: ".concat(f)),[3,5];case 5:return[3,7];case 6:return h=g.sent(),this.loggerProvider.warn("Failed to access keyval store: ".concat(h,". For more information, visit: https://www.docs.developers.amplitude.com/session-replay/sdks/standalone/#indexeddb-best-practices")),[3,7];case 7:return[2]}})})},r.apiKey=n.apiKey,r.db=n.db,r}return t.new=function(n,r,i){return W(this,void 0,void 0,function(){var s,o,a,l,u;return q(this,function(d){switch(d.label){case 0:return d.trys.push([0,3,,4]),s=n==="replay"?"":"_".concat(n),o="".concat(r.apiKey.substring(0,10),"_amp_session_replay_events").concat(s),[4,Z9(o)];case 1:return a=d.sent(),l=new t(Y(Y({},r),{db:a})),[4,l.transitionFromKeyValStore(i)];case 2:return d.sent(),[2,l];case 3:return u=d.sent(),r.loggerProvider.warn("".concat(Za,": ").concat(u)),[3,4];case 4:return[2]}})})},t.prototype.getCurrentSequenceEvents=function(n){return W(this,void 0,void 0,function(){var o,r,i,s,o,a,l,u;return q(this,function(d){switch(d.label){case 0:return n?[4,this.db.get("sessionCurrentSequence",n)]:[3,2];case 1:return o=d.sent(),o?[2,[o]]:[2,void 0];case 2:r=[],d.label=3;case 3:return d.trys.push([3,8,9,10]),[4,this.db.getAll("sessionCurrentSequence")];case 4:i=De.apply(void 0,[d.sent()]),s=i.next(),d.label=5;case 5:if(s.done)return[3,7];o=s.value,r.push(o),d.label=6;case 6:return s=i.next(),[3,5];case 7:return[3,10];case 8:return a=d.sent(),l={error:a},[3,10];case 9:try{s&&!s.done&&(u=i.return)&&u.call(i)}finally{if(l)throw l.error}return[7];case 10:return[2,r]}})})},t}(rA),eG=function(e){Xt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.finalizedSequences={},n.sequences={},n.sequenceId=0,n}return t.prototype.resetCurrentSequence=function(n){this.sequences[n]=[]},t.prototype.addSequence=function(n){var r=this.sequenceId++,i=Ke([],Te(this.sequences[n]),!1);return this.finalizedSequences[r]={sessionId:n,events:i},this.resetCurrentSequence(n),{sequenceId:r,events:i,sessionId:n}},t.prototype.getSequencesToSend=function(){return W(this,void 0,void 0,function(){return q(this,function(n){return[2,Object.entries(this.finalizedSequences).map(function(r){var i=Te(r,2),s=i[0],o=i[1],a=o.sessionId,l=o.events;return{sequenceId:Number(s),sessionId:a,events:l}})]})})},t.prototype.storeCurrentSequence=function(n){return W(this,void 0,void 0,function(){return q(this,function(r){return this.sequences[n]?[2,this.addSequence(n)]:[2,void 0]})})},t.prototype.addEventToCurrentSequence=function(n,r){return W(this,void 0,void 0,function(){var i;return q(this,function(s){return this.sequences[n]||this.resetCurrentSequence(n),this.shouldSplitEventsList(this.sequences[n],r)&&(i=this.addSequence(n)),this.sequences[n].push(r),[2,i]})})},t.prototype.storeSendingEvents=function(n,r){return W(this,void 0,void 0,function(){return q(this,function(i){return this.finalizedSequences[this.sequenceId]={sessionId:n,events:r},[2,this.sequenceId++]})})},t.prototype.cleanUpSessionEventsStore=function(n,r){return W(this,void 0,void 0,function(){return q(this,function(i){return r!==void 0&&delete this.finalizedSequences[r],[2]})})},t}(rA),hC=function(e){var t=e.config,n=e.sessionId,r=e.minInterval,i=e.maxInterval,s=e.type,o=e.payloadBatcher,a=e.storeType;return W(void 0,void 0,void 0,function(){function l(x){return x===void 0&&(x=!1),W(this,void 0,void 0,function(){return q(this,function(b){return[2,u.flush(x)]})})}var u,d,f,h,p,g,v,w,y;return q(this,function(x){switch(x.label){case 0:return u=new L9(Y(Y({},t),{loggerProvider:t.loggerProvider,payloadBatcher:o})),d=function(){return new eG({loggerProvider:t.loggerProvider,maxInterval:i,minInterval:r})},f=function(){return W(void 0,void 0,void 0,function(){var b;return q(this,function(_){switch(_.label){case 0:return[4,J9.new(s,{loggerProvider:t.loggerProvider,minInterval:r,maxInterval:i,apiKey:t.apiKey},n)];case 1:return b=_.sent(),t.loggerProvider.log("Failed to initialize idb store, falling back to memory store."),[2,b??d()]}})})},a!=="idb"?[3,2]:[4,f()];case 1:return p=x.sent(),[3,3];case 2:p=d(),x.label=3;case 3:return h=p,g=function(b){var _=b.events,S=b.sessionId,E=b.deviceId,k=b.sequenceId;t.debugMode&&QI().then(function(C){var P=C.totalStorageSize,T=C.percentOfQuota,N=C.usageDetails;t.loggerProvider.debug("Total storage size: ".concat(P," KB, percentage of quota: ").concat(T,"%, usage details: ").concat(N))}).catch(function(){}),u.sendEventsList({events:_,sessionId:S,flushMaxRetries:t.flushMaxRetries,apiKey:t.apiKey,deviceId:E,sampleRate:t.sampleRate,serverZone:t.serverZone,version:t.version,type:s,onComplete:function(){return W(void 0,void 0,void 0,function(){return q(this,function(C){switch(C.label){case 0:return[4,h.cleanUpSessionEventsStore(S,k)];case 1:return C.sent(),[2]}})})}})},v=function(b){var _=b.sessionId,S=b.deviceId;h.storeCurrentSequence(_).then(function(E){E&&g({sequenceId:E.sequenceId,events:E.events,sessionId:E.sessionId,deviceId:S})}).catch(function(E){t.loggerProvider.warn("Failed to get current sequence of session replay events for session:",E)})},w=function(b){var _=b.deviceId;return W(void 0,void 0,void 0,function(){var S;return q(this,function(E){switch(E.label){case 0:return[4,h.getSequencesToSend()];case 1:return S=E.sent(),S&&S.forEach(function(k){g({sequenceId:k.sequenceId,events:k.events,sessionId:k.sessionId,deviceId:_})}),[2]}})})},y=function(b){var _=b.event,S=b.sessionId,E=b.deviceId;h.addEventToCurrentSequence(S,_.data).then(function(k){return k&&g({sequenceId:k.sequenceId,events:k.events,sessionId:k.sessionId,deviceId:E})}).catch(function(k){t.loggerProvider.warn("Failed to add event to session replay capture:",k)})},[2,{sendCurrentSequenceEvents:v,addEvent:y,sendStoredEvents:w,flush:l}]}})})},pC=function(){function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=new Map;t.forEach(function(i){r.set(i.name,i.manager)}),this.managers=r}return e.prototype.sendStoredEvents=function(t){return W(this,void 0,void 0,function(){var n;return q(this,function(r){switch(r.label){case 0:return n=[],this.managers.forEach(function(i){n.push(i.sendStoredEvents(t))}),[4,Promise.all(n)];case 1:return r.sent(),[2]}})})},e.prototype.addEvent=function(t){var n,r=t.sessionId,i=t.event,s=t.deviceId;(n=this.managers.get(i.type))===null||n===void 0||n.addEvent({sessionId:r,event:i,deviceId:s})},e.prototype.sendCurrentSequenceEvents=function(t){var n=t.sessionId,r=t.deviceId;this.managers.forEach(function(i){i.sendCurrentSequenceEvents({sessionId:n,deviceId:r})})},e.prototype.flush=function(t){return W(this,void 0,void 0,function(){var n;return q(this,function(r){switch(r.label){case 0:return n=[],this.managers.forEach(function(i){n.push(i.flush(t))}),[4,Promise.all(n)];case 1:return r.sent(),[2]}})})},e}();const mC={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},gC={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},lh={};function tG(e){var t,n;const r=(n=(t=globalThis==null?void 0:globalThis.Zone)==null?void 0:t.__symbol__)==null?void 0:n.call(t,e);if(r&&globalThis[r])return globalThis[r]}function s_(e){if(lh[e])return lh[e];const t=tG(e)||globalThis[e],n=t.prototype,r=e in mC?mC[e]:void 0,i=!!(r&&r.every(a=>{var l,u;return!!((u=(l=Object.getOwnPropertyDescriptor(n,a))==null?void 0:l.get)!=null&&u.toString().includes("[native code]"))})),s=e in gC?gC[e]:void 0,o=!!(s&&s.every(a=>{var l;return typeof n[a]=="function"&&((l=n[a])==null?void 0:l.toString().includes("[native code]"))}));if(i&&o)return lh[e]=t.prototype,t.prototype;try{const a=document.createElement("iframe");document.body.appendChild(a);const l=a.contentWindow;if(!l)return t.prototype;const u=l[e].prototype;return document.body.removeChild(a),u?lh[e]=u:n}catch{return n}}const Jv={};function Fo(e,t,n){var r;const i=`${e}.${String(n)}`;if(Jv[i])return Jv[i].call(t);const s=s_(e),o=(r=Object.getOwnPropertyDescriptor(s,n))==null?void 0:r.get;return o?(Jv[i]=o,o.call(t)):t[n]}const ey={};function iA(e,t,n){const r=`${e}.${String(n)}`;if(ey[r])return ey[r].bind(t);const s=s_(e)[n];return typeof s!="function"?t[n]:(ey[r]=s,s.bind(t))}function nG(e){return Fo("Node",e,"childNodes")}function rG(e){return Fo("Node",e,"parentNode")}function iG(e){return Fo("Node",e,"parentElement")}function sG(e){return Fo("Node",e,"textContent")}function oG(e,t){return iA("Node",e,"contains")(t)}function aG(e){return iA("Node",e,"getRootNode")()}function lG(e){return!e||!("host"in e)?null:Fo("ShadowRoot",e,"host")}function cG(e){return e.styleSheets}function uG(e){return!e||!("shadowRoot"in e)?null:Fo("Element",e,"shadowRoot")}function dG(e,t){return Fo("Element",e,"querySelector")(t)}function fG(e,t){return Fo("Element",e,"querySelectorAll")(t)}function hG(){return s_("MutationObserver").constructor}const vC={childNodes:nG,parentNode:rG,parentElement:iG,textContent:sG,contains:oG,getRootNode:aG,host:lG,styleSheets:cG,shadowRoot:uG,querySelector:dG,querySelectorAll:fG,mutationObserver:hG};function pG(e){var t,n,r,i,s=e.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:s.documentElement.scrollLeft||(s==null?void 0:s.body)&&((t=vC.parentElement(s.body))===null||t===void 0?void 0:t.scrollLeft)||((n=s==null?void 0:s.body)===null||n===void 0?void 0:n.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:(s==null?void 0:s.documentElement.scrollTop)||(s==null?void 0:s.body)&&((r=vC.parentElement(s.body))===null||r===void 0?void 0:r.scrollTop)||((i=s==null?void 0:s.body)===null||i===void 0?void 0:i.scrollTop)||0}}function ty(){var e=et();return(e==null?void 0:e.innerHeight)||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight||0}function ny(){var e=et();return(e==null?void 0:e.innerWidth)||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth||0}var Pr,o_,sA;function mG(e,t){if(sA=new Date,e.nodeType!==Node.ELEMENT_NODE)throw new Error("Can't generate CSS selector for non-element node type.");if(e.tagName.toLowerCase()==="html")return"html";var n={root:document.body,idName:function(s){return!0},className:function(s){return!0},tagName:function(s){return!0},attr:function(s,o){return!1},seedMinLength:1,optimizedMinLength:2,threshold:1e3,maxNumberOfTries:1e4,timeoutMs:void 0};Pr=Y(Y({},n),t),o_=gG(Pr.root,n);var r=ch(e,"all",function(){return ch(e,"two",function(){return ch(e,"one",function(){return ch(e,"none")})})});if(r){var i=lA(cA(r,e));return i.length>0&&(r=i[0]),fg(r)}else throw new Error("Selector was not found.")}function gG(e,t){return e.nodeType===Node.DOCUMENT_NODE?e:e===t.root?e.ownerDocument:e}function ch(e,t,n){for(var r=null,i=[],s=e,o=0,a=function(){var u,d,f=new Date().getTime()-sA.getTime();if(Pr.timeoutMs!==void 0&&f>Pr.timeoutMs)throw new Error("Timeout: Can't find a unique selector after ".concat(f,"ms"));var h=dh(vG(s))||dh.apply(void 0,Ke([],Te(yG(s)),!1))||dh.apply(void 0,Ke([],Te(xG(s)),!1))||dh(wG(s))||[wC()],p=bG(s);if(t=="all")p&&(h=h.concat(h.filter(ry).map(function(x){return uh(x,p)})));else if(t=="two")h=h.slice(0,1),p&&(h=h.concat(h.filter(ry).map(function(x){return uh(x,p)})));else if(t=="one"){var g=Te(h=h.slice(0,1),1),v=g[0];p&&ry(v)&&(h=[uh(v,p)])}else t=="none"&&(h=[wC()],p&&(h=[uh(h[0],p)]));try{for(var w=(u=void 0,De(h)),y=w.next();!y.done;y=w.next()){var v=y.value;v.level=o}}catch(x){u={error:x}}finally{try{y&&!y.done&&(d=w.return)&&d.call(w)}finally{if(u)throw u.error}}if(i.push(h),i.length>=Pr.seedMinLength&&(r=yC(i,n),r))return"break";s=s.parentElement,o++};s;){var l=a();if(l==="break")break}return r||(r=yC(i,n)),!r&&n?n():r}function yC(e,t){var n,r,i=lA(aA(e));if(i.length>Pr.threshold)return t?t():null;try{for(var s=De(i),o=s.next();!o.done;o=s.next()){var a=o.value;if(oA(a))return a}}catch(l){n={error:l}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return null}function fg(e){for(var t=e[0],n=t.name,r=1;r<e.length;r++){var i=e[r].level||0;t.level===i-1?n="".concat(e[r].name," > ").concat(n):n="".concat(e[r].name," ").concat(n),t=e[r]}return n}function xC(e){return e.map(function(t){return t.penalty}).reduce(function(t,n){return t+n},0)}function oA(e){var t=fg(e);switch(o_.querySelectorAll(t).length){case 0:throw new Error("Can't select any node with this selector: ".concat(t));case 1:return!0;default:return!1}}function vG(e){var t=e.getAttribute("id");return t&&Pr.idName(t)?{name:"#"+CSS.escape(t),penalty:0}:null}function yG(e){var t=Array.from(e.attributes).filter(function(n){return Pr.attr(n.name,n.value)});return t.map(function(n){return{name:"[".concat(CSS.escape(n.name),'="').concat(CSS.escape(n.value),'"]'),penalty:.5}})}function xG(e){var t=Array.from(e.classList).filter(Pr.className);return t.map(function(n){return{name:"."+CSS.escape(n),penalty:1}})}function wG(e){var t=e.tagName.toLowerCase();return Pr.tagName(t)?{name:t,penalty:2}:null}function wC(){return{name:"*",penalty:3}}function bG(e){var t=e.parentNode;if(!t)return null;var n=t.firstChild;if(!n)return null;for(var r=0;n&&(n.nodeType===Node.ELEMENT_NODE&&r++,n!==e);)n=n.nextSibling;return r}function uh(e,t){return{name:e.name+":nth-child(".concat(t,")"),penalty:e.penalty+1}}function ry(e){return e.name!=="html"&&!e.name.startsWith("#")}function dh(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e.filter(_G);return n.length>0?n:null}function _G(e){return e!=null}function aA(e,t){var n,r,i,s,o,a;return t===void 0&&(t=[]),q(this,function(l){switch(l.label){case 0:if(!(e.length>0))return[3,9];l.label=1;case 1:l.trys.push([1,6,7,8]),n=De(e[0]),r=n.next(),l.label=2;case 2:return r.done?[3,5]:(i=r.value,[5,De(aA(e.slice(1,e.length),t.concat(i)))]);case 3:l.sent(),l.label=4;case 4:return r=n.next(),[3,2];case 5:return[3,8];case 6:return s=l.sent(),o={error:s},[3,8];case 7:try{r&&!r.done&&(a=n.return)&&a.call(n)}finally{if(o)throw o.error}return[7];case 8:return[3,11];case 9:return[4,t];case 10:l.sent(),l.label=11;case 11:return[2]}})}function lA(e){return Ke([],Te(e),!1).sort(function(t,n){return xC(t)-xC(n)})}function cA(e,t,n){var r,i,s;return n===void 0&&(n={counter:0,visited:new Map}),q(this,function(o){switch(o.label){case 0:if(!(e.length>2&&e.length>Pr.optimizedMinLength))return[3,5];r=1,o.label=1;case 1:return r<e.length-1?n.counter>Pr.maxNumberOfTries?[2]:(n.counter+=1,i=Ke([],Te(e),!1),i.splice(r,1),s=fg(i),n.visited.has(s)?[2]:oA(i)&&SG(i,t)?[4,i]:[3,4]):[3,5];case 2:return o.sent(),n.visited.set(s,!0),[5,De(cA(i,t,n))];case 3:o.sent(),o.label=4;case 4:return r++,[3,1];case 5:return[2]}})}function SG(e,t){return o_.querySelector(fg(e))===t}var EG=36e5,kG=function(e){var t=e.version,n=e.events,r=[];return n.forEach(function(i){var s=JSON.parse(i);s.count=1,s.type==="click"&&r.push(s)}),{version:t,events:r}},CG=function(e){var t=e.version,n=e.events,r=[];n.forEach(function(s){var o=JSON.parse(s);o.type==="click"&&r.push(o)});var i=r.reduce(function(s,o){var a=o.x,l=o.y,u=o.selector,d=o.timestamp,f=d-d%EG,h="".concat(a,":").concat(l,":").concat(u??"",":").concat(f);return s[h]?s[h].count+=1:s[h]=Y(Y({},o),{timestamp:f,count:1}),s},{});return{version:t,events:Object.values(i)}},TG=function(e,t){var n=t.eventsManager,r=t.sessionId,i=t.deviceIdFn,s=t.mirror,o=t.ugcFilterRules;return function(a){if(a.type===eA.Click){var l=et();if(l){var u=l.location,d=l.innerHeight,f=l.innerWidth;if(u){var h=a.x,p=a.y;if(!(h===void 0||p===void 0)){var g=s.getNode(a.id),v;if(g)try{v=mG(g)}catch{e.debug("error resolving selector from finder")}var w=pG(l),y=w.left,x=w.top,b=ug(u.href,o),_={x:h+y,y:p+x,selector:v,viewportHeight:d,viewportWidth:f,pageUrl:b,timestamp:Date.now(),type:"click"},S=i();S&&n.addEvent({sessionId:r,event:{type:"interaction",data:JSON.stringify(_)},deviceId:S})}}}}}},jG=function(){function e(t,n){var r=et();r&&r.navigator&&typeof r.navigator.sendBeacon=="function"?this.sendBeacon=function(i,s){try{if(r.navigator.sendBeacon(i,JSON.stringify(s)))return!0}catch{}return!1}:this.sendBeacon=function(){return!1},this.sendXhr=function(i,s){var o=new XMLHttpRequest;return o.open("POST",i,!0),o.setRequestHeader("Accept","*/*"),o.send(JSON.stringify(s)),!0},this.basePageUrl=YI(n.serverZone,n.trackServerUrl),this.apiKey=n.apiKey,this.context=t}return e.prototype.send=function(t,n){var r=this.context,i=r.sessionId,s=r.type,o=new URLSearchParams({device_id:t,session_id:String(i),type:String(s),api_key:this.apiKey}),a="".concat(this.basePageUrl,"?").concat(o.toString());this.sendBeacon(a,n)||this.sendXhr(a,n)},e}(),PG=function(){function e(t,n){var r=this;this.timestamp=Date.now(),this.hook=function(i){r.update(i)},this.send=function(i){return function(s){var o,a,l=i(),u=et();u&&l&&r.transport.send(l,{version:1,events:[{maxScrollX:r._maxScrollX,maxScrollY:r._maxScrollY,maxScrollWidth:r._maxScrollWidth,maxScrollHeight:r._maxScrollHeight,viewportHeight:ty(),viewportWidth:ny(),pageUrl:ug(u.location.href,(a=(o=r.config.interactionConfig)===null||o===void 0?void 0:o.ugcFilterRules)!==null&&a!==void 0?a:[]),timestamp:r.timestamp,type:"scroll"}]})}},this._maxScrollX=0,this._maxScrollY=0,this._maxScrollWidth=ny(),this._maxScrollHeight=ty(),this.config=n,this.transport=t}return e.default=function(t,n){return new e(new jG(t,n),n)},Object.defineProperty(e.prototype,"maxScrollX",{get:function(){return this._maxScrollX},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollY",{get:function(){return this._maxScrollY},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollWidth",{get:function(){return this._maxScrollWidth},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollHeight",{get:function(){return this._maxScrollHeight},enumerable:!1,configurable:!0}),e.prototype.update=function(t){var n=Date.now();if(t.x>this._maxScrollX){var r=ny();this._maxScrollX=t.x;var i=t.x+r;i>this._maxScrollWidth&&(this._maxScrollWidth=i),this.timestamp=n}if(t.y>this._maxScrollY){var s=ty();this._maxScrollY=t.y;var o=t.y+s;o>
vendor: 5,071 bytes, line 86
86this._maxScrollHeight&&(this._maxScrollHeight=o),this.timestamp=n}},e}(),bC=function(){function e(t){var n=t.sessionId,r=t.deviceId;this.deviceId=r,this.sessionId=n,n&&r&&(this.sessionReplayId=p9(n,r))}return e}(),Nr=Uint8Array,Nn=Uint16Array,Ed=Uint32Array,a_=new Nr([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),l_=new Nr([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),_C=new Nr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),uA=function(e,t){for(var n=new Nn(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new Ed(n[30]),r=1;r<30;++r)for(var s=n[r];s<n[r+1];++s)i[s]=s-n[r]<<5|r;return[n,i]},dA=uA(a_,2),NG=dA[0],kx=dA[1];NG[28]=258,kx[258]=28;var RG=uA(l_,0),SC=RG[1],Cx=new Nn(32768);for(var ct=0;ct<32768;++ct){var Es=(ct&43690)>>>1|(ct&21845)<<1;Es=(Es&52428)>>>2|(Es&13107)<<2,Es=(Es&61680)>>>4|(Es&3855)<<4,Cx[ct]=((Es&65280)>>>8|(Es&255)<<8)>>>1}var Bu=function(e,t,n){for(var r=e.length,i=0,s=new Nn(t);i<r;++i)++s[e[i]-1];var o=new Nn(t);for(i=0;i<t;++i)o[i]=o[i-1]+s[i-1]<<1;var a;if(n){a=new Nn(1<<t);var l=15-t;for(i=0;i<r;++i)if(e[i])for(var u=i<<4|e[i],d=t-e[i],f=o[e[i]-1]++<<d,h=f|(1<<d)-1;f<=h;++f)a[Cx[f]>>>l]=u}else for(a=new Nn(r),i=0;i<r;++i)a[i]=Cx[o[e[i]-1]++]>>>15-e[i];return a},Na=new Nr(288);for(var ct=0;ct<144;++ct)Na[ct]=8;for(var ct=144;ct<256;++ct)Na[ct]=9;for(var ct=256;ct<280;++ct)Na[ct]=7;for(var ct=280;ct<288;++ct)Na[ct]=8;var Kp=new Nr(32);for(var ct=0;ct<32;++ct)Kp[ct]=5;var IG=Bu(Na,9,0),AG=Bu(Kp,5,0),fA=function(e){return(e/8>>0)+(e&7&&1)},hA=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof Nn?Nn:e instanceof Ed?Ed:Nr)(n-t);return r.set(e.subarray(t,n)),r},Gi=function(e,t,n){n<<=t&7;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},iu=function(e,t,n){n<<=t&7;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},iy=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,s=n.slice();if(!i)return[new Nr(0),0];if(i==1){var o=new Nr(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort(function(S,E){return S.f-E.f}),n.push({s:-1,f:25001});var a=n[0],l=n[1],u=0,d=1,f=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};d!=i-1;)a=n[n[u].f<n[f].f?u++:f++],l=n[u!=d&&n[u].f<n[f].f?u++:f++],n[d++]={s:-1,f:a.f+l.f,l:a,r:l};for(var h=s[0].s,r=1;r<i;++r)s[r].s>h&&(h=s[r].s);var p=new Nn(h+1),g=Tx(n[d-1],p,0);if(g>t){var r=0,v=0,w=g-t,y=1<<w;for(s.sort(function(E,k){return p[k.s]-p[E.s]||E.f-k.f});r<i;++r){var x=s[r].s;if(p[x]>t)v+=y-(1<<g-p[x]),p[x]=t;else break}for(v>>>=w;v>0;){var b=s[r].s;p[b]<t?v-=1<<t-p[b]++-1:++r}for(;r>=0&&v;--r){var _=s[r].s;p[_]==t&&(--p[_],++v)}g=t}return[new Nr(p),g]},Tx=function(e,t,n){return e.s==-1?Math.max(Tx(e.l,t,n+1),Tx(e.r,t,n+1)):t[e.s]=n},EC=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Nn(++t),r=0,i=e[0],s=1,o=function(l){n[r++]=l},a=1;a<=t;++a)if(e[a]==i&&a!=t)++s;else{if(!i&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(i),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(i);s=1,i=e[a]}return[n.subarray(0,r),t]},su=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},jx=function(e,t,n){var r=n.length,i=fA(t+2);e[i]=r&255,e[i+1]=r>>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var s=0;s<r;++s)e[i+s+4]=n[s];return(i+4+r)*8},kC=function(e,t,n,r,i,s,o,a,l,u,d){Gi(t,d++,n),++i[256];for(var f=iy(i,15),h=f[0],p=f[1],g=iy(s,15),v=g[0],w=g[1],y=EC(h),x=y[0],b=y[1],_=EC(v),S=_[0],E=_[1],k=new Nn(19),C=0;C<x.length;++C)k[x[C]&31]++;for(var C=0;C<S.length;++C)k[S[C]&31]++;for(var P=iy(k,7),T=P[0],N=P[1],I=19;I>4&&!T[_C[I-1]];--I);var O=u+5<<3,j=su(i,Na)+su(s,Kp)+o,A=su(i,h)+su(s,v)+o+14+3*I+su(k,T)+(2*k[16]+3*k[17]+7*k[18]);if(O<=j&&O<=A)return jx(t,d,e.subarray(l,l+u));var V,$,R,L;if(Gi(t,d,1+(A<j)),d+=2,A<j){V=Bu(h,p,0),$=h,R=Bu(v,w,0),L=v;var H=Bu(T,N,0);Gi(t,d,b-257),Gi(t,d+5,E-1),Gi(t,d+10,I-4),d+=14;for(var C=0;C<I;++C)Gi(t,d+3*C,T[_C[C]]);d+=3*I;for(var z=[x,S],Q=0;Q<2;++Q)for(var de=z[Q],C=0;C<de.length;++C){var ne=de[C]&31;Gi(t,d,H[ne]),d+=T[ne],ne>15&&(Gi(t,d,de[C]>>>5&127),d+=de[C]>>>12)}}else V=IG,$=Na,R=AG,L=Kp;for(var C=0;C<a;++C)if(r[C]>255){var ne=r[C]>>>18&31;iu(t,d,V[ne+257]),d+=$[ne+257],ne>7&&(Gi(t,d,r[C]>>>23&31),d+=a_[ne]);var ye=r[C]&31;iu(t,d,R[ye]),d+=L[ye],ye>3&&(iu(t,d,r[C]>>>5&8191),d+=l_[ye])}else iu(t,d,V[r[C]]),d+=$[r[C]];return iu(t,d,V[256]),d+$[256]},OG=new Ed([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),DG=function(e,t,n,r,i,s){var o=e.length,a=new Nr(r+o+5*(1+Math.floor(o/7e3))+i),l=a.subarray(r,a.length-i),u=0;if(!t||o<8)for(var d=0;d<=o;d+=65535){var f=d+65535;f<o?u=jx(l,u,e.subarray(d,f)):(l[d]=s,u=jx(l,u,e.subarray(d,o)))}else{for(var h=OG[t-1],p=h>>>13,g=h&8191,v=(1<<n)-1,w=new Nn(32768),y=new Nn(v+1),x=Math.ceil(n/3),b=2*x,_=function(qt){return(e[qt]^e[qt+1]<<x^e[qt+2]<<b)&v},S=new Ed(25e3),E=new Nn(288),k=new Nn(32),C=0,P=0,d=0,T=0,N=0,I=0;d<o;++d){var O=_(d),j=d&32767,A=y[O];if(w[j]=A,y[O]=j,N<=d){var V=o-d;if((C>7e3||T>24576)&&V>423){u=kC(e,l,0,S,E,k,P,T,I,d-I,u),T=C=P=0,I=d;for(var $=0;$<286;++$)E[$]=0;for(var $=0;$<30;++$)k[$]=0}
vendor: 16,878 bytes, line 86
86var R=2,L=0,H=g,z=j-A&32767;if(V>2&&O==_(d-z))for(var Q=Math.min(p,V)-1,de=Math.min(32767,d),ne=Math.min(258,V);z<=de&&--H&&j!=A;){if(e[d+R]==e[d+R-z]){for(var ye=0;ye<ne&&e[d+ye]==e[d+ye-z];++ye);if(ye>R){if(R=ye,L=z,ye>Q)break;for(var he=Math.min(z,ye-2),Pe=0,$=0;$<he;++$){var Ue=d-z+$+32768&32767,Ae=w[Ue],Fe=Ue-Ae+32768&32767;Fe>Pe&&(Pe=Fe,A=Ue)}}}j=A,A=w[j],z+=j-A+32768&32767}if(L){S[T++]=268435456|kx[R]<<18|SC[L];var wt=kx[R]&31,jt=SC[L]&31;P+=a_[wt]+l_[jt],++E[257+wt],++k[jt],N=d+R,++C}else S[T++]=e[d],++E[e[d]]}}u=kC(e,l,s,S,E,k,P,T,I,d-I,u)}return hA(a,0,r+fA(u)+i)},MG=function(){var e=1,t=0;return{p:function(n){for(var r=e,i=t,s=n.length,o=0;o!=s;){for(var a=Math.min(o+5552,s);o<a;++o)r+=n[o],i+=r;r%=65521,i%=65521}e=r,t=i},d:function(){return(e>>>8<<16|(t&255)<<8|t>>>8)+((e&255)<<23)*2}}},LG=function(e,t,n,r,i){return DG(e,t.level==null?6:t.level,t.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):12+t.mem,n,r,!i)},FG=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},$G=function(e,t){var n=t.level,r=n==0?0:n<6?1:n==9?3:2;e[0]=120,e[1]=r<<6|(r?32-2*r:1)};function UG(e,t){t===void 0&&(t={});var n=MG();n.p(e);var r=LG(e,t,2,4);return $G(r,t),FG(r,r.length-4,n.d()),r}function VG(e,t){var n=e.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(e);for(var r=new Nr(e.length+(e.length>>>1)),i=0,s=function(u){r[i++]=u},o=0;o<n;++o){if(i+5>r.length){var a=new Nr(i+8+(n-o<<1));a.set(r),r=a}var l=e.charCodeAt(o);l<128||t?s(l):l<2048?(s(192|l>>>6),s(128|l&63)):l>55295&&l<57344?(l=65536+(l&1047552)|e.charCodeAt(++o)&1023,s(240|l>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|l&63)):(s(224|l>>>12),s(128|l>>>6&63),s(128|l&63))}return hA(r,0,i)}function zG(e,t){for(var n="",r=0;r<e.length;){var i=e[r++];i<128||t?n+=String.fromCharCode(i):i<224?n+=String.fromCharCode((i&31)<<6|e[r++]&63):i<240?n+=String.fromCharCode((i&15)<<12|(e[r++]&63)<<6|e[r++]&63):(i=((i&15)<<18|(e[r++]&63)<<12|(e[r++]&63)<<6|e[r++]&63)-65536,n+=String.fromCharCode(55296|i>>10,56320|i&1023))}return n}const BG="v1",WG=e=>{const t={...e,v:BG};return zG(UG(VG(JSON.stringify(t))),!0)};var qG=2e3,HG=function(){function e(t,n,r,i){var s=this,o,a,l;this.taskQueue=[],this.isProcessing=!1,this.compressEvent=function(p){var g=WG(p);return JSON.stringify(g)},this.addCompressedEventToManager=function(p,g){s.eventsManager&&s.deviceId&&s.eventsManager.addEvent({event:{type:"replay",data:p},sessionId:g,deviceId:s.deviceId})},this.addCompressedEvent=function(p,g){if(s.worker)s.worker.postMessage({event:p,sessionId:g});else{var v=s.compressEvent(p);s.addCompressedEventToManager(v,g)}},this.terminate=function(){var p;(p=s.worker)===null||p===void 0||p.terminate()};var u=et();this.canUseIdleCallback=u&&"requestIdleCallback"in u,this.eventsManager=t,this.config=n,this.deviceId=r,this.timeout=((o=n.performanceConfig)===null||o===void 0?void 0:o.timeout)||qG;var d={},f=(a=d.COMPRESSION_WEBWORKER_BODY)!==null&&a!==void 0?a:i;if(!((l=this.config.experimental)===null||l===void 0)&&l.useWebWorker&&u&&u.Worker&&f){n.loggerProvider.log("[Experimental] Enabling web worker for compression");var h=new Worker(URL.createObjectURL(new Blob([f],{type:"application/javascript"})));h.onerror=function(p){n.loggerProvider.error(p)},h.onmessage=function(p){var g=p.data,v=g.compressedEvent,w=g.sessionId;s.addCompressedEventToManager(v,w)},this.worker=h}}return e.prototype.scheduleIdleProcessing=function(){var t=this;this.isProcessing||(this.isProcessing=!0,requestIdleCallback(function(n){t.processQueue(n)},{timeout:this.timeout}))},e.prototype.enqueueEvent=function(t,n){var r;this.canUseIdleCallback&&(!((r=this.config.performanceConfig)===null||r===void 0)&&r.enabled)?(this.config.loggerProvider.debug("Enqueuing event for processing during idle time."),this.taskQueue.push({event:t,sessionId:n}),this.scheduleIdleProcessing()):(this.config.loggerProvider.debug("Processing event without idle callback."),this.addCompressedEvent(t,n))},e.prototype.processQueue=function(t){for(var n=this;this.taskQueue.length>0&&(t.timeRemaining()>0||t.didTimeout);){var r=this.taskQueue.shift();if(r){var i=r.event,s=r.sessionId;this.addCompressedEvent(i,s)}}this.taskQueue.length>0?requestIdleCallback(function(o){n.processQueue(o)},{timeout:this.timeout}):this.isProcessing=!1},e}();function pA(e){return e===void 0&&(e={}),{name:"amplitude/url-tracking@1",observer:function(t,n,r){var i,s,o,a=Y(Y({},e),r),l=a.ugcFilterRules||[],u=(i=a.enablePolling)!==null&&i!==void 0?i:!1,d=(s=a.pollingInterval)!==null&&s!==void 0?s:qI,f=(o=a.captureDocumentTitle)!==null&&o!==void 0?o:!1;if(!n)return function(){};var h=void 0,p=function(){return n.location&&n.location.href||""},g=function(){var E=n.innerHeight,k=n.innerWidth,C=n.document,P=p(),T="";f&&(T=(C==null?void 0:C.title)||"");var N=l.length>0?ug(P,l):P;return{href:N,title:T,viewportHeight:E,viewportWidth:k,type:"url-change-event"}},v=function(){var E=p();if(h===void 0||E!==h){h=E;var k=g();t(k)}},w=function(E){return function(){for(var k=[],C=0;C<arguments.length;C++)k[C]=arguments[C];var P=E.apply(this,k);return v(),P}},y=function(){v()};if(u){var x=n.setInterval(function(){v()},d);return v(),function(){x&&n.clearInterval(x)}}if(n.history){var b=n.history.pushState.bind(n.history),_=n.history.replaceState.bind(n.history),S=function(){n.history.pushState=w(b),n.history.replaceState=w(_)};return S(),n.addEventListener("popstate",v),n.addEventListener("hashchange",y),v(),function(){n.history.pushState=b,n.history.replaceState=_,n.removeEventListener("popstate",v),n.removeEventListener("hashchange",y)}}return n.addEventListener("hashchange",y),v(),function(){n.removeEventListener("hashchange",y)}},options:e}}pA();var GG=function(){function e(){var t=this;this.name="@amplitude/session-replay-browser",this.recordCancelCallback=null,this.eventCount=0,this.pageLeaveFns=[],this.recordFunction=null,this.teardownEventListeners=function(n){var r=et();r&&(r.removeEventListener("blur",t.blurListener),r.removeEventListener("focus",t.focusListener),!n&&r.addEventListener("blur",t.blurListener),!n&&r.addEventListener("focus",t.focusListener),r.self&&"onpagehide"in r.self?(r.removeEventListener("pagehide",t.pageLeaveListener),!n&&r.addEventListener("pagehide",t.pageLeaveListener)):(r.removeEventListener("beforeunload",t.pageLeaveListener),!n&&r.addEventListener("beforeunload",t.pageLeaveListener)))},this.blurListener=function(){t.sendEvents()},this.focusListener=function(){t.recordEvents(!1)},this.pageLeaveListener=function(n){t.pageLeaveFns.forEach(function(r){r(n)})},this.addCustomRRWebEvent=function(n,r,i){return r===void 0&&(r={}),i===void 0&&(i=!0),W(t,void 0,void 0,function(){var s,o,a,l;return q(this,function(u){switch(u.label){case 0:return u.trys.push([0,3,,4]),s=void 0,o=this.config,o&&n!==Jo.METADATA?(s={config:XI(o),version:xx},i?[4,QI()]:[3,2]):[3,2];case 1:a=u.sent(),s=Y(Y({},a),s),u.label=2;case 2:return this.recordCancelCallback&&this.recordFunction?this.recordFunction.addCustomEvent(n,Y(Y({},r),s)):this.loggerProvider.debug("Not able to add custom replay capture event ".concat(n," due to no ongoing recording.")),[3,4];case 3:return l=u.sent(),this.loggerProvider.debug("Error while adding custom replay capture event: ",l),[3,4];case 4:return[2]}})})},this.stopRecordingEvents=function(){var n;try{t.loggerProvider.log("Session Replay capture stopping."),t.recordCancelCallback&&t.recordCancelCallback(),t.recordCancelCallback=null,(n=t.networkObservers)===null||n===void 0||n.stop()}catch(i){var r=i;t.loggerProvider.warn("Error occurred while stopping replay capture: ".concat(r.toString()))}},this.loggerProvider=new gx(new wd)}return e.prototype.init=function(t,n){return pn(this._init(t,n))},e.prototype._init=function(t,n){var r,i,s,o,a,l;return W(this,void 0,void 0,function(){var u,d,f,h,p,g,v,w,y,x,E,b,_,S,E;return q(this,function(k){switch(k.label){case 0:return this.loggerProvider=new gx(n.loggerProvider||new wd),Object.prototype.hasOwnProperty.call(n,"logLevel")&&this.loggerProvider.enable(n.logLevel),this.identifiers=new bC({sessionId:n.sessionId,deviceId:n.deviceId}),u=this,[4,R9(t,n)];case 1:return u.joinedConfigGenerator=k.sent(),[4,this.joinedConfigGenerator.generateJoinedConfig(this.identifiers.sessionId)];case 2:d=k.sent(),f=d.joinedConfig,h=d.localConfig,p=d.remoteConfig,this.config=f,this.setMetadata(n.sessionId,f,h,p,(r=n.version)===null||r===void 0?void 0:r.version,xx,(i=n.version)===null||i===void 0?void 0:i.type),n.sessionId&&(!((s=this.config.interactionConfig)===null||s===void 0)&&s.enabled)&&(g=PG.default({sessionId:n.sessionId,type:"interaction"},this.config),this.pageLeaveFns=[g.send(this.getDeviceId.bind(this)).bind(g)],this.scrollHook=g.hook.bind(g)),v=[],w=this.config.storeType,w==="idb"&&!(!((o=et())===null||o===void 0)&&o.indexedDB)&&(w="memory",this.loggerProvider.warn("Could not use preferred indexedDB storage, reverting to in memory option.")),this.loggerProvider.log("Using ".concat(w," for event storage.")),k.label=3;case 3:return k.trys.push([3,5,,6]),[4,hC({config:this.config,sessionId:this.identifiers.sessionId,type:"replay",storeType:w})];case 4:return y=k.sent(),v.push({name:"replay",manager:y}),[3,6];case 5:return x=k.sent(),E=x,this.loggerProvider.warn("Error occurred while creating replay events manager: ".concat(E.toString())),[3,6];case 6:if(!(!((a=this.config.interactionConfig)===null||a===void 0)&&a.enabled))return[3,10];b=this.config.interactionConfig.batch?CG:kG,k.label=7;case 7:return k.trys.push([7,9,,10]),[4,hC({config:this.config,sessionId:this.identifiers.sessionId,type:"interaction",minInterval:(l=this.config.interactionConfig.trackEveryNms)!==null&&l!==void 0?l:i9,maxInterval:s9,payloadBatcher:b,storeType:w})];case 8:return _=k.sent(),v.push({name:"interaction",manager:_}),[3,10];case 9:return S=k.sent(),E=S,this.loggerProvider.warn("Error occurred while creating interaction events manager: ".concat(E.toString())),[3,10];case 10:return this.eventsManager=new(pC.bind.apply(pC,Ke([void 0],Te(v),!1))),this.eventCompressor&&this.eventCompressor.terminate(),this.eventCompressor=new HG(this.eventsManager,this.config,this.getDeviceId()),[4,this.initializeNetworkObservers()];case 11:return k.sent(),this.loggerProvider.log("Installing @amplitude/session-replay-browser."),this.teardownEventListeners(!1),this.initialize(!0),[2]}})})},e.prototype.setSessionId=function(t,n){return pn(this.asyncSetSessionId(t,n))},e.prototype.asyncSetSessionId=function(t,n){return W(this,void 0,void 0,function(){var r,i,s;return q(this,function(o){switch(o.label){case 0:return r=this.identifiers&&this.identifiers.sessionId,r&&this.sendEvents(r),i=n||this.getDeviceId(),this.identifiers=new bC({sessionId:t,deviceId:i}),this.joinedConfigGenerator&&r?[4,this.joinedConfigGenerator.generateJoinedConfig(this.identifiers.sessionId)]:[3,2];case 1:s=o.sent().joinedConfig,this.config=s,o.label=2;case 2:return this.recordEvents(),[2]}})})},e.prototype.getSessionReplayProperties=function(){var t,n=this.config,r=this.identifiers;if(!n||!r)return this.loggerProvider.warn("Session replay init has not been called, cannot get session replay properties."),{};var i=this.getShouldRecord(),s={};return i&&(s=(t={},t[GH]=r.sessionReplayId?r.sessionReplayId:null,t),n.debugMode&&(s[XH]=JSON.stringify({appHash:yx(n.apiKey).toString()}))),this.addCustomRRWebEvent(Jo.GET_SR_PROPS,{shouldRecord:i,eventProperties:s},this.eventCount===10),this.eventCount===10&&(this.eventCount=0),this.eventCount++,s},e.prototype.sendEvents=function(t){var n,r=t||((n=this.identifiers)===null||n===void 0?void 0:n.sessionId),i=this.getDeviceId();this.eventsManager&&r&&i&&this.eventsManager.sendCurrentSequenceEvents({sessionId:r,deviceId:i})},e.prototype.initialize=function(t){var n;return t===void 0&&(t=!1),W(this,void 0,void 0,function(){var r;return q(this,function(i){return!((n=this.identifiers)===null||n===void 0)&&n.sessionId?(r=this.getDeviceId(),r?(this.eventsManager&&t&&this.eventsManager.sendStoredEvents({deviceId:r}),[2,this.recordEvents()]):(this.loggerProvider.log("Session is not being recorded due to lack of device id."),[2,Promise.resolve()])):(this.loggerProvider.log("Session is not being recorded due to lack of session id."),[2,Promise.resolve()])})})},e.prototype.shouldOptOut=function(){var t,n,r;if(!((t=this.config)===null||t===void 0)&&t.instanceName){var i=cc(this.config.instanceName).identityStore;r=i.getIdentity().optOut}return r!==void 0?r:(n=this.config)===null||n===void 0?void 0:n.optOut},e.prototype.getShouldRecord=function(){if(!this.identifiers||!this.config||!this.identifiers.sessionId)return this.loggerProvider.warn("Session is not being recorded due to lack of config, please call sessionReplay.init."),!1;if(!this.config.captureEnabled)return this.loggerProvider.log("Session ".concat(this.identifiers.sessionId," not being captured due to capture being disabled for project or because the remote config could not be fetched.")),!1;if(this.shouldOptOut())return this.loggerProvider.log("Opting session ".concat(this.identifiers.sessionId," out of recording due to optOut config.")),!1;var t=f9(this.identifiers.sessionId,this.config.sampleRate);return t||this.loggerProvider.log("Opting session ".concat(this.identifiers.sessionId," out of recording due to sample rate.")),t},e.prototype.getBlockSelectors=function(){var t,n,r,i=(r=(n=(t=this.config)===null||t===void 0?void 0:t.privacyConfig)===null||n===void 0?void 0:n.blockSelector)!==null&&r!==void 0?r:[];if(i.length!==0)return i},e.prototype.getMaskTextSelectors=function(){var t,n,r,i;if(((n=(t=this.config)===null||t===void 0?void 0:t.privacyConfig)===null||n===void 0?void 0:n.defaultMaskLevel)==="conservative")return"*";var s=(i=(r=this.config)===null||r===void 0?void 0:r.privacyConfig)===null||i===void 0?void 0:i.maskSelector;if(s)return s},e.prototype.getRecordingPlugins=function(t){var n,r,i,s,o,a;return W(this,void 0,void 0,function(){var l,u,d,f;return q(this,function(h){switch(h.label){case 0:l=[];try{u=pA({ugcFilterRules:((r=(n=this.config)===null||n===void 0?void 0:n.interactionConfig)===null||r===void 0?void 0:r.ugcFilterRules)||[],enablePolling:((i=this.config)===null||i===void 0?void 0:i.enableUrlChangePolling)||!1,pollingInterval:(s=this.config)===null||s===void 0?void 0:s.urlChangePollingInterval,captureDocumentTitle:(o=this.config)===null||o===void 0?void 0:o.captureDocumentTitle}),l.push(u)}catch(p){this.loggerProvider.warn("Failed to create URL tracking plugin:",p)}if(!(!((a=t==null?void 0:t.console)===null||a===void 0)&&a.enabled))return[3,4];h.label=1;case 1:return h.trys.push([1,3,,4]),[4,ho(()=>import("./rrweb-plugin-console-record-CcP6hw3h.js"),[])];case 2:return d=h.sent().getRecordConsolePlugin,l.push(d({level:t.console.levels})),[3,4];case 3:return f=h.sent(),this.loggerProvider.warn("Failed to load console plugin:",f),[3,4];case 4:return[2,l.length>0?l:void 0]}})})},e.prototype.getRecordFunction=function(){return W(this,void 0,void 0,function(){var t,n;return q(this,function(r){switch(r.label){case 0:if(this.recordFunction)return[2,this.recordFunction];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,ho(()=>import("./rrweb-record-BdNOAzOA.js"),[])];case 2:return t=r.sent().record,this.recordFunction=t,[2,t];case 3:return n=r.sent(),this.loggerProvider.warn("Failed to load rrweb-record module:",n),[2,null];case 4:return[2]}})})},e.prototype.recordEvents=function(t){var n,r,i,s,o;return t===void 0&&(t=!0),W(this,void 0,void 0,function(){var a,l,u,d,f,h,p,g,v,w,y,x,b,_=this;return q(this,function(S){switch(S.label){case 0:return a=this.config,l=this.getShouldRecord(),u=(n=this.identifiers)===null||n===void 0?void 0:n.sessionId,!l||!u||!a?[2]:(this.stopRecordingEvents(),[4,this.getRecordFunction()]);case 1:return d=S.sent(),d?[4,this.initializeNetworkObservers()]:[2];case 2:S.sent(),(r=this.networkObservers)===null||r===void 0||r.start(function(E){_.addCustomRRWebEvent(Jo.FETCH_REQUEST,E)}),f=a.privacyConfig,h=a.interactionConfig,p=a.loggingConfig,g=h!=null&&h.enabled?{mouseInteraction:this.eventsManager&&TG(this.loggerProvider,{eventsManager:this.eventsManager,sessionId:u,deviceIdFn:this.getDeviceId.bind(this),mirror:d.mirror,ugcFilterRules:(i=h.ugcFilterRules)!==null&&i!==void 0?i:[]}),scroll:this.scrollHook}:{},v=h!=null&&h.enabled&&h.ugcFilterRules?h.ugcFilterRules:[],this.loggerProvider.log("Session Replay capture beginning for ".concat(u,".")),S.label=3;case 3:return S.trys.push([3,5,,6]),w=this,y=d,b={emit:function(E){if(_.shouldOptOut()){_.loggerProvider.log("Opting session ".concat(u," out of recording due to optOut config.")),_.stopRecordingEvents(),_.sendEvents();return}E.type===JI.Meta&&(E.data.href=ug(E.data.href,v)),_.eventCompressor&&_.eventCompressor.enqueueEvent(E,u)},inlineStylesheet:a.shouldInlineStylesheet,hooks:g,maskAllInputs:!0,maskTextClass:HI,blockClass:ZH,blockSelector:this.getBlockSelectors(),applyBackgroun
86dColorToBlockedElements:a.applyBackgroundColorToBlockedElements,maskInputFn:iC("input",f),maskTextFn:iC("text",f),maskTextSelector:this.getMaskTextSelectors(),recordCanvas:!1,slimDOMOptions:{script:(s=a.omitElementTags)===null||s===void 0?void 0:s.script,comment:(o=a.omitElementTags)===null||o===void 0?void 0:o.comment},errorHandler:function(E){var k=E;if(k.message.includes("insertRule")&&k.message.includes("CSSStyleSheet")||k._external_)throw k;return _.loggerProvider.warn("Error while capturing replay: ",k.toString()),!0}},[4,this.getRecordingPlugins(p)];case 4:return w.recordCancelCallback=y.apply(void 0,[(b.plugins=S.sent(),b)]),this.addCustomRRWebEvent(Jo.DEBUG_INFO),t&&this.addCustomRRWebEvent(Jo.METADATA,this.metadata),[3,6];case 5:return x=S.sent(),this.loggerProvider.warn("Failed to initialize session replay:",x),[3,6];case 6:return[2]}})})},e.prototype.getDeviceId=function(){var t;return(t=this.identifiers)===null||t===void 0?void 0:t.deviceId},e.prototype.getSessionId=function(){var t;return(t=this.identifiers)===null||t===void 0?void 0:t.sessionId},e.prototype.flush=function(t){var n;return t===void 0&&(t=!1),W(this,void 0,void 0,function(){return q(this,function(r){return[2,(n=this.eventsManager)===null||n===void 0?void 0:n.flush(t)]})})},e.prototype.shutdown=function(){this.teardownEventListeners(!0),this.stopRecordingEvents(),this.sendEvents()},e.prototype.mapSDKType=function(t){return t==="plugin"?"@amplitude/plugin-session-replay-browser":t==="segment"?"@amplitude/segment-session-replay-plugin":null},e.prototype.setMetadata=function(t,n,r,i,s,o,a){var l=t!=null&&t.toString()?yx(t.toString()):void 0;this.metadata={joinedConfig:n,localConfig:r,remoteConfig:i,sessionId:t,hashValue:l,sampleRate:n.sampleRate,replaySDKType:this.mapSDKType(a),replaySDKVersion:s,standaloneSDKType:"@amplitude/session-replay-browser",standaloneSDKVersion:o}},e.prototype.initializeNetworkObservers=function(){var t,n,r;return W(this,void 0,void 0,function(){var i,s;return q(this,function(o){switch(o.label){case 0:if(!(!((r=(n=(t=this.config)===null||t===void 0?void 0:t.loggingConfig)===null||n===void 0?void 0:n.network)===null||r===void 0)&&r.enabled&&!this.networkObservers))return[3,4];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,ho(()=>import("./observers-3B-4hT_X.js"),[])];case 2:return i=o.sent().NetworkObservers,this.networkObservers=new i,[3,4];case 3:return s=o.sent(),this.loggerProvider.warn("Failed to import or instantiate NetworkObservers:",s),[3,4];case 4:return[2]}})})},e}(),Ja=function(e){return function(){var t=e.config,n=t||ZI(),r=n.loggerProvider,i=n.logLevel;return{logger:r,logLevel:i}}},KG=function(){var e=new GG;return{init:Ze(e.init.bind(e),"init",Ja(e)),setSessionId:Ze(e.setSessionId.bind(e),"setSessionId",Ja(e)),getSessionId:Ze(e.getSessionId.bind(e),"getSessionId",Ja(e)),getSessionReplayProperties:Ze(e.getSessionReplayProperties.bind(e),"getSessionReplayProperties",Ja(e)),flush:Ze(e.flush.bind(e),"flush",Ja(e)),shutdown:Ze(e.shutdown.bind(e),"shutdown",Ja(e))}};const Rc=KG();var YG=Rc.init,QG=Rc.setSessionId,XG=Rc.getSessionId,ZG=Rc.getSessionReplayProperties,JG=Rc.flush,eK=Rc.shutdown,CC="1.21.1",tK=function(){function e(t){this.name=e.pluginName,this.type="enrichment",this.sessionReplay={flush:JG,getSessionId:XG,getSessionReplayProperties:ZG,init:YG,setSessionId:QG,shutdown:eK},this.options=Y({forceSessionTracking:!1},t),this.srInitOptions=this.options}return e.prototype.setup=function(t,n){var r,i,s,o,a;return W(this,void 0,void 0,function(){var l;return q(this,function(u){switch(u.label){case 0:return u.trys.push([0,2,,3]),t==null||t.loggerProvider.log("Installing @amplitude/plugin-session-replay, version ".concat(CC,".")),this.config=t,this.options.forceSessionTracking&&(typeof t.defaultTracking=="boolean"?t.defaultTracking===!1&&(t.defaultTracking={pageViews:!1,formInteractions:!1,fileDownloads:!1,sessions:!0}):t.defaultTracking=Y(Y({},t.defaultTracking),{sessions:!0})),this.srInitOptions={instanceName:this.config.instanceName,deviceId:(r=this.options.deviceId)!==null&&r!==void 0?r:this.config.deviceId,optOut:this.config.optOut,sessionId:this.options.customSessionId?void 0:this.config.sessionId,loggerProvider:this.config.loggerProvider,logLevel:this.config.logLevel,flushMaxRetries:this.config.flushMaxRetries,serverZone:this.config.serverZone,configServerUrl:this.options.configServerUrl,trackServerUrl:this.options.trackServerUrl,sampleRate:this.options.sampleRate,privacyConfig:{blockSelector:(i=this.options.privacyConfig)===null||i===void 0?void 0:i.blockSelector,maskSelector:(s=this.options.privacyConfig)===null||s===void 0?void 0:s.maskSelector,unmaskSelector:(o=this.options.privacyConfig)===null||o===void 0?void 0:o.unmaskSelector,defaultMaskLevel:(a=this.options.privacyConfig)===null||a===void 0?void 0:a.defaultMaskLevel},debugMode:this.options.debugMode,shouldInlineStylesheet:this.options.shouldInlineStylesheet,version:{type:"plugin",version:CC},performanceConfig:this.options.performanceConfig,storeType:this.options.storeType,experimental:this.options.experimental,omitElementTags:this.options.omitElementTags,applyBackgroun
86dColorToBlockedElements:this.options.applyBackgroundColorToBlockedElements,interactionConfig:this.options.interactionConfig,captureDocumentTitle:this.options.captureDocumentTitle,enableUrlChangePolling:this.options.enableUrlChangePolling,urlChangePollingInterval:this.options.urlChangePollingInterval},[4,this.sessionReplay.init(t.apiKey,this.srInitOptions).promise];case 1:return u.sent(),[3,3];case 2:return l=u.sent(),t==null||t.loggerProvider.error("Session Replay: Failed to initialize due to ".concat(l.message)),[3,3];case 3:return[2]}})})},e.prototype.onSessionIdChanged=function(t){return W(this,void 0,void 0,function(){return q(this,function(n){switch(n.label){case 0:return this.config.loggerProvider.debug("Analytics session id is changed to ".concat(t,", SR session id is ").concat(String(this.sessionReplay.getSessionId()),".")),[4,this.sessionReplay.setSessionId(t).promise];case 1:return n.sent(),[2]}})})},e.prototype.onOptOutChanged=function(t){return W(this,void 0,void 0,function(){return q(this,function(n){switch(n.label){case 0:return this.config.loggerProvider.debug("optOut is changed to ".concat(String(t),", calling ").concat(t?"sessionReplay.shutdown()":"sessionReplay.init()",".")),t?(this.sessionReplay.shutdown(),[3,3]):[3,1];case 1:return[4,this.sessionReplay.init(this.config.apiKey,this.srInitOptions).promise];case 2:n.sent(),n.label=3;case 3:return[2]}})})},e.prototype.execute=function(t){var n;return W(this,void 0,void 0,function(){var r,i,r,i,s;return q(this,function(o){switch(o.label){case 0:return o.trys.push([0,8,,9]),this.options.customSessionId?(r=this.options.customSessionId(t),r?r===this.sessionReplay.getSessionId()?[3,2]:[4,this.sessionReplay.setSessionId(r).promise]:[3,3]):[3,4];case 1:o.sent(),o.label=2;case 2:i=this.sessionReplay.getSessionReplayProperties(),t.event_properties=Y(Y({},t.event_properties),i),o.label=3;case 3:return[3,7];case 4:return r=this.config.sessionId,r&&r!==this.sessionReplay.getSessionId()?[4,this.sessionReplay.setSessionId(r).promise]:[3,6];case 5:o.sent(),o.label=6;case 6:r&&r===t.session_id&&(i=this.sessionReplay.getSessionReplayProperties(),t.event_properties=Y(Y({},t.event_properties),i)),o.label=7;case 7:return[2,Promise.resolve(t)];case 8:return s=o.sent(),(n=this.config)===null||n===void 0||n.loggerProvider.error("Session Replay: Failed to enrich event due to ".concat(s.message)),[2,Promise.resolve(t)];case 9:return[2]}})})},e.prototype.teardown=function(){var t;return W(this,void 0,void 0,function(){return q(this,function(n){try{this.sessionReplay.shutdown(),this.config=null}catch(r){(t=this.config)===null||t===void 0||t.loggerProvider.error("Session Replay: teardown failed due to ".concat(r.message))}return[2]})})},e.prototype.getSessionReplayProperties=function(){return this.sessionReplay.getSessionReplayProperties()},e.pluginName="@amplitude/plugin-session-replay-browser",e}(),nK=function(e){return new tK(e)};const fh={apiKey:"36cd5fc50c10785fd2f8fba9edeaff3e",appVersion:"1.0.0",sessionReplay:{sampleRate:.9,debugMode:!1,privacyConfig:{maskTextInputs:!1,maskAllInputs:!1,blockClass:"sr-block",blockAttributes:["data-sr-block"]},applyBackgroundColorToBlockedElements:!1},isDevelopment:!1};class rK{constructor(){Hi(this,"initialized",!1);Hi(this,"config",null);Hi(this,"initPromise",null)}async init(t){return this.initPromise?this.initPromise:(this.initPromise=this.performInit(t),this.initPromise)}async performInit(t){try{const n=(t==null?void 0:t.apiKey)||fh.apiKey,r=(t==null?void 0:t.appVersion)||fh.appVersion,i=(t==null?void 0:t.isDevelopment)??fh.isDevelopment,s=(t==null?void 0:t.sessionReplay)||fh.sessionReplay;if(!n){console.warn("Analytics: No API key available. Analytics disabled.");return}this.config={apiKey:n,appVersion:r,isDevelopment:i,sessionReplay:s},i&&console.info("Analytics: Development mode - events will be sent to Amplitude AND logged to console");const o=nK({sampleRate:s.sampleRate,debugMode:s.debugMode,privacyConfig:s.privacyConfig,applyBackgroundColorToBlockedElements:s.applyBackgroundColorToBlockedElements});UH(o),WH(n,{autocapture:!0,fetchRemoteConfig:!0,logLevel:jn.Warn,flushIntervalMillis:1e3,flushQueueSize:30,minIdLength:5,serverUrl:"https://api2.amplitude.com/2/httpapi",serverZone:"US"}),this.initialized=!0,console.info("Analytics: Successfully initialized with Amplitude and Session Replay")}catch(n){console.error("Analytics: Failed to initialize",n)}}track(t,n){this.init().then(()=>{var r;try{const i={...this.getCommonProperties(),...n};
86if((r=this.config)!=null&&r.isDevelopment&&console.log("Analytics Event (Dev):",t,i),!this.initialized)return;HH(t,i)}catch(i){console.warn("Analytics: Failed to track event",t,i)}}).catch(r=>{console.warn("Analytics: Failed to initialize before tracking event:",r)})}setUserId(t){this.init().then(()=>{var n;try{if((n=this.config)!=null&&n.isDevelopment&&console.log("Analytics User ID (Dev):",t||"cleared"),!this.initialized)return;if(t===void 0){Qv(void 0);return}if(t.length<5){console.warn("Analytics: User ID too short, must be at least 5 characters");return}Qv(t)}catch(r){console.warn("Analytics: Failed to set user ID",r)}}).catch(n=>{console.warn("Analytics: Failed to initialize before setting user ID:",n)})}clearUserId(){this.init().then(()=>{var t;try{if((t=this.config)!=null&&t.isDevelopment&&console.log("Analytics: User ID cleared (Dev)"),!this.initialized)return;Qv(void 0)}catch(n){console.warn("Analytics: Failed to clear user ID",n)}}).catch(t=>{console.warn("Analytics: Failed to initialize before clearing user ID:",t)})}setUserProperties(t){this.init().then(()=>{var n;try{if((n=this.config)!=null&&n.isDevelopment&&console.log("Analytics User Properties (Dev):",t),!this.initialized)return;const r=new xd;Object.entries(t).forEach(([i,s])=>{r.set(i,s)}),BH(r)}catch(r){console.warn("Analytics: Failed to set user properties",r)}}).catch(n=>{console.warn("Analytics: Failed to initialize before setting user properties:",n)})}getUserId(){try{return this.initialized?zH():void 0}catch(t){console.warn("Analytics: Failed to get user ID",t);return}}getCommonProperties(){var t;return{user_type:this.getUserId()?"authenticated":"anonymous",timestamp:Date.now(),app_version:((t=this.config)==null?void 0:t.appVersion)||"unknown"}}isInitialized(){return this.initialized}getConfig(){return this.config}flush(){try{if(!this.initialized)return;VH()}catch(t){console.warn("Analytics: Failed to flush events",t)}}reset(){try{if(!this.initialized)return;qH()}catch(t){console.warn("Analytics: Failed to reset",t)}}}const Zr=new rK,mA=m.createContext(void 0);function iK({children:e}){const[t,n]=m.useState(null),[r,i]=m.useState(null),[s,o]=m.useState(!0),[a,l]=m.useState(!1),[u,d]=m.useState(null),[f,h]=m.useState(!1),[p,g]=m.useState(!1),{toast:v}=zi();m.useEffect(()=>{const S=async()=>{if(new URLSearchParams(window.location.hash.substring(1)).get("access_token")){g(!0);try{const{data:N,error:I}=await g8();if(I)throw I;if(N.user){const{data:O}=await dk();O.session&&(i(O.session),n(O.session.user),v({title:"Welcome!",duration:2e3}),setTimeout(()=>{E(O.session.user.id)},100))}}catch(N){console.error("Error handling OAuth redirect:",N),v({title:"Sign in failed",description:"Failed to complete Google authentication.",variant:"destructive"})}finally{setTimeout(()=>{g(!1),o(!1)},500),window.history&&window.history.replaceState&&window.history.replaceState({},document.title,window.location.pathname+window.location.search)}return!0}return!1},E=async P=>{const{profile:T,needsOnboarding:N}=await u8(P);d(T),h(N)};(async()=>{if(o(!0),!await S())try{const{data:{session:T}}=await dk();i(T),n((T==null?void 0:T.user)??null),T!=null&&T.user&&await E(T.user.id)}catch(T){console.error("Error initializing auth:",T)}finally{setTimeout(()=>{o(!1)},100)}})();const{data:{subscription:C}}=_e.auth.onAuthStateChange((P,T)=>{console.log("Auth state changed:",P),i(T),n((T==null?void 0:T.user)??null),P==="SIGNED_IN"&&(T!=null&&T.user)?p||(v({title:"Welcome back",duration:2e3}),setTimeout(()=>{E(T.user.id)},0)):P==="SIGNED_OUT"&&(d(null),h(!1),v({title:"Signed out",duration:2e3}))});return()=>{C.unsubscribe()}},[v,p]),m.useEffect(()=>{!s&&!p&&(async()=>{var E,k,C,P;try{if(t&&t.id){if(console.log("Setting analytics user ID:",t.id),await Zr.setUserId(t.id),u){const T={user_type:"authenticated",has_dietary_preferences:!!((E=u.dietary_preferences)!=null&&E.length),has_cuisine_preferences:!!((k=u.cuisine_preferences)!=null&&k.length),has_spice_tolerance:!!u.spice_tolerance,has_default_servings:!!u.default_servings,needs_onboarding:f};(C=u.dietary_preferences)!=null&&C.length&&(T.dietary_preferences=u.dietary_preferences),(P=u.cuisine_preferences)!=null&&P.length&&(T.cuisine_preferences=u.cuisine_preferences),u.spice_tolerance&&(T.spice_tolerance=u.spice_tolerance),u.default_servings&&(T.default_servings=u.default_servings),console.log("Setting analytics user properties:",T),await Zr.
86setUserProperties(T)}}else{console.log("Clearing analytics user ID - using device ID for anonymous tracking"),await Zr.setUserId(void 0);const T={user_type:"anonymous"};console.log("Setting analytics user properties for anonymous user:",T),await Zr.setUserProperties(T)}}catch(T){console.error("Error updating analytics user identification:",T)}})()},[t,u,f,s,p]);const w=async(S,E,k,C)=>{try{o(!0);const{error:P}=await h8(S,E,k,C);if(P)throw P}catch(P){throw v({title:"Authentication error",description:P.message,variant:"destructive",duration:4e3}),P}finally{o(!1)}},y=async(S,E)=>{try{o(!0);const{error:k}=await f8(S,E);if(k)throw k}catch(k){throw v({title:"Authentication error",description:k.message,variant:"destructive",duration:4e3}),k}finally{o(!1)}},x=async()=>{try{o(!0);const{error:S}=await p8();if(S&&S.message.includes("session not found")){console.log("Session already expired, cleaning up local state"),n(null),i(null),d(null),h(!1),v({title:"Signed out",duration:2e3});return}if(S)throw S}catch(S){console.error("Error during sign out:",S),v({title:"Authentication error",description:S.message,variant:"destructive",duration:4e3}),n(null),i(null),d(null),h(!1)}finally{o(!1)}},b=async S=>{if(t)try{l(!0);const{success:E,error:k}
86=await d8(t.id,S);if(!E)throw k;d(C=>C?{...C,...S}:null),(S.dietary_preferences||S.cuisine_preferences||S.spice_tolerance)&&h(!1),v({title:"Profile updated",description:"Your preferences have been saved."})}catch(E){v({title:"Profile update error",description:E.message,variant:"destructive",duration:4e3})}finally{l(!1)}},_=async(S,E=!1)=>{try{o(!0);const{data:k,error:C}=await m8(S,E);if(C)throw C;k.url&&(g(!0),v({title:"Redirecting to Google",description:E?"Please select an account to sign up with.":"Please complete the authentication process."}))}catch(k){throw v({title:"Authentication error",description:k.message,variant:"destructive",duration:4e3}),k}finally{o(!1)}};return c.jsx(mA.Provider,{value:{user:t,session:r,isLoading:s,isUpdatingProfile:a,isRedirecting:p,profile:u,signIn:y,signUp:w,signOut:x,signInWithProvider:_,updateProfile:b,needsOnboarding:f},children:e})}function Zt(){const e=m.useContext(mA);if(e===void 0)throw new Error("useAuth must be used within an AuthProvider");return e}/**
87 * @license lucide-react v0.462.0 - ISC
88 *
89 * This source code is licensed under the ISC license.
90 * See the LICENSE file in the root directory of this source tree.
91 */const sK=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),gA=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
92 * @license lucide-react v0.462.0 - ISC
93 *
94 * This source code is licensed under the ISC license.
95 * See the LICENSE file in the root directory of this source tree.
96 */var oK={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"};/**
97 * @license lucide-react v0.462.0 - ISC
98 *
99 * This source code is licensed under the ISC license.
100 * See the LICENSE file in the root directory of this source tree.
101 */const aK=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:o,...a},l)=>m.createElement("svg",{ref:l,...oK,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:gA("lucide",i),...a},[...o.map(([u,d])=>m.createElement(u,d)),...Array.isArray(s)?s:[s]]));/**
102 * @license lucide-react v0.462.0 - ISC
103 *
104 * This source code is licensed under the ISC license.
105 * See the LICENSE file in the root directory of this source tree.
106 */const ce=(e,t)=>{const n=m.forwardRef(({className:r,...i},s)=>m.createElement(aK,{ref:s,iconNode:t,className:gA(`lucide-${sK(e)}`,r),...i}));return n.displayName=`${e}`,n};/**
107 * @license lucide-react v0.462.0 - ISC
108 *
109 * This source code is licensed under the ISC license.
110 * See the LICENSE file in the root directory of this source tree.
111 */const lK=ce("Apple",[["path",{d:"M12 20.94c1.5 0 2.75 1.06 4 1.06 3 0 6-8 6-12.22A4.91 4.91 0 0 0 17 5c-2.22 0-4 1.44-5 2-1-.56-2.78-2-5-2a4.9 4.9 0 0 0-5 4.78C2 14 5 22 8 22c1.25 0 2.5-1.06 4-1.06Z",key:"3s7exb"}],["path",{d:"M10 2c1 .5 2 2 2 5",key:"fcco2y"}]]);/**
112 * @license lucide-react v0.462.0 - ISC
113 *
114 * This source code is licensed under the ISC license.
115 * See the LICENSE file in the root directory of this source tree.
116 */const c_=ce("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
117 * @license lucide-react v0.462.0 - ISC
118 *
119 * This source code is licensed under the ISC license.
120 * See the LICENSE file in the root directory of this source tree.
121 */const vA=ce("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
122 * @license lucide-react v0.462.0 - ISC
123 *
124 * This source code is licensed under the ISC license.
125 * See the LICENSE file in the root directory of this source tree.
126 */const cK=ce("Baby",[["path",{d:"M9 12h.01",key:"157uk2"}],["path",{d:"M15 12h.01",key:"1k8ypt"}],["path",{d:"M10 16c.5.3 1.2.5 2 .5s1.5-.2 2-.5",key:"1u7htd"}],["path",{d:"M19 6.3a9 9 0 0 1 1.8 3.9 2 2 0 0 1 0 3.6 9 9 0 0 1-17.6 0 2 2 0 0 1 0-3.6A9 9 0 0 1 12 3c2 0 3.5 1.1 3.5 2.5s-.9 2.5-2 2.5c-.8 0-1.5-.4-1.5-1",key:"5yv0yz"}]]);/**
127 * @license lucide-react v0.462.0 - ISC
128 *
129 * This source code is licensed under the ISC license.
130 * See the LICENSE file in the root directory of this source tree.
131 */const uK=ce("Beef",[["circle",{cx:"12.5",cy:"8.5",r:"2.5",key:"9738u8"}],["path",{d:"M12.5 2a6.5 6.5 0 0 0-6.22 4.6c-1.1 3.13-.78 3.9-3.18 6.08A3 3 0 0 0 5 18c4 0 8.4-1.8 11.4-4.3A6.5 6.5 0 0 0 12.5 2Z",key:"o0f6za"}],["path",{d:"m18.5 6 2.19 4.5a6.48 6.48 0 0 1 .31 2 6.49 6.49 0 0 1-2.6 5.2C15.4 20.2 11 22 7 22a3 3 0 0 1-2.68-1.66L2.4 16.5",key:"k7p6i0"}]]);/**
132 * @license lucide-react v0.462.0 - ISC
133 *
134 * This source code is licensed under the ISC license.
135 * See the LICENSE file in the root directory of this source tree.
136 */const dK=ce("BugPlay",[["path",{d:"M12.765 21.522a.5.5 0 0 1-.765-.424v-8.196a.5.5 0 0 1 .765-.424l5.878 3.674a1 1 0 0 1 0 1.696z",key:"17shqo"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M18 11a4 4 0 0 0-4-4h-4a4 4 0 0 0-4 4v3a6.1 6.1 0 0 0 2 4.5",key:"1tjixy"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}]]);/**
137 * @license lucide-react v0.462.0 - ISC
138 *
139 * This source code is licensed under the ISC license.
140 * See the LICENSE file in the root directory of this source tree.
141 */const fK=ce("CalendarDays",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);/**
142 * @license lucide-react v0.462.0 - ISC
143 *
144 * This source code is licensed under the ISC license.
145 * See the LICENSE file in the root directory of this source tree.
146 */const hK=ce("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
147 * @license lucide-react v0.462.0 - ISC
148 *
149 * This source code is licensed under the ISC license.
150 * See the LICENSE file in the root directory of this source tree.
151 */const uc=ce("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/**
152 * @license lucide-react v0.462.0 - ISC
153 *
154 * This source code is licensed under the ISC license.
155 * See the LICENSE file in the root directory of this source tree.
156 */const Ra=ce("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
157 * @license lucide-react v0.462.0 - ISC
158 *
159 * This source code is licensed under the ISC license.
160 * See the LICENSE file in the root directory of this source tree.
161 */const Yp=ce("ChefHat",[["path",{d:"M17 21a1 1 0 0 0 1-1v-5.35c0-.457.316-.844.727-1.041a4 4 0 0 0-2.134-7.589 5 5 0 0 0-9.186 0 4 4 0 0 0-2.134 7.588c.411.198.727.585.727 1.041V20a1 1 0 0 0 1 1Z",key:"1qvrer"}],["path",{d:"M6 17h12",key:"1jwigz"}]]);/**
162 * @license lucide-react v0.462.0 - ISC
163 *
164 * This source code is licensed under the ISC license.
165 * See the LICENSE file in the root directory of this source tree.
166 */const u_=ce("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
167 * @license lucide-react v0.462.0 - ISC
168 *
169 * This source code is licensed under the ISC license.
170 * See the LICENSE file in the root directory of this source tree.
171 */const yA=ce("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
172 * @license lucide-react v0.462.0 - ISC
173 *
174 * This source code is licensed under the ISC license.
175 * See the LICENSE file in the root directory of this source tree.
176 */const d_=ce("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
177 * @license lucide-react v0.462.0 - ISC
178 *
179 * This source code is licensed under the ISC license.
180 * See the LICENSE file in the root directory of this source tree.
181 */const pK=ce("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
182 * @license lucide-react v0.462.0 - ISC
183 *
184 * This source code is licensed under the ISC license.
185 * See the LICENSE file in the root directory of this source tree.
186 */const xA=ce("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
187 * @license lucide-react v0.462.0 - ISC
188 *
189 * This source code is licensed under the ISC license.
190 * See the LICENSE file in the root directory of this source tree.
191 */const mK=ce("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
192 * @license lucide-react v0.462.0 - ISC
193 *
194 * This source code is licensed under the ISC license.
195 * See the LICENSE file in the root directory of this source tree.
196 */const gK=ce("CircleDot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);/**
197 * @license lucide-react v0.462.0 - ISC
198 *
199 * This source code is licensed under the ISC license.
200 * See the LICENSE file in the root directory of this source tree.
201 */const wA=ce("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
202 * @license lucide-react v0.462.0 - ISC
203 *
204 * This source code is licensed under the ISC license.
205 * See the LICENSE file in the root directory of this source tree.
206 */const bA=ce("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
207 * @license lucide-react v0.462.0 - ISC
208 *
209 * This source code is licensed under the ISC license.
210 * See the LICENSE file in the root directory of this source tree.
211 */const _A=ce("Coffee",[["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M14 2v2",key:"6buw04"}],["path",{d:"M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1",key:"pwadti"}],["path",{d:"M6 2v2",key:"colzsn"}]]);/**
212 * @license lucide-react v0.462.0 - ISC
213 *
214 * This source code is licensed under the ISC license.
215 * See the LICENSE file in the root directory of this source tree.
216 */const vK=ce("Cookie",[["path",{d:"M12 2a10 10 0 1 0 10 10 4 4 0 0 1-5-5 4 4 0 0 1-5-5",key:"laymnq"}],["path",{d:"M8.5 8.5v.01",key:"ue8clq"}],["path",{d:"M16 15.5v.01",key:"14dtrp"}],["path",{d:"M12 12v.01",key:"u5ubse"}],["path",{d:"M11 17v.01",key:"1hyl5a"}],["path",{d:"M7 14v.01",key:"uct60s"}]]);/**
217 * @license lucide-react v0.462.0 - ISC
218 *
219 * This source code is licensed under the ISC license.
220 * See the LICENSE file in the root directory of this source tree.
221 */const kd=ce("CookingPot",[["path",{d:"M2 12h20",key:"9i4pu4"}],["path",{d:"M20 12v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-8",key:"u0tga0"}],["path",{d:"m4 8 16-4",key:"16g0ng"}],["path",{d:"m8.86 6.78-.45-1.81a2 2 0 0 1 1.45-2.43l1.94-.48a2 2 0 0 1 2.43 1.46l.45 1.8",key:"12cejc"}
221]]);/**
222 * @license lucide-react v0.462.0 - ISC
223 *
224 * This source code is licensed under the ISC license.
225 * See the LICENSE file in the root directory of this source tree.
226 */const yK=ce("Dog",[["path",{d:"M11.25 16.25h1.5L12 17z",key:"w7jh35"}],["path",{d:"M16 14v.5",key:"1lajdz"}],["path",{d:"M4.42 11.247A13.152 13.152 0 0 0 4 14.556C4 18.728 7.582 21 12 21s8-2.272 8-6.444a11.702 11.702 0 0 0-.493-3.309",key:"u7s9ue"}],["path",{d:"M8 14v.5",key:"1nzgdb"}],["path",{d:"M8.5 8.5c-.384 1.05-1.083 2.028-2.344 2.5-1.931.722-3.576-.297-3.656-1-.113-.994 1.177-6.53 4-7 1.923-.321 3.651.845 3.651 2.235A7.497 7.497 0 0 1 14 5.277c0-1.39 1.844-2.598 3.767-2.277 2.823.47 4.113 6.006 4 7-.08.703-1.725 1.722-3.656 1-1.261-.472-1.855-1.45-2.239-2.5",key:"v8hric"}]]);/**
227 * @license lucide-react v0.462.0 - ISC
228 *
229 * This source code is licensed under the ISC license.
230 * See the LICENSE file in the root directory of this source tree.
231 */const xK=ce("Egg",[["path",{d:"M12 22c6.23-.05 7.87-5.57 7.5-10-.36-4.34-3.95-9.96-7.5-10-3.55.04-7.14 5.66-7.5 10-.37 4.43 1.27 9.95 7.5 10z",key:"1c39pg"}]]);/**
232 * @license lucide-react v0.462.0 - ISC
233 *
234 * This source code is licensed under the ISC license.
235 * See the LICENSE file in the root directory of this source tree.
236 */const TC=ce("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
237 * @license lucide-react v0.462.0 - ISC
238 *
239 * This source code is licensed under the ISC license.
240 * See the LICENSE file in the root directory of this source tree.
241 */const jC=ce("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
242 * @license lucide-react v0.462.0 - ISC
243 *
244 * This source code is licensed under the ISC license.
245 * See the LICENSE file in the root directory of this source tree.
246 */const wK=ce("Fish",[["path",{d:"M6.5 12c.94-3.46 4.94-6 8.5-6 3.56 0 6.06 2.54 7 6-.94 3.47-3.44 6-7 6s-7.56-2.53-8.5-6Z",key:"15baut"}],["path",{d:"M18 12v.5",key:"18hhni"}],["path",{d:"M16 17.93a9.77 9.77 0 0 1 0-11.86",key:"16dt7o"}],["path",{d:"M7 10.67C7 8 5.58 5.97 2.73 5.5c-1 1.5-1 5 .23 6.5-1.24 1.5-1.24 5-.23 6.5C5.58 18.03 7 16 7 13.33",key:"l9di03"}],["path",{d:"M10.46 7.26C10.2 5.88 9.17 4.24 8 3h5.8a2 2 0 0 1 1.98 1.67l.23 1.4",key:"1kjonw"}],["path",{d:"m16.01 17.93-.23 1.4A2 2 0 0 1 13.8 21H9.5a5.96 5.96 0 0 0 1.49-3.98",key:"1zlm23"}]]);/**
247 * @license lucide-react v0.462.0 - ISC
248 *
249 * This source code is licensed under the ISC license.
250 * See the LICENSE file in the root directory of this source tree.
251 */const Kt=ce("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]);/**
252 * @license lucide-react v0.462.0 - ISC
253 *
254 * This source code is licensed under the ISC license.
255 * See the LICENSE file in the root directory of this source tree.
256 */const SA=ce("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/**
257 * @license lucide-react v0.462.0 - ISC
258 *
259 * This source code is licensed under the ISC license.
260 * See the LICENSE file in the root directory of this source tree.
261 */const bK=ce("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
262 * @license lucide-react v0.462.0 - ISC
263 *
264 * This source code is licensed under the ISC license.
265 * See the LICENSE file in the root directory of this source tree.
266 */const _K=ce("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
267 * @license lucide-react v0.462.0 - ISC
268 *
269 * This source code is licensed under the ISC license.
270 * See the LICENSE file in the root directory of this source tree.
271 */const PC=ce("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
272 * @license lucide-react v0.462.0 - ISC
273 *
274 * This source code is licensed under the ISC license.
275 * See the LICENSE file in the root directory of this source tree.
276 */const SK=ce("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
277 * @license lucide-react v0.462.0 - ISC
278 *
279 * This source code is licensed under the ISC license.
280 * See the LICENSE file in the root directory of this source tree.
281 */const EK=ce("ListTodo",[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
282 * @license lucide-react v0.462.0 - ISC
283 *
284 * This source code is licensed under the ISC license.
285 * See the LICENSE file in the root directory of this source tree.
286 */const Wt=ce("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
287 * @license lucide-react v0.462.0 - ISC
288 *
289 * This source code is licensed under the ISC license.
290 * See the LICENSE file in the root directory of this source tree.
291 */const NC=ce("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
292 * @license lucide-react v0.462.0 - ISC
293 *
294 * This source code is licensed under the ISC license.
295 * See the LICENSE file in the root directory of this source tree.
296 */const kK=ce("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"}]]);/**
297 * @license lucide-react v0.462.0 - ISC
298 *
299 * This source code is licensed under the ISC license.
300 * See the LICENSE file in the root directory of this source tree.
301 */const sy=ce("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"}]]);/**
302 * @license lucide-react v0.462.0 - ISC
303 *
304 * This source code is licensed under the ISC license.
305 * See the LICENSE file in the root directory of this source tree.
306 */const CK=ce("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
307 * @license lucide-react v0.462.0 - ISC
308 *
309 * This source code is licensed under the ISC license.
310 * See the LICENSE file in the root directory of this source tree.
311 */const Qp=ce("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/**
312 * @license lucide-react v0.462.0 - ISC
313 *
314 * This source code is licensed under the ISC license.
315 * See the LICENSE file in the root directory of this source tree.
316 */const TK=ce("Milk",[["path",{d:"M8 2h8",key:"1ssgc1"}],["path",{d:"M9 2v2.789a4 4 0 0 1-.672 2.219l-.656.984A4 4 0 0 0 7 10.212V20a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-9.789a4 4 0 0 0-.672-2.219l-.656-.984A4 4 0 0 1 15 4.788V2",key:"qtp12x"}],["path",{d:"M7 15a6.472 6.472 0 0 1 5 0 6.47 6.47 0 0 0 5 0",key:"ygeh44"}]]);/**
317 * @license lucide-react v0.462.0 - ISC
318 *
319 * This source code is licensed under the ISC license.
320 * See the LICENSE file in the root directory of this source tree.
321 */const jK=ce("PackageOpen",[["path",{d:"M12 22v-9",key:"x3hkom"}],["path",{d:"M15.17 2.21a1.67 1.67 0 0 1 1.63 0L21 4.57a1.93 1.93 0 0 1 0 3.36L8.82 14.79a1.655 1.655 0 0 1-1.64 0L3 12.43a1.93 1.93 0 0 1 0-3.36z",key:"2ntwy6"}],["path",{d:"M20 13v3.87a2.06 2.06 0 0 1-1.11 1.83l-6 3.08a1.93 1.93 0 0 1-1.78 0l-6-3.08A2.06 2.06 0 0 1 4 16.87V13",key:"1pmm1c"}],["path",{d:"M21 12.43a1.93 1.93 0 0 0 0-3.36L8.83 2.2a1.64 1.64 0 0 0-1.63 0L3 4.57a1.93 1.93 0 0 0 0 3.36l12.18 6.86a1.636 1.636 0 0 0 1.63 0z",key:"12ttoo"}]]);/**
322 * @license lucide-react v0.462.0 - ISC
323 *
324 * This source code is licensed under the ISC license.
325 * See the LICENSE file in the root directory of this source tree.
326 */const PK=ce("Pen",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]);/**
327 * @license lucide-react v0.462.0 - ISC
328 *
329 * This source code is licensed under the ISC license.
330 * See the LICENSE file in the root directory of this source tree.
331 */const EA=ce("Pizza",[["path",{d:"m12 14-1 1",key:"11onhr"}],["path",{d:"m13.75 18.25-1.25 1.42",key:"1yisr3"}],["path",{d:"M17.775 5.654a15.68 15.68 0 0 0-12.121 12.12",key:"1qtqk6"}],["path",{d:"M18.8 9.3a1 1 0 0 0 2.1 7.7",key:"fbbbr2"}],["path",{d:"M21.964 20.732a1 1 0 0 1-1.232 1.232l-18-5a1 1 0 0 1-.695-1.232A19.68 19.68 0 0 1 15.732 2.037a1 1 0 0 1 1.232.695z",key:"1hyfdd"}]]);/**
332 * @license lucide-react v0.462.0 - ISC
333 *
334 * This source code is licensed under the ISC license.
335 * See the LICENSE file in the root directory of this source tree.
336 */const NK=ce("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
337 * @license lucide-react v0.462.0 - ISC
338 *
339 * This source code is licensed under the ISC license.
340 * See the LICENSE file in the root directory of this source tree.
341 */const Px=ce("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
342 * @license lucide-react v0.462.0 - ISC
343 *
344 * This source code is licensed under the ISC license.
345 * See the LICENSE file in the root directory of this source tree.
346 */const RC=ce("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);/**
347 * @license lucide-react v0.462.0 - ISC
348 *
349 * This source code is licensed under the ISC license.
350 * See the LICENSE file in the root directory of this source tree.
351 */const RK=ce("Receipt",[["path",{d:"M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z",key:"q3az6g"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 17.5v-11",key:"1jc1ny"}]]);/**
352 * @license lucide-react v0.462.0 - ISC
353 *
354 * This source code is licensed under the ISC license.
355 * See the LICENSE file in the root directory of this source tree.
356 */const hg=ce("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"}]]);/**
357 * @license lucide-react v0.462.0 - ISC
358 *
359 * This source code is licensed under the ISC license.
360 * See the LICENSE file in the root directory of this source tree.
361 */const IK=ce("Refrigerator",[["path",{d:"M5 6a4 4 0 0 1 4-4h6a4 4 0 0 1 4 4v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6Z",key:"fpq118"}
361],["path",{d:"M5 10h14",key:"elsbfy"}],["path",{d:"M15 7v6",key:"1nx30x"}]]);/**
362 * @license lucide-react v0.462.0 - ISC
363 *
364 * This source code is licensed under the ISC license.
365 * See the LICENSE file in the root directory of this source tree.
366 */const kA=ce("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
367 * @license lucide-react v0.462.0 - ISC
368 *
369 * This source code is licensed under the ISC license.
370 * See the LICENSE file in the root directory of this source tree.
371 */const Nx=ce("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
372 * @license lucide-react v0.462.0 - ISC
373 *
374 * This source code is licensed under the ISC license.
375 * See the LICENSE file in the root directory of this source tree.
376 */const CA=ce("ShoppingBag",[["path",{d:"M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z",key:"hou9p0"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}]]);/**
377 * @license lucide-react v0.462.0 - ISC
378 *
379 * This source code is licensed under the ISC license.
380 * See the LICENSE file in the root directory of this source tree.
381 */const Xp=ce("ShoppingCart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]]);/**
382 * @license lucide-react v0.462.0 - ISC
383 *
384 * This source code is licensed under the ISC license.
385 * See the LICENSE file in the root directory of this source tree.
386 */const f_=ce("Snowflake",[["line",{x1:"2",x2:"22",y1:"12",y2:"12",key:"1dnqot"}],["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"m20 16-4-4 4-4",key:"rquw4f"}],["path",{d:"m4 8 4 4-4 4",key:"12s3z9"}],["path",{d:"m16 4-4 4-4-4",key:"1tumq1"}],["path",{d:"m8 20 4-4 4 4",key:"9p200w"}]]);/**
387 * @license lucide-react v0.462.0 - ISC
388 *
389 * This source code is licensed under the ISC license.
390 * See the LICENSE file in the root directory of this source tree.
391 */const TA=ce("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"}]]);/**
392 * @license lucide-react v0.462.0 - ISC
393 *
394 * This source code is licensed under the ISC license.
395 * See the LICENSE file in the root directory of this source tree.
396 */const AK=ce("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
397 * @license lucide-react v0.462.0 - ISC
398 *
399 * This source code is licensed under the ISC license.
400 * See the LICENSE file in the root directory of this source tree.
401 */const OK=ce("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
402 * @license lucide-react v0.462.0 - ISC
403 *
404 * This source code is licensed under the ISC license.
405 * See the LICENSE file in the root directory of this source tree.
406 */const Rx=ce("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}
406],["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"}]]);/**
407 * @license lucide-react v0.462.0 - ISC
408 *
409 * This source code is licensed under the ISC license.
410 * See the LICENSE file in the root directory of this source tree.
411 */const DK=ce("Trash",[["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"}]]);/**
412 * @license lucide-react v0.462.0 - ISC
413 *
414 * This source code is licensed under the ISC license.
415 * See the LICENSE file in the root directory of this source tree.
416 */const h_=ce("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
417 * @license lucide-react v0.462.0 - ISC
418 *
419 * This source code is licensed under the ISC license.
420 * See the LICENSE file in the root directory of this source tree.
421 */const p_=ce("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"}]]);/**
422 * @license lucide-react v0.462.0 - ISC
423 *
424 * This source code is licensed under the ISC license.
425 * See the LICENSE file in the root directory of this source tree.
426 */const jA=ce("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
427 * @license lucide-react v0.462.0 - ISC
428 *
429 * This source code is licensed under the ISC license.
430 * See the LICENSE file in the root directory of this source tree.
431 */const PA=ce("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"}]]);/**
432 * @license lucide-react v0.462.0 - ISC
433 *
434 * This source code is licensed under the ISC license.
435 * See the LICENSE file in the root directory of this source tree.
436 */const MK=ce("UtensilsCrossed",[["path",{d:"m16 2-2.3 2.3a3 3 0 0 0 0 4.2l1.8 1.8a3 3 0 0 0 4.2 0L22 8",key:"n7qcjb"}],["path",{d:"M15 15 3.3 3.3a4.2 4.2 0 0 0 0 6l7.3 7.3c.7.7 2 .7 2.8 0L15 15Zm0 0 7 7",key:"d0u48b"}],["path",{d:"m2.1 21.8 6.4-6.3",key:"yn04lh"}],["path",{d:"m19 5-7 7",key:"194lzd"}]]);/**
437 * @license lucide-react v0.462.0 - ISC
438 *
439 * This source code is licensed under the ISC license.
440 * See the LICENSE file in the root directory of this source tree.
441 */const NA=ce("Utensils",[["path",{d:"M3 2v7c0 1.1.9 2 2 2h4a2 2 0 0 0 2-2V2",key:"cjf0a3"}],["path",{d:"M7 2v20",key:"1473qp"}],["path",{d:"M21 15V2a5 5 0 0 0-5 5v6c0 1.1.9 2 2 2h3Zm0 0v7",key:"j28e5"}]]);/**
442 * @license lucide-react v0.462.0 - ISC
443 *
444 * This source code is licensed under the ISC license.
445 * See the LICENSE file in the root directory of this source tree.
446 */const LK=ce("Volume",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}]]);/**
447 * @license lucide-react v0.462.0 - ISC
448 *
449 * This source code is licensed under the ISC license.
450 * See the LICENSE file in the root directory of this source tree.
451 */const FK=ce("Wheat",[["path",{d:"M2 22 16 8",key:"60hf96"}],["path",{d:"M3.47 12.53 5 11l1.53 1.53a3.5 3.5 0 0 1 0 4.94L5 19l-1.53-1.53a3.5 3.5 0 0 1 0-4.94Z",key:"1rdhi6"}],["path",{d:"M7.47 8.53 9 7l1.53 1.53a3.5 3.5 0 0 1 0 4.94L9 15l-1.53-1.53a3.5 3.5 0 0 1 0-4.94Z",key:"1sdzmb"}],["path",{d:"M11.47 4.53 13 3l1.53 1.53a3.5 3.5 0 0 1 0 4.94L13 11l-1.53-1.53a3.5 3.5 0 0 1 0-4.94Z",key:"eoatbi"}],["path",{d:"M20 2h2v2a4 4 0 0 1-4 4h-2V6a4 4 0 0 1 4-4Z",key:"19rau1"}],["path",{d:"M11.47 17.47 13 19l-1.53 1.53a3.5 3.5 0 0 1-4.94 0L5 19l1.53-1.53a3.5 3.5 0 0 1 4.94 0Z",key:"tc8ph9"}],["path",{d:"M15.47 13.47 17 15l-1.53 1.53a3.5 3.5 0 0 1-4.94 0L9 15l1.53-1.53a3.5 3.5 0 0 1 4.94 0Z",key:"2m8kc5"}],["path",{d:"M19.47 9.47 21 11l-1.53 1.53a3.5 3.5 0 0 1-4.94 0L13 11l1.53-1.53a3.5 3.5 0 0 1 4.94 0Z",key:"vex3ng"}]]);/**
452 * @license lucide-react v0.462.0 - ISC
453 *
454 * This source code is licensed under the ISC license.
455 * See the LICENSE file in the root directory of this source tree.
456 */const $K=ce("Wine",[["path",{d:"M8 22h8",key:"rmew8v"}],["path",{d:"M7 10h10",key:"1101jm"}],["path",{d:"M12 15v7",key:"t2xh3l"}],["path",{d:"M12 15a5 5 0 0 0 5-5c0-2-.5-4-2-8H9c-1.5 4-2 6-2 8a5 5 0 0 0 5 5Z",key:"10ffi3"}]]);/**
457 * @license lucide-react v0.462.0 - ISC
458 *
459 * This source code is licensed under the ISC license.
460 * See the LICENSE file in the root directory of this source tree.
461 */const Di=ce("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}
vendor: 8,467 bytes, line 461
461],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),UK=({children:e})=>{const{user:t,isLoading:n,needsOnboarding:r,isRedirecting:i}=Zt(),s=ws();return n||i?c.jsxs("div",{className:"flex h-screen w-full items-center justify-center",children:[c.jsx(Wt,{className:"h-8 w-8 animate-spin text-primary"}),c.jsx("p",{className:"ml-2 text-sm text-muted-foreground",children:i?"Completing sign in...":"Getting you signed in..."})]}):t?r&&!s.pathname.includes("/onboarding")?c.jsx(U0,{to:"/onboarding/welcome",replace:!0}):e?c.jsx(c.Fragment,{children:e}):c.jsx(rR,{}):c.jsx(U0,{to:"/",state:{from:s},replace:!0})};function VK(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function pg(...e){return t=>e.forEach(n=>VK(n,t))}function Le(...e){return m.useCallback(pg(...e),e)}var ps=m.forwardRef((e,t)=>{const{children:n,...r}=e,i=m.Children.toArray(n),s=i.find(zK);if(s){const o=s.props.children,a=i.map(l=>l===s?m.Children.count(o)>1?m.Children.only(null):m.isValidElement(o)?o.props.children:null:l);return c.jsx(Ix,{...r,ref:t,children:m.isValidElement(o)?m.cloneElement(o,void 0,a):null})}return c.jsx(Ix,{...r,ref:t,children:n})});ps.displayName="Slot";var Ix=m.forwardRef((e,t)=>{const{children:n,...r}=e;if(m.isValidElement(n)){const i=WK(n);return m.cloneElement(n,{...BK(r,n.props),ref:t?pg(t,i):i})}return m.Children.count(n)>1?m.Children.only(null):null});Ix.displayName="SlotClone";var m_=({children:e})=>c.jsx(c.Fragment,{children:e});function zK(e){return m.isValidElement(e)&&e.type===m_}function BK(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{s(...a),i(...a)}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function WK(e){var r,i;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=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function RA(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=RA(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function IA(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=RA(e))&&(r&&(r+=" "),r+=t);return r}const IC=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,AC=IA,Va=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return AC(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:s}=t,o=Object.keys(i).map(u=>{const d=n==null?void 0:n[u],f=s==null?void 0:s[u];if(d===null)return null;const h=IC(d)||IC(f);return i[u][h]}),a=n&&Object.entries(n).reduce((u,d)=>{let[f,h]=d;return h===void 0||(u[f]=h),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:f,className:h,...p}=d;return Object.entries(p).every(g=>{let[v,w]=g;return Array.isArray(w)?w.includes({...s,...a}[v]):{...s,...a}[v]===w})?[...u,f,h]:u},[]);return AC(e,o,l,n==null?void 0:n.class,n==null?void 0:n.className)},g_="-",qK=e=>{const t=GK(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const a=o.split(g_);return a[0]===""&&a.length!==1&&a.shift(),AA(a,t)||HK(o)},getConflictingClassGroupIds:(o,a)=>{const l=n[o]||[];return a&&r[o]?[...l,...r[o]]:l}}},AA=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?AA(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const s=e.join(g_);return(o=t.validators.find(({validator:a})=>a(s)))==null?void 0:o.classGroupId},OC=/^\[(.+)\]$/,HK=e=>{if(OC.test(e)){const t=OC.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},GK=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return YK(Object.entries(e.classGroups),n).forEach(([s,o])=>{Ax(o,r,s,t)}),r},Ax=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const s=i===""?t:DC(t,i);s.classGroupId=n;return}if(typeof i=="function"){if(KK(i)){Ax(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,o])=>{Ax(o,DC(t,s),n,r)})})},DC=(e,t)=>{let n=e;return t.split(g_).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},KK=e=>e.isThemeGetter,YK=(e,t)=>t?e.map(([n,r])=>{const i=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([o,a])=>[t+o,a])):s);return[n,i]}):e,QK=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(s,o)=>{n.set(s,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let o=n.get(s);if(o!==void 0)return o;if((o=r.get(s))!==void 0)return i(s,o),o},set(s,o){n.has(s)?n.set(s,o):i(s,o)}}},OA="!",XK=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],s=t.length,o=a=>{const l=[];let u=0,d=0,f;for(let w=0;w<a.length;w++){let y=a[w];if(u===0){if(y===i&&(r||a.slice(w,w+s)===t)){l.push(a.slice(d,w)),d=w+s;continue}if(y==="/"){f=w;continue}}y==="["?u++:y==="]"&&u--}const h=l.length===0?a:a.substring(d),p=h.startsWith(OA),g=p?h.substring(1):h,v=f&&f>d?f-d:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:v}};return n?a=>n({className:a,parseClassName:o}):o},ZK=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},JK=e=>({cache:QK(e.cacheSize),parseClassName:XK(e),...qK(e)}),eY=/\s+/,tY=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,s=[],o=e.trim().split(eY);let a="";for(let l=o.length-1;l>=0;l-=1){const u=o[l],{modifiers:d,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:p}=n(u);let g=!!p,v=r(g?h.substring(0,p):h);if(!v){if(!g){a=u+(a.length>0?" "+a:a);continue}if(v=r(h),!v){a=u+(a.length>0?" "+a:a);continue}g=!1}const w=ZK(d).join(":"),y=f?w+OA:w,x=y+v;if(s.includes(x))continue;s.push(x);const b=i(v,g);for(let _=0;_<b.length;++_){const S=b[_];s.push(y+S)}a=u+(a.length>0?" "+a:a)}return a};function nY(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=DA(t))&&(r&&(r+=" "),r+=n);return r}const DA=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=DA(e[r]))&&(n&&(n+=" "),n+=t);return n};function rY(e,...t){let n,r,i,s=o;function o(l){const u=t.reduce((d,f)=>f(d),e());return n=JK(u),r=n.cache.get,i=n.cache.set,s=a,a(l)}function a(l){const u=r(l);if(u)return u;const d=tY(l,n);return i(l,d),d}return function(){return s(nY.apply(null,arguments))}}const at=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},MA=/^\[(?:([a-z-]+):)?(.+)\]$/i,iY=/^\d+\/\d+$/,sY=new Set(["px","full","screen"]),oY=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,aY=/\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$/,lY=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,cY=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,uY=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ki=e=>Fl(e)||sY.has(e)||iY.test(e),ks=e=>Ic(e,"length",yY),Fl=e=>!!e&&!Number.isNaN(Number(e)),oy=e=>Ic(e,"number",Fl),ou=e=>!!e&&Number.isInteger(Number(e)),dY=e=>e.endsWith("%")&&Fl(e.slice(0,-1)),Ie=e=>MA.test(e),Cs=e=>oY.test(e),fY=new Set(["length","size","percentage"]),hY=e=>Ic(e,fY,LA),pY=e=>Ic(e,"position",LA),mY=new Set(["image","url"]),gY=e=>Ic(e,mY,wY),vY=e=>Ic(e,"",xY),au=()=>!0,Ic=(e,t,n)=>{const r=MA.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},yY=e=>aY.test(e)&&!lY.test(e),LA=()=>!1,xY=e=>cY.test(e),wY=e=>uY.test(e),bY=()=>{const e=at("colors"),t=at("spacing"),n=at("blur"),r=at("brightness"),i=at("borderColor"),s=at("borderRadius"),o=at("borderSpacing"),a=at("borderWidth"),l=at("contrast"),u=at("grayscale"),d=at("hueRotate"),f=at("invert"),h=at("gap"),p=at("gradientColorStops"),g=at("gradientColorStopPositions"),v=at("inset"),w=at("margin"),y=at("opacity"),x=at("padding"),b=at("saturate"),_=at("scale"),S=at("sepia"),E=at("skew"),k=at("space"),C=at("translate"),P=()=>["auto","contain","none"],T=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto",Ie,t],I=()=>[Ie,t],O=()=>["",Ki,ks],j=()=>["auto",Fl,Ie],A=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],
vendor: 12,070 bytes, line 461
461V=()=>["solid","dashed","dotted","double","none"],$=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],R=()=>["start","end","center","between","around","evenly","stretch"],L=()=>["","0",Ie],H=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>[Fl,Ie];return{cacheSize:500,separator:":",theme:{colors:[au],spacing:[Ki,ks],blur:["none","",Cs,Ie],brightness:z(),borderColor:[e],borderRadius:["none","","full",Cs,Ie],borderSpacing:I(),borderWidth:O(),contrast:z(),grayscale:L(),hueRotate:z(),invert:L(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[dY,ks],inset:N(),margin:N(),opacity:z(),padding:I(),saturate:z(),scale:z(),sepia:L(),skew:z(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",Ie]}],container:["container"],columns:[{columns:[Cs]}],"break-after":[{"break-after":H()}],"break-before":[{"break-before":H()}],"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:[...A(),Ie]}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ou,Ie]}],basis:[{basis:N()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ie]}],grow:[{grow:L()}],shrink:[{shrink:L()}],order:[{order:["first","last","none",ou,Ie]}],"grid-cols":[{"grid-cols":[au]}],"col-start-end":[{col:["auto",{span:["full",ou,Ie]},Ie]}],"col-start":[{"col-start":j()}],"col-end":[{"col-end":j()}],"grid-rows":[{"grid-rows":[au]}],"row-start-end":[{row:["auto",{span:[ou,Ie]},Ie]}],"row-start":[{"row-start":j()}],"row-end":[{"row-end":j()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ie]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ie]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...R()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...R(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...R(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ie,t]}],"min-w":[{"min-w":[Ie,t,"min","max","fit"]}],"max-w":[{"max-w":[Ie,t,"none","full","min","max","fit","prose",{screen:[Cs]},Cs]}],h:[{h:[Ie,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ie,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ie,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ie,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Cs,ks]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",oy]}],"font-family":[{font:[au]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ie]}],"line-clamp":[{"line-clamp":["none",Fl,oy]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ki,Ie]}],"list-image":[{"list-image":["none",Ie]}],"list-style-type":[{list:["none","disc","decimal",Ie]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...V(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ki,ks]}],"underline-offset":[{"underline-offset":["auto",Ki,Ie]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ie]}],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",Ie]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...A(),pY]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",hY]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},gY]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"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":[y]}],"border-style":[{border:[...V(),"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":[y]}],"divide-style":[{divide:V()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...V()]}],"outline-offset":[{"outline-offset":[Ki,Ie]}],"outline-w":[{outline:[Ki,ks]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:O()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[Ki,ks]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Cs,vY]}],"shadow-color":[{shadow:[au]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...$(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":$()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Cs,Ie]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[b]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"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",Ie]}],duration:[{duration:z()}],ease:[{ease:["linear","in","out","in-out",Ie]}],delay:[{delay:z()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ie]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[_]}],"scale-x":[{"scale-x":[_]}],"scale-y":[{"scale-y":[_]}],rotate:[{rotate:[ou,Ie]}],"translate-x":[{"translate-x":[C]}],"translate-y":[{"translate-y":[C]}],"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",Ie]}],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",Ie]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}
461],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",Ie]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ki,ks,oy]}],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"]}}},_Y=rY(bY);function K(...e){return _Y(IA(e))}const v_=Va("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-full 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 transition-all duration-300",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90 shadow-sm hover:-translate-y-0.5",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground hover:-translate-y-0.5",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 shadow-sm hover:-translate-y-0.5",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline",bubble:"bubble-button hover:-translate-y-1"},size:{default:"h-10 px-5 py-2",sm:"h-9 rounded-full px-4",lg:"h-11 rounded-full px-8 text-base",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),ie=m.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},s)=>{const o=r?ps:"button";return c.jsx(o,{className:K(v_({variant:t,size:n,className:e})),ref:s,...i})});ie.displayName="Button";function se(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function SY(e,t){const n=m.createContext(t),r=s=>{const{children:o,...a}=s,l=m.useMemo(()=>a,Object.values(a));return c.jsx(n.Provider,{value:l,children:o})};r.displayName=e+"Provider";function i(s){const o=m.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,i]}function Mn(e,t=[]){let n=[];function r(s,o){const a=m.createContext(o),l=n.length;n=[...n,o];const u=f=>{var y;const{scope:h,children:p,...g}=f,v=((y=h==null?void 0:h[e])==null?void 0:y[l])||a,w=m.useMemo(()=>g,Object.values(g));return c.jsx(v.Provider,{value:w,children:p})};u.displayName=s+"Provider";function d(f,h){var v;const p=((v=h==null?void 0:h[e])==null?void 0:v[l])||a,g=m.useContext(p);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[u,d]}const i=()=>{const s=n.map(o=>m.createContext(o));return function(a){const l=(a==null?void 0:a[e])||s;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,EY(i,...t)]}function EY(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((a,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...a,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var Dr=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},kY=BP.useId||(()=>{}),CY=0;function Ni(e){const[t,n]=m.useState(kY());return Dr(()=>{e||n(r=>r??String(CY++))},[e]),e||(t?`radix-${t}`:"")}function gt(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 Jn({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=TY({defaultProp:t,onChange:n}),s=e!==void 0,o=s?e:r,a=gt(n),l=m.useCallback(u=>{if(s){const f=typeof u=="function"?u(e):u;f!==e&&a(f)}else i(u)},[s,e,i,a]);return[o,l]}function TY({defaultProp:e,onChange:t}){const n=m.useState(e),[r]=n,i=m.useRef(r),s=gt(t);return m.useEffect(()=>{i.current!==r&&(s(r),i.current=r)},[r,i,s]),n}var jY=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],me=jY.reduce((e,t)=>
vendor: 9,975 bytes, line 461
461{const n=m.forwardRef((r,i)=>{const{asChild:s,...o}=r,a=s?ps:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(a,{...o,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function y_(e,t){e&&kc.flushSync(()=>e.dispatchEvent(t))}function PY(e,t=globalThis==null?void 0:globalThis.document){const n=gt(e);m.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var NY="DismissableLayer",Ox="dismissableLayer.update",RY="dismissableLayer.pointerDownOutside",IY="dismissableLayer.focusOutside",MC,FA=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ac=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:o,onDismiss:a,...l}=e,u=m.useContext(FA),[d,f]=m.useState(null),h=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=m.useState({}),g=Le(t,k=>f(k)),v=Array.from(u.layers),[w]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=v.indexOf(w),x=d?v.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,_=x>=y,S=OY(k=>{const C=k.target,P=[...u.branches].some(T=>T.contains(C));!_||P||(i==null||i(k),o==null||o(k),k.defaultPrevented||a==null||a())},h),E=DY(k=>{const C=k.target;[...u.branches].some(T=>T.contains(C))||(s==null||s(k),o==null||o(k),k.defaultPrevented||a==null||a())},h);return PY(k=>{x===u.layers.size-1&&(r==null||r(k),!k.defaultPrevented&&a&&(k.preventDefault(),a()))},h),m.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(MC=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),LC(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=MC)}},[d,h,n,u]),m.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),LC())},[d,u]),m.useEffect(()=>{const k=()=>p({});return document.addEventListener(Ox,k),()=>document.removeEventListener(Ox,k)},[]),c.jsx(me.div,{...l,ref:g,style:{pointerEvents:b?_?"auto":"none":void 0,...e.style},onFocusCapture:se(e.onFocusCapture,E.onFocusCapture),onBlurCapture:se(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:se(e.onPointerDownCapture,S.onPointerDownCapture)})});Ac.displayName=NY;var AY="DismissableLayerBranch",$A=m.forwardRef((e,t)=>{const n=m.useContext(FA),r=m.useRef(null),i=Le(t,r);return m.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),c.jsx(me.div,{...e,ref:i})});$A.displayName=AY;function OY(e,t=globalThis==null?void 0:globalThis.document){const n=gt(e),r=m.useRef(!1),i=m.useRef(()=>{});return m.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let l=function(){UA(RY,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=l,t.addEventListener("click",i.current,{once:!0})):l()}else t.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",s),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function DY(e,t=globalThis==null?void 0:globalThis.document){const n=gt(e),r=m.useRef(!1);return m.useEffect(()=>{const i=s=>{s.target&&!r.current&&UA(IY,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function LC(){const e=new CustomEvent(Ox);document.dispatchEvent(e)}function UA(e,t,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?y_(i,s):i.dispatchEvent(s)}var MY=Ac,LY=$A,ay="focusScope.autoFocusOnMount",ly="focusScope.autoFocusOnUnmount",FC={bubbles:!1,cancelable:!0},FY="FocusScope",mg=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=e,[a,l]=m.useState(null),u=gt(i),d=gt(s),f=m.useRef(null),h=Le(t,v=>l(v)),p=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let v=function(b){if(p.paused||!a)return;const _=b.target;a.contains(_)?f.current=_:Rs(f.current,{select:!0})},w=function(b){if(p.paused||!a)return;const _=b.relatedTarget;_!==null&&(a.contains(_)||Rs(f.current,{select:!0}))},y=function(b){if(document.activeElement===document.body)for(const S of b)S.removedNodes.length>0&&Rs(a)};document.addEventListener("focusin",v),document.addEventListener("focusout",w);const x=new MutationObserver(y);return a&&x.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",w),x.disconnect()}}},[r,a,p.paused]),m.useEffect(()=>{if(a){UC.add(p);const v=document.activeElement;if(!a.contains(v)){const y=new CustomEvent(ay,FC);a.addEventListener(ay,u),a.dispatchEvent(y),y.defaultPrevented||($Y(WY(VA(a)),{select:!0}),document.activeElement===v&&Rs(a))}return()=>{a.removeEventListener(ay,u),setTimeout(()=>{const y=new CustomEvent(ly,FC);a.addEventListener(ly,d),a.dispatchEvent(y),y.defaultPrevented||Rs(v??document.body,{select:!0}),a.removeEventListener(ly,d),UC.remove(p)},0)}}},[a,u,d,p]);const g=m.useCallback(v=>{if(!n&&!r||p.paused)return;const w=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,y=document.activeElement;if(w&&y){const x=v.currentTarget,[b,_]=UY(x);b&&_?!v.shiftKey&&y===_?(v.preventDefault(),n&&Rs(b,{select:!0})):v.shiftKey&&y===b&&(v.preventDefault(),n&&Rs(_,{select:!0})):y===x&&v.preventDefault()}},[n,r,p.paused]);return c.jsx(me.div,{tabIndex:-1,...o,ref:h,onKeyDown:g})});mg.displayName=FY;function $Y(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Rs(r,{select:t}),document.activeElement!==n)return}function UY(e){const t=VA(e),n=$C(t,e),r=$C(t.reverse(),e);return[n,r]}function VA(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function $C(e,t){for(const n of e)if(!VY(n,{upTo:t}))return n}function VY(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 zY(e){return e instanceof HTMLInputElement&&"select"in e}function Rs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&zY(e)&&t&&e.select()}}var UC=BY();function BY(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=VC(e,t),e.unshift(t)},remove(t){var n;e=VC(e,t),(n=e[0])==null||n.resume()}}}function VC(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function WY(e){return e.filter(t=>t.tagName!=="A")}var qY="Portal",gf=m.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[i,s]=m.useState(!1);Dr(()=>s(!0),[]);const o=n||i&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?H2.createPortal(c.jsx(me.div,{...r,ref:t}),o):null});gf.displayName=qY;function HY(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var Lt=e=>{const{present:t,children:n}=e,r=GY(t),i=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),s=Le(r.ref,KY(i));return typeof n=="function"||r.isPresent?m.cloneElement(i,{ref:s}):null};Lt.displayName="Presence";function GY(e){const[t,n]=m.useState(),r=m.useRef({}),i=m.useRef(e),s=m.useRef("none"),o=e?"mounted":"unmounted",[a,l]=HY(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const u=hh(r.current);s.current=a==="mounted"?u:"none"},[a]),Dr(()=>{const u=r.current,d=i.current;if(d!==e){const h=s.current,p=hh(u);e?l("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&h!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),Dr(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,f=p=>{const v=hh(r.current).includes(p.animationName);if(p.target===t&&v&&(l("ANIMATION_END"),!i.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},h=p=>{p.target===t&&(s.current=hh(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(u),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(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function hh(e){return(e==null?void 0:e.animationName)||"none"}function KY(e){var r,i;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=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var cy=0;function x_(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??zC()),document.body.insertAdjacentElement("beforeend",e[1]??zC()),cy++,()=>{cy===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),cy--}},[])}function zC(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.
vendor: 4,856 bytes, lines 461-476
461style.position="fixed",e.style.pointerEvents="none",e}var Zh="right-scroll-bar-position",Jh="width-before-scroll-bar",YY="with-scroll-bars-hidden",QY="--removed-body-scroll-bar-size";function uy(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function XY(e,t){var n=m.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var ZY=typeof window<"u"?m.useLayoutEffect:m.useEffect,BC=new WeakMap;function JY(e,t){var n=XY(null,function(r){return e.forEach(function(i){return uy(i,r)})});return ZY(function(){var r=BC.get(n);if(r){var i=new Set(r),s=new Set(e),o=n.current;i.forEach(function(a){s.has(a)||uy(a,null)}),s.forEach(function(a){i.has(a)||uy(a,o)})}BC.set(n,e)},[e]),n}function eQ(e){return e}function tQ(e,t){t===void 0&&(t=eQ);var n=[],r=!1,i={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(s){var o=t(s,r);return n.push(o),function(){n=n.filter(function(a){return a!==o})}},assignSyncMedium:function(s){for(r=!0;n.length;){var o=n;n=[],o.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var o=[];if(n.length){var a=n;n=[],a.forEach(s),o=n}var l=function(){var d=o;o=[],d.forEach(s)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(d){o.push(d),u()},filter:function(d){return o=o.filter(d),n}}}};return i}function nQ(e){e===void 0&&(e={});var t=tQ(null);return t.options=Y({async:!0,ssr:!1},e),t}var zA=function(e){var t=e.sideCar,n=yd(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,Y({},n))};zA.isSideCarExport=!0;function rQ(e,t){return e.useMedium(t),zA}var BA=nQ(),dy=function(){},gg=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:dy,onWheelCapture:dy,onTouchMoveCapture:dy}),i=r[0],s=r[1],o=e.forwardProps,a=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,h=e.sideCar,p=e.noIsolation,g=e.inert,v=e.allowPinchZoom,w=e.as,y=w===void 0?"div":w,x=e.gapMode,b=yd(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=h,S=JY([n,t]),E=Y(Y({},b),i);return m.createElement(m.Fragment,null,d&&m.createElement(_,{sideCar:BA,removeScrollBar:u,shards:f,noIsolation:p,inert:g,setCallbacks:s,allowPinchZoom:!!v,lockRef:n,gapMode:x}),o?m.cloneElement(m.Children.only(a),Y(Y({},E),{ref:S})):m.createElement(y,Y({},E,{className:l,ref:S}),a))});gg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};gg.classNames={fullWidth:Jh,zeroRight:Zh};var iQ=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function sQ(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=iQ();return t&&e.setAttribute("nonce",t),e}function oQ(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function aQ(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var lQ=function(){var e=0,t=null;return{add:function(n){e==0&&(t=sQ())&&(oQ(t,n),aQ(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},cQ=function(){var e=lQ();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},WA=function(){var e=cQ(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},uQ={left:0,top:0,right:0,gap:0},fy=function(e){return parseInt(e||"",10)||0},dQ=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[fy(n),fy(r),fy(i)]},fQ=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return uQ;var t=dQ(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])}},hQ=WA(),$l="data-scroll-locked",pQ=function(e,t,n,r){var i=e.left,s=e.top,o=e.right,a=e.gap;return n===void 0&&(n="margin"),`
462  .`.concat(YY,` {
463   overflow: hidden `).concat(r,`;
464   padding-right: `).concat(a,"px ").concat(r,`;
465  }
466  body[`).concat($l,`] {
467    overflow: hidden `).concat(r,`;
468    overscroll-behavior: contain;
469    `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
470    padding-left: `.concat(i,`px;
471    padding-top: `).concat(s,`px;
472    padding-right: `).concat(o,`px;
473    margin-left:0;
474    margin-top:0;
475    margin-right: `).concat(a,"px ").concat(r,`;
476    `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";
476")].filter(Boolean).join(""),`
477  }
478  
479  .`).concat(Zh,` {
480    right: `).concat(a,"px ").concat(r,`;
481  }
482  
483  .`).concat(Jh,` {
484    margin-right: `).concat(a,"px ").concat(r,`;
485  }
486  
487  .`).concat(Zh," .").concat(Zh,` {
488    right: 0 `).concat(r,`;
489  }
490  
491  .`).concat(Jh," .").concat(Jh,` {
492    margin-right: 0 `).concat(r,`;
493  }
494  
495  body[`).concat($l,`] {
496    `).concat(QY,": ").concat(a,`px;
497  }
498`)},WC=function(){var e=parseInt(document.body.getAttribute($l)||"0",10);return isFinite(e)?e:0},mQ=function(){m.useEffect(function(){return document.body.setAttribute($l,(WC()+1).toString()),function(){var e=WC()-1;e<=0?document.body.removeAttribute($l):document.body.setAttribute($l,e.toString())}},[])},gQ=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;mQ();var s=m.useMemo(function(){return fQ(i)},[i]);return m.createElement(hQ,{styles:pQ(s,!t,i,n?"":"!important")})},Dx=!1;if(typeof window<"u")try{var ph=Object.defineProperty({},"passive",{get:function(){return Dx=!0,!0}});window.addEventListener("test",ph,ph),window.removeEventListener("test",ph,ph)}catch{Dx=!1}var el=Dx?{passive:!1}:!1,vQ=function(e){return e.tagName==="TEXTAREA"},qA=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!vQ(e)&&n[t]==="visible")},yQ=function(e){return qA(e,"overflowY")},xQ=function(e){return qA(e,"overflowX")},qC=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=HA(e,r);if(i){var s=GA(e,r),o=s[1],a=s[2];if(o>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},wQ=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},bQ=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},HA=function(e,t){return e==="v"?yQ(t):xQ(t)},GA=function(e,t){return e==="v"?wQ(t):bQ(t)},_Q=function(e,t){return e==="h"&&t==="rtl"?-1:1},SQ=function(e,t,n,r,i){var s=_Q(e,window.getComputedStyle(t).direction),o=s*r,a=n.target,l=t.contains(a),u=!1,d=o>0,f=0,h=0;do{var p=GA(e,a),g=p[0],v=p[1],w=p[2],y=v-w-s*g;(g||y)&&HA(e,a)&&(f+=y,h+=g),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(d&&(Math.abs(f)<1||!i)||!d&&(Math.abs(h)<1||!i))&&(u=!0),u},mh=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},HC=function(e){return[e.deltaX,e.deltaY]},GC=function(e){return e&&"current"in e?e.current:e},EQ=function(e,t){return e[0]===t[0]&&e[1]===t[1]},kQ=function(e){return`
499  .block-interactivity-`.concat(e,` {pointer-events: none;}
500  .allow-interactivity-`).concat(e,` {pointer-events: all;}
501`)},CQ=0,tl=[];function TQ(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),i=m.useState(CQ++)[0],s=m.useState(WA)[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(i));var v=Ke([e.lockRef.current],(e.shards||[]).map(GC),!0).filter(Boolean);return v.forEach(function(w){return w.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),v.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=m.useCallback(function(v,w){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!o.current.allowPinchZoom;var y=mh(v),x=n.current,b="deltaX"in v?v.deltaX:x[0]-y[0],_="deltaY"in v?v.deltaY:x[1]-y[1],S,E=v.target,k=Math.abs(b)>Math.abs(_)?"h":"v";if("touches"in v&&k==="h"&&E.type==="range")return!1;var C=qC(k,E);if(!C)return!0;if(C?S=k:(S=k==="v"?"h":"v",C=qC(k,E)),!C)return!1;if(!r.current&&"changedTouches"in v&&(b||_)&&(r.current=S),!S)return!0;var P=r.current||S;return SQ(P,w,v,P==="h"?b:_,!0)},[]),l=m.useCallback(function(v){var w=v;if(!(!tl.length||tl[tl.length-1]!==s)){var y="deltaY"in w?HC(w):mh(w),x=t.current.filter(function(S){return S.name===w.type&&(S.target===w.target||w.target===S.shadowParent)&&EQ(S.delta,y)})[0];if(x&&x.should){w.cancelable&&w.preventDefault();return}
vendor: 9,246 bytes, lines 501-505
501if(!x){var b=(o.current.shards||[]).map(GC).filter(Boolean).filter(function(S){return S.contains(w.target)}),_=b.length>0?a(w,b[0]):!o.current.noIsolation;_&&w.cancelable&&w.preventDefault()}}},[]),u=m.useCallback(function(v,w,y,x){var b={name:v,delta:w,target:y,should:x,shadowParent:jQ(y)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(_){return _!==b})},1)},[]),d=m.useCallback(function(v){n.current=mh(v),r.current=void 0},[]),f=m.useCallback(function(v){u(v.type,HC(v),v.target,a(v,e.lockRef.current))},[]),h=m.useCallback(function(v){u(v.type,mh(v),v.target,a(v,e.lockRef.current))},[]);m.useEffect(function(){return tl.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",l,el),document.addEventListener("touchmove",l,el),document.addEventListener("touchstart",d,el),function(){tl=tl.filter(function(v){return v!==s}),document.removeEventListener("wheel",l,el),document.removeEventListener("touchmove",l,el),document.removeEventListener("touchstart",d,el)}},[]);var p=e.removeScrollBar,g=e.inert;return m.createElement(m.Fragment,null,g?m.createElement(s,{styles:kQ(i)}):null,p?m.createElement(gQ,{gapMode:e.gapMode}):null)}function jQ(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const PQ=rQ(BA,TQ);var vg=m.forwardRef(function(e,t){return m.createElement(gg,Y({},e,{ref:t,sideCar:PQ}))});vg.classNames=gg.classNames;var NQ=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},nl=new WeakMap,gh=new WeakMap,vh={},hy=0,KA=function(e){return e&&(e.host||KA(e.parentNode))},RQ=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=KA(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})},IQ=function(e,t,n,r){var i=RQ(t,Array.isArray(e)?e:[e]);vh[n]||(vh[n]=new WeakMap);var s=vh[n],o=[],a=new Set,l=new Set(i),u=function(f){!f||a.has(f)||(a.add(f),u(f.parentNode))};i.forEach(u);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),g=p!==null&&p!=="false",v=(nl.get(h)||0)+1,w=(s.get(h)||0)+1;nl.set(h,v),s.set(h,w),o.push(h),v===1&&g&&gh.set(h,!0),w===1&&h.setAttribute(n,"true"),g||h.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",h,y)}})};return d(t),a.clear(),hy++,function(){o.forEach(function(f){var h=nl.get(f)-1,p=s.get(f)-1;nl.set(f,h),s.set(f,p),h||(gh.has(f)||f.removeAttribute(r),gh.delete(f)),p||f.removeAttribute(n)}),hy--,hy||(nl=new WeakMap,nl=new WeakMap,gh=new WeakMap,vh={})}},w_=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=NQ(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),IQ(r,i,n,"aria-hidden")):function(){return null}},b_="Dialog",[YA,QA]=Mn(b_),[AQ,ui]=YA(b_),XA=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:o=!0}=e,a=m.useRef(null),l=m.useRef(null),[u=!1,d]=Jn({prop:r,defaultProp:i,onChange:s});return c.jsx(AQ,{scope:t,triggerRef:a,contentRef:l,contentId:Ni(),titleId:Ni(),descriptionId:Ni(),open:u,onOpenChange:d,onOpenToggle:m.useCallback(()=>d(f=>!f),[d]),modal:o,children:n})};XA.displayName=b_;var ZA="DialogTrigger",JA=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ui(ZA,n),s=Le(t,i.triggerRef);return c.jsx(me.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":E_(i.open),...r,ref:s,onClick:se(e.onClick,i.onOpenToggle)})});JA.displayName=ZA;var __="DialogPortal",[OQ,eO]=YA(__,{forceMount:void 0}),tO=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,s=ui(__,t);return c.jsx(OQ,{scope:t,forceMount:n,children:m.Children.map(r,o=>c.jsx(Lt,{present:n||s.open,children:c.jsx(gf,{asChild:!0,container:i,children:o})}))})};tO.displayName=__;var Zp="DialogOverlay",nO=m.forwardRef((e,t)=>{const n=eO(Zp,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=ui(Zp,e.__scopeDialog);return s.modal?c.jsx(Lt,{present:r||s.open,children:c.jsx(DQ,{...i,ref:t})}):null});nO.displayName=Zp;var DQ=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ui(Zp,n);return c.jsx(vg,{as:ps,allowPinchZoom:!0,shards:[i.contentRef],children:c.jsx(me.div,{"data-state":E_(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Ia="DialogContent",rO=m.forwardRef((e,t)=>{const n=eO(Ia,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=ui(Ia,e.__scopeDialog);return c.jsx(Lt,{present:r||s.open,children:s.modal?c.jsx(MQ,{...i,ref:t}):c.jsx(LQ,{...i,ref:t})})});rO.displayName=Ia;var MQ=m.forwardRef((e,t)=>{const n=ui(Ia,e.__scopeDialog),r=m.useRef(null),i=Le(t,n.contentRef,r);return m.useEffect(()=>{const s=r.current;if(s)return w_(s)},[]),c.jsx(iO,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:se(e.onCloseAutoFocus,s=>{var o;s.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:se(e.onPointerDownOutside,s=>{const o=s.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&s.preventDefault()}),onFocusOutside:se(e.onFocusOutside,s=>s.preventDefault())})}),LQ=m.forwardRef((e,t)=>{const n=ui(Ia,e.__scopeDialog),r=m.useRef(!1),i=m.useRef(!1);return c.jsx(iO,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o,a;(o=e.onCloseAutoFocus)==null||o.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),iO=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...o}=e,a=ui(Ia,n),l=m.useRef(null),u=Le(t,l);return x_(),c.jsxs(c.Fragment,{children:[c.jsx(mg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:c.jsx(Ac,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":E_(a.open),...o,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx($Q,{titleId:a.titleId}),c.jsx(VQ,{contentRef:l,descriptionId:a.descriptionId})]})]})}),S_="DialogTitle",sO=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ui(S_,n);return c.jsx(me.h2,{id:i.titleId,...r,ref:t})});sO.displayName=S_;var oO="DialogDescription",aO=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ui(oO,n);return c.jsx(me.p,{id:i.descriptionId,...r,ref:t})});aO.displayName=oO;var lO="DialogClose",cO=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ui(lO,n);return c.jsx(me.button,{type:"button",...r,ref:t,onClick:se(e.onClick,()=>i.onOpenChange(!1))})});cO.displayName=lO;function E_(e){return e?"open":"closed"}var uO="DialogTitleWarning",[FQ,dO]=SY(uO,{contentName:Ia,titleName:S_,docsSlug:"dialog"}),$Q=({titleId:e})=>{const t=dO(uO),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
502
503If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
504
505For 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},UQ="DialogDescriptionWarning",VQ=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${dO(UQ).contentName}}.`;return m.useEffect(()=>{var s;const i=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},yg=XA,k_=JA,xg=tO,Oc=nO,Dc=rO,Mc=sO,Lc=aO,vf=cO;const zQ=yg,BQ=k_,WQ=xg,fO=m.forwardRef(({className:e,...t},n)=>c.jsx(Oc,{className:K("fixed inset-0 z-[100] bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));fO.displayName=Oc.displayName;const qQ=Va("fixed z-[101] gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4  border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),hO=m.forwardRef(({side:e="right",className:t,children:n,...r},i)=>c.jsxs(WQ,{children:[c.jsx(fO,{}),c.jsxs(Dc,{ref:i,className:K(qQ({side:e}),t),...r,children:[n,c.jsxs(vf,{className:"absolute right-4 top-4 roun
505ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[c.jsx(Di,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));hO.displayName=Dc.displayName;const HQ=m.forwardRef(({className:e,...t},n)=>c.jsx(Mc,{ref:n,className:K("text-lg font-semibold text-foreground",e),...t}));HQ.displayName=Mc.displayName;const GQ=m.forwardRef(({className:e,...t},n)=>c.jsx(Lc,{ref:n,className:K("text-sm text-muted-foreground",e),...t}));GQ.displayName=Lc.displayName;function KQ(e,t=[]){let n=[];function r(s,o){const a=m.createContext(o),l=n.length;n=[...n,o];function u(f){const{scope:h,children:p,...g}=f,v=(h==null?void 0:h[e][l])||a,w=m.useMemo(()=>g,Object.values(g));return c.jsx(v.Provider,{value:w,children:p})}function d(f,h){const p=(h==null?void 0:h[e][l])||a,g=m.useContext(p);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return u.displayName=s+"Provider",[u,d]}const i=()=>{const s=n.map(o=>m.createContext(o));return function(a){const l=(a==null?void 0:a[e])||s;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,YQ(i,...t)]}function YQ(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((a,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...a,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function wg(e){const t=e+"CollectionProvider",[n,r]=KQ(t),[i,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=p=>{const{scope:g,children:v}=p,w=F.useRef(null),y=F.useRef(new Map).current;return c.jsx(i,{scope:g,itemMap:y,collectionRef:w,children:v})};o.displayName=t;const a=e+"CollectionSlot",l=F.forwardRef((p,g)=>{const{scope:v,children:w}=p,y=s(a,v),x=Le(g,y.collectionRef);return c.jsx(ps,{ref:x,children:w})});l.displayName=a;const u=e+"CollectionItemSlot",d="data-radix-collection-item",f=F.forwardRef((p,g)=>{const{scope:v,children:w,...y}=p,x=F.useRef(null),b=Le(g,x),_=s(u,v);return F.useEffect(()=>(_.itemMap.set(x,{ref:x,...y}),()=>void _.itemMap.delete(x))),c.jsx(ps,{[d]:"",ref:b,children:w})});f.displayName=u;function h(p){const g=s(e+"CollectionConsumer",p);return F.useCallback(()=>{const w=g.collectionRef.current;if(!w)return[];const y=Array.from(w.querySelectorAll(`[${d}]`));return Array.from(g.itemMap.values()).sort((_,S)=>y.indexOf(_.ref.current)-y.indexOf(S.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:o,Slot:l,ItemSlot:f},h,r]}var QQ=m.createContext(void 0);function za(e){const t=m.useContext(QQ);return e||t||"ltr"}const XQ=["top","right","bottom","left"],_o=Math.min,sr=Math.max,Jp=Math.round,yh=Math.floor,So=e=>({x:e,y:e}),ZQ={left:"right",right:"left",bottom:"top",top:"bottom"},JQ={start:"end",end:"start"};function Mx(e,t,n){return sr(e,_o(t,n))}function ms(e,t){return typeof e=="function"?e(t):e}function gs(e){return e.split("-")[0]}function Fc(e){return e.split("-")[1]}function C_(e){return e==="x"?"y":"x"}function T_(e){return e==="y"?"height":"width"}function Eo(e){return["top","bottom"].includes(gs(e))?"y":"x"}function j_(e){return C_(Eo(e))}function eX(e,t,n){n===void 0&&(n=!1);const r=Fc(e),i=j_(e),s=T_(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=em(o)),[o,em(o)]}function tX(e){const t=em(e);return[Lx(e),t,Lx(t)]}function Lx(e){return e.replace(/start|end/g,t=>JQ[t])}function nX(e,t,n){const r=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?s:o;default:return[]}}function rX(e,t,n,r){const i=Fc(e);let s=nX(gs(e),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),t&&(s=s.concat(s.map(Lx)))),s}function em(e){return e.replace(/left|right|bottom|top/g,t=>ZQ[t])}function iX(e){return{top:0,right:0,bottom:0,left:0,...e}}function pO(e){return typeof e!="number"?iX(e):{top:e,right:e,bottom:e,left:e}}function tm(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function KC(e,t,n){let{reference:r,floating:i}=e;const s=Eo(t),o=j_(t),a=T_(o),l=gs(t),u=s==="y",d=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,h=r[a]/2-i[a]/2;let p;switch(l){case"top":p={x:d,y:r.y-i.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-i.width,y:f};break;default:p={x:r.x,y:r.y}}switch(Fc(t)){case"start":p[o]-=h*(n&&u?-1:1);break;case"end":p[o]+=h*(n&&u?-1:1);break}return p}const sX=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}
vendor: 9,691 bytes, line 505
505=n,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:f}=KC(u,r,l),h=r,p={},g=0;for(let v=0;v<a.length;v++){const{name:w,fn:y}=a[v],{x,y:b,data:_,reset:S}=await y({x:d,y:f,initialPlacement:r,placement:h,strategy:i,middlewareData:p,rects:u,platform:o,elements:{reference:e,floating:t}});d=x??d,f=b??f,p={...p,[w]:{...p[w],..._}},S&&g<=50&&(g++,typeof S=="object"&&(S.placement&&(h=S.placement),S.rects&&(u=S.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):S.rects),{x:d,y:f}=KC(u,h,l)),v=-1)}return{x:d,y:f,placement:h,strategy:i,middlewareData:p}};async function Cd(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=ms(t,e),g=pO(p),w=a[h?f==="floating"?"reference":"floating":f],y=tm(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:d,strategy:l})),x=f==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),_=await(s.isElement==null?void 0:s.isElement(b))?await(s.getScale==null?void 0:s.getScale(b))||{x:1,y:1}:{x:1,y:1},S=tm(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:b,strategy:l}):x);return{top:(y.top-S.top+g.top)/_.y,bottom:(S.bottom-y.bottom+g.bottom)/_.y,left:(y.left-S.left+g.left)/_.x,right:(S.right-y.right+g.right)/_.x}}const oX=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=t,{element:u,padding:d=0}=ms(e,t)||{};if(u==null)return{};const f=pO(d),h={x:n,y:r},p=j_(i),g=T_(p),v=await o.getDimensions(u),w=p==="y",y=w?"top":"left",x=w?"bottom":"right",b=w?"clientHeight":"clientWidth",_=s.reference[g]+s.reference[p]-h[p]-s.floating[g],S=h[p]-s.reference[p],E=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let k=E?E[b]:0;(!k||!await(o.isElement==null?void 0:o.isElement(E)))&&(k=a.floating[b]||s.floating[g]);const C=_/2-S/2,P=k/2-v[g]/2-1,T=_o(f[y],P),N=_o(f[x],P),I=T,O=k-v[g]-N,j=k/2-v[g]/2+C,A=Mx(I,j,O),V=!l.arrow&&Fc(i)!=null&&j!==A&&s.reference[g]/2-(j<I?T:N)-v[g]/2<0,$=V?j<I?j-I:j-O:0;return{[p]:h[p]+$,data:{[p]:A,centerOffset:j-A-$,...V&&{alignmentOffset:$}},reset:V}}}),aX=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:l,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:v=!0,...w}=ms(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=gs(i),x=Eo(a),b=gs(a)===a,_=await(l.isRTL==null?void 0:l.isRTL(u.floating)),S=h||(b||!v?[em(a)]:tX(a)),E=g!=="none";!h&&E&&S.push(...rX(a,v,g,_));const k=[a,...S],C=await Cd(t,w),P=[];let T=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&P.push(C[y]),f){const j=eX(i,o,_);P.push(C[j[0]],C[j[1]])}if(T=[...T,{placement:i,overflows:P}],!P.every(j=>j<=0)){var N,I;const j=(((N=s.flip)==null?void 0:N.index)||0)+1,A=k[j];if(A)return{data:{index:j,overflows:T},reset:{placement:A}};let V=(I=T.filter($=>$.overflows[0]<=0).sort(($,R)=>$.overflows[1]-R.overflows[1])[0])==null?void 0:I.placement;if(!V)switch(p){case"bestFit":{var O;const $=(O=T.filter(R=>{if(E){const L=Eo(R.placement);return L===x||L==="y"}return!0}).map(R=>[R.placement,R.overflows.filter(L=>L>0).reduce((L,H)=>L+H,0)]).sort((R,L)=>R[1]-L[1])[0])==null?void 0:O[0];$&&(V=$);break}case"initialPlacement":V=a;break}if(i!==V)return{reset:{placement:V}}}return{}}}};function YC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function QC(e){return XQ.some(t=>e[t]>=0)}const lX=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=ms(e,t);switch(r){case"referenceHidden":{const s=await Cd(t,{...i,elementContext:"reference"}),o=YC(s,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:QC(o)}}}case"escaped":{const s=await Cd(t,{...i,altBoundary:!0}),o=YC(s,n.floating);return{data:{escapedOffsets:o,escaped:QC(o)}}}default:return{}}}}};async function cX(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=gs(n),a=Fc(n),l=Eo(n)==="y",u=["left","top"].includes(o)?-1:1,d=s&&l?-1:1,f=ms(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof g=="number"&&(p=a==="end"?g*-1:g),l?{x:p*d,y:h*u}:{x:h*u,y:p*d}}const uX=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:s,placement:o,middlewareData:a}=t,l=await cX(t,e);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},dX=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:w=>{let{x:y,y:x}=w;return{x:y,y:x}}},...l}=ms(e,t),u={x:n,y:r},d=await Cd(t,l),f=Eo(gs(i)),h=C_(f);let p=u[h],g=u[f];if(s){const w=h==="y"?"top":"left",y=h==="y"?"bottom":"right",x=p+d[w],b=p-d[y];p=Mx(x,p,b)}if(o){const w=f==="y"?"top":"left",y=f==="y"?"bottom":"right",x=g+d[w],b=g-d[y];g=Mx(x,g,b)}const v=a.fn({...t,[h]:p,[f]:g});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[h]:s,[f]:o}}}}}},fX=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:s,middlewareData:o}=t,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=ms(e,t),d={x:n,y:r},f=Eo(i),h=C_(f);let p=d[h],g=d[f];const v=ms(a,t),w=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(l){const b=h==="y"?"height":"width",_=s.reference[h]-s.floating[b]+w.mainAxis,S=s.reference[h]+s.reference[b]-w.mainAxis;p<_?p=_:p>S&&(p=S)}if(u){var y,x;const b=h==="y"?"width":"height",_=["top","left"].includes(gs(i)),S=s.reference[f]-s.floating[b]+(_&&((y=o.offset)==null?void 0:y[f])||0)+(_?0:w.crossAxis),E=s.reference[f]+s.reference[b]+(_?0:((x=o.offset)==null?void 0:x[f])||0)-(_?w.crossAxis:0);g<S?g=S:g>E&&(g=E)}return{[h]:p,[f]:g}}}},hX=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:s,platform:o,elements:a}=t,{apply:l=()=>{},...u}=ms(e,t),d=await Cd(t,u),f=gs(i),h=Fc(i),p=Eo(i)==="y",{width:g,height:v}=s.floating;let w,y;f==="top"||f==="bottom"?(w=f,y=h===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(y=f,w=h==="end"?"top":"bottom");const x=v-d.top-d.bottom,b=g-d.left-d.right,_=_o(v-d[w],x),S=_o(g-d[y],b),E=!t.middlewareData.shift;let k=_,C=S;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(C=b),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=x),E&&!h){const T=sr(d.left,0),N=sr(d.right,0),I=sr(d.top,0),O=sr(d.bottom,0);p?C=g-2*(T!==0||N!==0?T+N:sr(d.left,d.right)):k=v-2*(I!==0||O!==0?I+O:sr(d.top,d.bottom))}await l({...t,availableWidth:C,availableHeight:k});const P=await o.getDimensions(a.floating);return g!==P.width||v!==P.height?{reset:{rects:!0}}:{}}}};function bg(){return typeof window<"u"}function $c(e){return mO(e)?(e.nodeName||"").toLowerCase():"#document"}function ur(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Bi(e){var t;return(t=(mO(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function mO(e){return bg()?e instanceof Node||e instanceof ur(e).Node:!1}function oi(e){return bg()?e instanceof Element||e instanceof ur(e).Element:!1}function Mi(e){return bg()?e instanceof HTMLElement||e instanceof ur(e).HTMLElement:!1}function XC(e){return!bg()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ur(e).ShadowRoot}function yf(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=ai(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function pX(e){return["table","td","th"].includes($c(e))}function _g(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function P_(e){const t=N_(),n=oi(e)?ai(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function mX(e){let t=ko(e);for(;Mi(t)&&!dc(t);){if(P_(t))return t;if(_g(t))return null;t=ko(t)}return null}function N_(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function dc(e){return["html","body","#document"].includes($c(e))}function ai(e){return ur(e).getComputedStyle(e)}function Sg(e){return oi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ko(e){if($c(e)==="html")return e;const t=e.assignedSlot||e.parentNode||XC(e)&&e.host||Bi(e);return XC(t)?t.host:t}function gO(e){const t=ko(e);return dc(t)?e.ownerDocument?e.ownerDocument.body:e.body:Mi(t)&&yf(t)?t:gO(t)}function Td(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=gO(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),o=ur(i);if(s){const a=Fx(o);
vendor: 7,125 bytes, line 505
505return t.concat(o,o.visualViewport||[],yf(i)?i:[],a&&n?Td(a):[])}return t.concat(i,Td(i,[],n))}function Fx(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function vO(e){const t=ai(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Mi(e),s=i?e.offsetWidth:n,o=i?e.offsetHeight:r,a=Jp(n)!==s||Jp(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function R_(e){return oi(e)?e:e.contextElement}function Ul(e){const t=R_(e);if(!Mi(t))return So(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=vO(t);let o=(s?Jp(n.width):n.width)/r,a=(s?Jp(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const gX=So(0);function yO(e){const t=ur(e);return!N_()||!t.visualViewport?gX:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function vX(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ur(e)?!1:t}function Aa(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=R_(e);let o=So(1);t&&(r?oi(r)&&(o=Ul(r)):o=Ul(e));const a=vX(s,n,r)?yO(s):So(0);let l=(i.left+a.x)/o.x,u=(i.top+a.y)/o.y,d=i.width/o.x,f=i.height/o.y;if(s){const h=ur(s),p=r&&oi(r)?ur(r):r;let g=h,v=Fx(g);for(;v&&r&&p!==g;){const w=Ul(v),y=v.getBoundingClientRect(),x=ai(v),b=y.left+(v.clientLeft+parseFloat(x.paddingLeft))*w.x,_=y.top+(v.clientTop+parseFloat(x.paddingTop))*w.y;l*=w.x,u*=w.y,d*=w.x,f*=w.y,l+=b,u+=_,g=ur(v),v=Fx(g)}}return tm({width:d,height:f,x:l,y:u})}function yX(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",o=Bi(r),a=t?_g(t.floating):!1;if(r===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=So(1);const d=So(0),f=Mi(r);if((f||!f&&!s)&&(($c(r)!=="body"||yf(o))&&(l=Sg(r)),Mi(r))){const h=Aa(r);u=Ul(r),d.x=h.x+r.clientLeft,d.y=h.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x,y:n.y*u.y-l.scrollTop*u.y+d.y}}function xX(e){return Array.from(e.getClientRects())}function $x(e,t){const n=Sg(e).scrollLeft;return t?t.left+n:Aa(Bi(e)).left+n}function wX(e){const t=Bi(e),n=Sg(e),r=e.ownerDocument.body,i=sr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=sr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+$x(e);const a=-n.scrollTop;return ai(r).direction==="rtl"&&(o+=sr(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}function bX(e,t){const n=ur(e),r=Bi(e),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const u=N_();(!u||u&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a,y:l}}function _X(e,t){const n=Aa(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=Mi(e)?Ul(e):So(1),o=e.clientWidth*s.x,a=e.clientHeight*s.y,l=i*s.x,u=r*s.y;return{width:o,height:a,x:l,y:u}}function ZC(e,t,n){let r;if(t==="viewport")r=bX(e,n);else if(t==="document")r=wX(Bi(e));else if(oi(t))r=_X(t,n);else{const i=yO(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return tm(r)}function xO(e,t){const n=ko(e);return n===t||!oi(n)||dc(n)?!1:ai(n).position==="fixed"||xO(n,t)}function SX(e,t){const n=t.get(e);if(n)return n;let r=Td(e,[],!1).filter(a=>oi(a)&&$c(a)!=="body"),i=null;const s=ai(e).position==="fixed";let o=s?ko(e):e;for(;oi(o)&&!dc(o);){const a=ai(o),l=P_(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||yf(o)&&!l&&xO(e,o))?r=r.filter(d=>d!==o):i=a,o=ko(o)}return t.set(e,r),r}function EX(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?_g(t)?[]:SX(t,this._c):[].concat(n),r],a=o[0],l=o.reduce((u,d)=>{const f=ZC(t,d,i);return u.top=sr(f.top,u.top),u.right=_o(f.right,u.right),u.bottom=_o(f.bottom,u.bottom),u.left=sr(f.left,u.left),u},ZC(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function kX(e){const{width:t,height:n}=vO(e);return{width:t,height:n}}function CX(e,t,n){const r=Mi(t),i=Bi(t),s=n==="fixed",o=Aa(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=So(0);if(r||!r&&!s)if(($c(t)!=="body"||yf(i))&&(a=Sg(t)),r){const p=Aa(t,!0,s,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else i&&(l.x=$x(i));let u=0,d=0;if(i&&!r&&!s){const p=i.getBoundingClientRect();d=p.top+a.scrollTop,u=p.left+a.scrollLeft-$x(i,p)}const f=o.left+a.scrollLeft-l.x-u,h=o.top+a.scrollTop-l.y-d;return{x:f,y:h,width:o.width,height:o.height}}function py(e){return ai(e).position==="static"}function JC(e,t){if(!Mi(e)||ai(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Bi(e)===n&&(n=n.ownerDocument.body),n}function wO(e,t){const n=ur(e);if(_g(e))return n;if(!Mi(e)){let i=ko(e);for(;i&&!dc(i);){if(oi(i)&&!py(i))return i;i=ko(i)}return n}let r=JC(e,t);for(;r&&pX(r)&&py(r);)r=JC(r,t);return r&&dc(r)&&py(r)&&!P_(r)?n:r||mX(e)||n}const TX=async function(e){const t=this.getOffsetParent||wO,n=this.getDimensions,r=await n(e.floating);return{reference:CX(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function jX(e){return ai(e).direction==="rtl"}const PX={convertOffsetParentRelativeRectToViewportRelativeRect:yX,getDocumentElement:Bi,getClippingRect:EX,getOffsetParent:wO,getElementRects:TX,getClientRects:xX,getDimensions:kX,getScale:Ul,isElement:oi,isRTL:jX};function NX(e,t){let n=null,r;const i=Bi(e);function s(){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),s();const{left:u,top:d,width:f,height:h}=e.getBoundingClientRect();if(a||t(),!f||!h)return;const p=yh(d),g=yh(i.clientWidth-(u+f)),v=yh(i.clientHeight-(d+h)),w=yh(u),x={rootMargin:-p+"px "+-g+"px "+-v+"px "+-w+"px",threshold:sr(0,_o(1,l))||1};let b=!0;function _(S){const E=S[0].intersectionRatio;if(E!==l){if(!b)return o();E?o(!1,E):r=setTimeout(()=>{o(!1,1e-7)},1e3)}b=!1}try{n=new IntersectionObserver(_,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(_,x)}n.observe(e)}return o(!0),s}function RX(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=R_(e),d=i||s?[...u?Td(u):[],...Td(t)]:[];d.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const f=u&&a?NX(u,n):null;let h=-1,p=null;o&&(p=new ResizeObserver(y=>{let[x]=y;x&&x.target===u&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var b;(b=p)==null||b.observe(t)})),n()}),u&&!l&&p.observe(u),p.observe(t));let g,v=l?Aa(e):null;l&&w();function w(){const y=Aa(e);v&&(y.x!==v.x||y.y!==v.y||y.width!==v.width||y.height!==v.height)&&n(),v=y,g=requestAnimationFrame(w)}return n(),()=>{var y;d.forEach(x=>{i&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),f==null||f(),(y=p)==null||y.disconnect(),p=null,l&&cancelAnimationFrame(g)}}const IX=uX,AX=dX,OX=aX,DX=hX,MX=lX,eT=oX,LX=fX,FX=(e,t,n)=>{const r=new Map,i={platform:PX,...n},s={...i.platform,_c:r};return sX(e,t,{...i,platform:s})};var ep=typeof document<"u"?m.useLayoutEffect:m.useEffect;function nm(e,t){if(e===t)return!0;
vendor: 27,992 bytes, line 505
505if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;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(!nm(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&e.$$typeof)&&!nm(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function bO(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function tT(e,t){const n=bO(e);return Math.round(t*n)/n}function my(e){const t=m.useRef(e);return ep(()=>{t.current=e}),t}function $X(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[d,f]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=m.useState(r);nm(h,r)||p(r);const[g,v]=m.useState(null),[w,y]=m.useState(null),x=m.useCallback(R=>{R!==E.current&&(E.current=R,v(R))},[]),b=m.useCallback(R=>{R!==k.current&&(k.current=R,y(R))},[]),_=s||g,S=o||w,E=m.useRef(null),k=m.useRef(null),C=m.useRef(d),P=l!=null,T=my(l),N=my(i),I=my(u),O=m.useCallback(()=>{if(!E.current||!k.current)return;const R={placement:t,strategy:n,middleware:h};N.current&&(R.platform=N.current),FX(E.current,k.current,R).then(L=>{const H={...L,isPositioned:I.current!==!1};j.current&&!nm(C.current,H)&&(C.current=H,kc.flushSync(()=>{f(H)}))})},[h,t,n,N,I]);ep(()=>{u===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,f(R=>({...R,isPositioned:!1})))},[u]);const j=m.useRef(!1);ep(()=>(j.current=!0,()=>{j.current=!1}),[]),ep(()=>{if(_&&(E.current=_),S&&(k.current=S),_&&S){if(T.current)return T.current(_,S,O);O()}},[_,S,O,T,P]);const A=m.useMemo(()=>({reference:E,floating:k,setReference:x,setFloating:b}),[x,b]),V=m.useMemo(()=>({reference:_,floating:S}),[_,S]),$=m.useMemo(()=>{const R={position:n,left:0,top:0};if(!V.floating)return R;const L=tT(V.floating,d.x),H=tT(V.floating,d.y);return a?{...R,transform:"translate("+L+"px, "+H+"px)",...bO(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:H}},[n,a,V.floating,d.x,d.y]);return m.useMemo(()=>({...d,update:O,refs:A,elements:V,floatingStyles:$}),[d,O,A,V,$])}const UX=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?eT({element:r.current,padding:i}).fn(n):{}:r?eT({element:r,padding:i}).fn(n):{}}}},VX=(e,t)=>({...IX(e),options:[e,t]}),zX=(e,t)=>({...AX(e),options:[e,t]}),BX=(e,t)=>({...LX(e),options:[e,t]}),WX=(e,t)=>({...OX(e),options:[e,t]}),qX=(e,t)=>({...DX(e),options:[e,t]}),HX=(e,t)=>({...MX(e),options:[e,t]}),GX=(e,t)=>({...UX(e),options:[e,t]});var KX="Arrow",_O=m.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...s}=e;return c.jsx(me.svg,{...s,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});_O.displayName=KX;var YX=_O;function QX(e,t=[]){let n=[];function r(s,o){const a=m.createContext(o),l=n.length;n=[...n,o];function u(f){const{scope:h,children:p,...g}=f,v=(h==null?void 0:h[e][l])||a,w=m.useMemo(()=>g,Object.values(g));return c.jsx(v.Provider,{value:w,children:p})}function d(f,h){const p=(h==null?void 0:h[e][l])||a,g=m.useContext(p);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return u.displayName=s+"Provider",[u,d]}const i=()=>{const s=n.map(o=>m.createContext(o));return function(a){const l=(a==null?void 0:a[e])||s;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,XX(i,...t)]}function XX(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((a,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...a,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function Eg(e){const[t,n]=m.useState(void 0);return Dr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;o=u.inlineSize,a=u.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 I_="Popper",[SO,Uc]=QX(I_),[ZX,EO]=SO(I_),kO=e=>{const{__scopePopper:t,children:n}=e,[r,i]=m.useState(null);return c.jsx(ZX,{scope:t,anchor:r,onAnchorChange:i,children:n})};kO.displayName=I_;var CO="PopperAnchor",TO=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,s=EO(CO,n),o=m.useRef(null),a=Le(t,o);return m.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:c.jsx(me.div,{...i,ref:a})});TO.displayName=CO;var A_="PopperContent",[JX,eZ]=SO(A_),jO=m.forwardRef((e,t)=>{var Pe,Ue,Ae,Fe,wt,jt;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:g,...v}=e,w=EO(A_,n),[y,x]=m.useState(null),b=Le(t,xe=>x(xe)),[_,S]=m.useState(null),E=Eg(_),k=(E==null?void 0:E.width)??0,C=(E==null?void 0:E.height)??0,P=r+(s!=="center"?"-"+s:""),T=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},N=Array.isArray(u)?u:[u],I=N.length>0,O={padding:T,boundary:N.filter(nZ),altBoundary:I},{refs:j,floatingStyles:A,placement:V,isPositioned:$,middlewareData:R}=$X({strategy:"fixed",placement:P,whileElementsMounted:(...xe)=>RX(...xe,{animationFrame:p==="always"}),elements:{reference:w.anchor},middleware:[VX({mainAxis:i+C,alignmentAxis:o}),l&&zX({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?BX():void 0,...O}),l&&WX({...O}),qX({...O,apply:({elements:xe,rects:qt,availableWidth:Fr,availableHeight:ln})=>{const{width:er,height:D}=qt.reference,U=xe.floating.style;U.setProperty("--radix-popper-available-width",`${Fr}px`),U.setProperty("--radix-popper-available-height",`${ln}px`),U.setProperty("--radix-popper-anchor-width",`${er}px`),U.setProperty("--radix-popper-anchor-height",`${D}px`)}}),_&&GX({element:_,padding:a}),rZ({arrowWidth:k,arrowHeight:C}),h&&HX({strategy:"referenceHidden",...O})]}),[L,H]=RO(V),z=gt(g);Dr(()=>{$&&(z==null||z())},[$,z]);const Q=(Pe=R.arrow)==null?void 0:Pe.x,de=(Ue=R.arrow)==null?void 0:Ue.y,ne=((Ae=R.arrow)==null?void 0:Ae.centerOffset)!==0,[ye,he]=m.useState();return Dr(()=>{y&&he(window.getComputedStyle(y).zIndex)},[y]),c.jsx("div",{ref:j.setFloating,"data-radix-popper-content-wrapper":"",style:{...A,transform:$?A.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ye,"--radix-popper-transform-origin":[(Fe=R.transformOrigin)==null?void 0:Fe.x,(wt=R.transformOrigin)==null?void 0:wt.y].join(" "),...((jt=R.hide)==null?void 0:jt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(JX,{scope:n,placedSide:L,onArrowChange:S,arrowX:Q,arrowY:de,shouldHideArrow:ne,children:c.jsx(me.div,{"data-side":L,"data-align":H,...v,ref:b,style:{...v.style,animation:$?void 0:"none"}})})})});jO.displayName=A_;var PO="PopperArrow",tZ={top:"bottom",right:"left",bottom:"top",left:"right"},NO=m.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,s=eZ(PO,r),o=tZ[s.placedSide];return c.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:c.jsx(YX,{...i,ref:n,style:{...i.style,display:"block"}})})});NO.displayName=PO;function nZ(e){return e!==null}var rZ=e=>({name:"transformOrigin",options:e,fn(t){var w,y,x;const{placement:n,rects:r,middlewareData:i}=t,o=((w=i.arrow)==null?void 0:w.centerOffset)!==0,a=o?0:e.arrowWidth,l=o?0:e.arrowHeight,[u,d]=RO(n),f={start:"0%",center:"50%",end:"100%"}[d],h=(((y=i.arrow)==null?void 0:y.x)??0)+a/2,p=(((x=i.arrow)==null?void 0:x.y)??0)+l/2;let g="",v="";return u==="bottom"?(g=o?f:`${h}px`,v=`${-l}px`):u==="top"?(g=o?f:`${h}px`,v=`${r.floating.height+l}px`):u==="right"?(g=`${-l}px`,v=o?f:`${p}px`):u==="left"&&(g=`${r.floating.width+l}px`,v=o?f:`${p}px`),{data:{x:g,y:v}}}});function RO(e){const[t,n="center"]=e.split("-");return[t,n]}var O_=kO,kg=TO,D_=jO,M_=NO;function iZ(e,t=[]){let n=[];function r(s,o){const a=m.createContext(o),l=n.length;n=[...n,o];function u(f){const{scope:h,children:p,...g}=f,v=(h==null?void 0:h[e][l])||a,w=m.useMemo(()=>g,Object.values(g));return c.jsx(v.Provider,{value:w,children:p})}function d(f,h){const p=(h==null?void 0:h[e][l])||a,g=m.useContext(p);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return u.displayName=s+"Provider",[u,d]}const i=()=>{const s=n.map(o=>m.createContext(o));return function(a){const l=(a==null?void 0:a[e])||s;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,sZ(i,...t)]}function sZ(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((a,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...a,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var gy="rovingFocusGroup.onEntryFocus",oZ={bubbles:!1,cancelable:!0},Cg="RovingFocusGroup",[Ux,IO,aZ]=wg(Cg),[lZ,$o]=iZ(Cg,[aZ]),[cZ,uZ]=lZ(Cg),AO=m.forwardRef((e,t)=>c.jsx(Ux.Provider,{scope:e.__scopeRovingFocusGroup,children:c.jsx(Ux.Slot,{scope:e.__scopeRovingFocusGroup,children:c.jsx(dZ,{...e,ref:t})})}));AO.displayName=Cg;var dZ=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,h=m.useRef(null),p=Le(t,h),g=za(s),[v=null,w]=Jn({prop:o,defaultProp:a,onChange:l}),[y,x]=m.useState(!1),b=gt(u),_=IO(n),S=m.useRef(!1),[E,k]=m.useState(0);return m.useEffect(()=>{const C=h.current;if(C)return C.addEventListener(gy,b),()=>C.removeEventListener(gy,b)},[b]),c.jsx(cZ,{scope:n,orientation:r,dir:g,loop:i,currentTabStopId:v,onItemFocus:m.useCallback(C=>w(C),[w]),onItemShiftTab:m.useCallback(()=>x(!0),[]),onFocusableItemAdd:m.useCallback(()=>k(C=>C+1),[]),onFocusableItemRemove:m.useCallback(()=>k(C=>C-1),[]),children:c.jsx(me.div,{tabIndex:y||E===0?-1:0,"data-orientation":r,...f,ref:p,style:{outline:"none",...e.style},onMouseDown:se(e.onMouseDown,()=>{S.current=!0}),onFocus:se(e.onFocus,C=>{const P=!S.current;if(C.target===C.currentTarget&&P&&!y){const T=new CustomEvent(gy,oZ);if(C.currentTarget.dispatchEvent(T),!T.defaultPrevented){const N=_().filter(V=>V.focusable),I=N.find(V=>V.active),O=N.find(V=>V.id===v),A=[I,O,...N].filter(Boolean).map(V=>V.ref.current);MO(A,d)}}S.current=!1}),onBlur:se(e.onBlur,()=>x(!1))})})}),OO="RovingFocusGroupItem",DO=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:s,...o}=e,a=Ni(),l=s||a,u=uZ(OO,n),d=u.currentTabStopId===l,f=IO(n),{onFocusableItemAdd:h,onFocusableItemRemove:p}=u;return m.useEffect(()=>{if(r)return h(),()=>p()},[r,h,p]),c.jsx(Ux.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:c.jsx(me.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...o,ref:t,onMouseDown:se(e.onMouseDown,g=>{r?u.onItemFocus(l):g.preventDefault()}),onFocus:se(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:se(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){u.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const v=pZ(g,u.orientation,u.dir);if(v!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let y=f().filter(x=>x.focusable).map(x=>x.ref.current);if(v==="last")y.reverse();else if(v==="prev"||v==="next"){v==="prev"&&y.reverse();const x=y.indexOf(g.currentTarget);y=u.loop?mZ(y,x+1):y.slice(x+1)}setTimeout(()=>MO(y))}})})})});DO.displayName=OO;var fZ={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function hZ(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function pZ(e,t,n){const r=hZ(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return fZ[r]}function MO(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function mZ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Tg=AO,jg=DO,Vx=["Enter"," "],gZ=["ArrowDown","PageUp","Home"],LO=["ArrowUp","PageDown","End"],vZ=[...gZ,...LO],yZ={ltr:[...Vx,"ArrowRight"],rtl:[...Vx,"ArrowLeft"]},xZ={ltr:["ArrowLeft"],rtl:["ArrowRight"]},xf="Menu",[jd,wZ,bZ]=wg(xf),[Ba,FO]=Mn(xf,[bZ,Uc,$o]),Pg=Uc(),$O=$o(),[_Z,Wa]=Ba(xf),[SZ,wf]=Ba(xf),UO=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:s,modal:o=!0}=e,a=Pg(t),[l,u]=m.useState(null),d=m.useRef(!1),f=gt(s),h=za(i);return m.useEffect(()=>{const p=()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>d.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),c.jsx(O_,{...a,children:c.jsx(_Z,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:u,children:c.jsx(SZ,{scope:t,onClose:m.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:o,children:r})})})};UO.displayName=xf;var EZ="MenuAnchor",L_=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=Pg(n);return c.jsx(kg,{...i,...r,ref:t})});L_.displayName=EZ;var F_="MenuPortal",[kZ,VO]=Ba(F_,{forceMount:void 0}),zO=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,s=Wa(F_,t);return c.jsx(kZ,{scope:t,forceMount:n,children:c.jsx(Lt,{present:n||s.open,children:c.jsx(gf,{asChild:!0,container:i,children:r})})})};zO.displayName=F_;var Rr="MenuContent",[CZ,$_]=Ba(Rr),BO=m.forwardRef((e,t)=>{const n=VO(Rr,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,s=Wa(Rr,e.__scopeMenu),o=wf(Rr,e.__scopeMenu);return c.jsx(jd.Provider,{scope:e.__scopeMenu,children:c.jsx(Lt,{present:r||s.open,children:c.jsx(jd.Slot,{scope:e.__scopeMenu,children:o.modal?c.jsx(TZ,{...i,ref:t}):c.jsx(jZ,{...i,ref:t})})})})}),TZ=m.forwardRef((e,t)=>{const n=Wa(Rr,e.__scopeMenu),r=m.useRef(null),i=Le(t,r);return m.useEffect(()=>{const s=r.current;if(s)return w_(s)},[]),c.jsx(U_,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:se(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),jZ=m.forwardRef((e,t)=>{const n=Wa(Rr,e.__scopeMenu);return c.jsx(U_,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),U_=m.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:p,disableOutsideScroll:g,...v}=e,w=Wa(Rr,n),y=wf(Rr,n),x=Pg(n),b=$O(n),_=wZ(n),[S,E]=m.useState(null),k=m.useRef(null),C=Le(t,k,w.onContentChange),P=m.useRef(0),T=m.useRef(""),N=m.useRef(0),I=m.useRef(null),O=m.useRef("right"),j=m.useRef(0),A=g?vg:m.Fragment,V=g?{as:ps,allowPinchZoom:!0}:void 0,$=L=>{var Pe,Ue;const H=T.current+L,z=_().filter(Ae=>!Ae.disabled),Q=document.activeElement,de=(Pe=z.find(Ae=>Ae.ref.current===Q))==null?void 0:Pe.textValue,ne=z.map(Ae=>Ae.textValue),ye=UZ(ne,H,de),he=(Ue=z.find(Ae=>Ae.textValue===ye))==null?void 0:Ue.ref.current;(function Ae(Fe){T.current=Fe,window.clearTimeout(P.current),Fe!==""&&(P.current=window.setTimeout(()=>Ae(""),1e3))})(H),he&&setTimeout(()=>he.focus())};m.useEffect(()=>()=>window.clearTimeout(P.current),[]),x_();const R=m.useCallback(L=>{var z,Q;return O.current===((z=I.current)==null?void 0:z.side)&&zZ(L,(Q=I.current)==null?void 0:Q.area)},[]);return c.jsx(CZ,{scope:n,searchRef:T,onItemEnter:m.useCallback(L=>{R(L)&&L.preventDefault()},[R]),onItemLeave:m.useCallback(L=>{var H;R(L)||((H=k.current)==null||H.focus(),E(null))},[R]),onTriggerLeave:m.useCallback(L=>{R(L)&&L.preventDefault()},[R]),pointerGraceTimerRef:N,onPointerGraceIntentChange:m.useCallback(L=>{I.current=L},[]),children:c.jsx(A,{...V,children:c.jsx(mg,{asChild:!0,trapped:i,onMountAutoFocus:se(s,L=>{var H;L.preventDefault(),(H=k.current)==null||H.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:c.jsx(Ac,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:p,children:c.jsx(Tg,{asChild:!0,...b,dir:y.dir,orientation:"vertical",loop:r,currentTabStopId:S,onCurrentTabStopIdChange:E,onEntryFocus:se(l,L=>{y.isUsingKeyboardRef.current||L.preventDefault()}),preventScrollOnEntryFocus:!0,children:c.jsx(D_,{role:"menu","aria-orientation":"vertical","data-state":sD(w.open),"data-radix-menu-content":"",dir:y.dir,...x,...v,ref:C,style:{outline:"none",...v.style},onKeyDown:se(v.onKeyDown,L=>{const z=L.target.closest("[data-radix-menu-content]")===L.currentTarget,Q=L.ctrlKey||L.altKey||L.metaKey,de=L.key.length===1;z&&(L.key==="Tab"&&L.preventDefault(),!Q&&de&&$(L.key));const ne=k.current;if(L.target!==ne||!vZ.includes(L.key))return;L.preventDefault();const he=_().filter(Pe=>!Pe.disabled).map(Pe=>Pe.ref.current);LO.includes(L.key)&&he.reverse(),FZ(he)}),onBlur:se(e.onBlur,L=>{L.currentTarget.contains(L.target)||(window.clearTimeout(P.current),T.current="")}),onPointerMove:se(e.onPointerMove,Pd(L=>{const H=L.target,z=j.current!==L.clientX;if(L.currentTarget.contains(H)&&z){const Q=L.clientX>j.current?"right":"left";O.current=Q,j.current=L.clientX}}))})})})})})})});BO.displayName=Rr;var PZ="MenuGroup",V_=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return c.jsx(me.div,{role:"group",...r,ref:t})});V_.displayName=PZ;var NZ="MenuLabel",WO=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return c.jsx(me.div,{...r,ref:t})});WO.displayName=NZ;var rm="MenuItem",nT="menu.itemSelect",Ng=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,s=m.useRef(null),o=wf(rm,e.__scopeMenu),a=$_(rm,e.__scopeMenu),l=Le(t,s),u=m.useRef(!1),d=()=>{const f=s.current;if(!n&&f){const h=new CustomEvent(nT,{bubbles:!0,cancelable:!0});f.addEventListener(nT,p=>r==null?void 0:r(p),{once:!0}),y_(f,h),h.defaultPrevented?u.current=!1:o.onClose()}};return c.jsx(qO,{...i,ref:l,disabled:n,onClick:se(e.onClick,d),onPointerDown:f=>{var h;(h=e.onPointerDown)==null||h.call(e,f),u.current=!0},onPointerUp:se(e.onPointerUp,f=>{var h;u.current||(h=f.currentTarget)==null||h.click()}),onKeyDown:se(e.onKeyDown,f=>{const h=a.searchRef.current!=="";n||h&&f.key===" "||Vx.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});Ng.displayName=rm;var qO=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...s}=e,o=$_(rm,n),a=$O(n),l=m.useRef(null),u=Le(t,l),[d,f]=m.useState(!1),[h,p]=m.useState("");return m.useEffect(()=>{const g=l.current;g&&p((g.textContent??"").trim())},[s.children]),c.jsx(jd.ItemSlot,{scope:n,disabled:r,textValue:i??h,children:c.jsx(jg,{asChild:!0,...a,focusable:!r,children:c.jsx(me.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:u,onPointerMove:se(e.onPointerMove,Pd(g=>{r?o.onItemLeave(g):(o.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:se(e.onPointerLeave,Pd(g=>o.onItemLeave(g))),onFocus:se(e.onFocus,()=>f(!0)),onBlur:se(e.onBlur,()=>f(!1))})})})}),RZ="MenuCheckboxItem",HO=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return c.jsx(XO,{scope:e.__scopeMenu,checked:n,children:c.jsx(Ng,{role:"menuitemcheckbox","aria-checked":im(n)?"mixed":n,...i,ref:t,"data-state":B_(n),onSelect:se(i.onSelect,()=>r==null?void 0:r(im(n)?!0:!n),{checkForDefaultPrevented:!1})})})});HO.displayName=RZ;var GO="MenuRadioGroup",[IZ,AZ]=Ba(GO,{value:void 0,onValueChange:()=>{}}),KO=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,s=gt(r);return c.jsx(IZ,{scope:e.__scopeMenu,value:n,onValueChange:s,children:c.jsx(V_,{...i,ref:t})})});KO.displayName=GO;var YO="MenuRadioItem",QO=m.forwardRef((e,t)=>{const{value:n,...r}=e,i=AZ(YO,e.__scopeMenu),s=n===i.value;return c.jsx(XO,{scope:e.__scopeMenu,checked:s,children:c.jsx(Ng,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":B_(s),onSelect:se(r.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,n)},{checkForDefaultPrevented:!1})})})});QO.displayName=YO;var z_="MenuItemIndicator",[XO,OZ]=Ba(z_,{checked:!1}),ZO=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,s=OZ(z_,n);return c.jsx(Lt,{present:r||im(s.checked)||s.checked===!0,children:c.jsx(me.span,{...i,ref:t,"data-state":B_(s.checked)})})});ZO.displayName=z_;var DZ="MenuSeparator",JO=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return c.jsx(me.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});JO.displayName=DZ;var MZ="MenuArrow",eD=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=Pg(n);return c.jsx(M_,{...i,...r,ref:t})});eD.displayName=MZ;var LZ="MenuSub",[Rpe,tD]=Ba(LZ),Su="MenuSubTrigger",nD=m.forwardRef((e,t)=>{const n=Wa(Su,e.__scopeMenu),r=wf(Su,e.__scopeMenu),i=tD(Su,e.__scopeMenu),s=$_(Su,e.__scopeMenu),o=m.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=s,u={__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]),c.jsx(L_,{asChild:!0,...u,children:c.jsx(qO,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":sD(n.open),...e,ref:pg(t,i.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:se(e.onPointerMove,Pd(f=>{s.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(s.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:se(e.onPointerLeave,Pd(f=>{var p,g;d();const h=(p=n.content)==null?void 0:p.getBoundingClientRect();if(h){const v=(g=n.content)==null?void 0:g.dataset.side,w=v==="right",y=w?-5:5,x=h[w?"left":"right"],b=h[w?"right":"left"];s.onPointerGraceIntentChange({area:[{x:f.clientX+y,y:f.clientY},{x,y:h.top},{x:b,y:h.top},{x:b,y:h.bottom},{x,y:h.bottom}],side:v}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(f),f.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:se(e.onKeyDown,f=>{var p;const h=s.searchRef.current!=="";e.disabled||h&&f.key===" "||yZ[r.dir].includes(f.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),f.preventDefault())})})})});nD.displayName=Su;var rD="MenuSubContent",iD=m.forwardRef((e,t)=>{const n=VO(Rr,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,s=Wa(Rr,e.__scopeMenu),o=wf(Rr,e.__scopeMenu),a=tD(rD,e.__scopeMenu),l=m.useRef(null),u=Le(t,l);return c.jsx(jd.Provider,{scope:e.__scopeMenu,children:c.jsx(Lt,{present:r||s.open,children:c.jsx(jd.Slot,{scope:e.__scopeMenu,children:c.jsx(U_,{id:a.contentId,"aria-labelledby":a.triggerId,...i,ref:u,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:se(e.onFocusOutside,d=>{d.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:se(e.onEscapeKeyDown,d=>{o.onClose(),d.preventDefault()}),onKeyDown:se(e.onKeyDown,d=>{var p;const f=d.currentTarget.contains(d.target),h=xZ[o.dir].includes(d.key);f&&h&&(s.onOpenChange(!1),(p=a.trigger)==null||p.focus(),d.preventDefault())})})})})})});iD.displayName=rD;function sD(e){return e?"open":"closed"}function im(e){return e==="indeterminate"}function B_(e){return im(e)?"indeterminate":e?"checked":"unchecked"}function FZ(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function $Z(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function UZ(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let o=$Z(e,Math.max(s,0));i.length===1&&(o=o.filter(u=>u!==n));const l=o.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function VZ(e,t){const{x:n,y:r}=e;let i=!1;for(let s=0,o=t.length-1;s<t.length;o=s++){const a=t[s].x,l=t[s].y,u=t[o].x,d=t[o].y;l>r!=d>r&&n<(u-a)*(r-l)/(d-l)+a&&(i=!i)}return i}function zZ(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return VZ(n,t)}function Pd(e){return t=>t.pointerType==="mouse"?e(t):void 0}var BZ=UO,WZ=L_,qZ=zO,HZ=BO,GZ=V_,KZ=WO,YZ=Ng,QZ=HO,XZ=KO,ZZ=QO,JZ=ZO,eJ=JO,tJ=eD,nJ=nD,rJ=iD,W_="DropdownMenu",[iJ,Ipe]=Mn(W_,[FO]),Ln=FO(),[sJ,oD]=iJ(W_),aD=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:s,onOpenChange:o,modal:a=!0}=e,l=Ln(t),u=m.useRef(null),[d=!1,f]=Jn({prop:i,defaultProp:s,onChange:o});return c.jsx(sJ,{scope:t,triggerId:Ni(),triggerRef:u,contentId:Ni(),open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(h=>!h),[f]),modal:a,children:c.jsx(BZ,{...l,open:d,onOpenChange:f,dir:r,modal:a,children:n})})};aD.displayName=W_;var lD="DropdownMenuTrigger",cD=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,s=oD(lD,n),o=Ln(n);return c.jsx(WZ,{asChild:!0,...o,children:c.jsx(me.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:pg(t,s.triggerRef),onPointerDown:se(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:se(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});cD.displayName=lD;var oJ="DropdownMenuPortal",uD=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Ln(t);return c.jsx(qZ,{...r,...n})};uD.displayName=oJ;var dD="DropdownMenuContent",fD=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=oD(dD,n),s=Ln(n),o=m.useRef(!1);return c.jsx(HZ,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...r,ref:t,onCloseAutoFocus:se(e.onCloseAutoFocus,a=>{var l;o.current||(l=i.triggerRef.current)==null||l.focus(),o.current=!1,a.preventDefault()}),onInteractOutside:se(e.onInteractOutside,a=>{const l=a.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,d=l.button===2||u;(!i.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)"}})});fD.displayName=dD;var aJ="DropdownMenuGroup",lJ=m.forwardRef((e,t)=>
505{const{__scopeDropdownMenu:n,...r}=e,i=Ln(n);return c.jsx(GZ,{...i,...r,ref:t})});lJ.displayName=aJ;var cJ="DropdownMenuLabel",hD=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Ln(n);return c.jsx(KZ,{...i,...r,ref:t})});hD.displayName=cJ;var uJ="DropdownMenuItem",pD=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Ln(n);return c.jsx(YZ,{...i,...r,ref:t})});pD.displayName=uJ;var dJ="DropdownMenuCheckboxItem",mD=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Ln(n);return c.jsx(QZ,{...i,...r,ref:t})});mD.displayName=dJ;var fJ="DropdownMenuRadioGroup",hJ=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Ln(n);return c.jsx(XZ,{...i,...r,ref:t})});hJ.displayName=fJ;var pJ="DropdownMenuRadioItem",gD=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Ln(n);return c.jsx(ZZ,{...i,...r,ref:t})});gD.displayName=pJ;var mJ="DropdownMenuItemIndicator",vD=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Ln(n);return c.jsx(JZ,{...i,...r,ref:t})});vD.displayName=mJ;var gJ="DropdownMenuSeparator",yD=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Ln(n);return c.jsx(eJ,{...i,...r,ref:t})});yD.displayName=gJ;var vJ="DropdownMenuArrow",yJ=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Ln(n);return c.jsx(tJ,{...i,...r,ref:t})});yJ.displayName=vJ;var xJ="DropdownMenuSubTrigger",xD=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Ln(n);return c.jsx(nJ,{...i,...r,ref:t})});xD.displayName=xJ;var wJ="DropdownMenuSubContent",wD=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Ln(n);return c.jsx(rJ,{...i,...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)"}})});wD.displayName=wJ;var bJ=aD,_J=cD,SJ=uD,bD=fD,_D=hD,SD=pD,ED=mD,kD=gD,CD=vD,TD=yD,jD=xD,PD=wD;const EJ=bJ,kJ=_J,CJ=m.forwardRef(({className:e,inset:t,children:n,...r},i)=>c.jsxs(jD,{ref:i,className:K("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,c.jsx(d_,{className:"ml-auto h-4 w-4"})]}));CJ.displayName=jD.displayName;const TJ=m.forwardRef(({className:e,...t},n)=>c.jsx(PD,{ref:n,className:K("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}));TJ.displayName=PD.displayName;const ND=m.forwardRef(({className:e,sideOffset:t=4,...n},r)=>c.jsx(SJ,{children:c.jsx(bD,{ref:r,sideOffset:t,className:K("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]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));ND.displayName=bD.displayName;const tp=m.forwardRef(({className:e,inset:t,...n},r)=>c.jsx(SD,{ref:r,className:K("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));tp.displayName=SD.displayName;const jJ=m.forwardRef(({className:e,children:t,checked:n,...r},i)=>c.jsxs(ED,{ref:i,className:K("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(CD,{children:c.jsx(Ra,{className:"h-4 w-4"})})}),t]}));jJ.displayName=ED.displayName;const PJ=m.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(kD,{ref:r,className:K("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(CD,{children:c.jsx(wA,{className:"h-2 w-2 fill-current"})})}),t]}));PJ.displayName=kD.displayName;const RD=m.forwardRef(({className:e,inset:t,...n},r)=>c.jsx(_D,{ref:r,className:K("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));RD.displayName=_D.displayName;const zx=m.forwardRef(({className:e,...t},n)=>c.jsx(TD,{ref:n,className:K("-mx-1 my-1 h-px bg-muted",e),...t}));zx.displayName=TD.displayName;var q_="Avatar",[NJ,Ape]=Mn(q_),[RJ,ID]=NJ(q_),AD=m.forwardRef((e,t)=>
505{const{__scopeAvatar:n,...r}=e,[i,s]=m.useState("idle");return c.jsx(RJ,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:s,children:c.jsx(me.span,{...r,ref:t})})});AD.displayName=q_;var OD="AvatarImage",DD=m.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...s}=e,o=ID(OD,n),a=IJ(r,s.referrerPolicy),l=gt(u=>{i(u),o.onImageLoadingStatusChange(u)});return Dr(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?c.jsx(me.img,{...s,ref:t,src:r}):null});DD.displayName=OD;var MD="AvatarFallback",LD=m.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,s=ID(MD,n),[o,a]=m.useState(r===void 0);return m.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(l)}},[r]),o&&s.imageLoadingStatus!=="loaded"?c.jsx(me.span,{...i,ref:t}):null});LD.displayName=MD;function IJ(e,t){const[n,r]=m.useState("idle");return Dr(()=>{if(!e){r("error");return}let i=!0;const s=new window.Image,o=a=>()=>{i&&r(a)};return r("loading"),s.onload=o("loaded"),s.onerror=o("error"),s.src=e,t&&(s.referrerPolicy=t),()=>{i=!1}},[e,t]),n}var FD=AD,$D=DD,UD=LD;const VD=m.forwardRef(({className:e,...t},n)=>c.jsx(FD,{ref:n,className:K("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));VD.displayName=FD.displayName;const zD=m.forwardRef(({className:e,...t},n)=>c.jsx($D,{ref:n,className:K("aspect-square h-full w-full",e),...t}));zD.displayName=$D.displayName;const BD=m.forwardRef(({className:e,...t},n)=>c.jsx(UD,{ref:n,className:K("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));BD.displayName=UD.displayName;const rl={AUTH_LOGIN_ATTEMPTED:"auth_login_attempted",AUTH_LOGIN_SUCCESS:"auth_login_success",AUTH_LOGIN_FAILED:"auth_login_failed",AUTH_REGISTRATION_STARTED:"auth_registration_started",AUTH_REGISTRATION_SUCCESS:"auth_registration_success",AUTH_REGISTRATION_FAILED:"auth_registration_failed",AUTH_LOGOUT:"auth_logout",RECIPE_GENERATION_REQUESTED:"recipe_generation_requested",RECIPE_GENERATION_STARTED:"recipe_generation_started",RECIPE_GENERATION_SUCCESS:"recipe_generation_success",RECIPE_GENERATION_FAILED:"recipe_generation_failed",RECIPE_VIEW:"recipe_view",RECIPE_SELECTED:"recipe_selected",INVENTORY_INGREDIENT_UPLOADED:"inventory_ingredient_uploaded",INVENTORY_INGREDIENT_ADDED_MANUAL:"inventory_ingredient_added_manual",INVENTORY_INGREDIENT_EDITED:"inventory_ingredient_edited",INVENTORY_INGREDIENT_DELETED:"inventory_ingredient_deleted",INVENTORY_INGREDIENTS_BATCH_ADDED:"inventory_ingredients_batch_added",INVENTORY_MULTIPLE_ITEMS_DELETED:"inventory_multiple_items_deleted",INVENTORY_CLEARED:"inventory_cleared",MEAL_PLAN_CREATION_STARTED:"meal_plan_creation_started",MEAL_PLAN_CREATION_SUCCESS:"meal_plan_creation_success",MEAL_PLAN_CREATION_FAILED:"meal_plan_creation_failed",MEAL_PLAN_VIEWED:"meal_plan_viewed",MEAL_PLAN_RECIPE_CONFIRMED:"meal_plan_recipe_confirmed",MEAL_PLAN_RECIPE_UNCONFIRMED:"meal_plan_recipe_unconfirmed",MEAL_PLAN_RECIPES_VIEWED:"meal_plan_recipes_viewed",SHOPPING_LIST_GENERATED:"shopping_list_generated",SHOPPING_LIST_VIEWED:"shopping_list_viewed",SHOPPING_LIST_INSTACART_OPENED:"shopping_list_instacart_opened",SHOPPING_LIST_GENERATION_STARTED:"shopping_list_generation_started",SHOPPING_LIST_GENERATION_SUCCESS:"shopping_list_generation_success",SHOPPING_LIST_GENERATION_FAILED:"shopping_list_generation_failed",SHOPPING_LIST_ITEM_TOGGLED:"shopping_list_item_toggled"};function vr(){const e=m.useCallback((h,p)=>{try{Zr.track(h,p)}catch(g){console.warn("Analytics hook: Failed to track event",h,g)}},[]),t=m.useCallback(h=>{try{Zr.setUserId(h)}catch(p){console.warn("Analytics hook: Failed to set user ID",p)}},[]),n=m.useCallback(()=>{try{Zr.clearUserId()}catch(h){console.warn("Analytics hook: Failed to clear user ID",h)}},[]),r=m.useCallback(()=>{try{return Zr.getUserId()}catch(h){console.warn("Analytics hook: Failed to get user ID",h);return}},[]),i=m.useCallback(()=>Zr.isInitialized(),[]),s=m.useCallback(()=>{try{Zr.flush()}catch(h){console.warn("Analytics hook: Failed to flush events",h)}},[]),o=m.useCallback((h,p)=>{const g=rl[h];g&&e(g,p)},[e]),a=m.useCallback((h,p)=>{const g=rl[h];g&&e(g,p)},[e]),l=m.useCallback((h,p)=>{const g=rl[h];g&&e(g,p)},[e]),u=m.useCallback((h,p)=>{const g=rl[h];g&&e(g,p)},[e]),d=m.useCallback((h,p)=>{const g=rl[h];g&&e(g,p)},[e]),f=m.useMemo(()=>rl,[]);return{track:e,setUserId:t,clearUserId:n,getUserId:r,isInitialized:i,flush:s,trackAuth:o,trackRecipe:a,trackInventory:l,trackMealPlan:u,trackShoppingList:d,events:f}}const AJ=()=>{var s,o;const{user:e,signOut:t}=Zt(),n=vr();if(!e)return null;const r=()=>{n.track("auth_logout",{logout_source:"user_menu"}),t()},i=()=>{var a,l,u;return(a=e.user_metadata)!=null&&a.first_name&&((l=e.user_metadata)!=null&&l.last_name)?`${e.user_metadata.first_name[0]}${e.user_metadata.last_name[0]}`.toUpperCase():((u=e.email)==null?void 0:u[0].toUpperCase())||"U"};return c.jsxs(EJ,{children:[c.jsx(kJ,{asChild:!0,children:c.jsx(ie,{variant:"ghost",className:"relative h-10 w-10 rounded-full",children:c.jsxs(VD,{children:[c.jsx(zD,{src:(s=e.user_metadata)==null?void 0:s.avatar_url}),c.jsx(BD,{children:i()})]})})}),c.jsxs(ND,{className:"w-56",align:"end",children:[c.jsx(RD,{children:c.jsxs("div",{className:"flex flex-col space-y-1",children:[c.jsx("p",{className:"text-sm font-medium leading-none",children:(o=e.user_metadata)!=null&&o.first_name?`${e.user_metadata.first_name} ${e.user_metadata.last_name}`:"My Account"}),c.jsx("p",{className:"text-xs leading-none text-muted-foreground",children:e.email})]})}),c.jsx(zx,{}),c.jsx(Nt,{to:"/dashboard",children:c.jsxs(tp,{children:[c.jsx(jA,{className:"mr-2 h-4 w-4"}),c.jsx("span",{children:"Dashboard"})]})}),c.jsx(Nt,{to:"/profile",children:c.jsxs(tp,{children:[c.jsx(Nx,{className:"mr-2 h-4 w-4"}),c.jsx("span",{children:"Settings"})]})}),c.jsx(zx,{}),c.jsxs(tp,{onClick:r,children:[c.jsx(kK,{className:"mr-2 h-4 w-4"}),c.jsx("span",{children:"Log out"})]})]})]})},Wi=({onOpenAuth:e})=>{const[t,n]=m.useState(!1),{user:r,isLoading:i}=Zt(),s=ws();wn();const o=a=>s.pathname===a||s.pathname.startsWith(`${a}/`);return m.useEffect(()=>{n(!1)},[s.pathname]),c.jsx("header",{className:"sticky top-0 z-40 w-full border-b bg-background/80 backdrop-blur-md",children:c.jsxs("div",{className:"container flex h-16 items-center justify-between px-4 sm:px-6",children:[c.jsxs(Nt,{to:r?"/dashboard":"/",className:"flex items-center gap-2",onClick:a=>
505{!r&&s.pathname==="/"&&(a.preventDefault(),window.scrollTo({top:0,behavior:"smooth"}))},children:[c.jsx("img",{src:"/lovable-uploads/c1f40201-c4cd-4e2f-85e8-7f3803684d6f.png",alt:"MealMuse Logo",className:"h-8 w-8"}),c.jsx("span",{className:"text-xl font-bold tracking-tight",children:"MealMuse"})]}),c.jsx("nav",{className:"hidden sm:flex items-center gap-6",children:!i&&(r?c.jsxs(c.Fragment,{children:[c.jsx(Nt,{to:"/dashboard",className:`text-sm font-medium ${o("/dashboard")?"text-foreground":"text-foreground/60"} transition-colors hover:text-foreground relative link-underline`,children:"Dashboard"}),c.jsx(Nt,{to:"/inventory/add",className:`text-sm font-medium ${o("/inventory/add")?"text-foreground":"text-foreground/60"} transition-colors hover:text-foreground relative link-underline`,children:"Add Ingredients"}),c.jsx(Nt,{to:"/inventory/manage",className:`text-sm font-medium ${o("/inventory/manage")?"text-foreground":"text-foreground/60"} transition-colors hover:text-foreground relative link-underline`,children:"My Inventory"}),c.jsx(Nt,{to:"/shopping-list",className:`text-sm font-medium ${o("/shopping-list")?"text-foreground":"text-foreground/60"} transition-colors hover:text-foreground relative link-underline`,children:"Shopping List"})]}):c.jsxs(c.Fragment,{children:[c.jsx(Nt,{to:"/",className:`text-sm font-medium ${o("/")&&!o("/dashboard")?"text-foreground":"text-foreground/60"} transition-colors hover:text-foreground relative link-underline`,onClick:a=>{s.pathname==="/"&&(a.preventDefault(),window.scrollTo({top:0,behavior:"smooth"}))},children:"Home"}),c.jsx(Nt,{to:"#features",className:"text-sm font-medium text-foreground/60 transition-colors hover:text-foreground relative link-underline",onClick:a=>{var l;a.preventDefault(),(l=document.getElementById("features"))==null||l.scrollIntoView({behavior:"smooth"})},children:"Features"}),c.jsx(Nt,{to:"#testimonials",className:"text-sm font-medium text-foreground/60 transition-colors hover:text-foreground relative link-underline",onClick:a=>{var l;a.preventDefault(),(l=document.getElementById("testimonials"))==null||l.scrollIntoView({behavior:"smooth"})},children:"Testimonials"})]}))}),c.jsxs("div",{className:"flex items-center gap-2",children:[!i&&(r?c.jsx(AJ,{}):c.jsxs(c.Fragment,{children:[c.jsx(ie,{variant:"ghost",className:"hidden sm:flex",onClick:()=>e&&e("login"),children:"Log In"}),c.jsx(ie,{variant:"bubble",onClick:()=>e&&e("signup"),className:"btn-bounce",children:"Sign Up"})]})),c.jsxs(zQ,{open:t,onOpenChange:n,children:[c.jsx(BQ,{asChild:!0,children:c.jsxs(ie,{variant:"ghost",size:"icon",className:"sm:hidden",children:[c.jsx(CK,{className:"h-5 w-5"}),c.jsx("span",{className:"sr-only",children:"Toggle menu"})]})}),c.jsx(hO,{side:"right",className:"w-[80%] sm:w-[350px] glass-card",children:c.jsxs("nav",{className:"flex flex-col gap-4 pt-8",children:[!i&&(r?c.jsxs(c.Fragment,{children:[c.jsx(Nt,{to:"/dashboard",className:"text-base font-medium hover:text-primary transition-colors",onClick:()=>n(!1),children:"Dashboard"}),c.jsx(Nt,{to:"/inventory/add",className:"text-base font-medium hover:text-primary transition-colors",onClick:()=>n(!1),children:"Add Ingredients"}),c.jsx(Nt,{to:"/inventory/manage",className:"text-base font-medium hover:text-primary transition-colors",onClick:()=>n(!1),children:"My Inventory"}),c.jsx(Nt,{to:"/shopping-list",className:"text-base font-medium hover:text-primary transition-colors",onClick:()=>n(!1),children:"Shopping List"})]}):c.jsxs(c.Fragment,{children:[c.jsx(Nt,{to:"/",className:"text-base font-medium hover:text-primary transition-colors",onClick:a=>{s.pathname==="/"&&(a.preventDefault(),window.scrollTo({top:0,behavior:"smooth"})),n(!1)},children:"Home"}),c.jsx(Nt,{to:"/#features",className:"text-base font-medium hover:text-primary transition-colors",onClick:a=>{var l;a.preventDefault(),n(!1),(l=document.getElementById("features"))==null||l.scrollIntoView({behavior:"smooth"})},children:"Features"}),c.jsx(Nt,{to:"/#testimonials",className:"text-base font-medium hover:text-primary transition-colors",onClick:a=>{var l;a.preventDefault(),n(!1),(l=document.getElementById("testimonials"))==null||l.scrollIntoView({behavior:"smooth"})},children:"Testimonials"})]})),!i&&!r&&c.jsxs("div",{className:"flex flex-col gap-2 mt-4",children:[c.jsx(ie,{variant:"outline",onClick:()=>{n(!1),e&&e("login")},children:"Log In"}),c.jsx(ie,{variant:"bubble",onClick:()=>{n(!1),e&&e("signup")},children:"Sign Up"})]})]})})]})]})]})})},OJ=({onOpenAuth:e})=>c.jsxs("section",{className:"relative pt-20 pb-12 sm:pt-28 sm:pb-16 overflow-hidden bg-gray-900 text-white",children:[c.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-gray-800 via-gray-900 to-gray-950 -z-10"}),c.jsx("div",{className:"absolute top-20 left-10 w-64 h-64 bg-primary/10 rounded-full blur-3xl -z-10 animate-float"}),c.jsx("div",{className:"absolute bottom-20 right-10 w-80 h-80 bg-secondary/10 rounded-full blur-3xl -z-10 animate-float",style:{animationDelay:"2s"}}),c.jsx("div",{className:"absolute top-40 right-20 w-32 h-32 bg-accent/20 rounded-full blur-2xl -z-10 animate-float",style:{animationDelay:"1s"}}),c.jsx("div",{className:"absolute inset-0 opacity-[0.03] bg-dotted -z-5"}),c.jsx("div",{className:"container px-4 sm:px-6 max-w-6xl",children:c.jsxs("div",{className:"text-center space-y-6 sm:space-y-8 max-w-4xl mx-auto",children:[c.jsxs("h1",{className:"text-4xl sm:text-5xl lg:text-6xl font-display font-bold leading-tight lg:leading-tight tracking-tight animate-fade-in text-white",children:[c.jsx("span",{children:"Smart Meal Planning,"}),c.jsx("br",{className:"hidden sm:block"}),c.jsx("span",{className:"text-gradient-fun",children:" Simplified"})]}),c.jsx("p",{className:"text-lg sm:text-xl text-gray-300 max-w-3xl mx-auto mt-6 animate-fade-in delay-200 leading-relaxed",children:"MealMuse uses AI to create personalized meal plans based on what's in your fridge, your dietary preferences, and your schedule."}),c.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-4 pt-4 sm:pt-6 animate-fade-in delay-300",children:[c.jsxs(ie,{onClick:()=>e("signup"),size:"lg",variant:"bubble",className:"w-full sm:w-auto group",children:["Get Started for Free",c.jsx(vA,{className:"ml-2 h-4 w-4 transition-transform group-hover:translate-x-1"})]}),c.jsx(ie,{variant:"outline",size:"lg",onClick:()=>e("login"),className:"w-full sm:w-auto border-primary text-primary hover:bg-primary hover:text-white",children:"Log In"})]})]})})]}),di=m.forwardRef(({className:e,...t},n)=>
505c.jsx("div",{ref:n,className:K("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));di.displayName="Card";const qa=m.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:K("flex flex-col space-y-1.5 p-6",e),...t}));qa.displayName="CardHeader";const Vc=m.forwardRef(({className:e,...t},n)=>c.jsx("h3",{ref:n,className:K("text-2xl font-semibold leading-none tracking-tight",e),...t}));Vc.displayName="CardTitle";const Rg=m.forwardRef(({className:e,...t},n)=>c.jsx("p",{ref:n,className:K("text-sm text-muted-foreground",e),...t}));Rg.displayName="CardDescription";const fi=m.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:K("p-6 pt-0",e),...t}));fi.displayName="CardContent";const bf=m.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:K("flex items-center p-6 pt-0",e),...t}));bf.displayName="CardFooter";function DJ(e,t=1200,n=.8){return new Promise(r=>{const i=document.createElement("canvas"),s=i.getContext("2d"),o=new Image;o.onload=()=>{let{width:a,height:l}=o;a>t&&(l=l*t/a,a=t),i.width=a,i.height=l,s==null||s.drawImage(o,0,0,a,l),i.toBlob(u=>{if(u){const d=new File([u],e.name,{type:"image/jpeg",lastModified:Date.now()});r(d)}else r(e)},"image/jpeg",n)},o.src=URL.createObjectURL(e)})}async function MJ(e){try{if(console.log(`Processing ${e.length} demo images`),e.length===0)return{success:!1,error:"No files provided"};const t=[];for(const r of e){const i=await DJ(r);console.log(`Original size: ${(r.size/1024/1024).toFixed(2)}MB, Compressed: ${(i.size/1024/1024).toFixed(2)}MB`);const s=`demo-${Date.now()}-${Math.random().toString(36).substr(2,9)}.jpg`,{data:o,error:a}=await _e.storage.from("demo-images").upload(s,i,{cacheControl:"3600",upsert:!1});if(a){console.error("Error uploading demo image:",a);continue}const{data:l}=_e.storage.from("demo-images").getPublicUrl(s);if(!l.publicUrl){console.error("Error getting public URL for demo image");continue}const{data:u,error:d}=await _e.functions.invoke("detect-ingredients",{body:{imageUrl:l.publicUrl,imageType:"fridge",isDemo:!0}});if(d){console.error("Error calling detect-ingredients function:",d);continue}u.success&&u.detectedIngredients&&t.push(...u.detectedIngredients),await _e.storage.from("demo-images").remove([s])}return t.length===0?{success:!0,detectedIngredients:[],noFoodDetected:!0,noFoodReason:"No ingredients detected in the uploaded images"}:{success:!0,detectedIngredients:LJ(t),noFoodDetected:!1}}catch(t){return console.error("Error in processDemoImages:",t),{success:!1,error:t instanceof Error?t.message:"Unknown error occurred"}}}function LJ(e){const t=new Set;return e.filter(n=>{const r=`${n.name.toLowerCase()}-${n.category}`;return t.has(r)?!1:(t.add(r),!0)})}var FJ="Label",WD=m.forwardRef((e,t)=>c.jsx(me.label,{...e,ref:t,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=e.onMouseDown)==null||i.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));WD.displayName=FJ;var qD=WD;const $J=Va("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Co=m.forwardRef(({className:e,...t},n)=>c.jsx(qD,{ref:n,className:K($J(),e),...t}));Co.displayName=qD.displayName;var HD={exports:{}},UJ="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",VJ=UJ,zJ=VJ;function GD(){}function KD(){}KD.resetWarningCache=GD;var BJ=function(){function e(r,i,s,o,a,l){if(l!==zJ){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:KD,resetWarningCache:GD};return n.PropTypes=n,n};HD.exports=BJ();var WJ=HD.exports;const tt=Uw(WJ),qJ
vendor: 41,168 bytes, line 505
505=new Map([["1km","application/vnd.1000minds.decision-model+xml"],["3dml","text/vnd.in3d.3dml"],["3ds","image/x-3ds"],["3g2","video/3gpp2"],["3gp","video/3gp"],["3gpp","video/3gpp"],["3mf","model/3mf"],["7z","application/x-7z-compressed"],["7zip","application/x-7z-compressed"],["123","application/vnd.lotus-1-2-3"],["aab","application/x-authorware-bin"],["aac","audio/x-acc"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abw","application/x-abiword"],["ac","application/vnd.nokia.n-gage.ac+xml"],["ac3","audio/ac3"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acu","application/vnd.acucobol"],["acutc","application/vnd.acucorp"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afm","application/x-font-type1"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/pdf"],["aif","audio/x-aiff"],["aifc","audio/x-aiff"],["aiff","audio/x-aiff"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["amr","audio/amr"],["apk","application/vnd.android.package-archive"],["apng","image/apng"],["appcache","text/cache-manifest"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["arc","application/x-freearc"],["arj","application/x-arj"],["asc","application/pgp-signature"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asx","video/x-ms-asf"],["atc","application/vnd.acucorp"],["atom","application/atom+xml"],["atomcat","application/atomcat+xml"],["atomdeleted","application/atomdeleted+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au","audio/x-au"],["avi","video/x-msvideo"],["avif","image/avif"],["aw","application/applixware"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azv","image/vnd.airzip.accelerator.azv"],["azw","application/vnd.amazon.ebook"],["b16","image/vnd.pco.b16"],["bat","application/x-msdownload"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bdoc","application/x-bdoc"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin","application/octet-stream"],["blb","application/x-blorb"],["blorb","application/x-blorb"],["bmi","application/vnd.bmi"],["bmml","application/vnd.balsamiq.bmml+xml"],["bmp","image/bmp"],["book","application/vnd.framemaker"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bpk","application/octet-stream"],["bpmn","application/octet-stream"],["bsp","model/vnd.valve.source.compiled-map"],["btif","image/prs.btif"],["buffer","application/octet-stream"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c","text/x-c"],["c4d","application/vnd.clonk.c4group"],["c4f","application/vnd.clonk.c4group"],["c4g","application/vnd.clonk.c4group"],["c4p","application/vnd.clonk.c4group"],["c4u","application/vnd.clonk.c4group"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["cab","application/vnd.ms-cab-compressed"],["caf","audio/x-caf"],["cap","application/vnd.tcpdump.pcap"],["car","application/vnd.curl.car"],["cat","application/vnd.ms-pki.seccat"],["cb7","application/x-cbr"],["cba","application/x-cbr"],["cbr","application/x-cbr"],["cbt","application/x-cbr"],["cbz","application/x-cbr"],["cc","text/x-c"],["cco","application/x-cocoa"],["cct","application/x-director"],["ccxml","application/ccxml+xml"],["cdbcmsg","application/vnd.contact.cmsg"],["cda","application/x-cdf"],["cdf","application/x-netcdf"],["cdfx","application/cdfx+xml"],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdr","application/cdr"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer","application/pkix-cert"],["cfs","application/x-cfs-compressed"],["cgm","image/cgm"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cjs","application/node"],["cla","application/vnd.claymore"],["class","application/octet-stream"],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod","application/vnd.rim.cod"],["coffee","text/coffeescript"],["com","application/x-msdownload"],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt","application/mac-compactpro"],["crd","application/x-mscardfile"],["crl","application/pkix-crl"],["crt","application/x-x509-ca-cert"],["crx","application/x-chrome-extension"],["cryptonote","application/vnd.rig.cryptonote"],["csh","application/x-csh"],["csl","application/vnd.citationstyles.style+xml"],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["csr","application/octet-stream"],["css","text/css"],["cst","application/x-director"],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxt","application/x-director"],["cxx","text/x-c"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["dart","application/vnd.dart"],["dataless","application/vnd.fdsn.seed"],["davmount","application/davmount+xml"],["dbf","application/vnd.dbf"],["dbk","application/docbook+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["ddf","application/vnd.syncml.dmddf+xml"],["dds","image/vnd.ms-dds"],["deb","application/x-debian-package"],["def","text/plain"],["deploy","application/octet-stream"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dgc","application/x-dgc-compressed"],["dic","text/x-c"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["disposition-notification","message/disposition-notification"],["dist","application/octet-stream"],["distz","application/octet-stream"],["djv","image/vnd.djvu"],["djvu","image/vnd.djvu"],["dll","application/octet-stream"],["dmg","application/x-apple-diskimage"],["dmn","application/octet-stream"],["dmp","application/vnd.tcpdump.pcap"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.template.macroEnabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroEnabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp","application/vnd.osgi.dp"],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drle","image/dicom-rle"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dvb","video/vnd.dvb.file"],["dvi","application/x-dvi"],["dwd","application/atsc-dwd+xml"],["dwf","model/vnd.dwf"],["dwg","image/vnd.dwg"],["dxf","image/vnd.dxf"],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ear","application/java-archive"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["ecma","application/ecmascript"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["elc","application/octet-stream"],["emf","image/emf"],["eml","message/rfc822"],["emma","application/emma+xml"],["emotionml","application/emotionml+xml"],["emz","application/x-msmetafile"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es","application/ecmascript"],["es3","application/vnd.eszigno3+xml"],["esa","application/vnd.osgi.subsystem"],["esf","application/vnd.epson.esf"],["et3","application/vnd.eszigno3+xml"],["etx","text/x-setext"],["eva","application/x-eva"],["evy","application/x-envoy"],["exe","application/octet-stream"],["exi","application/exi"],["exp","application/express"],["exr","image/aces"],["ext","application/vnd.novadigm.ext"],["ez","application/andrew-inset"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f","text/x-fortran"],["f4v","video/mp4"],["f77","text/x-fortran"],["f90","text/x-fortran"],["fbs","image/vnd.fastbidsheet"],["fcdt","application/vnd.adobe.formscentral.fcdt"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fdt","application/fdt+xml"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fgd","application/x-director"],["fh","image/x-freehand"],["fh4","image/x-freehand"],["fh5","image/x-freehand"],["fh7","image/x-freehand"],["fhc","image/x-freehand"],["fig","application/x-xfig"],["fits","image/fits"],["flac","audio/x-flac"],["fli","video/x-fli"],["flo","application/vnd.micrografx.flo"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fnc","application/vnd.frogans.fnc"],["fo","application/vnd.software602.filler.form+xml"],["for","text/x-fortran"],["fpx","image/vnd.fpx"],["frame","application/vnd.framemaker"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fxpl","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gam","application/x-tads"],["gbr","application/rpki-ghostbusters"],["gca","application/x-gca-compressed"],["gdl","model/vnd.gdl"],["gdoc","application/vnd.google-apps.document"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["glb","model/gltf-binary"],["gltf","model/gltf+json"],["gml","application/gml+xml"],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gpg","application/gpg-keys"],["gph","application/vnd.flographit"],["gpx","application/gpx+xml"],["gqf","application/vnd.grafeq"],["gqs","application/vnd.grafeq"],["gram","application/srgs"],["gramps","application/x-gramps-xml"],["gre","application/vnd.geometry-explorer"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsf","application/x-font-ghostscript"],["gsheet","application/vnd.google-apps.spreadsheet"],["gslides","application/vnd.google-apps.presentation"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxf","application/gxf"],["gxt","application/vnd.geonext"],["gz","application/gzip"],["gzip","application/gzip"],["h","text/x-c"],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hbs","text/x-handlebars-template"],["hdd","application/x-virtualbox-hdd"],["hdf","application/x-hdf"],["heic","image/heic"],["heics","image/heic-sequence"],["heif","image/heif"],["heifs","image/heif-sequence"],["hej2","image/hej2k"],["held","application/atsc-held+xml"],["hh","text/x-c"],["hjson","application/hjson"],["hlp","application/winhlp"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx","application/mac-binhex40"],["hsj2","image/hsj2"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["icm","application/vnd.iccprofile"],["ico","image/x-icon"],["ics","text/calendar"],["ief","image/ief"],["ifb","text/calendar"],["ifm","application/vnd.shana.informed.formdata"],["iges","model/iges"],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs","model/iges"],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["img","application/octet-stream"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["in","text/plain"],["ini","text/plain"],["ink","application/inkml+xml"],["inkml","application/inkml+xml"],["install","application/x-install-instructions"],["iota","application/vnd.astraea-software.iota"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["iso","application/x-iso9660-image"],["itp","application/vnd.shana.informed.formtemplate"],["its","application/its+xml"],["ivp","application/vnd.immervision-ivp"],["ivu","application/vnd.immervision-ivu"],["jad","text/vnd.sun.j2me.app-descriptor"],["jade","text/jade"],["jam","application/vnd.jam"],["jar","application/java-archive"],["jardiff","application/x-java-archive-diff"],["java","text/x-java-source"],["jhc","image/jphc"],["jisp","application/vnd.jisp"],["jls","image/jls"],["jlt","application/vnd.hp-jlyt"],["jng","image/x-jng"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jp2","image/jp2"],["jpe","image/jpeg"],["jpeg","image/jpeg"],["jpf","image/jpx"],["jpg","image/jpeg"],["jpg2","image/jp2"],["jpgm","video/jpm"],["jpgv","video/jpeg"],["jph","image/jph"],["jpm","video/jpm"],["jpx","image/jpx"],["js","application/javascript"],["json","application/json"],["json5","application/json5"],["jsonld","application/ld+json"],["jsonl","application/jsonl"],["jsonml","application/jsonml+json"],["jsx","text/jsx"],["jxr","image/jxr"],["jxra","image/jxra"],["jxrs","image/jxrs"],["jxs","image/jxs"],["jxsc","image/jxsc"],["jxsi","image/jxsi"],["jxss","image/jxss"],["kar","audio/midi"],["karbon","application/vnd.kde.karbon"],["kdb","application/octet-stream"],["kdbx","application/x-keepass2"],["key","application/x-iwork-keynote-sffkey"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["knp","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["kpt","application/vnd.kde.kpresenter"],["kpxx","application/vnd.ds-keypoint"],["ksp","application/vnd.kde.kspread"],["ktr","application/vnd.kahootz"],["ktx","image/ktx"],["ktx2","image/ktx2"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["kwt","application/vnd.kde.kword"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["less","text/less"],["lgr","application/lgr+xml"],["lha","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["list3820","application/vnd.ibm.modcap"],["listafp","application/vnd.ibm.modcap"],["litcoffee","text/coffeescript"],["lnk","application/x-ms-shortcut"],["log","text/plain"],["lostxml","application/lost+xml"],["lrf","application/octet-stream"],["lrm","application/vnd.ms-lrm"],["ltf","application/vnd.frogans.ltf"],["lua","text/x-lua"],["luac","application/x-lua-bytecode"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh","application/octet-stream"],["m1v","video/mpeg"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3a","audio/mpeg"],["m3u","text/plain"],["m3u8","application/vnd.apple.mpegurl"],["m4a","audio/x-m4a"],["m4p","application/mp4"],["m4s","video/iso.segment"],["m4u","application/vnd.mpegurl"],["m4v","video/x-m4v"],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m21","application/mp21"],["ma","application/mathematica"],["mads","application/mads+xml"],["maei","application/mmt-aei+xml"],["mag","application/vnd.ecowin.chart"],["maker","application/vnd.framemaker"],["man","text/troff"],["manifest","text/cache-manifest"],["map","application/json"],["mar","application/octet-stream"],["markdown","text/markdown"],["mathml","application/mathml+xml"],["mb","application/mathematica"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc1","application/vnd.medcalcdata"],["mcd","application/vnd.mcd"],["mcurl","text/vnd.curl.mcurl"],["md","text/markdown"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["mdx","text/mdx"],["me","text/troff"],["mesh","model/mesh"],["meta4","application/metalink4+xml"],["metalink","application/metalink+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mft","application/rpki-manifest"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mid","audio/midi"],["midi","audio/midi"],["mie","application/x-mie"],["mif","application/vnd.mif"],["mime","message/rfc822"],["mj2","video/mj2"],["mjp2","video/mj2"],["mjs","application/javascript"],["mk3d","video/x-matroska"],["mka","audio/x-matroska"],["mkd","text/x-markdown"],["mks","video/x-matroska"],["mkv","video/x-matroska"],["mlp","application/vnd.dolby.mlp"],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mmf","application/vnd.smaf"],["mml","text/mathml"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mng","video/x-mng"],["mny","application/x-msmoney"],["mobi","application/x-mobipocket-ebook"],["mods","application/mods+xml"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2","audio/mpeg"],["mp2a","audio/mpeg"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mp4a","audio/mp4"],["mp4s","application/mp4"],["mp4v","video/mp4"],["mp21","application/mp21"],["mpc","application/vnd.mophun.certificate"],["mpd","application/dash+xml"],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg","video/mpeg"],["mpg4","video/mp4"],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/vnd.ms-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","text/troff"],["mscml","application/mediaservercontrol+xml"],["mseed","application/vnd.fdsn.mseed"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msi","application/x-msdownload"],["msl","application/vnd.mobius.msl"],["msm","application/octet-stream"],["msp","application/octet-stream"],["msty","application/vnd.muvee.style"],["mtl","model/mtl"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musd","application/mmt-usd+xml"],["musicxml","application/vnd.recordare.musicxml+xml"],["mvb","application/x-msmediaview"],["mvt","application/vnd.mapbox-vector-tile"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxmf","audio/mobile-xmf"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nb","application/mathematica"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncx","application/x-dtbncx+xml"],["nfo","text/x-nfo"],["ngdat","application/vnd.nokia.n-gage.data"],["nitf","application/vnd.nitf"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nq","application/n-quads"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nt","application/n-triples"],["ntf","application/vnd.nitf"],["numbers","application/x-iwork-numbers-sffnumbers"],["nzb","application/x-nzb"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["obgx","application/vnd.openblox.game+xml"],["obj","model/obj"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogex","model/vnd.opengex"],["ogg","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omdoc","application/omdoc+xml"],["onepkg","application/onenote"],["onetmp","application/onenote"],["onetoc","application/onenote"],["onetoc2","application/onenote"],["opf","application/oebps-package+xml"],["opml","text/x-opml"],["oprc","application/vnd.palm"],["opus","audio/ogg"],["org","text/x-org"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["osm","application/vnd.openstreetmap.data+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","font/otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["ova","application/x-virtualbox-ova"],["ovf","application/x-virtualbox-ovf"],["owl","application/rdf+xml"],["oxps","application/oxps"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c","application/pkcs7-mime"],["p7m","application/pkcs7-mime"],["p7r","application/x-pkcs7-certreqresp"],["p7s","application/pkcs7-signature"],["p8","application/pkcs8"],["p10","application/x-pkcs10"],["p12","application/x-pkcs12"],["pac","application/x-ns-proxy-autoconfig"],["pages","application/x-iwork-pages-sffpages"],["pas","text/x-pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcap","application/vnd.tcpdump.pcap"],["pcf","application/x-font-pcf"],["pcl","application/vnd.hp-pcl"],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb","application/x-pilot"],["pde","text/x-processing"],["pdf","application/pdf"],["pem","application/x-x509-user-cert"],["pfa","application/x-font-type1"],["pfb","application/x-font-type1"],["pfm","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfx","application/x-pkcs12"],["pgm","image/x-portable-graymap"],["pgn","application/x-chess-pgn"],["pgp","application/pgp"],["php","application/x-httpd-php"],["php3","application/x-httpd-php"],["php4","application/x-httpd-php"],["phps","application/x-httpd-php-source"],["phtml","application/x-httpd-php"],["pic","image/x-pict"],["pkg","application/octet-stream"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pkpass","application/vnd.apple.pkpass"],["pl","application/x-perl"],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["pm","application/x-perl"],["pml","application/vnd.ctc-posml"],["png","image/png"],["pnm","image/x-portable-anymap"],["portpkg","application/vnd.macports.portpkg"],["pot","application/vnd.ms-powerpoint"],["potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps","application/vnd.ms-powerpoint"],["ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt","application/powerpoint"],["pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["pqa","application/vnd.palm"],["prc","application/x-pilot"],["pre","application/vnd.lotus-freelance"],["prf","application/pics-rules"],["provx","application/provenance+xml"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd","application/x-photoshop"],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["pti","image/prs.pti"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pwn","application/vnd.3m.post-it-notes"],["pya","audio/vnd.ms-playready.media.pya"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qfx","application/vnd.intu.qfx"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qwd","application/vnd.quark.quarkxpress"],["qwt","application/vnd.quark.quarkxpress"],["qxb","application/vnd.quark.quarkxpress"],["qxd","application/vnd.quark.quarkxpress"],["qxl","application/vnd.quark.quarkxpress"],["qxt","application/vnd.quark.quarkxpress"],["ra","audio/x-realaudio"],["ram","audio/x-pn-realaudio"],["raml","application/raml+yaml"],["rapd","application/route-apd+xml"],["rar","application/x-rar"],["ras","image/x-cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["relo","application/p2p-overlay+xml"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["ris","application/x-research-info-systems"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm","audio/x-pn-realaudio"],["rmi","audio/midi"],["rmp","audio/x-pn-realaudio-plugin"],["rms","application/vnd.jcp.javame.midlet-rms"],["rmvb","application/vnd.rn-realmedia-vbr"],["rnc","application/relax-ng-compact-syntax"],["rng","application/xml"],["roa","application/rpki-roa"],["roff","text/troff"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsa","application/x-pkcs7"],["rsat","application/atsc-rsat+xml"],["rsd","application/rsd+xml"],["rsheet","application/urc-ressheet+xml"],["rss","application/rss+xml"],["rtf","text/rtf"],["rtx","text/richtext"],["run","application/x-makeself"],["rusd","application/route-usd+xml"],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["sass","text/x-sass"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm","application/vnd.lotus-screencam"],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["scss","text/x-scss"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkd","application/vnd.solent.sdkm+xml"],["sdkm","application/vnd.solent.sdkm+xml"],["sdp","application/sdp"],["sdw","application/vnd.stardivision.writer"],["sea","application/octet-stream"],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["senmlx","application/senml+xml"],["sensmlx","application/sensml+xml"],["ser","application/java-serialized-object"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sfv","text/x-sfv"],["sgi","image/sgi"],["sgl","application/vnd.stardivision.writer-global"],["sgm","text/sgml"],["sgml","text/sgml"],["sh","application/x-sh"],["shar","application/x-shar"],["shex","text/shex"],["shf","application/shf+xml"],["shtml","text/html"],["sid","image/x-mrsid-image"],["sieve","application/sieve"],["sig","application/pgp-signature"],["sil","audio/silk"],["silo","model/mesh"],["sis","application/vnd.symbian.install"],["sisx","application/vnd.symbian.install"],["sit","application/x-stuffit"],["sitx","application/x-stuffitx"],["siv","application/sieve"],["skd","application/vnd.koan"],["skm","application/vnd.koan"],["skp","application/vnd.koan"],["skt","application/vnd.koan"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slim","text/slim"],["slm","text/slim"],["sls","application/route-s-tsid+xml"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi","application/smil"],["smil","application/smil"],["smv","video/x-smv"],["smzip","application/vnd.stepmania.package"],["snd","audio/basic"],["snf","application/x-font-snf"],["so","application/octet-stream"],["spc","application/x-pkcs7-certificates"],["spdx","text/spdx"],["spf","application/vnd.yamaha.smaf-phrase"],["spl","application/x-futuresplash"],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spx","audio/ogg"],["sql","application/x-sql"],["src","application/x-wais-source"],["srt","application/x-subrip"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["ssdl","application/ssdl+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssml","application/ssml+xml"],["sst","application/octet-stream"],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl","model/stl"],["stpx","model/step+xml"],["stpxz","model/step-xml+zip"],["stpz","model/step+zip"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["styl","text/stylus"],["stylus","text/stylus"],["sub","text/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["susp","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svg","image/svg+xml"],["svgz","image/svg+xml"],["swa","application/x-director"],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["swidtag","application/swid+xml"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t","text/troff"],["t3","application/x-t3vm-image"],["t38","image/t38"],["taglet","application/vnd.mynfc"],["tao","application/vnd.tao.intent-module-archive"],["tap","image/vnd.tencent.tap"],["tar","application/x-tar"],["tcap","application/vnd.3gpp2.tcap"],["tcl","application/x-tcl"],["td","application/urc-targetdesc+xml"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["teicorpus","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text","text/plain"],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tfx","image/tiff-fx"],["tga","image/x-tga"],["tgz","application/x-tar"],["thmx","application/vnd.ms-officetheme"],["tif","image/tiff"],["tiff","image/tiff"],["tk","application/x-tcl"],["tmo","application/vnd.tmobile-livetv"],["toml","application/toml"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","text/troff"],["tra","application/vnd.trueapp"],["trig","application/trig"],["trm","application/x-msterminal"],["ts","video/mp2t"],["tsd","application/timestamped-data"],["tsv","text/tab-separated-values"],["ttc","font/collection"],["ttf","font/ttf"],["ttl","text/turtle"],["ttml","application/ttml+xml"],["twd","application/vnd.simtech-mindmapper"],["twds","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["u8dsn","message/global-delivery-status"],["u8hdr","message/global-headers"],["u8mdn","message/global-disposition-notification"],["u8msg","message/global"],["u32","application/x-authorware-bin"],["ubj","application/ubjson"],["udeb","application/x-debian-package"],["ufd","application/vnd.ufdl"],["ufdl","application/vnd.ufdl"],["ulx","application/x-glulx"],["umj","application/vnd.umajin"],["unityweb","application/vnd.unity"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["urls","text/uri-list"],["usdz","model/vnd.usdz+zip"],["ustar","application/x-ustar"],["utz","application/vnd.uiq.theme"],["uu","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvd","application/vnd.dece.data"],["uvf","application/vnd.dece.data"],["uvg","image/vnd.dece.graphic"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvt","application/vnd.dece.ttml+xml"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["uvva","audio/vnd.dece.audio"],["uvvd","application/vnd.dece.data"],["uvvf","application/vnd.dece.data"],["uvvg","image/vnd.dece.graphic"],["uvvh","video/vnd.dece.hd"],["uvvi","image/vnd.dece.graphic"],["uvvm","video/vnd.dece.mobile"],["uvvp","video/vnd.dece.pd"],["uvvs","video/vnd.dece.sd"],["uvvt","application/vnd.dece.ttml+xml"],["uvvu","video/vnd.uvvu.mp4"],["uvvv","video/vnd.dece.video"],["uvvx","application/vnd.dece.unspecified"],["uvvz","application/vnd.dece.zip"],["uvx","application/vnd.dece.unspecified"],["uvz","application/vnd.dece.zip"],["vbox","application/x-virtualbox-vbox"],["vbox-extpack","application/x-virtualbox-vbox-extpack"],["vcard","text/vcard"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vdi","application/x-virtualbox-vdi"],["vds","model/vnd.sap.vds"],["vhd","application/x-virtualbox-vhd"],["vis","application/vnd.visionary"],["viv","video/vnd.vivo"],["vlc","application/videolan"],["vmdk","application/x-virtualbox-vmdk"],["vob","video/x-ms-vob"],["vor","application/vnd.stardivision.writer"],["vox","application/x-authorware-bin"],["vrml","model/vrml"],["vsd","application/vnd.visio"],["vsf","application/vnd.vsf"],["vss","application/vnd.visio"],["vst","application/vnd.visio"],["vsw","application/vnd.visio"],["vtf","image/vnd.valve.source.texture"],["vtt","text/vtt"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w3d","application/x-director"],["wad","application/x-doom"],["wadl","application/vnd.sun.wadl+xml"],["war","application/java-archive"],["wasm","application/wasm"],["wav","audio/x-wav"],["wax","audio/x-ms-wax"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["wdp","image/vnd.ms-photo"],["weba","audio/webm"],["webapp","application/x-web-app-manifest+json"],["webm","video/webm"],["webmanifest","application/manifest+json"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf","image/wmf"],["wml","text/vnd.wap.wml"],["wmlc","application/wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-msmetafile"],["woff","font/woff"],["woff2","font/woff2"],["word","application/msword"],["wpd","application/vnd.wordperfect"],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wqd","application/vnd.wqd"],["wri","application/x-mswrite"],["wrl","model/vrml"],["wsc","message/vnd.wfa.wsc"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wtb","application/vnd.webturbo"],["wvx","video/x-ms-wvx"],["x3d","model/x3d+xml"],["x3db","model/x3d+fastinfoset"],["x3dbz","model/x3d+binary"],["x3dv","model/x3d-vrml"],["x3dvz","model/x3d+vrml"],["x3dz","model/x3d+xml"],["x32","application/x-authorware-bin"],["x_b","model/vnd.parasolid.transmit.binary"],["x_t","model/vnd.parasolid.transmit.text"],["xaml","application/xaml+xml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xav","application/xcap-att+xml"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm","image/x-xbitmap"],["xca","application/xcap-caps+xml"],["xcs","application/calendar+xml"],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xel","application/xcap-el+xml"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xht","application/xhtml+xml"],["xhtml","application/xhtml+xml"],["xhvml","application/xv+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla","application/vnd.ms-excel"],["xlam","application/vnd.ms-excel.addin.macroEnabled.12"],["xlc","application/vnd.ms-excel"],["xlf","application/xliff+xml"],["xlm","application/vnd.ms-excel"],["xls","application/vnd.ms-excel"],["xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt","application/vnd.ms-excel"],["xltm","application/vnd.ms-excel.template.macroEnabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlw","application/vnd.ms-excel"],["xm","audio/xm"],["xml","application/xml"],["xns","application/xcap-ns+xml"],["xo","application/vnd.olpc-sugar"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpl","application/xproc+xml"],["xpm","image/x-xpixmap"],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xpx","application/vnd.intercon.formnet"],["xsd","application/xml"],["xsl","application/xml"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xul","application/vnd.mozilla.xul+xml"],["xvm","application/xv+xml"],["xvml","application/xv+xml"],["xwd","image/x-xwindowdump"],["xyz","chemical/x-xyz"],["xz","application/x-xz"],["yaml","text/yaml"],["yang","application/yang"],["yin","application/yin+xml"],["yml","text/yaml"],["ymp","text/x-suse-ymp"],["z","application/x-compress"],["z1","application/x-zmachine"],["z2","application/x-zmachine"],["z3","application/x-zmachine"],["z4","application/x-zmachine"],["z5","application/x-zmachine"],["z6","application/x-zmachine"],["z7","application/x-zmachine"],["z8","application/x-zmachine"],["zaz","application/vnd.zzazz.deck+xml"],["zip","application/zip"],["zir","application/vnd.zul"],["zirz","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zsh","text/x-scriptzsh"]]);function 
vendor: 16,874 bytes, lines 505-509
505fc(e,t,n){const r=HJ(e),{webkitRelativePath:i}=e,s=typeof t=="string"?t:typeof i=="string"&&i.length>0?i:`./${e.name}`;return typeof r.path!="string"&&rT(r,"path",s),rT(r,"relativePath",s),r}function HJ(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),i=qJ.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}function rT(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}const GJ=[".DS_Store","Thumbs.db"];function KJ(e){return W(this,void 0,void 0,function*(){return sm(e)&&YJ(e.dataTransfer)?JJ(e.dataTransfer,e.type):QJ(e)?XJ(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?ZJ(e):[]})}function YJ(e){return sm(e)}function QJ(e){return sm(e)&&sm(e.target)}function sm(e){return typeof e=="object"&&e!==null}function XJ(e){return Bx(e.target.files).map(t=>fc(t))}function ZJ(e){return W(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>fc(n))})}function JJ(e,t){return W(this,void 0,void 0,function*(){if(e.items){const n=Bx(e.items).filter(i=>i.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(eee));return iT(YD(r))}return iT(Bx(e.files).map(n=>fc(n)))})}function iT(e){return e.filter(t=>GJ.indexOf(t.name)===-1)}function Bx(e){if(e===null)return[];const t=[];for(let n=0;n<e.length;n++){const r=e[n];t.push(r)}return t}function eee(e){if(typeof e.webkitGetAsEntry!="function")return sT(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?QD(t):sT(e,t)}function YD(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?YD(n):[n]],[])}function sT(e,t){return W(this,void 0,void 0,function*(){var n;if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle=="function"){const s=yield e.getAsFileSystemHandle();if(s===null)throw new Error(`${e} is not a File`);if(s!==void 0){const o=yield s.getFile();return o.handle=s,fc(o)}}const r=e.getAsFile();if(!r)throw new Error(`${e} is not a File`);return fc(r,(n=t==null?void 0:t.fullPath)!==null&&n!==void 0?n:void 0)})}function tee(e){return W(this,void 0,void 0,function*(){return e.isDirectory?QD(e):nee(e)})}function QD(e){const t=e.createReader();return new Promise((n,r)=>{const i=[];function s(){t.readEntries(o=>W(this,void 0,void 0,function*(){if(o.length){const a=Promise.all(o.map(tee));i.push(a),s()}else try{const a=yield Promise.all(i);n(a)}catch(a){r(a)}}),o=>{r(o)})}s()})}function nee(e){return W(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(r=>{const i=fc(r,e.fullPath);t(i)},r=>{n(r)})})})}var vy=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var r=e.name||"",i=(e.type||"").toLowerCase(),s=i.replace(/\/.*$/,"");return n.some(function(o){var a=o.trim().toLowerCase();return a.charAt(0)==="."?r.toLowerCase().endsWith(a):a.endsWith("/*")?s===a.replace(/\/.*$/,""):i===a})}return!0};function oT(e){return see(e)||iee(e)||ZD(e)||ree()}function ree(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
506In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function iee(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function see(e){if(Array.isArray(e))return Wx(e)}function aT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function lT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aT(Object(n),!0).forEach(function(r){XD(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function XD(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nd(e,t){return lee(e)||aee(e,t)||ZD(e,t)||oee()}function oee(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
507In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ZD(e,t){if(e){if(typeof e=="string")return Wx(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Wx(e,t)}}function Wx(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function aee(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,s=!1,o,a;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(r.push(o.value),!(t&&r.length===t));i=!0);}catch(l){s=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(s)throw a}}return r}}function lee(e){if(Array.isArray(e))return e}var cee=typeof vy=="function"?vy:vy.default,uee="file-invalid-type",dee="file-too-large",fee="file-too-small",hee="too-many-files",pee=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=t.split(","),r=n.length>1?"one of ".concat(n.join(", ")):n[0];return{code:uee,message:"File type must be ".concat(r)}},cT=function(t){return{code:dee,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},uT=function(t){return{code:fee,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},mee={code:hee,message:"Too many files"};function JD(e,t){var n=e.type==="application/x-moz-file"||cee(e,t);return[n,n?null:pee(t)]}function eM(e,t,n){if(ea(e.size))if(ea(t)&&ea(n)){if(e.size>n)return[!1,cT(n)];if(e.size<t)return[!1,uT(t)]}else{if(ea(t)&&e.size<t)return[!1,uT(t)];if(ea(n)&&e.size>n)return[!1,cT(n)]}return[!0,null]}function ea(e){return e!=null}function gee(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,s=e.multiple,o=e.maxFiles,a=e.validator;return!s&&t.length>1||s&&o>=1&&t.length>o?!1:t.every(function(l){var u=JD(l,n),d=Nd(u,1),f=d[0],h=eM(l,r,i),p=Nd(h,1),g=p[0],v=a?a(l):null;return f&&g&&!v})}function om(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function xh(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function dT(e){e.preventDefault()}function vee(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function yee(e){return e.indexOf("Edge/")!==-1}function xee(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return vee(e)||yee(e)}function yi(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];return t.some(function(a){return!om(r)&&a&&a.apply(void 0,[r].concat(s)),om(r)})}}function wee(){return"showOpenFilePicker"in window}function bee(e){if(ea(e)){var t=Object.entries(e).filter(function(n){var r=Nd(n,2),i=r[0],s=r[1],o=!0;return tM(i)||(console.warn('Skipped "'.concat(i,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),o=!1),(!Array.isArray(s)||!s.every(nM))&&(console.warn('Skipped "'.concat(i,'" because an invalid file extension was provided.')),o=!1),o}).reduce(function(n,r){var i=Nd(r,2),s=i[0],o=i[1];return lT(lT({},n),{},XD({},s,o))},{});return[{description:"Files",accept:t}]}return e}function _ee(e){if(ea(e))return Object.entries(e).reduce(function(t,n){var r=Nd(n,2),i=r[0],s=r[1];return[].concat(oT(t),[i],oT(s))},[]).filter(function(t){return tM(t)||nM(t)}).join(",")}function See(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function Eee(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function tM(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function nM(e){return/^.*\.[\w]+$/.test(e)}var kee=["children"],Cee=["open"],Tee=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],jee=["refKey","onChange","onClick"];function Pee(e){return Iee(e)||Ree(e)||rM(e)||Nee()}function Nee(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
508In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ree(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Iee(e){if(Array.isArray(e))return qx(e)}function yy(e,t){return Dee(e)||Oee(e,t)||rM(e,t)||Aee()}function Aee(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
509In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rM(e,t){if(e){if(typeof e=="string")return qx(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qx(e,t)}}function qx(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Oee(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,s=!1,o,a;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(r.push(o.value),!(t&&r.length===t));i=!0);}catch(l){s=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(s)throw a}}return r}}function Dee(e){if(Array.isArray(e))return e}function fT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ft(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fT(Object(n),!0).forEach(function(r){Hx(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Hx(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function am(e,t){if(e==null)return{};var n=Mee(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Mee(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var H_=m.forwardRef(function(e,t){var n=e.children,r=am(e,kee),i=G_(r),s=i.open,o=am(i,Cee);return m.useImperativeHandle(t,function(){return{open:s}},[s]),F.createElement(m.Fragment,null,n(ft(ft({},o),{},{open:s})))});H_.displayName="Dropzone";var iM={disabled:!1,getFilesFromEvent:KJ,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};H_.defaultProps=iM;H_.propTypes={children:tt.func,accept:tt.objectOf(tt.arrayOf(tt.string)),multiple:tt.bool,preventDropOnDocument:tt.bool,noClick:tt.bool,noKeyboard:tt.bool,noDrag:tt.bool,noDragEventsBubbling:tt.bool,minSize:tt.number,maxSize:tt.number,maxFiles:tt.number,disabled:tt.bool,getFilesFromEvent:tt.func,onFileDialogCancel:tt.func,onFileDialogOpen:tt.func,useFsAccessApi:tt.bool,autoFocus:tt.bool,onDragEnter:tt.func,onDragLeave:tt.func,onDragOver:tt.func,onDrop:tt.func,onDropAccepted:tt.func,onDropRejected:tt.func,onError:tt.func,validator:tt.func};var Gx={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function G_(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=ft(ft({},iM),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,s=t.maxSize,o=t.minSize,a=t.multiple,l=t.maxFiles,u=t.onDragEnter,d=t.onDragLeave,f=t.onDragOver,h=t.onDrop,p=t.onDropAccepted,g=t.onDropRejected,v=t.onFileDialogCancel,w=t.onFileDialogOpen,y=t.useFsAccessApi,x=t.autoFocus,b=t.preventDropOnDocument,_=t.noClick,S=t.noKeyboard,E=t.noDrag,k=t.noDragEventsBubbling,C=t.onError,P=t.validator,T=m.useMemo(function(){return _ee(n)},[n]),N=m.useMemo(function(){return bee(n)},[n]),I=m.useMemo(function(){return typeof w=="function"?w:hT},[w]),O=m.useMemo(function(){return typeof v=="function"?v:hT},[v]),j=m.useRef(null),A=m.useRef(null),V=m.useReducer(Lee,Gx),$=yy(V,2),R=$[0],L=$[1],H=R.isFocused,z=R.isFileDialogActive,Q=m.useRef(typeof window<"u"&&window.isSecureContext&&y&&wee()),de=function(){!Q.current&&z&&setTimeout(function(){if(A.current){var J=A.current.files;J.length||(L({type:"closeDialog"}),O())}},300)};m.useEffect(function(){return window.addEventListener("focus",de,!1),function(){window.removeEventListener("focus",de,!1)}},[A,z,O,Q]);var ne=m.useRef([]),ye=function(J){j.current&&j.current.contains(J.target)||(J.preventDefault(),ne.current=[])};m.useEffect(function(){return b&&(document.addEventListener("dragover",dT,!1),document.addEventListener("drop",ye,!1)),function(){b&&(document.removeEventListener("dragover",dT),document.removeEventListener("drop",ye))}},[j,b]),m.useEffect(function(){return!r&&x&&j.current&&j.current.focus(),function(){}},[j,x,r]);var he=m.useCallback(function(G){C?C(G):console.error(G)},[C]),Pe=m.useCallback(function(G){G.preventDefault(),G.persist(),B(G),ne.current=[].concat(Pee(ne.current),[G.target]),xh(G)&&Promise.resolve(i(G)).then(function(J){if(!(om(G)&&!k)){var je=J.length,Se=je>0&&gee({files:J,accept:T,minSize:o,maxSize:s,multiple:a,maxFiles:l,validator:P}),nt=je>0&&!Se;L({isDragAccept:Se,isDragReject:nt,isDragActive:!0,type:"setDraggedFiles"}),u&&u(G)}}).catch(function(J){return he(J)})},[i,u,he,k,T,o,s,a,l,P]),Ue=m.useCallback(function(G){G.preventDefault(),G.persist(),B(G);var J=xh(G);if(J&&G.dataTransfer)try{G.dataTransfer.dropEffect="copy"}catch{}return J&&f&&f(G),!1},[f,k]),Ae=m.useCallback(function(G){G.preventDefault(),G.persist(),B(G);var J=ne.current.filter(function(Se){return j.current&&j.current.contains(Se)}),je=J.indexOf(G.target);je!==-1&&J.splice(je,1),ne.current=J,!(J.length>0)&&(L({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),xh(G)&&d&&d(G))},[j,d,k]),Fe=m.useCallback(function(G,J){var je=[],Se=[];G.forEach(function(nt){var Jt=JD(nt,T),bn=yy(Jt,2),_n=bn[0],$r=bn[1],Ur=eM(nt,o,s),mi=yy(Ur,2),yr=mi[0],Fn=mi[1],zo=P?P(nt):null;if(_n&&yr&&!zo)je.push(nt);else{var ee=[$r,Fn];zo&&(ee=ee.concat(zo)),Se.push({file:nt,errors:ee.filter(function(ve){return ve})})}}),(!a&&je.length>1||a&&l>=1&&je.length>l)&&(je.forEach(function(nt){Se.push({file:nt,errors:[mee]})}),je.splice(0)),L({acceptedFiles:je,fileRejections:Se,isDragReject:Se.length>0,type:"setFiles"}),h&&h(je,Se,J),Se.length>0&&g&&g(Se,J),je.length>0&&p&&p(je,J)},[L,a,T,o,s,l,h,p,g,P]),wt=m.useCallback(function(G){G.preventDefault(),G.persist(),B(G),ne.current=[],xh(G)&&Promise.resolve(i(G)).then(function(J){om(G)&&!k||Fe(J,G)}).catch(function(J){return he(J)}),L({type:"reset"})},[i,Fe,he,k]),jt=m.useCallback(function(){if(Q.current){L({type:"openDialog"}),I();var G={multiple:a,types:N};window.showOpenFilePicker(G).then(function(J){return i(J)}).then(function(J){Fe(J,null),L({type:"closeDialog"})}).catch(function(J){See(J)?(O(J),L({type:"closeDialog"})):Eee(J)?(Q.current=!1,A.current?(A.current.value=null,A.current.click()):he(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):he(J)});return}A.current&&(L({type:"openDialog"}),I(),A.current.value=null,A.current.click())},[L,I,O,y,Fe,he,N,a]),xe=m.useCallback(function(G){!j.current||!j.current.isEqualNode(G.target)||(G.key===" "||G.key==="Enter"||G.keyCode===32||G.keyCode===13)&&(G.preventDefault(),jt())},[j,jt]),qt=m.useCallback(function(){L({type:"focus"})},[]),Fr=m.useCallback(function(){L({type:"blur"})},[]),ln=m.useCallback(function(){_||(xee()?setTimeout(jt,0):jt())},[_,jt]),er=function(J){return r?null:J},D=function(J){return S?null:er(J)},U=function(J){return E?null:er(J)},B=function(J){k&&J.stopPropagation()},ae=m.useMemo(function(){return function(){var G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},J=G.refKey,je=J===void 0?"ref":J,Se=G.role,nt=G.onKeyDown,Jt=G.onFocus,bn=G.onBlur,_n=G.onClick,$r=G.onDragEnter,Ur=G.onDragOver,mi=G.onDragLeave,yr=G.onDrop,Fn=am(G,Tee);return ft(ft(Hx({onKeyDown:D(yi(nt,xe)),onFocus:D(yi(Jt,qt)),onBlur:D(yi(bn,Fr)),onClick:er(yi(_n,ln)
509),onDragEnter:U(yi($r,Pe)),onDragOver:U(yi(Ur,Ue)),onDragLeave:U(yi(mi,Ae)),onDrop:U(yi(yr,wt)),role:typeof Se=="string"&&Se!==""?Se:"presentation"},je,j),!r&&!S?{tabIndex:0}:{}),Fn)}},[j,xe,qt,Fr,ln,Pe,Ue,Ae,wt,S,E,r]),re=m.useCallback(function(G){G.stopPropagation()},[]),X=m.useMemo(function(){return function(){var G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},J=G.refKey,je=J===void 0?"ref":J,Se=G.onChange,nt=G.onClick,Jt=am(G,jee),bn=Hx({accept:T,multiple:a,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:er(yi(Se,wt)),onClick:er(yi(nt,re)),tabIndex:-1},je,A);return ft(ft({},bn),Jt)}},[A,n,a,wt,r]);return ft(ft({},R),{},{isFocused:H&&!r,getRootProps:ae,getInputProps:X,rootRef:j,inputRef:A,open:er(jt)})}function Lee(e,t){switch(t.type){case"focus":return ft(ft({},e),{},{isFocused:!0});case"blur":return ft(ft({},e),{},{isFocused:!1});case"openDialog":return ft(ft({},Gx),{},{isFileDialogActive:!0});case"closeDialog":return ft(ft({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return ft(ft({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return ft(ft({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return ft({},Gx);default:return e}}function hT(){}const Fee=({selectedFiles:e,imagePreviews:t,onFileChange:n,onRemoveFile:r,maxFiles:i})=>{const s=m.useCallback(u=>{n({target:{files:u}})},[n]),{getRootProps:o,getInputProps:a,isDragActive:l}=G_({onDrop:s,accept:{"image/*":[".jpeg",".png",".jpg",".gif",".webp"]},maxFiles:i-e.length,disabled:e.length>=i});return c.jsxs("div",{children:[c.jsxs("div",{...o(),className:`border-2 border-dashed rounded-md p-6 pt-6 pb-4 sm:pt-6 sm:pb-4 relative transition-colors cursor-pointer min-h-[120px] sm:min-h-[140px] ${l?"border-primary bg-primary/10":"border-gray-600 hover:border-primary/50 bg-gray-800/30"}`,children:[c.jsx("input",{...a(),id:"demo-image-upload",multiple:!0,capture:"environment",accept:"image/*"}),c.jsx("div",{className:"text-center",children:l?c.jsx("p",{className:"text-sm text-primary",children:"Drop photos here to upload"}):c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"text-sm font-medium text-gray-200",children:"Drag & drop photos here, or tap to select"}),c.jsxs("p",{className:"text-xs text-gray-400 mt-2",children:["Take a photo or choose from gallery (max ",i," photos)"]})]})})]}),e.length>0&&c.jsxs("div",{className:"mt-4",children:[c.jsx(Co,{htmlFor:"demo-image-upload",className:"text-sm font-medium text-gray-200",children:"Selected Photos:"}),c.jsx("div",{className:"mt-2 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:t.map((u,d)=>c.jsxs("div",{className:"relative group",children:[c.jsx("div",{className:"aspect-square overflow-hidden rounded-md border border-gray-600",children:c.jsx("img",{src:u,alt:`Preview ${d+1}`,className:"h-full w-full object-cover transition-transform group-hover:scale-105"})}),c.jsx(ie,{type:"button",variant:"ghost",size:"icon",onClick:()=>r(d),className:"absolute -top-2 -right-2 h-8 w-8 sm:h-6 sm:w-6 rounded-full bg-gray-800 shadow-lg hover:bg-red-600 hover:text-white border border-gray-600 touch-manipulation text-gray-200",children:c.jsx(Di,{className:"h-4 w-4 sm:h-3 sm:w-3"})})]},d))})]})]})},$ee=({ingredients:e,imagePreviews:t})=>{const[n,r]=m.useState(0),i=()=>{r(a=>(a+1)%t.length)},s=()=>{r(a=>(a-1+t.length)%t.length)},o=e.reduce((a,l,u)=>(a[l.category]||(a[l.category]=[]),a[l.category].push({...l,originalIndex:u}),a),{});return c.jsxs("div",{className:"space-y-6",children:[t.length>0&&c.jsxs("div",{children:[t.length>1&&c.jsxs("div",{className:"flex justify-between items-center mb-3",children:[c.jsx(ie,{variant:"ghost",size:"default",onClick:s,disabled:t.length<=1,className:"h-11 w-11 sm:h-9 sm:w-9 p-0 touch-manipulation",children:c.jsx(yA,{className:"h-5 w-5 sm:h-4 sm:w-4"})}),c.jsxs("span",{className:"text-sm text-gray-400 px-2 text-center",children:["Photo ",n+1," of ",t.length]}),c.jsx(ie,{variant:"ghost",size:"default",onClick:i,disabled:t.length<=1,className:"h-11 w-11 sm:h-9 sm:w-9 p-0 touch-manipulation",children:c.jsx(d_,{className:"h-5 w-5 sm:h-4 sm:w-4"})})]}),c.jsx("div",{className:"aspect-video overflow-hidden rounded-lg border border-gray-600 max-w-md mx-auto",children:c.jsx("img",{src:t[n],alt:`Uploaded photo ${n+1}`,className:"w-full h-full object-cover"})})]}),c.jsx("div",{children:c.jsx("div",{className:"space-y-4",children:Object.entries(o).map(([a,l])=>c.jsx(di,{className:"border-gray-600 bg-gray-800/30 shadow-lg",children:c.jsxs(fi,{className:"p-4 sm:p-6",children:[c.jsx("h4",{className:"font-medium text-sm text-primary mb-3",children:a}),c.jsx("div",{className:"space-y-3",children:l.map((u,d)=>c.jsxs("div",{className:"flex items-center justify-between p-3 sm:p-2 rounded-md bg-gray-700/50 hover:bg-gray-700/70 transition-colors min-h-[44px]",children:[c.jsx("div",{className:"flex-1",children:c.jsx("span",{className:"font-medium text-sm text-gray-200",children:u.name})}),c.jsxs("div",{className:"text-sm text-gray-400 ml-2",children:[u.quantity," ",u.unit]})]},d))})]})},a))})})]})},Uee=({onOpenAuth:e})=>{const[t,n]=m.useState("upload"),[r,i]=m.useState([]),[s,o]=m.useState([]),[a,l]=m.useState([]),[u,d]=m.useState(""),f=()=>{const b=Date.now(),_=60*60*1e3,S=2;
509try{const E=localStorage.getItem("demoUploads");let k=E?JSON.parse(E):[];k=k.filter(P=>b-P<_),localStorage.setItem("demoUploads",JSON.stringify(k));const C=Math.max(0,S-k.length);return{allowed:k.length<S,remaining:C}}catch(E){return console.error("Error checking rate limit:",E),{allowed:!0,remaining:S}}},h=()=>{try{const b=Date.now(),_=localStorage.getItem("demoUploads"),S=_?JSON.parse(_):[];S.push(b),localStorage.setItem("demoUploads",JSON.stringify(S)),console.log(`Demo upload recorded at ${new Date(b).toISOString()}`);try{const E=localStorage.getItem("demoStats"),k=E?JSON.parse(E):{totalAttempts:0,lastUsed:null};k.totalAttempts+=1,k.lastUsed=b,localStorage.setItem("demoStats",JSON.stringify(k))}catch(E){console.error("Error updating demo stats:",E)}}catch(b){console.error("Error recording upload:",b)}},p=b=>{const _=Array.from(b.target.files||[]);if(_.length===0)return;n("upload"),d(""),l([]),i(_);const S=_.map(E=>URL.createObjectURL(E));o(S)},g=b=>{const _=r.filter((E,k)=>k!==b),S=s.filter((E,k)=>k!==b);URL.revokeObjectURL(s[b]),i(_),o(S),_.length===0&&(n("upload"),l([]),d(""))},v=async()=>{if(r.length===0)return;if(!f().allowed){d("You've reached the demo limit (2 uploads per hour). Please try again later or create a free account for unlimited usage."),n("error");return}n("processing"),d(""),h();try{const _=await MJ(r);if(!_.success)throw new Error(_.error||"Failed to detect ingredients");if(_.noFoodDetected){n("no-food");return}if(_.detectedIngredients&&_.detectedIngredients.length>0){l(_.detectedIngredients),n("results");try{const S=localStorage.getItem("demoStats"),E=S?JSON.parse(S):{totalAttempts:0,successfulDetections:0};E.successfulDetections=(E.successfulDetections||0)+1,localStorage.setItem("demoStats",JSON.stringify(E))}catch(S){console.error("Error updating success stats:",S)}}else n("no-food")}catch(_){console.error("Error detecting ingredients:",_),d("Failed to detect ingredients. Please try again."),n("error")}},w=()=>{try{const b=localStorage.getItem("demoStats"),_=b?JSON.parse(b):{conversionAttempts:0};_.conversionAttempts=(_.conversionAttempts||0)+1,localStorage.setItem("demoStats",JSON.stringify(_)),console.log("Demo-to-signup conversion attempt tracked")}catch(b){console.error("Error tracking conversion:",b)}e("signup")},y=()=>{n("upload"),i([]),o([]),l([]),d("")},x=()=>{switch(t){case"upload":return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:c.jsx(uc,{className:"h-8 w-8 text-primary"})}),c.jsx("h3",{className:"text-xl font-semibold mb-2 text-primary",children:"Try MealMuse"}),c.jsx("p",{className:"text-gray-300",children:"Upload photos of your ingredients or a grocery receipt"})]}),c.jsx(Fee,{selectedFiles:r,imagePreviews:s,onFileChange:p,onRemoveFile:g,maxFiles:3}),r.length>0&&c.jsxs("div",{className:"text-center space-y-2",children:[c.jsxs(ie,{onClick:v,size:"lg",className:"bg-primary hover:bg-primary/90 text-white h-12 px-6 touch-manipulation",children:[c.jsx(TA,{className:"h-5 w-5 mr-2"}),"Detect Ingredients"]}),(()=>{const E=f();return E.remaining<2&&c.jsxs("p",{className:"text-xs text-gray-400",children:[E.remaining," demo upload",E.remaining!==1?"s":""," remaining this hour"]})})()]})]});case"processing":return c.jsxs("div",{className:"text-center py-12",children:[c.jsx(Wt,{className:"h-12 w-12 animate-spin text-primary mx-auto mb-4"}),c.jsx("h3",{className:"text-xl font-semibold mb-2 text-primary",children:"Analyzing Your Photos"}),c.jsx("p",{className:"text-gray-300",children:"MealMuse is identifying ingredients in your photos..."})]});case"results":return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"text-center",children:[c.jsx("h3",{className:"text-xl font-semibold mb-2 text-primary",children:"Ingredients Detected!"}),c.jsx("p",{className:"text-gray-300",children:"Here's what we found in your photos"})]}),c.jsx($ee,{ingredients:a,imagePreviews:s}),c.jsxs("div",{className:"text-center space-y-3",children:[c.jsxs(ie,{onClick:w,size:"lg",className:"bg-primary hover:bg-primary/90 text-white h-12 px-6 touch-manipulation",children:[c.jsx(Yp,{className:"h-5 w-5 mr-2"}),"Generate Recipes"]}),c.jsx("p",{className:"text-sm text-muted-foreground px-4",children:"Create a free account to generate personalized recipes"})]})]});case"no-food":const b=["We don't recommend you eat that! 🤔","That's not food! 😅","Hmm, we couldn't find any ingredients in your photo. Try a photo of your fridge or pantry! 🍎","Our AI is good, but we can't make ingredients out of thin air! 🪄","No food detected - maybe tr
509y a different angle? 📸","That photo looks great, but we need to see some food! 🥕"],_=b[Math.floor(Math.random()*b.length)];return c.jsxs("div",{className:"text-center py-12",children:[c.jsx("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-orange-100 flex items-center justify-center",children:c.jsx(uc,{className:"h-8 w-8 text-orange-600"})}),c.jsx("h3",{className:"text-xl font-semibold mb-2 text-primary",children:"No Ingredients Found"}),c.jsx("p",{className:"text-muted-foreground mb-4",children:_}),c.jsx(ie,{onClick:y,variant:"outline",size:"lg",className:"h-12 px-6 touch-manipulation",children:"Try Different Photo"})]});case"error":const S=u==null?void 0:u.includes("demo limit");return c.jsxs("div",{className:"text-center py-12",children:[c.jsx("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-red-100 flex items-center justify-center",children:c.jsx(p_,{className:"h-8 w-8 text-red-600"})}),c.jsx("h3",{className:"text-xl font-semibold mb-2 text-primary",children:"Detection Failed"}),c.jsx("p",{className:"text-gray-300 mb-4",children:u||"Sorry, we couldn't detect ingredients from your photos."}),S?c.jsx(ie,{onClick:w,size:"lg",className:"bg-primary hover:bg-primary/90 text-white h-12 px-6 touch-manipulation",children:"Sign Up for Free"}):c.jsx(ie,{onClick:y,variant:"outline",size:"lg",className:"h-12 px-6 touch-manipulation",children:"Try Again"})]});default:return null}};return c.jsx("section",{className:"py-12 sm:py-16 bg-gradient-to-b from-gray-950 via-black to-gray-900 text-white",children:c.jsxs("div",{className:"container px-4 max-w-4xl mx-auto",children:[c.jsxs("div",{className:"text-center mb-8 sm:mb-12",children:[c.jsx("span",{className:"inline-block py-1.5 px-4 text-sm font-medium bg-primary/10 text-primary rounded-full shadow-sm flex items-center gap-1.5 mx-auto w-fit",children:"Try It Now"}),c.jsx("h2",{className:"mt-5 text-3xl sm:text-4xl font-display font-bold text-white",children:"See MealMuse in Action"}),c.jsx("p",{className:"mt-4 text-lg text-gray-300 max-w-2xl mx-auto leading-relaxed",children:"Snap a photo of your ingredients or grocery receipt, and instantly identify everything for your next delicious meal."})]}),c.jsx(di,{className:"overflow-hidden border-gray-700 bg-gray-800/50 backdrop-blur-sm shadow-xl",children:c.jsx(fi,{className:"p-6 sm:p-8",children:x()})})]})})},K_=m.createContext({});function Ig(e){const t=m.useRef(null);return t.current===null&&(t.current=e()),t.current}const Y_=typeof window<"u",Q_=Y_?m.useLayoutEffect:m.useEffect,Ag=m.createContext(null);function X_(e,t){e.indexOf(t)===-1&&e.push(t)}function Z_(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Li=(e,t,n)=>n>t?t:n<e?e:n;let hc=()=>{};const vs={},sM=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function oM(e){return typeof e=="object"&&e!==null}const aM=e=>/^0[^.\s]+$/u.test(e);function J_(e){let t;return()=>(t===void 0&&(t=e()),t)}const Zn=e=>e,Vee=(e,t)=>n=>t(e(n)),_f=(...e)=>e.reduce(Vee),pc=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class e1{constructor(){this.subscriptions=[]}add(t){return X_(this.subscriptions,t),()=>Z_(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let s=0;s<i;s++){const o=this.subscriptions[s];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Ri=e=>e*1e3,Ii=e=>e/1e3;function t1(e,t){return t?e*(1e3/t):0}const lM=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,zee=1e-7,Bee=12;function Wee(e,t,n,r,i){let s,o,a=0;do o=t+(n-t)/2,s=lM(o,r,i)-e,s>0?n=o:t=o;while(Math.abs(s)>zee&&++a<Bee);return o}function Sf(e,t,n,r){if(e===t&&n===r)return Zn;const i=s=>Wee(s,0,1,e,n);return s=>s===0||s===1?s:lM(i(s),t,r)}const cM=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,uM=e=>t=>1-e(1-t),dM=Sf(.33,1.53,.69,.99),n1=uM(dM),fM=cM(n1),hM=e=>(e*=2)<1?.5*n1(e):.5*(2-Math.pow(2,-10*(e-1))),r1=e=>1-Math.sin(Math.acos(e)),pM=uM(r1),mM=cM(r1),qee=Sf(.42,0,1,1),Hee=Sf(0,0,.58,1),gM=Sf(.42,0,.58,1),Gee=e=>Array.isArray(e)&&typeof e[0]!="number",vM=e=>Array.isArray(e)&&typeof e[0]=="number",pT={linear:Zn,easeIn:qee,easeInOut:gM,easeOut:Hee,circIn:r1,circInOut:mM,circOut:pM,backIn:n1,backInOut:fM,backOut:dM,anticipate:hM},Kee=e=>typeof e=="string",mT=e=>{if(vM(e)){hc(e.length===4);const[t,n,r,i]=e;return Sf(t,n,r,i)}else if(Kee(e))return hc(pT[e]!==void 0),pT[e];return e},wh=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],gT={value:null,addProjectionMetrics:null};function Yee(e,t){let n=new Set,r=new Set,i=!1,s=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;
vendor: 5,579 bytes, line 509
509function u(f){o.has(f)&&(d.schedule(f),e()),l++,f(a)}const d={schedule:(f,h=!1,p=!1)=>{const v=p&&i?n:r;return h&&o.add(f),v.has(f)||v.add(f),f},cancel:f=>{r.delete(f),o.delete(f)},process:f=>{if(a=f,i){s=!0;return}i=!0,[n,r]=[r,n],n.forEach(u),t&&gT.value&&gT.value.frameloop[t].push(l),l=0,n.clear(),i=!1,s&&(s=!1,d.process(f))}};return d}const Qee=40;function yM(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=wh.reduce((b,_)=>(b[_]=Yee(s,t?_:void 0),b),{}),{setup:a,read:l,resolveKeyframes:u,preUpdate:d,update:f,preRender:h,render:p,postRender:g}=o,v=()=>{const b=vs.useManualTiming?i.timestamp:performance.now();n=!1,vs.useManualTiming||(i.delta=r?1e3/60:Math.max(Math.min(b-i.timestamp,Qee),1)),i.timestamp=b,i.isProcessing=!0,a.process(i),l.process(i),u.process(i),d.process(i),f.process(i),h.process(i),p.process(i),g.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(v))},w=()=>{n=!0,r=!0,i.isProcessing||e(v)};return{schedule:wh.reduce((b,_)=>{const S=o[_];return b[_]=(E,k=!1,C=!1)=>(n||w(),S.schedule(E,k,C)),b},{}),cancel:b=>{for(let _=0;_<wh.length;_++)o[wh[_]].cancel(b)},state:i,steps:o}}const{schedule:Je,cancel:Fi,state:Gt,steps:xy}=yM(typeof requestAnimationFrame<"u"?requestAnimationFrame:Zn,!0);let np;function Xee(){np=void 0}const Kn={now:()=>(np===void 0&&Kn.set(Gt.isProcessing||vs.useManualTiming?Gt.timestamp:performance.now()),np),set:e=>{np=e,queueMicrotask(Xee)}},xM=e=>t=>typeof t=="string"&&t.startsWith(e),i1=xM("--"),Zee=xM("var(--"),s1=e=>Zee(e)?Jee.test(e.split("/*")[0].trim()):!1,Jee=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,zc={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Rd={...zc,transform:e=>Li(0,1,e)},bh={...zc,default:1},Wu=e=>Math.round(e*1e5)/1e5,o1=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function ete(e){return e==null}const tte=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,a1=(e,t)=>n=>!!(typeof n=="string"&&tte.test(n)&&n.startsWith(e)||t&&!ete(n)&&Object.prototype.hasOwnProperty.call(n,t)),wM=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,s,o,a]=r.match(o1);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},nte=e=>Li(0,255,e),wy={...zc,transform:e=>Math.round(nte(e))},ia={test:a1("rgb","red"),parse:wM("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+wy.transform(e)+", "+wy.transform(t)+", "+wy.transform(n)+", "+Wu(Rd.transform(r))+")"};function rte(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const Kx={test:a1("#"),parse:rte,transform:ia.transform},Ef=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Is=Ef("deg"),Ai=Ef("%"),ke=Ef("px"),ite=Ef("vh"),ste=Ef("vw"),vT={...Ai,parse:e=>Ai.parse(e)/100,transform:e=>Ai.transform(e*100)},_l={test:a1("hsl","hue"),parse:wM("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Ai.transform(Wu(t))+", "+Ai.transform(Wu(n))+", "+Wu(Rd.transform(r))+")"},Dt={test:e=>ia.test(e)||Kx.test(e)||_l.test(e),parse:e=>ia.test(e)?ia.parse(e):_l.test(e)?_l.parse(e):Kx.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ia.transform(e):_l.transform(e),getAnimatableNone:e=>{const t=Dt.parse(e);return t.alpha=0,Dt.transform(t)}},ote=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function ate(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(o1))==null?void 0:t.length)||0)+(((n=e.match(ote))==null?void 0:n.length)||0)>0}const bM="number",_M="color",lte="var",cte="var(",yT="${}",ute=/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 Id(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const a=t.replace(ute,l=>(Dt.test(l)?(r.color.push(s),i.push(_M),n.push(Dt.parse(l))):l.startsWith(cte)?(r.var.push(s),i.push(lte),n.push(l)):(r.number.push(s),i.push(bM),n.push(parseFloat(l))),++s,yT)).split(yT);return{values:n,split:a,indexes:r,types:i}}function SM(e){return Id(e).values}function EM(e){const{split:t,types:n}=Id(e),r=t.length;return i=>{let s="";for(let o=0;o<r;o++)if(s+=t[o],i[o]!==void 0){const a=n[o];a===bM?s+=Wu(i[o]):a===_M?s+=Dt.transform(i[o]):s+=i[o]}return s}}const dte=e=>typeof e=="number"?0:Dt.test(e)?Dt.getAnimatableNone(e):e;function fte(e){const t=SM(e);return EM(e)(t.map(dte))}const To={test:ate,parse:SM,createTransformer:EM,getAnimatableNone:fte};function by(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 hte({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,s=0,o=0;if(!t)i=s=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;i=by(l,a,e+1/3),s=by(l,a,e),o=by(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}function lm(e,t){return n=>n>0?t:e}const vt=(e,t,n)=>e+(t-e)*n,_y=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},pte=[Kx,ia,_l],mte=e=>pte.find(t=>t.test(e));function xT(e){const t=mte(e);
vendor: 15,528 bytes, line 509
509if(!t)return!1;let n=t.parse(e);return t===_l&&(n=hte(n)),n}const wT=(e,t)=>{const n=xT(e),r=xT(t);if(!n||!r)return lm(e,t);const i={...n};return s=>(i.red=_y(n.red,r.red,s),i.green=_y(n.green,r.green,s),i.blue=_y(n.blue,r.blue,s),i.alpha=vt(n.alpha,r.alpha,s),ia.transform(i))},Yx=new Set(["none","hidden"]);function gte(e,t){return Yx.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function vte(e,t){return n=>vt(e,t,n)}function l1(e){return typeof e=="number"?vte:typeof e=="string"?s1(e)?lm:Dt.test(e)?wT:wte:Array.isArray(e)?kM:typeof e=="object"?Dt.test(e)?wT:yte:lm}function kM(e,t){const n=[...e],r=n.length,i=e.map((s,o)=>l1(s)(s,t[o]));return s=>{for(let o=0;o<r;o++)n[o]=i[o](s);return n}}function yte(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=l1(e[i])(e[i],t[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function xte(e,t){const n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const s=t.types[i],o=e.indexes[s][r[s]],a=e.values[o]??0;n[i]=a,r[s]++}return n}const wte=(e,t)=>{const n=To.createTransformer(t),r=Id(e),i=Id(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Yx.has(e)&&!i.values.length||Yx.has(t)&&!r.values.length?gte(e,t):_f(kM(xte(r,i),i.values),n):lm(e,t)};function CM(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?vt(e,t,n):l1(e)(e,t)}const bte=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Je.update(t,n),stop:()=>Fi(t),now:()=>Gt.isProcessing?Gt.timestamp:Kn.now()}},TM=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let s=0;s<i;s++)r+=Math.round(e(s/(i-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},cm=2e4;function c1(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<cm;)t+=n,r=e.next(t);return t>=cm?1/0:t}function _te(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(c1(r),cm);return{type:"keyframes",ease:s=>r.next(i*s).value/t,duration:Ii(i)}}const Ste=5;function jM(e,t,n){const r=Math.max(t-Ste,0);return t1(n-e(r),t-r)}const kt={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},Sy=.001;function Ete({duration:e=kt.duration,bounce:t=kt.bounce,velocity:n=kt.velocity,mass:r=kt.mass}){let i,s,o=1-t;o=Li(kt.minDamping,kt.maxDamping,o),e=Li(kt.minDuration,kt.maxDuration,Ii(e)),o<1?(i=u=>{const d=u*o,f=d*e,h=d-n,p=Qx(u,o),g=Math.exp(-f);return Sy-h/p*g},s=u=>{const f=u*o*e,h=f*n+n,p=Math.pow(o,2)*Math.pow(u,2)*e,g=Math.exp(-f),v=Qx(Math.pow(u,2),o);return(-i(u)+Sy>0?-1:1)*((h-p)*g)/v}):(i=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-Sy+d*f},s=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const a=5/e,l=Cte(i,s,a);if(e=Ri(e),isNaN(l))return{stiffness:kt.stiffness,damping:kt.damping,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:e}}}const kte=12;function Cte(e,t,n){let r=n;for(let i=1;i<kte;i++)r=r-e(r)/t(r);return r}function Qx(e,t){return e*Math.sqrt(1-t*t)}const Tte=["duration","bounce"],jte=["stiffness","damping","mass"];function bT(e,t){return t.some(n=>e[n]!==void 0)}function Pte(e){let t={velocity:kt.velocity,stiffness:kt.stiffness,damping:kt.damping,mass:kt.mass,isResolvedFromDuration:!1,...e};if(!bT(e,jte)&&bT(e,Tte))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*Li(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:kt.mass,stiffness:i,damping:s}}else{const n=Ete(e);t={...t,...n,mass:kt.mass},t.isResolvedFromDuration=!0}return t}function um(e=kt.visualDuration,t=kt.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:u,mass:d,duration:f,velocity:h,isResolvedFromDuration:p}=Pte({...n,velocity:-Ii(n.velocity||0)}),g=h||0,v=u/(2*Math.sqrt(l*d)),w=o-s,y=Ii(Math.sqrt(l/d)),x=Math.abs(w)<5;r||(r=x?kt.restSpeed.granular:kt.restSpeed.default),i||(i=x?kt.restDelta.granular:kt.restDelta.default);let b;if(v<1){const S=Qx(y,v);b=E=>{const k=Math.exp(-v*y*E);return o-k*((g+v*y*w)/S*Math.sin(S*E)+w*Math.cos(S*E))}}else if(v===1)b=S=>o-Math.exp(-y*S)*(w+(g+y*w)*S);else{const S=y*Math.sqrt(v*v-1);b=E=>{const k=Math.exp(-v*y*E),C=Math.min(S*E,300);return o-k*((g+v*y*w)*Math.sinh(C)+S*w*Math.cosh(C))/S}}const _={calculatedDuration:p&&f||null,next:S=>{const E=b(S);if(p)a.done=S>=f;else{let k=S===0?g:0;v<1&&(k=S===0?Ri(g):jM(b,S,E));const C=Math.abs(k)<=r,P=Math.abs(o-E)<=i;a.done=C&&P}return a.value=a.done?o:E,a},toString:()=>{const S=Math.min(c1(_),cm),E=TM(k=>_.next(S*k).value,S,30);return S+"ms "+E},toTransition:()=>{}};return _}um.applyToOptions=e=>{const t=_te(e,100,um);return e.ease=t.ease,e.duration=Ri(t.duration),e.type="keyframes",e};function Xx({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:d}){const f=e[0],h={done:!1,value:f},p=C=>a!==void 0&&C<a||l!==void 0&&C>l,g=C=>a===void 0?l:l===void 0||Math.abs(a-C)<Math.abs(l-C)?a:l;let v=n*t;const w=f+v,y=o===void 0?w:o(w);y!==w&&(v=y-f);const x=C=>-v*Math.exp(-C/r),b=C=>y+x(C),_=C=>{const P=x(C),T=b(C);h.done=Math.abs(P)<=u,h.value=h.done?y:T};let S,E;const k=C=>{p(h.value)&&(S=C,E=um({keyframes:[h.value,g(h.value)],velocity:jM(b,C,h.value),damping:i,stiffness:s,restDelta:u,restSpeed:d}))};return k(0),{calculatedDuration:null,next:C=>{let P=!1;return!E&&S===void 0&&(P=!0,_(C),k(C)),S!==void 0&&C>=S?E.next(C-S):(!P&&_(C),h)}}}function Nte(e,t,n){const r=[],i=n||vs.mix||CM,s=e.length-1;for(let o=0;o<s;o++){let a=i(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||Zn:t;a=_f(l,a)}r.push(a)}return r}function PM(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const s=e.length;if(hc(s===t.length),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=Nte(t,r,i),l=a.length,u=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=pc(e[f],e[f+1],d);return a[f](h)};return n?d=>u(Li(e[0],e[s-1],d)):u}function Rte(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=pc(0,t,r);e.push(vt(n,1,i))}}function NM(e){const t=[0];return Rte(t,e.length-1),t}function Ite(e,t){return e.map(n=>n*t)}function Ate(e,t){return e.map(()=>t||gM).splice(0,e.length-1)}function qu({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=Gee(r)?r.map(mT):mT(r),s={done:!1,value:t[0]},o=Ite(n&&n.length===t.length?n:NM(t),e),a=PM(o,t,{ease:Array.isArray(i)?i:Ate(t,i)});return{calculatedDuration:e,next:l=>(s.value=a(l),s.done=l>=e,s)}}const Ote=e=>e!==null;function u1(e,{repeat:t,repeatType:n="loop"},r,i=1){const s=e.filter(Ote),a=i<0||t&&n!=="loop"&&t%2===1?0:s.length-1;return!a||r===void 0?s[a]:r}const Dte={decay:Xx,inertia:Xx,tween:qu,keyframes:qu,spring:um};function RM(e){typeof e.type=="string"&&(e.type=Dte[e.type])}class d1{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 Mte=e=>e/100;class f1 extends d1{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var r,i;const{motionValue:n}=this.options;n&&n.updatedAt!==Kn.now()&&this.tick(Kn.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(r=this.options).onStop)==null||i.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;RM(t);const{type:n=qu,repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=t;let{keyframes:a}=t;const l=n||qu;l!==qu&&typeof a[0]!="number"&&(this.mixKeyframes=_f(Mte,CM(a[0],a[1])),a=[0,100]);const u=l({...t,keyframes:a});s==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=c1(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+i,this.totalDuration=this.resolvedDuration*(r+1)-i,this.generator=u}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:i,mixKeyframes:s,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:u=0,keyframes:d,repeat:f,repeatType:h,repeatDelay:p,type:g,onUpdate:v,finalKeyframe:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const y=this.currentTime-u*(this.playbackSpeed>=0?1:-1),x=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let b=this.currentTime,_=r;if(f){const C=Math.min(this.currentTime,i)/a;let P=Math.floor(C),T=C%1;!T&&C>=1&&(T=1),T===1&&P--,P=Math.min(P,f+1),!!(P%2)&&(h==="reverse"?(T=1-T,p&&(T-=p/a)):h==="mirror"&&(_=o)),b=Li(0,1,T)*a}const S=x?{done:!1,value:d[0]}:_.next(b);s&&(S.value=s(S.value));let{done:E}=S;!x&&l!==null&&(E=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const k=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&E);return k&&g!==Xx&&(S.value=u1(d,this.options,w,this.speed)),v&&v(S.value),k&&this.finish(),S}then(t,n){return this.finished.then(t,n)}get duration(){return Ii(this.calculatedDuration)}get time(){return Ii(this.currentTime)}set time(t){var n;t=Ri(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),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Kn.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Ii(this.currentTime))}play(){var i,s;if(this.isStopped)return;const{driver:t=bte,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),(s=(i=this.options).onPlay)==null||s.call(i);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(Kn.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 Lte(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const sa=e=>e*180/Math.PI,Zx=e=>{const t=sa(Math.atan2(e[1],e[0]));return Jx(t)},Fte={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Zx,rotateZ:Zx,skewX:e=>sa(Math.atan(e[1])),skewY:e=>sa(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Jx=e=>(e=e%360,e<0&&(e+=360),e),_T=Zx,ST=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),ET=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),$te={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ST,scaleY:ET,scale:e=>(ST(e)+ET(e))/2,rotateX:e=>Jx(sa(Math.atan2(e[6],e[5]))),rotateY:e=>Jx(sa(Math.atan2(-e[2],e[0]))),rotateZ:_T,rotate:_T,skewX:e=>sa(Math.atan(e[4])),skewY:e=>sa(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function ew(e){return e.includes("scale")?1:0}function tw(e,t){if(!e||e==="none")return ew(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=$te,i=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Fte,i=a}if(!i)return ew(t);const s=r[t],o=i[1].split(",").map(Vte);return typeof s=="function"?s(o):o[s]}const Ute=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return tw(n,t)};function Vte(e){return parseFloat(e.trim())}const Bc=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Wc=new Set(Bc),kT=e=>e===zc||e===ke,zte=new Set(["x","y","z"]),Bte=Bc.filter(e=>!zte.has(e));function Wte(e){const t=[];return Bte.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const xa={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>tw(t,"x"),y:(e,{transform:t})=>tw(t,"y")};xa.translateX=xa.x;xa.translateY=xa.y;const wa=new Set;let nw=!1,rw=!1,iw=!1;function IM(){if(rw){const e=Array.from(wa).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=Wte(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,o])=>{var a;(a=r.getValue(s))==null||a.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}rw=!1,nw=!1,wa.forEach(e=>e.complete(iw)),wa.clear()}function AM(){wa.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(rw=!0)})}function qte(){iw=!0,AM(),IM(),iw=!1}class h1{constructor(t,n,r,i,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(wa.add(this),nw||(nw=!0,Je.read(AM),Je.resolveKeyframes(IM))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;if(t[0]===null){const s=i==null?void 0:i.get(),o=t[t.length-1];if(s!==void 0)t[0]=s;else if(r&&n){const a=r.readValue(n,o);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=o),i&&s===void 0&&i.set(t[0])}Lte(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),wa.delete(this)}cancel(){this.state==="scheduled"&&(wa.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Hte=e=>e.startsWith("--");function Gte(e,t,n){Hte(t)?e.style.setProperty(t,n):e.style[t]=n}const OM=J_(()=>window.ScrollTimeline!==void 0),Kte={};function Yte(e,t){const n=J_(e);return()=>Kte[t]??n()}const DM=Yte(()=>{try{document.createElement("div").animate({opacity:0}
509,{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Eu=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,CT={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Eu([0,.65,.55,1]),circOut:Eu([.55,0,1,.45]),backIn:Eu([.31,.01,.66,-.59]),backOut:Eu([.33,1.53,.69,.99])};function MM(e,t){if(e)return typeof e=="function"?DM()?TM(e,t):"ease-out":vM(e)?Eu(e):Array.isArray(e)?e.map(n=>MM(n,t)||CT.easeOut):CT[e]}function Qte(e,t,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a="easeOut",times:l}={},u=void 0){const d={[t]:n};l&&(d.offset=l);const f=MM(a,i);Array.isArray(f)&&(d.easing=f);const h={delay:r,duration:i,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"};return u&&(h.pseudoElement=u),e.animate(d,h)}function LM(e){return typeof e=="function"&&"applyToOptions"in e}function Xte({type:e,...t}){return LM(e)&&DM()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class Zte extends d1{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:i,pseudoElement:s,allowFlatten:o=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=!!s,this.allowFlatten=o,this.options=t,hc(typeof t.type!="string");const u=Xte(t);this.animation=Qte(n,r,i,u,s),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const d=u1(i,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(d):Gte(n,r,d),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(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 t,n;this.isPseudoElement||(n=(t=this.animation).commitStyles)==null||n.call(t)}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 Ii(Number(t))}get time(){return Ii(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=Ri(t)}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 Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&OM()?(this.animation.timeline=t,Zn):n(this)}}const FM={anticipate:hM,backInOut:fM,circInOut:mM};function Jte(e){return e in FM}function ene(e){typeof e.ease=="string"&&Jte(e.ease)&&(e.ease=FM[e.ease])}const TT=10;class tne extends Zte{constructor(t){ene(t),RM(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:i,element:s,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new f1({...o,autoplay:!1}),l=Ri(this.finishedTime??this.time);n.setWithVelocity(a.sample(l-TT).value,a.sample(l).value,TT),a.stop()}}const jT=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(To.test(e)||e==="0")&&!e.startsWith("url("));function nne(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 rne(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],o=jT(i,t),a=jT(s,t);return!o||!a?!1:nne(e)||(n==="spring"||LM(n))&&r}function sw(e){e.duration=0,e.type}const ine=new Set(["opacity","clipPath","filter","transform"]),sne=J_(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function one(e){var d;const{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:s,type:o}=e;if(!(((d=t==null?void 0:t.owner)==null?void 0:d.current)instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=t.owner.getProps();return sne()&&n&&ine.has(n)&&(n!=="transform"||!u)&&!l&&!r&&i!=="mirror"&&s!==0&&o!=="inertia"}const ane=40;class lne extends d1{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:
509o="loop",keyframes:a,name:l,motionValue:u,element:d,...f}){var g;super(),this.stop=()=>{var v,w;this._animation&&(this._animation.stop(),(v=this.stopTimeline)==null||v.call(this)),(w=this.keyframeResolver)==null||w.cancel()},this.createdAt=Kn.now();const h={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:o,name:l,motionValue:u,element:d,...f},p=(d==null?void 0:d.KeyframeResolver)||h1;this.keyframeResolver=new p(a,(v,w,y)=>this.onKeyframesResolved(v,w,h,!y),l,u,d),(g=this.keyframeResolver)==null||g.scheduleResolve()}onKeyframesResolved(t,n,r,i){this.keyframeResolver=void 0;const{name:s,type:o,velocity:a,delay:l,isHandoff:u,onUpdate:d}=r;this.resolvedAt=Kn.now(),rne(t,s,o,a)||((vs.instantAnimations||!l)&&(d==null||d(u1(t,r,n))),t[0]=t[t.length-1],sw(r),r.repeat=0);const h={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>ane?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},p=!u&&one(h)?new tne({...h,element:h.motionValue.owner.current}):new f1(h);p.finished.then(()=>this.notifyFinished()).catch(Zn),this.pendingTimeline&&(this.stopTimeline=p.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=p}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(),qte()),this._animation}get duration(){return this.animation.duration}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()}}const cne=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function une(e){const t=cne.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function $M(e,t,n=1){const[r,i]=une(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const o=s.trim();return sM(o)?parseFloat(o):o}return s1(i)?$M(i,t,n+1):i}function p1(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const UM=new Set(["width","height","top","left","right","bottom",...Bc]),dne={test:e=>e==="auto",parse:e=>e},VM=e=>t=>t.test(e),zM=[zc,ke,Ai,Is,ste,ite,dne],PT=e=>zM.find(VM(e));function fne(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||aM(e):!0}const hne=new Set(["brightness","contrast","saturate","opacity"]);function pne(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(o1)||[];if(!r)return e;const i=n.replace(r,"");let s=hne.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const mne=/\b([a-z-]*)\(.*?\)/gu,ow={...To,getAnimatableNone:e=>{const t=e.match(mne);return t?t.map(pne).join(" "):e}},NT={...zc,transform:Math.round},gne={rotate:Is,rotateX:Is,rotateY:Is,rotateZ:Is,scale:bh,scaleX:bh,scaleY:bh,scaleZ:bh,skew:Is,skewX:Is,skewY:Is,distance:ke,translateX:ke,translateY:ke,translateZ:ke,x:ke,y:ke,z:ke,perspective:ke,transformPerspective:ke,opacity:Rd,originX:vT,originY:vT,originZ:ke},m1={borderWidth:ke,borderTopWidth:ke,borderRightWidth:ke,borderBottomWidth:ke,borderLeftWidth:ke,borderRadius:ke,radius:ke,borderTopLeftRadius:ke,borderTopRightRadius:ke,borderBottomRightRadius:ke,borderBottomLeftRadius:ke,width:ke,maxWidth:ke,height:ke,maxHeight:ke,top:ke,right:ke,bottom:ke,left:ke,padding:ke,paddingTop:ke,paddingRight:ke,paddingBottom:ke,paddingLeft:ke,margin:ke,marginTop:ke,marginRight:ke,marginBottom:ke,marginLeft:ke,backgroundPositionX:ke,backgroundPositionY:ke,...gne,zIndex:NT,fillOpacity:Rd,strokeOpacity:Rd,numOctaves:NT},vne={...m1,color:Dt,backgroundColor:Dt,outlineColor:Dt,fill:Dt,stroke:Dt,borderColor:Dt,borderTopColor:Dt,borderRightColor:Dt,borderBottomColor:Dt,borderLeftColor:Dt,filter:ow,WebkitFilter:ow},BM=e=>vne[e];function WM(e,t){let n=BM(e);return n!==ow&&(n=To),n.getAnimatableNone?n.getAnimatableNone(t):void 0}
vendor: 1,658 bytes, line 509
509const yne=new Set(["auto","none","0"]);function xne(e,t,n){let r=0,i;for(;r<e.length&&!i;){const s=e[r];typeof s=="string"&&!yne.has(s)&&Id(s).values.length&&(i=e[r]),r++}if(i&&n)for(const s of t)e[s]=WM(n,i)}class wne extends h1{constructor(t,n,r,i,s){super(t,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let u=t[l];if(typeof u=="string"&&(u=u.trim(),s1(u))){const d=$M(u,n.current);d!==void 0&&(t[l]=d),l===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!UM.has(r)||t.length!==2)return;const[i,s]=t,o=PT(i),a=PT(s);if(o!==a)if(kT(o)&&kT(a))for(let l=0;l<t.length;l++){const u=t[l];typeof u=="string"&&(t[l]=parseFloat(u))}else xa[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)(t[i]===null||fne(t[i]))&&r.push(i);r.length&&xne(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=xa[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const i=t.getValue(n);i&&i.jump(this.measuredOrigin,!1);const s=r.length-1,o=r[s];r[s]=xa[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEac
vendor: 5,302 bytes, line 509
509h(([l,u])=>{t.getValue(l).set(u)}),this.resolveNoneKeyframes()}}function qM(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){const i=document.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}const HM=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function g1(e){return oM(e)&&"offsetHeight"in e}const RT=30,bne=e=>!isNaN(parseFloat(e));class _ne{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var s;const i=Kn.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((s=this.events.change)==null||s.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=Kn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=bne(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 e1);const r=this.events[t].add(n);return t==="change"?()=>{r(),Je.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=Kn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>RT)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,RT);return t1(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 Ci(e,t){return new _ne(e,t)}const{schedule:v1,cancel:Ope}=yM(queueMicrotask,!1),Wr={x:!1,y:!1};function GM(){return Wr.x||Wr.y}function Sne(e){return e==="x"||e==="y"?Wr[e]?null:(Wr[e]=!0,()=>{Wr[e]=!1}):Wr.x||Wr.y?null:(Wr.x=Wr.y=!0,()=>{Wr.x=Wr.y=!1})}function KM(e,t){const n=qM(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function IT(e){return!(e.pointerType==="touch"||GM())}function Ene(e,t,n={}){const[r,i,s]=KM(e,n),o=a=>{if(!IT(a))return;const{target:l}=a,u=t(l,a);if(typeof u!="function"||!l)return;const d=f=>{IT(f)&&(u(f),l.removeEventListener("pointerleave",d))};l.addEventListener("pointerleave",d,i)};return r.forEach(a=>{a.addEventListener("pointerenter",o,i)}),s}const YM=(e,t)=>t?e===t?!0:YM(e,t.parentElement):!1,y1=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,kne=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Cne(e){return kne.has(e.tagName)||e.tabIndex!==-1}const rp=new WeakSet;function AT(e){return t=>{t.key==="Enter"&&e(t)}}function Ey(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Tne=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=AT(()=>{if(rp.has(n))return;Ey(n,"down");const i=AT(()=>{Ey(n,"up")}),s=()=>Ey(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function OT(e){return y1(e)&&!GM()}function jne(e,t,n={}){const[r,i,s]=KM(e,n),o=a=>{const l=a.currentTarget;if(!OT(a))return;rp.add(l);const u=t(l,a),d=(p,g)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),rp.has(l)&&rp.delete(l),OT(p)&&typeof u=="function"&&u(p,{success:g})},f=p=>{d(p,l===window||l===document||n.useGlobalTarget||YM(l,p.target))},h=p=>{d(p,!1)};window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",h,i)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),g1(a)&&(a.addEventListener("focus",u=>Tne(u,i)),!Cne(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}function x1(e){return oM(e)&&"ownerSVGElement"in e}const ip=new WeakMap;let As;const QM=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+"Size"]:x1(r)&&"getBBox"in r?r.getBBox()[t]:r[n],Pne=QM("inline","width","offsetWidth"),Nne=QM("block","height","offsetHeight");function Rne({target:e,borderBoxSize:t}){var n;
509(n=ip.get(e))==null||n.forEach(r=>{r(e,{get width(){return Pne(e,t)},get height(){return Nne(e,t)}})})}function Ine(e){e.forEach(Rne)}function Ane(){typeof ResizeObserver>"u"||(As=new ResizeObserver(Ine))}function One(e,t){As||Ane();const n=qM(e);return n.forEach(r=>{let i=ip.get(r);i||(i=new Set,ip.set(r,i)),i.add(t),As==null||As.observe(r)}),()=>{n.forEach(r=>{const i=ip.get(r);i==null||i.delete(t),i!=null&&i.size||As==null||As.unobserve(r)})}}const sp=new Set;let Sl;function Dne(){Sl=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};sp.forEach(t=>t(e))},window.addEventListener("resize",Sl)}function Mne(e){return sp.add(e),Sl||Dne(),()=>{sp.delete(e),!sp.size&&typeof Sl=="function"&&(window.removeEventListener("resize",Sl),Sl=void 0)}}function Lne(e,t){return typeof e=="function"?Mne(e):One(e,t)}function XM(e,t){let n;const r=()=>{const{currentTime:i}=t,o=(i===null?0:i.value)/100;n!==o&&e(o),n=o};return Je.preUpdate(r,!0),()=>Fi(r)}function Fne(e){return x1(e)&&e.tagName==="svg"}const gn=e=>!!(e&&e.getVelocity),$ne=[...zM,Dt,To],Une=e=>$ne.find(VM(e)),w1=m.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class Vne extends m.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,i=g1(r)&&r.offsetWidth||0,s=this.props.sizeRef.current;s.height=n.offsetHeight||0,s.width=n.offsetWidth||0,s.top=n.offsetTop,s.left=n.offsetLeft,s.right=i-s.width-s.left}return null}componentDidUpdate(){}render(){return this.props.children}}function zne({children:e,isPresent:t,anchorX:n,root:r}){const i=m.useId(),s=m.useRef(null),o=m.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:a}=m.useContext(w1);return m.useInsertionEffect(()=>{const{width:l,height:u,top:d,left:f,right:h}=o.current;if(t||!s.current||!l||!u)return;const p=n==="left"?`left: ${f}`:`right: ${h}`;s.current.dataset.motionPopId=i;const g=document.createElement("style");a&&(g.nonce=a);const v=r??document.head;return v.appendChild(g),g.sheet&&g.sheet.insertRule(`
510          [data-motion-pop-id="${i}"] {
511            position: absolute !important;
512            width: ${l}px !important;
513            height: ${u}px !important;
514            ${p}px !important;
515            top: ${d}px !important;
516          }
517        `),()=>{v.contains(g)&&v.removeChild(g)}},[t]),c.jsx(Vne,{isPresent:t,childRef:s,sizeRef:o,children:m.cloneElement(e,{ref:s})})}const Bne=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:o,anchorX:a,root:l})=>{const u=Ig(Wne),d=m.useId();let f=!0,h=m.useMemo(()=>(f=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:p=>{u.set(p,!0);for(const g of u.values())if(!g)return;r&&r()},register:p=>(u.set(p,!1),()=>u.delete(p))}),[n,u,r]);return s&&f&&(h={...h}),m.useMemo(()=>{u.forEach((p,g)=>u.set(g,!1))},[n]),m.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),o==="popLayout"&&(e=c.jsx(zne,{isPresent:n,anchorX:a,root:l,children:e})),c.jsx(Ag.Provider,{value:h,children:e})};function Wne(){return new Map}function ZM(e=!0){const t=m.useContext(Ag);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,s=m.useId();m.useEffect(()=>{if(e)return i(s)},[e]);const o=m.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,o]:[!0]}const _h=e=>e.key||"";function DT(e){const t=[];return m.Children.forEach(e,n=>{m.isValidElement(n)&&t.push(n)}),t}const qne=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:o=!1,anchorX:a="left",root:l})=>{const[u,d]=ZM(o),f=m.useMemo(()=>DT(e),[e]),h=o&&!u?[]:f.map(_h),p=m.useRef(!0),g=m.useRef(f),v=Ig(()=>new Map),[w,y]=m.useState(f),[x,b]=m.useState(f);Q_(()=>{p.current=!1,g.current=f;for(let E=0;E<x.length;E++){const k=_h(x[E]);h.includes(k)?v.delete(k):v.get(k)!==!0&&v.set(k,!1)}},[x,h.length,h.join("-")]);const _=[];if(f!==w){let E=[...f];for(let k=0;k<x.length;k++){const C=x[k],P=_h(C);h.includes(P)||(E.splice(k,0,C),_.push(C))}return s==="wait"&&_.length&&(E=_),b(DT(E)),y(f),null}const{forceRender:S}=m.useContext(K_);return c.jsx(c.Fragment,{children:x.map(E=>{const k=_h(E),C=o&&!u?!1:f===x||h.includes(k),P=()=>{if(v.has(k))v.set(k,!0);else return;let T=!0;v.forEach(N=>
vendor: 4,106 bytes, line 517
517{N||(T=!1)}),T&&(S==null||S(),b(g.current),o&&(d==null||d()),r&&r())};return c.jsx(Bne,{isPresent:C,initial:!p.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:s,root:l,onExitComplete:C?void 0:P,anchorX:a,children:E},k)})})},JM=m.createContext({strict:!1}),MT={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"]},mc={};for(const e in MT)mc[e]={isEnabled:t=>MT[e].some(n=>!!t[n])};function Hne(e){for(const t in e)mc[t]={...mc[t],...e[t]}}const Gne=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","ignoreStrict","viewport"]);function dm(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Gne.has(e)}let eL=e=>!dm(e);function Kne(e){typeof e=="function"&&(eL=t=>t.startsWith("on")?!dm(t):e(t))}try{Kne(require("@emotion/is-prop-valid").default)}catch{}function Yne(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(eL(i)||n===!0&&dm(i)||!t&&!dm(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}const Og=m.createContext({});function Dg(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Ad(e){return typeof e=="string"||Array.isArray(e)}const b1=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],_1=["initial",...b1];function Mg(e){return Dg(e.animate)||_1.some(t=>Ad(e[t]))}function tL(e){return!!(Mg(e)||e.variants)}function Qne(e,t){if(Mg(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Ad(n)?n:void 0,animate:Ad(r)?r:void 0}}return e.inherit!==!1?t:{}}function Xne(e){const{initial:t,animate:n}=Qne(e,m.useContext(Og));return m.useMemo(()=>({initial:t,animate:n}),[LT(t),LT(n)])}function LT(e){return Array.isArray(e)?e.join(" "):e}const Od={};function Zne(e){for(const t in e)Od[t]=e[t],i1(t)&&(Od[t].isCSSVariable=!0)}function nL(e,{layout:t,layoutId:n}){return Wc.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Od[e]||e==="opacity")}const Jne={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ere=Bc.length;function tre(e,t,n){let r="",i=!0;for(let s=0;s<ere;s++){const o=Bc[s],a=e[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const u=HM(a,m1[o]);if(!l){i=!1;const d=Jne[o]||o;r+=`${d}(${u}) `}n&&(t[o]=u)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function S1(e,t,n){const{style:r,vars:i,transformOrigin:s}=e;let o=!1,a=!1;for(const l in t){const u=t[l];if(Wc.has(l)){o=!0;continue}else if(i1(l)){i[l]=u;continue}else{const d=HM(u,m1[l]);l.startsWith("origin")?(a=!0,s[l]=d):r[l]=d}}if(t.transform||(o||n?r.transform=tre(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:u="50%",originZ:d=0}=s;r.transformOrigin=`${l} ${u} ${d}`}}const E1=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function rL(e,t,n){for(const r in t)!gn(t[r])&&!nL(r,n)&&(e[r]=t[r])}function nre({transformTemplate:e},t){return m.useMemo(()=>{const n=E1();return S1(n,t,e),Object.assign({},n.vars,n.style)},[t])}function rre(e,t){const n=e.style||{},r={};return rL(r,n,e),Object.assign(r,nre(e,t)),r}function ire(e,t){const n={},r=rre(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"}
517`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const sre={offset:"stroke-dashoffset",array:"stroke-dasharray"},ore={offset:"strokeDashoffset",array:"strokeDasharray"};function are(e,t,n=1,r=0,i=!0){e.pathLength=1;const s=i?sre:ore;e[s.offset]=ke.transform(-r);const o=ke.transform(t),a=ke.transform(n);e[s.array]=`${o} ${a}`}function iL(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:s=1,pathOffset:o=0,...a},l,u,d){if(S1(e,a,u),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),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),i!==void 0&&are(f,i,s,o,!1)}const sL=()=>({...E1(),attrs:{}}),oL=e=>typeof e=="string"&&e.toLowerCase()==="svg";function lre(e,t,n,r){const i=m.useMemo(()=>{const s=sL();return iL(s,t,oL(r),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};rL(s,e.style,e),i.style={...s,...i.style}}return i}const cre=["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 k1(e){return typeof e!="string"||e.includes("-")?!1:!!(cre.indexOf(e)>-1||/[A-Z]/u.test(e))}function ure(e,t,n,{latestValues:r},i,s=!1){const a=(k1(e)?lre:ire)(t,r,i,e),l=Yne(t,typeof e=="string",s),u=e!==m.Fragment?{...l,...a,ref:n}:{},{children:d}=t,f=m.useMemo(()=>gn(d)?d.get():d,[d]);return m.createElement(e,{...u,children:f})}function FT(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function C1(e,t,n,r){if(typeof t=="function"){const[i,s]=FT(r);t=t(n!==void 0?n:e.custom,i,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,s]=FT(r);t=t(n!==void 0?n:e.custom,i,s)}return t}function op(e){return gn(e)?e.get():e}function dre({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:fre(n,r,i,e),renderState:t()}}function fre(e,t,n,r){const i={},s=r(e,{});for(const h in s)i[h]=op(s[h]);let{initial:o,animate:a}=e;const l=Mg(e),u=tL(e);t&&u&&!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"&&!Dg(f)){const h=Array.isArray(f)?f:[f];for(let p=0;p<h.length;p++){const g=C1(e,h[p]);if(g){const{transitionEnd:v,transition:w,...y}=g;for(const x in y){let b=y[x];if(Array.isArray(b)){const _=d?b.length-1:0;b=b[_]}b!==null&&(i[x]=b)}for(const x in v)i[x]=v[x]}}}return i}const aL=e=>(t,n)=>{const r=m.useContext(Og),i=m.useContext(Ag),s=()=>dre(e,t,r,i);return n?s():Ig(s)};function T1(e,t,n){var s;const{style:r}=e,i={};for(const o in r)(gn(r[o])||t.style&&gn(t.style[o])||nL(o,e)||((s=n==null?void 0:n.getValue(o))==null?void 0:s.liveStyle)!==void 0)&&(i[o]=r[o]);return i}const hre=aL({scrapeMotionValuesFromProps:T1,createRenderState:E1});function lL(e,t,n){const r=T1(e,t,n);for(const i in e)if(gn(e[i])||gn(t[i])){const s=Bc.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=e[i]}return r}const pre=aL({scrapeMotionValuesFromProps:lL,createRenderState:sL}),mre=Symbol.for("motionComponentSymbol");function El(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function gre(e,t,n){return m.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):El(n)&&(n.current=r))},[t])}const j1=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),vre="framerAppearId",cL="data-"+j1(vre),uL=m.createContext({});function yre(e,t,n,r,i){var v,w;const{visualElement:s}=m.useContext(Og),o=m.useContext(JM),a=m.useContext(Ag),l=m.useContext(w1).reducedMotion,u=m.useRef(null);r=r||o.renderer,!u.current&&r&&(u.current=r(e,{visualState:t,parent:s,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const d=u.current,f=m.useContext(uL);d&&!d.projection&&i&&(d.type==="html"||d.type==="svg")&&xre(u.current,n,i,f);const h=m.useRef(!1);m.useInsertionEffect(()=>{d&&h.current&&d.update(n,a)});const p=n[cL],g=m.useRef(!!p&&!((v=window.MotionHandoffIsComplete)!=null&&v.call(window,p))&&((w=window.MotionHasOptimisedAnimation)==null?void 0:w.call(window,p)));return Q_(()=>{d&&(h.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),d.scheduleRenderMicrotask(),g.current&&d.animationState&&d.animationState.animateChanges())}),m.useEffect(()=>{d&&(!g.current&&d.animationState&&d.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)==null||y.call(window,p)}),g.current=!1))}),d}function xre(e,t,n,r){const{layoutId:i,layout:s,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:dL(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&El(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:l,layoutRoot:u})}function dL(e){if(e)return e.options.allowProjection!==!1?e.projection:dL(e.parent)}function ky(e,{forwardMotionProps:t=!1}={},n,r){n&&Hne(n);const i=k1(e)?pre:hre;function s(a,l){let u;const d={...m.useContext(w1),...a,layoutId:wre(a)},{isStatic:f}=d,h=Xne(a),p=i(a,f);if(!f&&Y_){bre();const g=_re(d);u=g.MeasureLayout,h.visualElement=yre(e,p,d,r,g.ProjectionNode)}return c.jsxs(Og.Provider,{value:h,children:[u&&h.visualElement?c.jsx(u,{visualElement:h.visualElement,...d}):null,ure(e,a,gre(p,h.visualElement,l),p,f,t)]})}s.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const o=m.forwardRef(s);return o[mre]=e,o}function wre({layoutId:e}){const t=m.useContext(K_).id;return t&&e!==void 0?t+"-"+e:e}function bre(e,t){m.useContext(JM).strict}function _re(e){const{drag:t,layout:n}=mc;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}
vendor: 4,450 bytes, line 517
517function Sre(e,t){if(typeof Proxy>"u")return ky;const n=new Map,r=(s,o)=>ky(s,o,e,t),i=(s,o)=>r(s,o);return new Proxy(i,{get:(s,o)=>o==="create"?r:(n.has(o)||n.set(o,ky(o,void 0,e,t)),n.get(o))})}function fL({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Ere({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function kre(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 Cy(e){return e===void 0||e===1}function aw({scale:e,scaleX:t,scaleY:n}){return!Cy(e)||!Cy(t)||!Cy(n)}function Qo(e){return aw(e)||hL(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function hL(e){return $T(e.x)||$T(e.y)}function $T(e){return e&&e!=="0%"}function fm(e,t,n){const r=e-n,i=t*r;return n+i}function UT(e,t,n,r,i){return i!==void 0&&(e=fm(e,i,r)),fm(e,n,r)+t}function lw(e,t=0,n=1,r,i){e.min=UT(e.min,t,n,r,i),e.max=UT(e.max,t,n,r,i)}function pL(e,{x:t,y:n}){lw(e.x,t.translate,t.scale,t.originPoint),lw(e.y,n.translate,n.scale,n.originPoint)}const VT=.999999999999,zT=1.0000000000001;function Cre(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let s,o;for(let a=0;a<i;a++){s=n[a],o=s.projectionDelta;const{visualElement:l}=s.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&Cl(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,pL(e,o)),r&&Qo(s.latestValues)&&Cl(e,s.latestValues))}t.x<zT&&t.x>VT&&(t.x=1),t.y<zT&&t.y>VT&&(t.y=1)}function kl(e,t){e.min=e.min+t,e.max=e.max+t}function BT(e,t,n,r,i=.5){const s=vt(e.min,e.max,i);lw(e,t,n,s,r)}function Cl(e,t){BT(e.x,t.x,t.scaleX,t.scale,t.originX),BT(e.y,t.y,t.scaleY,t.scale,t.originY)}function mL(e,t){return fL(kre(e.getBoundingClientRect(),t))}function Tre(e,t,n){const r=mL(e,n),{scroll:i}=t;return i&&(kl(r.x,i.offset.x),kl(r.y,i.offset.y)),r}const WT=()=>({translate:0,scale:1,origin:0,originPoint:0}),Tl=()=>({x:WT(),y:WT()}),qT=()=>({min:0,max:0}),Pt=()=>({x:qT(),y:qT()}),cw={current:null},gL={current:!1};function jre(){if(gL.current=!0,!!Y_)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>cw.current=e.matches;e.addEventListener("change",t),t()}else cw.current=!1}const Pre=new WeakMap;function Nre(e,t,n){for(const r in t){const i=t[r],s=n[r];if(gn(i))e.addValue(r,i);else if(gn(s))e.addValue(r,Ci(i,{owner:e}));else if(s!==i)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=e.getStaticValue(r);e.addValue(r,Ci(o!==void 0?o:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const HT=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Rre{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=h1,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const h=Kn.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,Je.render(this.render,!1,!0))};const{latestValues:l,renderState:u}=o;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=Mg(n),this.isVariantNode=tL(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:d,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const h in f){const p=f[h];l[h]!==void 0&&gn(p)&&p.set(l[h])}}mount(t){this.current=t,Pre.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.forEac
vendor: 4,227 bytes, line 517
517h((n,r)=>this.bindToMotionValue(r,n)),gL.current||jre(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:cw.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Fi(this.notifyUpdate),Fi(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Wc.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&Je.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),s&&s(),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 mc){const n=mc[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Pt()}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<HT.length;r++){const i=HT[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s="on"+i,o=t[s];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=Nre(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=Ci(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"&&(sM(r)||aM(r))?r=parseFloat(r):!Une(r)&&To.test(n)&&(r=WM(t,n)),this.setBaseTarget(t,gn(r)?r.get():r)),gn(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var s;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=C1(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);o&&(r=o[t])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!gn(i)?i:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}
vendor: 6,465 bytes, line 517
517on(t,n){return this.events[t]||(this.events[t]=new e1),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){v1.render(this.render)}}class vL extends Rre{constructor(){super(...arguments),this.KeyframeResolver=wne}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;gn(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function yL(e,{style:t,vars:n},r,i){const s=e.style;let o;for(o in t)s[o]=t[o];i==null||i.applyProjectionStyles(s,r);for(o in n)s.setProperty(o,n[o])}function Ire(e){return window.getComputedStyle(e)}class Are extends vL{constructor(){super(...arguments),this.type="html",this.renderInstance=yL}readValueFromInstance(t,n){var r;if(Wc.has(n))return(r=this.projection)!=null&&r.isProjecting?ew(n):Ute(t,n);{const i=Ire(t),s=(i1(n)?i.getPropertyValue(n):i[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return mL(t,n)}build(t,n,r){S1(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return T1(t,n,r)}}const xL=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Ore(e,t,n,r){yL(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(xL.has(i)?i:j1(i),t.attrs[i])}class Dre extends vL{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Pt}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Wc.has(n)){const r=BM(n);return r&&r.default||0}return n=xL.has(n)?n:j1(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return lL(t,n,r)}build(t,n,r){iL(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,i){Ore(t,n,r,i)}mount(t){this.isSVGTag=oL(t.tagName),super.mount(t)}}const Mre=(e,t)=>k1(e)?new Dre(t):new Are(t,{allowProjection:e!==m.Fragment});function Dd(e,t,n){const r=e.getProps();return C1(r,t,n!==void 0?n:r.custom,e)}const uw=e=>Array.isArray(e);function Lre(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ci(n))}function Fre(e){return uw(e)?e[e.length-1]||0:e}function $re(e,t){const n=Dd(e,t);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const o in s){const a=Fre(s[o]);Lre(e,o,a)}}function Ure(e){return!!(gn(e)&&e.add)}function dw(e,t){const n=e.getValue("willChange");if(Ure(n))return n.add(t);if(!n&&vs.WillChange){const r=new vs.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function wL(e){return e.props[cL]}const Vre=e=>e!==null;function zre(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(Vre),s=t&&n!=="loop"&&t%2===1?0:i.length-1;return!s||r===void 0?i[s]:r}const Bre={type:"spring",stiffness:500,damping:25,restSpeed:10},Wre=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),qre={type:"keyframes",duration:.8},Hre={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Gre=(e,{keyframes:t})=>t.length>2?qre:Wc.has(e)?e.startsWith("scale")?Wre(t[1]):Bre:Hre;function Kre({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:l,elapsed:u,...d}){return!!Object.keys(d).length}const P1=(e,t,n,r={},i,s)=>o=>{const a=p1(r,e)||{},l=a.delay||r.delay||0;let{elapsed:u=0}=r;u=u-Ri(l);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-u,onUpdate:h=>{t.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:i};Kre(a)||Object.assign(d,Gre(e,d)),d.duration&&(d.duration=Ri(d.duration)),d.repeatDelay&&(d.repeatDelay=Ri(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(sw(d),d.delay===0&&(f=!0)),(vs.instantAnimations||vs.skipAnimations)&&(f=!0,sw(d),d.delay=0),d.allowFlatten=!a.type&&!a.ease,f&&!s&&t.get()!==void 0){const h=zre(d.keyframes,a);if(h!==void 0){Je.update(()=>{d.onUpdate(h),d.onComplete()});return}}return a.isSync?new f1(d):new lne(d)};function Yre({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function bL(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:s=e.getDefaultTransition(),transitionEnd:o,...a}=t;r&&(s=r);const l=[],u=i&&e.animationState&&e.animationState.getState()[i];for(const d in a){const f=e.getValue(d,e.latestValues[d]??null),h=a[d];if(h===void 0||u&&Yre(u,d))continue;const p={delay:n,...p1(s||{},d)},g=f.get();if(g!==void 0&&!f.isAnimating&&!Array.isArray(h)&&h===g&&!p.velocity)continue;let v=!1;if(window.MotionHandoffAnimation){const y=wL(e);if(y){const x=window.MotionHandoffAnimation(y,d,Je);x!==null&&(p.startTime=x,v=!0)}}dw(e,d),f.start(P1(d,f,h,e.shouldReduceMotion&&UM.has(d)?{type:!1}:p,e,v));const w=f.animation;w&&l.push(w)}return o&&Promise.all(l).then(()=>{Je.update(()=>{o&&$re(e,o)})}),l}function fw(e,t,n={}){var l;const r=Dd(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const s=r?()=>Promise.all(bL(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=i;return Qre(e,t,u,d,f,h,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[u,d]=a==="beforeChildren"?[s,o]:[o,s];return u().then(()=>d())}else return Promise.all([s(),o(n.delay)])}function Qre(e,t,n=0,r=0,i=0,s=1,o){const a=[],l=e.variantChildren.size,u=(l-1)*i,d=typeof r=="function",f=d?h=>r(h,l):s===1?(h=0)=>h*i:(h=0)=>u-h*i;return Array.from(e.variantChildren).sort(Xre).forEach((h,p)=>{h.notify("AnimationStart",t),a.push(fw(h,t,{...o,delay:n+(d?0:r)+f(p)}).then(()=>h.notify("AnimationComplete",t)))}),Promise.all(a)}function Xre(e,t){return e.sortNodePosition(t)}function Zre(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>fw(e,s,n));r=Promise.all(i)}
vendor: 24,575 bytes, line 517
517else if(typeof t=="string")r=fw(e,t,n);else{const i=typeof t=="function"?Dd(e,t,n.custom):t;r=Promise.all(bL(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function _L(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 Jre=_1.length;function SL(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?SL(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Jre;n++){const r=_1[n],i=e.props[r];(Ad(i)||i===!1)&&(t[r]=i)}return t}const eie=[...b1].reverse(),tie=b1.length;function nie(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Zre(e,n,r)))}function rie(e){let t=nie(e),n=GT(),r=!0;const i=l=>(u,d)=>{var h;const f=Dd(e,d,l==="exit"?(h=e.presenceContext)==null?void 0:h.custom:void 0);if(f){const{transition:p,transitionEnd:g,...v}=f;u={...u,...v,...g}}return u};function s(l){t=l(e)}function o(l){const{props:u}=e,d=SL(e.parent)||{},f=[],h=new Set;let p={},g=1/0;for(let w=0;w<tie;w++){const y=eie[w],x=n[y],b=u[y]!==void 0?u[y]:d[y],_=Ad(b),S=y===l?x.isActive:null;S===!1&&(g=w);let E=b===d[y]&&b!==u[y]&&_;if(E&&r&&e.manuallyAnimateOnMount&&(E=!1),x.protectedKeys={...p},!x.isActive&&S===null||!b&&!x.prevProp||Dg(b)||typeof b=="boolean")continue;const k=iie(x.prevProp,b);let C=k||y===l&&x.isActive&&!E&&_||w>g&&_,P=!1;const T=Array.isArray(b)?b:[b];let N=T.reduce(i(y),{});S===!1&&(N={});const{prevResolvedValues:I={}}=x,O={...I,...N},j=$=>{C=!0,h.has($)&&(P=!0,h.delete($)),x.needsAnimating[$]=!0;const R=e.getValue($);R&&(R.liveStyle=!1)};for(const $ in O){const R=N[$],L=I[$];if(p.hasOwnProperty($))continue;let H=!1;uw(R)&&uw(L)?H=!_L(R,L):H=R!==L,H?R!=null?j($):h.add($):R!==void 0&&h.has($)?j($):x.protectedKeys[$]=!0}x.prevProp=b,x.prevResolvedValues=N,x.isActive&&(p={...p,...N}),r&&e.blockInitialAnimation&&(C=!1),C&&(!(E&&k)||P)&&f.push(...T.map($=>({animation:$,options:{type:y}})))}if(h.size){const w={};if(typeof u.initial!="boolean"){const y=Dd(e,Array.isArray(u.initial)?u.initial[0]:u.initial);y&&y.transition&&(w.transition=y.transition)}h.forEach(y=>{const x=e.getBaseTarget(y),b=e.getValue(y);b&&(b.liveStyle=!0),w[y]=x??null}),f.push({animation:w})}let v=!!f.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(v=!1),r=!1,v?t(f):Promise.resolve()}function a(l,u){var f;if(n[l].isActive===u)return Promise.resolve();(f=e.variantChildren)==null||f.forEach(h=>{var p;return(p=h.animationState)==null?void 0:p.setActive(l,u)}),n[l].isActive=u;const d=o(l);for(const h in n)n[h].protectedKeys={};return d}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>n,reset:()=>{n=GT(),r=!0}}}function iie(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!_L(t,e):!1}function qo(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function GT(){return{animate:qo(!0),whileInView:qo(),whileHover:qo(),whileTap:qo(),whileDrag:qo(),whileFocus:qo(),exit:qo()}}class Uo{constructor(t){this.isMounted=!1,this.node=t}update(){}}class sie extends Uo{constructor(t){super(t),t.animationState||(t.animationState=rie(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Dg(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 oie=0;class aie extends Uo{constructor(){super(...arguments),this.id=oie++}update(){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;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const lie={animation:{Feature:sie},exit:{Feature:aie}};function Md(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function kf(e){return{point:{x:e.pageX,y:e.pageY}}}const cie=e=>t=>y1(t)&&e(t,kf(t));function Hu(e,t,n,r){return Md(e,t,cie(n),r)}const EL=1e-4,uie=1-EL,die=1+EL,kL=.01,fie=0-kL,hie=0+kL;function Rn(e){return e.max-e.min}function pie(e,t,n){return Math.abs(e-t)<=n}function KT(e,t,n,r=.5){e.origin=r,e.originPoint=vt(t.min,t.max,e.origin),e.scale=Rn(n)/Rn(t),e.translate=vt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=uie&&e.scale<=die||isNaN(e.scale))&&(e.scale=1),(e.translate>=fie&&e.translate<=hie||isNaN(e.translate))&&(e.translate=0)}function Gu(e,t,n,r){KT(e.x,t.x,n.x,r?r.originX:void 0),KT(e.y,t.y,n.y,r?r.originY:void 0)}function YT(e,t,n){e.min=n.min+t.min,e.max=e.min+Rn(t)}function mie(e,t,n){YT(e.x,t.x,n.x),YT(e.y,t.y,n.y)}function QT(e,t,n){e.min=t.min-n.min,e.max=e.min+Rn(t)}function Ku(e,t,n){QT(e.x,t.x,n.x),QT(e.y,t.y,n.y)}function wr(e){return[e("x"),e("y")]}const CL=({current:e})=>e?e.ownerDocument.defaultView:null,XT=(e,t)=>Math.abs(e-t);function gie(e,t){const n=XT(e.x,t.x),r=XT(e.y,t.y);return Math.sqrt(n**2+r**2)}class TL{constructor(t,n,{transformPagePoint:r,contextWindow:i=window,dragSnapToOrigin:s=!1,distanceThreshold:o=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const h=jy(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,g=gie(h.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!g)return;const{point:v}=h,{timestamp:w}=Gt;this.history.push({...v,timestamp:w});const{onStart:y,onMove:x}=this.handlers;p||(y&&y(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),x&&x(this.lastMoveEvent,h)},this.handlePointerMove=(h,p)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=Ty(p,this.transformPagePoint),Je.update(this.updatePoint,!0)},this.handlePointerUp=(h,p)=>{this.end();const{onEnd:g,onSessionEnd:v,resumeAnimation:w}=this.handlers;if(this.dragSnapToOrigin&&w&&w(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=jy(h.type==="pointercancel"?this.lastMoveEventInfo:Ty(p,this.transformPagePoint),this.history);this.startEvent&&g&&g(h,y),v&&v(h,y)},!y1(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=i||window;const a=kf(t),l=Ty(a,this.transformPagePoint),{point:u}=l,{timestamp:d}=Gt;this.history=[{...u,timestamp:d}];const{onSessionStart:f}=n;f&&f(t,jy(l,this.history)),this.removeListeners=_f(Hu(this.contextWindow,"pointermove",this.handlePointerMove),Hu(this.contextWindow,"pointerup",this.handlePointerUp),Hu(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Fi(this.updatePoint)}}function Ty(e,t){return t?{point:t(e.point)}:e}function ZT(e,t){return{x:e.x-t.x,y:e.y-t.y}}function jy({point:e},t){return{point:e,delta:ZT(e,jL(t)),offset:ZT(e,vie(t)),velocity:yie(t,.1)}}function vie(e){return e[0]}function jL(e){return e[e.length-1]}function yie(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=jL(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Ri(t)));)n--;if(!r)return{x:0,y:0};const s=Ii(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const o={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function xie(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?vt(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?vt(n,e,r.max):Math.min(e,n)),e}function JT(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 wie(e,{top:t,left:n,bottom:r,right:i}){return{x:JT(e.x,n,i),y:JT(e.y,t,r)}}function ej(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 bie(e,t){return{x:ej(e.x,t.x),y:ej(e.y,t.y)}}function _ie(e,t){let n=.5;const r=Rn(e),i=Rn(t);return i>r?n=pc(t.min,t.max-r,e.min):r>i&&(n=pc(e.min,e.max-i,t.min)),Li(0,1,n)}function Sie(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 hw=.35;function Eie(e=hw){return e===!1?e=0:e===!0&&(e=hw),{x:tj(e,"left","right"),y:tj(e,"top","bottom")}}function tj(e,t,n){return{min:nj(e,t),max:nj(e,n)}}function nj(e,t){return typeof e=="number"?e:e[t]||0}const kie=new WeakMap;class Cie{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=Pt(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const s=f=>{const{dragSnapToOrigin:h}=this.getProps();h?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(kf(f).point)},o=(f,h)=>{const{drag:p,dragPropagation:g,onDragStart:v}=this.getProps();if(p&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Sne(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),wr(y=>{let x=this.getAxisMotionValue(y).get()||0;if(Ai.test(x)){const{projection:b}=this.visualElement;if(b&&b.layout){const _=b.layout.layoutBox[y];_&&(x=Rn(_)*(parseFloat(x)/100))}}this.originPoint[y]=x}),v&&Je.postRender(()=>v(f,h)),dw(this.visualElement,"transform");const{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},a=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h;const{dragPropagation:p,dragDirectionLock:g,onDirectionLock:v,onDrag:w}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:y}=h;if(g&&this.currentDirection===null){this.currentDirection=Tie(y),this.currentDirection!==null&&v&&v(this.currentDirection);return}this.updateAxis("x",h.point,y),this.updateAxis("y",h.point,y),this.visualElement.render(),w&&w(f,h)},l=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h,this.stop(f,h),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>wr(f=>{var h;return this.getAnimationState(f)==="paused"&&((h=this.getAxisMotionValue(f).animation)==null?void 0:h.play())}),{dragSnapToOrigin:d}=this.getProps();this.panSession=new TL(t,{onSessionStart:s,onStart:o,onMove:a,onSessionEnd:l,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:CL(this.visualElement)})}stop(t,n){const r=t||this.latestPointerEvent,i=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!i||!r)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:a}=this.getProps();a&&Je.postRender(()=>a(r,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!Sh(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=xie(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){var s;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,i=this.constraints;t&&El(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=wie(r.layoutBox,t):this.constraints=!1,this.elastic=Eie(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&wr(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Sie(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!El(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=Tre(r,i.root,this.visualElement.getTransformPagePoint());let o=bie(i.layout.layoutBox,s);if(n){const a=n(Ere(o));this.hasMutatedConstraints=!!a,a&&(o=fL(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=wr(d=>{if(!Sh(d,n,this.currentDirection))return;let f=l&&l[d]||{};o&&(f={min:0,max:0});const h=i?200:1e6,p=i?40:1e7,g={type:"inertia",velocity:r?t[d]:0,bounceStiffness:h,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(d,g)});return Promise.all(u).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return dw(this.visualElement,t),r.start(P1(t,r,0,n,this.visualElement,!1))}stopAnimation(){wr(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){wr(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){wr(n=>{const{drag:r}=this.getProps();if(!Sh(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n];s.set(t[n]-vt(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!El(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};wr(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=_ie({min:l,max:l},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),wr(o=>{if(!Sh(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];a.set(vt(l,u,i[o]))})}addListeners(){if(!this.visualElement.current)return;kie.set(this.visualElement,this);const t=this.visualElement.current,n=Hu(t,"pointerdown",l=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();El(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Je.read(r);const o=Md(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(wr(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=l[d].translate,f.set(f.get()+l[d].translate))}),this.visualElement.render())});return()=>{o(),n(),s(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=hw,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function Sh(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Tie(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class jie extends Uo{constructor(t){super(t),this.removeGroupControls=Zn,this.removeListeners=Zn,this.controls=new Cie(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Zn}unmount(){this.removeGroupControls(),this.removeListeners()}}const rj=e=>(t,n)=>{e&&Je.postRender(()=>e(t,n))};class Pie extends Uo{constructor(){super(...arguments),this.removePointerDownListener=Zn}onPointerDown(t){this.session=new TL(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:CL(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:rj(t),onStart:rj(n),onMove:r,onEnd:(s,o)=>{delete this.session,i&&Je.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=Hu(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const ap={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function ij(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const lu={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ke.test(e))e=parseFloat(e);else return e;const n=ij(e,t.target.x),r=ij(e,t.target.y);return`${n}% ${r}%`}},Nie={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=To.parse(e);if(i.length>5)return r;const s=To.createTransformer(e),o=typeof i[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;i[0+o]/=a,i[1+o]/=l;const u=vt(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),s(i)}};let sj=!1;class Rie extends m.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=t;Zne(Iie),s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),sj&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),ap.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,{projection:o}=r;return o&&(o.isPresent=s,sj=!0,i||t.layoutDependency!==n||n===void 0||t.isPresent!==s?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||Je.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),v1.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function PL(e){const[t,n]=ZM(),r=m.useContext(K_);return c.jsx(Rie,{...e,layoutGroup:r,switchLayoutGroup:m.useContext(uL),isPresent:t,safeToRemove:n})}const Iie={borderRadius:{...lu,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:lu,borderTopRightRadius:lu,borderBottomLeftRadius:lu,borderBottomRightRadius:lu,boxShadow:Nie};function Aie(e,t,n){const r=gn(e)?e:Ci(e);return r.start(P1("",r,t,n)),r.animation}const Oie=(e,t)=>e.depth-t.depth;class Die{constructor(){this.children=[],this.isDirty=!1}add(t){X_(this.children,t),this.isDirty=!0}remove(t){Z_(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Oie),this.isDirty=!1,this.children.forEach(t)}}function Mie(e,t){const n=Kn.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(Fi(r),e(s-t))};return Je.setup(r,!0),()=>Fi(r)}const NL=["TopLeft","TopRight","BottomLeft","BottomRight"],Lie=NL.length,oj=e=>typeof e=="string"?parseFloat(e):e,aj=e=>typeof e=="number"||ke.test(e);function Fie(e,t,n,r,i,s){i?(e.opacity=vt(0,n.opacity??1,$ie(r)),e.opacityExit=vt(t.opacity??1,0,Uie(r))):s&&(e.opacity=vt(t.opacity??1,n.opacity??1,r));for(let o=0;o<Lie;o++){const a=`border${NL[o]}Radius`;let l=lj(t,a),u=lj(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||aj(l)===aj(u)?(e[a]=Math.max(vt(oj(l),oj(u),r),0),(Ai.test(u)||Ai.test(l))&&(e[a]+="%")):e[a]=u}(t.rotate||n.rotate)&&(e.rotate=vt(t.rotate||0,n.rotate||0,r))}function lj(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const $ie=RL(0,.5,pM),Uie=RL(.5,.95,Zn);function RL(e,t,n){return r=>r<e?0:r>t?1:n(pc(e,t,r))}function cj(e,t){e.min=t.min,e.max=t.max}function xr(e,t){cj(e.x,t.x),cj(e.y,t.y)}function uj(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function dj(e,t,n,r,i){return e-=t,e=fm(e,1/n,r),i!==void 0&&(e=fm(e,1/i,r)),e}function Vie(e,t=0,n=1,r=.5,i,s=e,o=e){if(Ai.test(t)&&(t=parseFloat(t),t=vt(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=vt(s.min,s.max,r);e===s&&(a-=t),e.min=dj(e.min,t,n,a,i),e.max=dj(e.max,t,n,a,i)}function fj(e,t,[n,r,i],s,o){Vie(e,t[n],t[r],t[i],t.scale,s,o)}const zie=["x","scaleX","originX"],Bie=["y","scaleY","originY"];function hj(e,t,n,r){fj(e.x,t,zie,n?n.x:void 0,r?r.x:void 0),fj(e.y,t,Bie,n?n.y:void 0,r?r.y:void 0)}function pj(e){return e.translate===0&&e.scale===1}function IL(e){return pj(e.x)&&pj(e.y)}function mj(e,t){return e.min===t.min&&e.max===t.max}function Wie(e,t){return mj(e.x,t.x)&&mj(e.y,t.y)}function gj(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function AL(e,t){return gj(e.x,t.x)&&gj(e.y,t.y)}function vj(e){return Rn(e.x)/Rn(e.y)}function yj(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class qie{constructor(){this.members=[]}add(t){X_(this.members,t),t.scheduleRender()}remove(t){if(Z_(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Hie(e,t,n){let r="";const i=e.x.translate/t.x,s=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((i||s||o)&&(r=`translate3d(${i}px, ${s}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:h,skewX:p,skewY:g}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),f&&(r+=`rotateX(${f}deg) `),h&&(r+=`rotateY(${h}deg) `),p&&(r+=`skewX(${p}deg) `),g&&(r+=`skewY(${g}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 Py=["","X","Y","Z"],Gie=1e3;let Kie=0;function Ny(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function OL(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=wL(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Je,!(i||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&OL(r)}function DL({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},a=t==null?void 0:t()){this.id=Kie++,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.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>
vendor: 4,316 bytes, line 517
517{this.projectionUpdateScheduled=!1,this.nodes.forEach(Xie),this.nodes.forEach(tse),this.nodes.forEach(nse),this.nodes.forEach(Zie)},this.resolvedRelativeTargetAt=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 Die)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new e1),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=x1(o)&&!Fne(o),this.instance=o;const{layoutId:a,layout:l,visualElement:u}=this.options;if(u&&!u.current&&u.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;Je.read(()=>{f=window.innerWidth}),e(o,()=>{const p=window.innerWidth;p!==f&&(f=p,this.root.updateBlockedByResize=!0,d&&d(),d=Mie(h,250),ap.hasAnimatedSinceResize&&(ap.hasAnimatedSinceResize=!1,this.nodes.forEach(bj)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(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 g=this.options.transition||u.getDefaultTransition()||ase,{onLayoutAnimationStart:v,onLayoutAnimationComplete:w}=u.getProps(),y=!this.targetLayout||!AL(this.targetLayout,p),x=!f&&h;if(this.options.layoutRoot||this.resumeFrom||x||f&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const b={...p1(g,"layout"),onPlay:v,onComplete:w};(u.shouldReduceMotion||this.options.layoutRoot)&&(b.delay=0,b.type=!1),this.startAnimation(b),this.setAnimationOrigin(d,x)}else f||bj(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(),Fi(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(rse),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&&OL(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,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(xj);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(wj);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(ese),this.nodes.forEach(Yie),this.nodes.forEach(Qie)):this.nodes.forEach(wj),this.clearAllSnapshots();const a=Kn.now();Gt.delta=Li(0,1e3/60,a-Gt.timestamp),Gt.timestamp=a,Gt.isProcessing=!0,xy.update.process(Gt),xy.preRender.process(Gt),xy.render.process(Gt),Gt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,v1.read(this.scheduleUpdate))}
vendor: 11,489 bytes, line 517
517clearAllSnapshots(){this.nodes.forEach(Jie),this.sharedNodes.forEach(ise)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Je.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Je.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Rn(this.snapshot.measuredBox.x)&&!Rn(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.layoutCorrected=Pt(),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(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!IL(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;o&&this.instance&&(a||Qo(this.latestValues)||d)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),lse(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:o}=this.options;if(!o)return Pt();const a=o.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(cse))){const{scroll:d}=this.root;d&&(kl(a.x,d.offset.x),kl(a.y,d.offset.y))}return a}removeElementScroll(o){var l;const a=Pt();if(xr(a,o),(l=this.scroll)!=null&&l.wasRoot)return a;for(let u=0;u<this.path.length;u++){const d=this.path[u],{scroll:f,options:h}=d;d!==this.root&&f&&h.layoutScroll&&(f.wasRoot&&xr(a,o),kl(a.x,f.offset.x),kl(a.y,f.offset.y))}return a}applyTransform(o,a=!1){const l=Pt();xr(l,o);for(let u=0;u<this.path.length;u++){const d=this.path[u];!a&&d.options.layoutScroll&&d.scroll&&d!==d.root&&Cl(l,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),Qo(d.latestValues)&&Cl(l,d.latestValues)}return Qo(this.latestValues)&&Cl(l,this.latestValues),l}removeTransform(o){const a=Pt();xr(a,o);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!Qo(u.latestValues))continue;aw(u.latestValues)&&u.updateSnapshot();const d=Pt(),f=u.measurePageBox();xr(d,f),hj(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return Qo(this.latestValues)&&hj(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!==Gt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var h;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||(h=this.parent)!=null&&h.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!(!this.layout||!(d||f))){if(this.resolvedRelativeTargetAt=Gt.timestamp,!this.targetDelta&&!this.relativeTarget){const p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Pt(),this.relativeTargetOrigin=Pt(),Ku(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),xr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Pt(),this.targetWithTransforms=Pt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),mie(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):xr(this.target,this.layout.layoutBox),pL(this.target,this.targetDelta)):xr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const p=this.getClosestProjectingParent();p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Pt(),this.relativeTargetOrigin=Pt(),Ku(this.relativeTargetOrigin,this.target,p.target),xr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||aw(this.parent.latestValues)||hL(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var g;const o=this.getLead(),a=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||(g=this.parent)!=null&&g.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===Gt.timestamp&&(l=!1),l)return;const{layout:u,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||!(u||d))return;xr(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,h=this.treeScale.y;Cre(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=Pt());const{target:p}=o;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(uj(this.prevProjectionDelta.x,this.projectionDelta.x),uj(this.prevProjectionDelta.y,this.projectionDelta.y)),Gu(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==h||!yj(this.projectionDelta.x,this.prevProjectionDelta.x)||!yj(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=Tl(),this.projectionDelta=Tl(),this.projectionDeltaWithTransform=Tl()}setAnimationOrigin(o,a=!1){const l=this.snapshot,u=l?l.latestValues:{},d={...this.latestValues},f=Tl();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=Pt(),p=l?l.source:void 0,g=this.layout?this.layout.source:void 0,v=p!==g,w=this.getStack(),y=!w||w.members.length<=1,x=!!(v&&!y&&this.options.crossfade===!0&&!this.path.some(ose));this.animationProgress=0;let b;this.mixTargetDelta=_=>{const S=_/1e3;_j(f.x,o.x,S),_j(f.y,o.y,S),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ku(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),sse(this.relativeTarget,this.relativeTargetOrigin,h,S),b&&Wie(this.relativeTarget,b)&&(this.isProjectionDirty=!1),b||(b=Pt()),xr(b,this.relativeTarget)),v&&(this.animationValues=d,Fie(d,u,this.latestValues,S,x,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var a,l,u;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(u=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||u.stop(),this.pendingAnimation&&(Fi(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Je.update(()=>{ap.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ci(0)),this.currentAnimation=Aie(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(Gie),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:d}=o;if(!(!a||!l||!u)){if(this!==o&&this.layout&&u&&ML(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Pt();const f=Rn(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+f;const h=Rn(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+h}xr(a,l),Cl(a,d),Gu(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new qie),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var 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 u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}
vendor: 4,220 bytes, line 517
517resetSkewAndRotation(){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 u={};l.z&&Ny("z",o,u,this.animationValues);for(let d=0;d<Py.length;d++)Ny(`rotate${Py[d]}`,o,u,this.animationValues),Ny(`skew${Py[d]}`,o,u,this.animationValues);o.render();for(const d in u)o.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[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=op(a==null?void 0:a.pointerEvents)||"",o.transform=l?l(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=op(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!Qo(this.latestValues)&&(o.transform=l?l({},""):"none",this.hasProjected=!1);return}o.visibility="";const d=u.animationValues||u.latestValues;this.applyTransformsToTarget();let f=Hie(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`,u.animationValues?o.opacity=u===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:o.opacity=u===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const g in Od){if(d[g]===void 0)continue;const{correct:v,applyTo:w,isCSSVariable:y}=Od[g],x=f==="none"?d[g]:v(d[g],u);if(w){const b=w.length;for(let _=0;_<b;_++)o[w[_]]=x}else y?this.options.visualElement.renderState.vars[g]=x:o[g]=x}this.options.layoutId&&(o.pointerEvents=u===this?op(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(xj),this.root.sharedNodes.clear()}}}function Yie(e){e.updateLayout()}function Qie(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:i}=e.layout,{animationType:s}=e.options,o=t.source!==e.layout.source;s==="size"?wr(f=>{const h=o?t.measuredBox[f]:t.layoutBox[f],p=Rn(h);h.min=r[f].min,h.max=h.min+p}):ML(s,t.layoutBox,r)&&wr(f=>{const h=o?t.measuredBox[f]:t.layoutBox[f],p=Rn(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=Tl();Gu(a,r,t.layoutBox);const l=Tl();o?Gu(l,e.applyTransform(i,!0),t.measuredBox):Gu(l,r,t.layoutBox);const u=!IL(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 g=Pt();Ku(g,t.layoutBox,h.layoutBox);const v=Pt();Ku(v,r,p.layoutBox),AL(g,v)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=v,e.relativeTargetOrigin=g,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Xie(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 Zie(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Jie(e){e.clearSnapshot()}function xj(e){e.clearMeasurements()}function wj(e){e.isLayoutDirty=!1}function ese(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function bj(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function tse(e){e.resolveTargetDelta()}function nse(e){e.calcProjection()}
517function rse(e){e.resetSkewAndRotation()}function ise(e){e.removeLeadSnapshot()}function _j(e,t,n){e.translate=vt(t.translate,0,n),e.scale=vt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Sj(e,t,n,r){e.min=vt(t.min,n.min,r),e.max=vt(t.max,n.max,r)}function sse(e,t,n,r){Sj(e.x,t.x,n.x,r),Sj(e.y,t.y,n.y,r)}function ose(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const ase={duration:.45,ease:[.4,0,.1,1]},Ej=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),kj=Ej("applewebkit/")&&!Ej("chrome/")?Math.round:Zn;function Cj(e){e.min=kj(e.min),e.max=kj(e.max)}function lse(e){Cj(e.x),Cj(e.y)}function ML(e,t,n){return e==="position"||e==="preserve-aspect"&&!pie(vj(t),vj(n),.2)}function cse(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const use=DL({attachResizeListener:(e,t)=>Md(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Ry={current:void 0},LL=DL({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Ry.current){const e=new use({});e.mount(window),e.setOptions({layoutScroll:!0}),Ry.current=e}return Ry.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),dse={pan:{Feature:Pie},drag:{Feature:jie,ProjectionNode:LL,MeasureLayout:PL}};function Tj(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&Je.postRender(()=>s(t,kf(t)))}class fse extends Uo{mount(){const{current:t}=this.node;t&&(this.unmount=Ene(t,(n,r)=>(Tj(this.node,r,"Start"),i=>Tj(this.node,i,"End"))))}unmount(){}}class hse extends Uo{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=_f(Md(this.node.current,"focus",()=>this.onFocus()),Md(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function jj(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 i="onTap"+(n==="End"?"":n),s=r[i];s&&Je.postRender(()=>s(t,kf(t)))}class pse extends Uo{mount(){const{current:t}=this.node;t&&(this.unmount=jne(t,(n,r)=>(jj(this.node,r,"Start"),(i,{success:s})=>jj(this.node,i,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const pw=new WeakMap,Iy=new WeakMap,mse=e=>{const t=pw.get(e.target);t&&t(e)},gse=e=>{e.forEach(mse)};function vse({root:e,...t}){const n=e||document;Iy.has(n)||Iy.set(n,{});const r=Iy.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(gse,{root:e,...t})),r[i]}function yse(e,t,n){const r=vse(t);return pw.set(e,n),r.observe(e),()=>{pw.delete(e),r.unobserve(e)}}const xse={some:0,all:1};class wse extends Uo{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:xse[i]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,s&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),h=u?d:f;h&&h(l)};return yse(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(bse(t,n))&&this.startObserver()}unmount(){}}function bse({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const _se={inView:{Feature:wse},tap:{Feature:pse},focus:{Feature:hse},hover:{Feature:fse}},Sse={layout:{ProjectionNode:LL,MeasureLayout:PL}},Ese={...lie,..._se,...dse,...Sse},mo=Sre(Ese,Mre);function kse(e,t,n){m.useInsertionEffect(()=>e.on(t,n),[e,t,n])}const Cse=50,Pj=()=>({current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}),Tse=()=>({time:0,x:Pj(),y:Pj()}),jse={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function Nj(e,t,n,r){const i=n[t],{length:s,position:o}=jse[t],a=i.current,l=n.time;i.current=e[`scroll${o}`],i.scrollLength=e[`scroll${s}`]-e[`client${s}`],i.offset.length=0,i.offset[0]=0,i.offset[1]=i.scrollLength,i.progress=pc(0,i.scrollLength,i.current);const u=r-l;i.velocity=u>Cse?0:t1(i.current-a,u)}function Pse(e,t,n){Nj(e,"x",t,n),Nj(e,"y",t,n),t.time=n}function Nse(e,t){const n={x:0,y:0};let r=e;for(;r&&r!==t;)if(g1(r))n.x+=r.offsetLeft,n.y+=r.offsetTop,r=r.offsetParent;else if(r.tagName==="svg"){const i=r.getBoundingClientRect();r=r.parentElement;const s=r.getBoundingClientRect();n.x+=i.left-s.left,n.y+=i.top-s.top}else if(r instanceof SVGGraphicsElement){const{x:i,y:s}=r.getBBox();n.x+=i,n.y+=s;let o=null,a=r.parentNode;for(;!o;)a.tagName==="svg"&&(o=a),a=r.parentNode;r=o}else break;return n}const mw={start:0,center:.5,end:1};function Rj(e,t,n=0){let r=0;if(e in mw&&(e=mw[e]),typeof e=="string"){const i=parseFloat(e);e.endsWith("px")?r=i:e.endsWith("%")?e=i/100:e.endsWith("vw")?r=i/100*document.documentElement.clientWidth:e.endsWith("vh")?r=i/100*document.documentElement.clientHeight:e=i}return typeof e=="number"&&(r=t*e),n+r}const Rse=[0,0];function Ise(e,t,n,r){let i=Array.isArray(e)?e:Rse,s=0,o=0;return typeof e=="number"?i=[e,e]:typeof e=="string"&&(e=e.trim(),e.includes(" ")?i=e.split(" "):i=[e,mw[e]?e:"0"]),s=Rj(i[0],n,r),o=Rj(i[1],t),s-o}const Ase={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},Ose={x:0,y:0};function Dse(e){return"getBBox"in e&&e.tagName!=="svg"?e.getBBox():{width:e.clientWidth,height:e.clientHeight}}function Mse(e,t,n){const{offset:r=Ase.All}=n,{target:i=e,axis:s="y"}=n,o=s==="y"?"height":"width",a=i!==e?Nse(i,e):Ose,l=i===e?{width:e.scrollWidth,height:e.scrollHeight}:Dse(i),u={width:e.clientWidth,height:e.clientHeight};t[s].offset.length=0;let d=!t[s].interpolate;const f=r.length;for(let h=0;h<f;h++){const p=Ise(r[h],u[o],l[o],a[s]);
517!d&&p!==t[s].interpolatorOffsets[h]&&(d=!0),t[s].offset[h]=p}d&&(t[s].interpolate=PM(t[s].offset,NM(r),{clamp:!1}),t[s].interpolatorOffsets=[...t[s].offset]),t[s].progress=Li(0,1,t[s].interpolate(t[s].current))}function Lse(e,t=e,n){if(n.x.targetOffset=0,n.y.targetOffset=0,t!==e){let r=t;for(;r&&r!==e;)n.x.targetOffset+=r.offsetLeft,n.y.targetOffset+=r.offsetTop,r=r.offsetParent}n.x.targetLength=t===e?t.scrollWidth:t.clientWidth,n.y.targetLength=t===e?t.scrollHeight:t.clientHeight,n.x.containerLength=e.clientWidth,n.y.containerLength=e.clientHeight}function Fse(e,t,n,r={}){return{measure:i=>{Lse(e,r.target,n),Pse(e,n,i),(r.offset||r.target)&&Mse(e,n,r)},notify:()=>t(n)}}const cu=new WeakMap,Ij=new WeakMap,Ay=new WeakMap,Aj=e=>e===document.scrollingElement?window:e;function FL(e,{container:t=document.scrollingElement,...n}={}){if(!t)return Zn;let r=Ay.get(t);r||(r=new Set,Ay.set(t,r));const i=Tse(),s=Fse(t,e,i,n);if(r.add(s),!cu.has(t)){const a=()=>{for(const f of r)f.measure(Gt.timestamp);Je.preUpdate(l)},l=()=>{for(const f of r)f.notify()},u=()=>Je.read(a);cu.set(t,u);const d=Aj(t);window.addEventListener("resize",u,{passive:!0}),t!==document.documentElement&&Ij.set(t,Lne(t,u)),d.addEventListener("scroll",u,{passive:!0}),u()}const o=cu.get(t);return Je.read(o,!1,!0),()=>{var u;Fi(o);const a=Ay.get(t);if(!a||(a.delete(s),a.size))return;const l=cu.get(t);cu.delete(t),l&&(Aj(t).removeEventListener("scroll",l),(u=Ij.get(t))==null||u(),window.removeEventListener("resize",l))}}const Oj=new Map;function $se(e){const t={value:0},n=FL(r=>
517{t.value=r[e.axis].progress*100},e);return{currentTime:t,cancel:n}}function $L({source:e,container:t,...n}){const{axis:r}=n;e&&(t=e);const i=Oj.get(t)??new Map;Oj.set(t,i);const s=n.target??"self",o=i.get(s)??{},a=r+(n.offset??[]).join(",");return o[a]||(o[a]=!n.target&&OM()?new ScrollTimeline({source:t,axis:r}):$se({container:t,...n})),o[a]}function Use(e,t){const n=$L(t);return e.attachTimeline({timeline:t.target?void 0:n,observe:r=>(r.pause(),XM(i=>{r.time=r.duration*i},n))})}function Vse(e){return e.length===2}function zse(e,t){return Vse(e)?FL(n=>{e(n[t.axis].progress,n)},t):XM(e,$L(t))}function Bse(e,{axis:t="y",container:n=document.scrollingElement,...r}={}){if(!n)return Zn;const i={axis:t,container:n,...r};return typeof e=="function"?zse(e,i):Use(e,i)}const Wse=()=>({scrollX:Ci(0),scrollY:Ci(0),scrollXProgress:Ci(0),scrollYProgress:Ci(0)}),Eh=e=>e?!e.current:!1;function qse({container:e,target:t,...n}={}){const r=Ig(Wse),i=m.useRef(null),s=m.useRef(!1),o=m.useCallback(()=>(i.current=Bse((a,{x:l,y:u})=>{r.scrollX.set(l.current),r.scrollXProgress.set(l.progress),r.scrollY.set(u.current),r.scrollYProgress.set(u.progress)},{...n,container:(e==null?void 0:e.current)||void 0,target:(t==null?void 0:t.current)||void 0}),()=>{var a;(a=i.current)==null||a.call(i)}),[e,t,JSON.stringify(n.offset)]);return Q_(()=>{if(s.current=!1,Eh(e)||Eh(t)){s.current=!0;return}else return o()},[o]),m.useEffect(()=>{if(s.current)return hc(!Eh(e)),hc(!Eh(t)),o()},[o]),r}const Hse=({content:e,contentClassName:t})=>{const[n,r]=F.useState(0),i=m.useRef(null),{scrollYProgress:s}=qse({container:i,offset:["start start","end start"]}),o=e.length;return kse(s,"change",a=>{const l=e.map((d,f)=>f/o),u=l.reduce((d,f,h)=>Math.abs(a-f)<Math.abs(a-l[d])?h:d,0);r(u)}),c.jsxs("div",{className:"relative",children:[c.jsxs("div",{className:"h-[30rem] overflow-y-auto flex justify-center relative space-x-10 rounded-md p-10 bg-transparent hide-scrollbar",ref:i,children:[c.jsx("div",{className:"div relative flex items-start px-4",children:c.jsxs("div",{className:"max-w-2xl",children:[e.map((a,l)=>c.jsxs("div",{className:"my-20",children:[c.jsx(mo.h2,{initial:{opacity:0}
517,animate:{opacity:n===l?1:.3},className:"text-2xl font-bold text-white",children:a.title}),c.jsx(mo.p,{initial:{opacity:0},animate:{opacity:n===l?1:.3},className:"text-lg text-gray-300 max-w-sm mt-10",children:a.description})]},`sticky-item-${l}`)),c.jsx("div",{className:"h-40"})]})}),c.jsx("div",{className:K("hidden lg:block h-[600px] w-96 rounded-md bg-transparent sticky top-10 overflow-visible",t),children:e[n].content??null})]}),c.jsx("div",{className:"absolute right-4 top-1/2 transform -translate-y-1/2 flex flex-col space-y-3",children:e.map((a,l)=>c.jsx(mo.div,{className:`w-2 h-2 rounded-full transition-all duration-300 ${l===n?"bg-primary h-8":"bg-gray-600"}`,animate:{scale:l===n?1.2:1},transition:{duration:.3}},l))})]})},UL=[{icon:c.jsx(uc,{className:"h-6 w-6"}),title:"Identify Ingredients Instantly",subtitle:"Make your phone your kitchen assistant",description:"No more lists, no more guessing. Just talk, snap, or scan - and watch your kitchen come alive. Tell us what's in your fridge, photograph your groceries, or scan a receipt. MealMuse understands it all and keeps your digital pantry up to date. Spend less time inventorying and more time cooking.",phoneImage:"https://znfdhxoristtdztjrzcn.supabase.co/storage/v1/object/public/demo-images//inventory.PNG"},{icon:c.jsx(fK,{className:"h-6 w-6"}),title:"Meal Planning",subtitle:"AI-powered meal suggestions",description:"Generate personalized meal plans and recipes based on your ingredients, preferences, and dietary restrictions. MealMuse considers what you have, what you like, and creates delicious meal combinations.",phoneImage:"https://znfdhxoristtdztjrzcn.supabase.co/storage/v1/object/public/demo-images//recipe.jpg"},{icon:c.jsx(CA,{className:"h-6 w-6"}),title:"Smart Shopping Lists",subtitle:"Organized by store sections",description:"MealMuse automatically adds missing ingredients from your selected recipes to organized shopping lists, sorted by store sections. Shopping stays simple and efficient - just pick your meals and we'll handle the rest.",phoneImage:"https://znfdhxoristtdztjrzcn.supabase.co/storage/v1/object/public/demo-images//shopping.PNG"},{icon:c.jsx(kA,{className:"h-6 w-6"}),title:"Preference Customization",subtitle:"Tailored to your taste",description:"Set dietary restrictions, spice tolerance, cuisine preferences, and serving sizes for tailored results. As you save and rate recipes, MealMuse learns what you like and dislike to further personalize future recommendations. Your preferences shape every suggestion.",phoneImage:"https://znfdhxoristtdztjrzcn.supabase.co/storage/v1/object/public/demo-images//preferences.PNG"}],Gse=UL.map(e=>({title:c.jsxs("div",{className:"flex items-start space-x-4",children:[c.jsx("div",{className:"w-12 h-12 rounded-xl bg-primary flex items-center justify-center text-white flex-shrink-0",children:e.icon}),c.jsxs("div",{className:"flex-1",children:[c.jsx("h3",{className:"text-2xl font-bold text-white",children:e.title}),c.jsx("p",{className:"text-primary text-lg mt-2",children:e.subt
517itle})]})]}),description:e.description,content:c.jsx("div",{className:"h-full w-full relative flex items-center justify-center p-4",children:c.jsx("div",{className:"relative w-72 h-[580px]",children:c.jsxs("div",{className:"absolute inset-0 bg-white rounded-[3rem] shadow-2xl border-8 border-gray-900",children:[c.jsx("div",{className:"absolute top-0 left-1/2 transform -translate-x-1/2 w-32 h-6 bg-black rounded-b-3xl"}),c.jsxs("div",{className:"absolute top-2 left-4 right-4 flex justify-between items-center text-xs text-black",children:[c.jsx("span",{children:"2:03"}),c.jsxs("div",{className:"flex items-center space-x-1",children:[c.jsx("div",{className:"w-4 h-2 bg-black rounded-sm"}),c.jsx("div",{className:"w-1 h-1 bg-black rounded-full"})]})]}),c.jsx("div",{className:"absolute top-12 left-4 right-4 bottom-4 bg-white",children:c.jsx("div",{className:"relative w-full h-full overflow-hidden rounded-lg",children:e.phoneImage?c.jsx("img",{src:e.phoneImage,alt:`${e.title} feature`,className:"w-full h-full object-contain rounded-lg"}):c.jsx("div",{className:"w-full h-full bg-gray-100 rounded-lg flex items-center justify-center",children:c.jsxs("div",{className:"text-center text-gray-500",children:[c.jsx("div",{className:"text-2xl mb-2",children:"📱"}),c.jsx("div",{className:"text-sm",children:"Add your image URL"})]})})})})]})})})})),Kse=()=>c.jsxs("section",{id:"features",className:"py-16 sm:py-24 bg-gradient-to-b from-gray-800 via-gray-900 to-gray-950 overflow-hidden relative text-white",children:[c.jsx("div",{className:"absolute top-40 left-20 w-72 h-72 rounded-full bg-primary/10 blur-3xl -z-10"}),c.jsx("div",{className:"absolute bottom-20 right-40 w-72 h-72 rounded-full bg-secondary/10 blur-3xl -z-10"}),c.jsxs("div",{className:"container mx-auto px-4 relative z-10",children:[c.jsxs("div",{className:"text-center mb-16",children:[c.jsx("span",{className:"inline-block py-1.5 px-4 text-sm font-medium bg-primary/10 text-primary rounded-full shadow-sm",children:"Features"}),c.jsx("h2",{className:"mt-5 text-3xl sm:text-4xl font-display font-bold text-white",children:"Make Meals Magical"}),c.jsx("p",{className:"text-lg text-gray-300 max-w-3xl mx-auto leading-relaxed",children:"MealMuse makes recipe discovery, grocery shoppings, and meal planning more intuitive, more enjoyable, and more intelligent."})]}),c.jsx("div",{className:"hidden lg:block",children:c.jsx(Hse,{content:Gse})}),c.jsx("div",{className:"lg:hidden space-y-12",children:UL.map((e,t)=>c.jsxs("div",{className:"text-center",children:[c.jsxs("div",{className:"mb-8",children:[c.jsxs("div",{className:"flex items-center justify-center mb-4",children:[c.jsx("div",{className:"w-12 h-12 rounded-xl bg-primary flex items-center justify-center text-white mr-4",children:e.icon}),c.jsx("h3",{className:"text-xl font-bold text-white text-left",children:e.title})]}),c.jsx("p",{className:"text-primary text-sm mb-4",children:e.subt
517itle}),c.jsx("p",{className:"text-gray-300 leading-relaxed text-sm max-w-sm mx-auto",children:e.description})]}),c.jsx("div",{className:"flex justify-center",children:c.jsx("div",{className:"relative w-48 h-[360px]",children:c.jsxs("div",{className:"absolute inset-0 bg-white rounded-[2rem] shadow-lg border-4 border-gray-900",children:[c.jsx("div",{className:"absolute top-0 left-1/2 transform -translate-x-1/2 w-16 h-2 bg-black rounded-b-xl"}),c.jsxs("div",{className:"absolute top-1 left-2 right-2 flex justify-between items-center text-xs text-black",children:[c.jsx("span",{className:"text-xs",children:"2:03"}),c.jsxs("div",{className:"flex items-center space-x-1",children:[c.jsx("div",{className:"w-2 h-1 bg-black rounded-sm"}),c.jsx("div",{className:"w-1 h-1 bg-black rounded-full"})]})]}),c.jsx("div",{className:"absolute top-4 left-2 right-2 bottom-2 bg-white",children:c.jsx("div",{className:"relative w-full h-full overflow-hidden rounded-lg",children:e.phoneImage?c.jsx("img",{src:e.phoneImage,alt:`${e.title} feature`,className:"w-full h-full object-contain rounded-lg"}):c.jsx("div",{className:"w-full h-full bg-gray-100 rounded-lg flex items-center justify-center",children:c.jsxs("div",{className:"text-center text-gray-500",children:[c.jsx("div",{className:"text-sm mb-1",children:"📱"}),c.jsx("div",{className:"text-xs",children:"Image"})]})})})})]})})})]},t))})]})]}),nr=[{quote:"MealMuse has completely revolutionized how I plan meals for my family. No more wasted food or last-minute takeout orders!",name:"Sarah Johnson",title:"Busy Parent of Three"},{quote:"As someone with dietary restrictions, finding varied meals was always a challenge. MealMuse's suggestions are always spot-on and consider my needs.",name:"David Chen",title:"Health Enthusiast"},{quote:"The ingredient detection feature is like magic. I just snap a picture of my fridge and MealMuse creates a meal plan with what I already have.",name:"Priya Patel",title:"Working Professional"},{quote:"I've saved so much money by reducing food waste and being more intentional with my grocery shopping thanks to MealMuse.",name:"Michael Rodriguez",title:"Budget-Conscious Cook"}],Yse=()=>{const[e,t]=m.useState(!1),[n,r]=m.useState(0),[i,s]=m.useState(!0),[o,a]=m.useState(!1),l=m.useRef(null),u=m.useRef(null),d=[...nr,...nr,...nr];m.useEffect(()=>{const g=new IntersectionObserver(([v])=>{v.isIntersecting&&(t(!0),g.disconnect())},{threshold:.1});return l.current&&g.observe(l.current),()=>g.disconnect()},[]),m.useEffect(()=>{if(!i||!e)return;const g=setInterval(()=>{o||r(v=>{const w=v+1;return w>=nr.length?nr.length:w})},5e3);return()=>clearInterval(g)},[i,e,o]),m.useEffect(()=>{n>=nr.length*2&&setTimeout(()=>{a(!0),r(nr.length),setTimeout(()=>a(!1),50)},700)},[n]);const f=()=>{s(!1),r(g=>{const v=g-1;return v<0?nr.length*2-1:v}),setTimeout(()=>s(!0),1e4)},h=()=>{s(!1),r(g=>{const v=g+1;return v>=nr.length*2?nr.length:v}),setTimeout(()=>s(!0),1e4)},p=g=>{s(!1),r(g+nr.length),setTimeout(()=>s(!0),1e4)};return c.jsx("section",{id:"testimonials",ref:l,className:"py-16 sm:py-24 bg-gradient-to-b from-black via-gray-950 to-black overflow-hidden text-white",children:c.jsxs("div",{className:"container px-4 max-w-6xl mx-auto",children:[c.jsxs("div",{className:"text-center mb-12 sm:mb-16 animate-fade-in",children:[c.jsx("span",{className:"inline-block py-1.5 px-4 text-sm font-medium bg-primary/10 text-primary rounded-full shadow-sm",children:"Testimonials"}),c.jsx("h2",{className:"mt-5 text-3xl sm:text-4xl font-display font-bold text-white",children:"What Our Home Cooks Say"}),c.jsx("p",{className:"mt-4 text-lg text-gray-300 max-w-2xl mx-auto leading-relaxed",children:"Thousands have transformed how they plan, cook, and shop"})]}),c.jsxs("div",{className:`relative transition-opacity duration-1000 ${e?"opacity-100":"opacity-0"}`,children:[c.jsx("div",{className:"absolute -top-6 -left-6 text-primary/10",children:c.jsx(RC,{size:60})}),c.jsx("div",{className:"absolute -bottom-6 -right-6 text-primary/10 transform rotate-180",children:c.jsx(RC,{size:60})}),c.jsxs("div",{className:"relative w-full max-w-4xl mx-auto",children:[c.jsx("div",{className:"overflow-hidden rounded-lg",children:c.jsx("div",{ref:u,className:"flex transition-transform duration-700 ease-in-out",style:{transform:`translateX(-${n*100}
517%)`,transition:o?"none":"transform 700ms ease-in-out"},children:d.map((g,v)=>c.jsx("div",{className:"w-full flex-shrink-0 px-6 py-4",children:c.jsxs("div",{className:"bg-gray-800/50 backdrop-blur-sm border border-gray-700 rounded-xl p-6 sm:p-8 shadow-xl h-full",children:[c.jsxs("blockquote",{className:"text-xl sm:text-2xl text-gray-100 mb-6 sm:mb-8 font-display italic leading-relaxed",children:['"',g.quote,'"']}),c.jsxs("div",{className:"flex items-center",children:[c.jsx("div",{className:"mr-4 w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center text-primary",children:c.jsx(jA,{size:24})}),c.jsxs("div",{children:[c.jsx("div",{className:"font-semibold text-white",children:g.name}),c.jsx("div",{className:"text-sm text-gray-400",children:g.title})]})]})]})},v))})}),c.jsx("button",{onClick:f,className:"absolute -left-12 lg:-left-16 top-1/2 -translate-y-1/2 hidden lg:flex w-12 h-12 rounded-full bg-gray-800/90 border border-gray-600 shadow-lg items-center justify-center text-primary hover:bg-gray-700 transition-colors",children:c.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),c.jsx("button",{onClick:h,className:"absolute -right-12 lg:-right-16 top-1/2 -translate-y-1/2 hidden lg:flex w-12 h-12 rounded-full bg-gray-800/90 border border-gray-600 shadow-lg items-center justify-center text-primary hover:bg-gray-700 transition-colors",children:c.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})})]}),c.jsx("div",{className:"flex justify-center mt-8 space-x-2 lg:hidden",children:nr.map((g,v)=>c.jsx("button",{onClick:()=>p(v),className:`w-2 h-2 rounded-full transition-all duration-300 ${n%nr.length===v?"bg-primary w-6":"bg-primary/30 hover:bg-primary/50"}`},v))})]})]})})},N1=()=>{const e=new Date().getFullYear();return c.jsx("footer",{className:"bg-black border-t border-gray-800 py-12 text-white",children:c.jsxs("div",{className:"container px-4 max-w-6xl mx-auto",children:[c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-4 gap-8",children:[c.jsxs("div",{className:"space-y-4 sm:col-span-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("img",{src:"/lovable-uploads/c1f40201-c4cd-4e2f-85e8-7f3803684d6f.png",alt:"MealMuse Logo",className:"h-8 w-8"}),c.jsx("h3",{className:"text-xl font-display font-semibold bg-clip-text text-transparent bg-gradient-to-r from-primary to-primary/80",children:"MealMuse"})]}),c.jsx("p",{className:"text-gray-400 max-w-xs",children:"Smart meal planning powered by AI. Save time, reduce waste, and enjoy delicious meals tailored to your preferences."})]}),c.jsxs("div",{children:[c.jsx("h4",{className:"font-semibold mb-4 text-white",children:"Quick Links"}),c.jsxs("ul",{className:"space-y-3",children:[c.jsx("li",{children:c.jsx("a",{href:"/",className:"text-gray-400 hover:text-primary transition-colors",children:"Home"})}),c.jsx("li",{children:c.jsx("a",{href:"#features",className:"text-gray-400 hover:text-primary transition-colors",children:"Features"})}),c.jsx("li",{children:c.jsx("a",{href:"#testimonials",className:"text-gray-400 hover:text-primary transition-colors",children:"Testimonials"})})]})]}),c.jsxs("div",{children:[c.jsx("h4",{className:"font-semibold mb-4 text-white",children:"Legal"}),c.jsxs("ul",{className:"space-y-3",children:[c.jsx("li",{children:c.jsx("a",{href:"/privacy-policy",className:"text-gray-400 hover:text-primary transition-colors",children:"Privacy Policy"})}),c.jsx("li",{children:c.jsx("a",{href:"/terms-of-service",className:"text-gray-400 hover:text-primary transition-colors",children:"Terms of Service"})})]})]})]}),c.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-center mt-12 pt-8 border-t border-gray-800",children:[c.jsxs("p",{className:"text-sm text-gray-500 mb-4 sm:mb-0",children:["© ",e," MealMuse. All rights reserved."]}),c.jsxs("div",{className:"flex items-center text-sm text-gray-500",children:[c.jsx("span",{children:"Made with"}),c.jsx(SA,{className:"h-4 w-4 mx-1 text-secondary"}),c.jsx("span",{children:"for food lovers everywhere"})]})]})]})})},hm=yg,Qse=xg,VL=m.forwardRef(({className:e,...t},n)=>c.jsx(Oc,{ref:n,className:K("fixed inset-0 z-[200] 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}));VL.displayName=Oc.displayName;const Ld=m.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(Qse,{children:[c.jsx(VL,{}),c.jsxs(Dc,{ref:r,className:K("fixed left-[50%] top-[50%] z-[201] 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
517nded-lg",e),...n,children:[t,c.jsxs(vf,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[c.jsx(Di,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ld.displayName=Dc.displayName;const zL=({className:e,...t})=>c.jsx("div",{className:K("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});zL.displayName="DialogHeader";const BL=({className:e,...t})=>c.jsx("div",{className:K("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});BL.displayName="DialogFooter";const Fd=m.forwardRef(({className:e,...t},n)=>c.jsx(Mc,{ref:n,className:K("text-lg font-semibold leading-none tracking-tight",e),...t}));Fd.displayName=Mc.displayName;const WL=m.forwardRef(({className:e,...t},n)=>c.jsx(Lc,{ref:n,className:K("text-sm text-muted-foreground",e),...t}));WL.displayName=Lc.displayName;const Pn=m.forwardRef(({className:e,type:t,...n},r)=>c.jsx("input",{type:t,className:K("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}));Pn.displayName="Input";var R1="Tabs",[Xse,Mpe]=Mn(R1,[$o]),qL=$o(),[Zse,I1]=Xse(R1),HL=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:s,orientation:o="horizontal",dir:a,activationMode:l="automatic",...u}=e,d=za(a),[f,h]=Jn({prop:r,onChange:i,defaultProp:s});return c.jsx(Zse,{scope:n,baseId:Ni(),value:f,onValueChange:h,orientation:o,dir:d,activationMode:l,children:c.jsx(me.div,{dir:d,"data-orientation":o,...u,ref:t})})});HL.displayName=R1;var GL="TabsList",KL=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,s=I1(GL,n),o=qL(n);return c.jsx(Tg,{asChild:!0,...o,orientation:s.orientation,dir:s.dir,loop:r,children:c.jsx(me.div,{role:"tablist","aria-orientation":s.orientation,...i,ref:t})})});KL.displayName=GL;var YL="TabsTrigger",QL=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...s}=e,o=I1(YL,n),a=qL(n),l=JL(o.baseId,r),u=e4(o.baseId,r),d=r===o.value;return c.jsx(jg,{asChild:!0,...a,focusable:!i,active:d,children:c.jsx(me.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:l,...s,ref:t,onMouseDown:se(e.onMouseDown,f=>{!i&&f.button===0&&f.ctrlKey===!1?o.onValueChange(r):f.preventDefault()}),onKeyDown:se(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&o.onValueChange(r)}),onFocus:se(e.onFocus,()=>{const f=o.activationMode!=="manual";!d&&!i&&f&&o.onValueChange(r)})})})});QL.displayName=YL;var XL="TabsContent",ZL=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:s,...o}=e,a=I1(XL,n),l=JL(a.baseId,r),u=e4(a.baseId,r),d=r===a.value,f=m.useRef(d);return m.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),c.jsx(Lt,{present:i||d,children:({present:h})=>c.jsx(me.div,{"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!h,id:u,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:h&&s})})});ZL.displayName=XL;function JL(e,t){return`${e}-trigger-${t}`}function e4(e,t){return`${e}-content-${t}`}var Jse=HL,t4=KL,n4=QL,r4=ZL;const A1=Jse,Lg=m.forwardRef(({className:e,...t},n)=>c.jsx(t4,{ref:n,className:K("inline-flex items-center justify-center rounded-lg bg-muted p-0.5 text-muted-foreground/70",e),...t}));Lg.displayName=t4.displayName;const go=m.forwardRef(({className:e,...t},n)=>c.jsx(n4,{ref:n,className:K("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1.5 text-sm font-medium outline-offset-2 transition-all hover:text-muted-foreground focus-visible:outline focus-visible:outline-2 focus-visible:outline-ring/70 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm data-[state=active]:shadow-black/5",e),...t}));go.displayName=n4.displayName;const $d=m.forwardRef(({className:e,...t},n)=>c.jsx(r4,{ref:n,className:K("mt-2 outline-offset-2 focus-visible:outline focus-visible:outline-2 focus-visible:outline-ring/70",e),...t}));$d.displayName=r4.displayName;var Cf=e=>e.type==="checkbox",oa=e=>e instanceof Date,Tn=e=>e==null;const i4=e=>typeof e=="object";var At=e=>!Tn(e)&&!Array.isArray(e)&&i4(e)&&!oa(e),s4=e=>At(e)&&e.target?Cf(e.target)?e.target.checked:e.target.value:e,eoe=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,o4=(e,t)=>
vendor: 32,108 bytes, line 517
517e.has(eoe(t)),toe=e=>{const t=e.constructor&&e.constructor.prototype;return At(t)&&t.hasOwnProperty("isPrototypeOf")},O1=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Un(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(O1&&(e instanceof Blob||e instanceof FileList))&&(n||At(e)))if(t=n?[]:{},!n&&!toe(e))t=e;else for(const r in e)e.hasOwnProperty(r)&&(t[r]=Un(e[r]));else return e;return t}var Fg=e=>Array.isArray(e)?e.filter(Boolean):[],Tt=e=>e===void 0,oe=(e,t,n)=>{if(!t||!At(e))return n;const r=Fg(t.split(/[,[\].]+?/)).reduce((i,s)=>Tn(i)?i:i[s],e);return Tt(r)||r===e?Tt(e[t])?n:e[t]:r},_r=e=>typeof e=="boolean",D1=e=>/^\w*$/.test(e),a4=e=>Fg(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Ge=(e,t,n)=>{let r=-1;const i=D1(t)?[t]:a4(t),s=i.length,o=s-1;for(;++r<s;){const a=i[r];let l=n;if(r!==o){const u=e[a];l=At(u)||Array.isArray(u)?u:isNaN(+i[r+1])?{}:[]}if(a==="__proto__")return;e[a]=l,e=e[a]}return e};const pm={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},ei={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Yi={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},l4=F.createContext(null),$g=()=>F.useContext(l4),noe=e=>{const{children:t,...n}=e;return F.createElement(l4.Provider,{value:n},t)};var c4=(e,t,n,r=!0)=>{const i={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(i,s,{get:()=>{const o=s;return t._proxyFormState[o]!==ei.all&&(t._proxyFormState[o]=!r||ei.all),n&&(n[o]=!0),e[o]}});return i},Bn=e=>At(e)&&!Object.keys(e).length,u4=(e,t,n,r)=>{n(e);const{name:i,...s}=e;return Bn(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(o=>t[o]===(!r||ei.all))},Yu=e=>Array.isArray(e)?e:[e],d4=(e,t,n)=>!e||!t||e===t||Yu(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r)));function M1(e){const t=F.useRef(e);t.current=e,F.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function roe(e){const t=$g(),{control:n=t.control,disabled:r,name:i,exact:s}=e||{},[o,a]=F.useState(n._formState),l=F.useRef(!0),u=F.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),d=F.useRef(i);return d.current=i,M1({disabled:r,next:f=>l.current&&d4(d.current,f.name,s)&&u4(f,u.current,n._updateFormState)&&a({...n._formState,...f}),subject:n._subjects.state}),F.useEffect(()=>(l.current=!0,u.current.isValid&&n._updateValid(!0),()=>{l.current=!1}),[n]),c4(o,n,u.current,!1)}var Ti=e=>typeof e=="string",f4=(e,t,n,r,i)=>Ti(e)?(r&&t.watch.add(e),oe(n,e,i)):Array.isArray(e)?e.map(s=>(r&&t.watch.add(s),oe(n,s))):(r&&(t.watchAll=!0),n);function ioe(e){const t=$g(),{control:n=t.control,name:r,defaultValue:i,disabled:s,exact:o}=e||{},a=F.useRef(r);a.current=r,M1({disabled:s,subject:n._subjects.values,next:d=>{d4(a.current,d.name,o)&&u(Un(f4(a.current,n._names,d.values||n._formValues,!1,i)))}});const[l,u]=F.useState(n._getWatch(r,i));return F.useEffect(()=>n._removeUnmounted()),l}function soe(e){const t=$g(),{name:n,disabled:r,control:i=t.control,shouldUnregister:s}=e,o=o4(i._names.array,n),a=ioe({control:i,name:n,defaultValue:oe(i._formValues,n,oe(i._defaultValues,n,e.defaultValue)),exact:!0}),l=roe({control:i,name:n,exact:!0}),u=F.useRef(i.register(n,{...e.rules,value:a,..._r(e.disabled)?{disabled:e.disabled}:{}}));return F.useEffect(()=>{const d=i._options.shouldUnregister||s,f=(h,p)=>{const g=oe(i._fields,h);g&&g._f&&(g._f.mount=p)};if(f(n,!0),d){const h=Un(oe(i._options.defaultValues,n));Ge(i._defaultValues,n,h),Tt(oe(i._formValues,n))&&Ge(i._formValues,n,h)}return()=>{(o?d&&!i._state.action:d)?i.unregister(n):f(n,!1)}},[n,i,o,s]),F.useEffect(()=>{oe(i._fields,n)&&i._updateDisabledField({disabled:r,fields:i._fields,name:n,value:oe(i._fields,n)._f.value})},[r,n,i]),{field:{name:n,value:a,..._r(r)||l.disabled?{disabled:l.disabled||r}:{},onChange:F.useCallback(d=>u.current.onChange({target:{value:s4(d),name:n},type:pm.CHANGE}),[n]),onBlur:F.useCallback(()=>u.current.onBlur({target:{value:oe(i._formValues,n),name:n},type:pm.BLUR}),[n,i]),ref:F.useCallback(d=>{const f=oe(i._fields,n);f&&d&&(f._f.ref={focus:()=>d.focus(),select:()=>d.select(),setCustomValidity:h=>d.setCustomValidity(h),reportValidity:()=>d.reportValidity()})},[i._fields,n])},formState:l,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!oe(l.errors,n)},isDirty:{enumerable:!0,get:()=>!!oe(l.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!oe(l.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!oe(l.validatingFields,n)},error:{enumerable:!0,get:()=>oe(l.errors,n)}})}}const ooe=e=>e.render(soe(e));var h4=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},Dj=e=>({isOnSubmit:!e||e===ei.onSubmit,isOnBlur:e===ei.onBlur,isOnChange:e===ei.onChange,isOnAll:e===ei.all,isOnTouch:e===ei.onTouched}),Mj=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Qu=(e,t,n,r)=>{for(const i of n||Object.keys(e)){const s=oe(e,i);if(s){const{_f:o,...a}=s;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],i)&&!r)return!0;if(o.ref&&t(o.ref,o.name)&&!r)return!0;if(Qu(a,t))break}else if(At(a)&&Qu(a,t))break}}};var aoe=(e,t,n)=>{const r=Yu(oe(e,n));return Ge(r,"root",t[n]),Ge(e,n,r),e},L1=e=>e.type==="file",os=e=>typeof e=="function",mm=e=>{if(!O1)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},lp=e=>Ti(e),F1=e=>e.type==="radio",gm=e=>e instanceof RegExp;const Lj={value:!1,isValid:!1},Fj={value:!0,isValid:!0};var p4=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Tt(e[0].attributes.value)?Tt(e[0].value)||e[0].value===""?Fj:{value:e[0].value,isValid:!0}:Fj:Lj}return Lj};const $j={isValid:!1,value:null};var m4=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,$j):$j;function Uj(e,t,n="validate"){if(lp(e)||Array.isArray(e)&&e.every(lp)||_r(e)&&!e)return{type:n,message:lp(e)?e:"",ref:t}}var il=e=>At(e)&&!gm(e)?e:{value:e,message:""},Vj=async(e,t,n,r,i)=>{const{ref:s,refs:o,required:a,maxLength:l,minLength:u,min:d,max:f,pattern:h,validate:p,name:g,valueAsNumber:v,mount:w,disabled:y}=e._f,x=oe(t,g);if(!w||y)return{};const b=o?o[0]:s,_=I=>{r&&b.reportValidity&&(b.setCustomValidity(_r(I)?"":I||""),b.reportValidity())},S={},E=F1(s),k=Cf(s),C=E||k,P=(v||L1(s))&&Tt(s.value)&&Tt(x)||mm(s)&&s.value===""||x===""||Array.isArray(x)&&!x.length,T=h4.bind(null,g,n,S),N=(I,O,j,A=Yi.maxLength,V=Yi.minLength)=>{const $=I?O:j;S[g]={type:I?A:V,message:$,ref:s,...T(I?A:V,$)}};if(i?!Array.isArray(x)||!x.length:a&&(!C&&(P||Tn(x))||_r(x)&&!x||k&&!p4(o).isValid||E&&!m4(o).isValid)){const{value:I,message:O}=lp(a)?{value:!!a,message:a}:il(a);if(I&&(S[g]={type:Yi.required,message:O,ref:b,...T(Yi.required,O)},!n))return _(O),S}if(!P&&(!Tn(d)||!Tn(f))){let I,O;const j=il(f),A=il(d);if(!Tn(x)&&!isNaN(x)){const V=s.valueAsNumber||x&&+x;Tn(j.value)||(I=V>j.value),Tn(A.value)||(O=V<A.value)}else{const V=s.valueAsDate||new Date(x),$=H=>new Date(new Date().toDateString()+" "+H),R=s.type=="time",L=s.type=="week";Ti(j.value)&&x&&(I=R?$(x)>$(j.value):L?x>j.value:V>new Date(j.value)),Ti(A.value)&&x&&(O=R?$(x)<$(A.value):L?x<A.value:V<new Date(A.value))}if((I||O)&&(N(!!I,j.message,A.message,Yi.max,Yi.min),!n))return _(S[g].message),S}if((l||u)&&!P&&(Ti(x)||i&&Array.isArray(x))){const I=il(l),O=il(u),j=!Tn(I.value)&&x.length>+I.value,A=!Tn(O.value)&&x.length<+O.value;if((j||A)&&(N(j,I.message,O.message),!n))return _(S[g].message),S}if(h&&!P&&Ti(x)){const{value:I,message:O}=il(h);if(gm(I)&&!x.match(I)&&(S[g]={type:Yi.pattern,message:O,ref:s,...T(Yi.pattern,O)},!n))return _(O),S}if(p){if(os(p)){const I=await p(x,t),O=Uj(I,b);if(O&&(S[g]={...O,...T(Yi.validate,O.message)},!n))return _(O.message),S}else if(At(p)){let I={};for(const O in p){if(!Bn(I)&&!n)break;const j=Uj(await p[O](x,t),b,O);j&&(I={...j,...T(O,j.message)},_(j.message),n&&(S[g]=I))}if(!Bn(I)&&(S[g]={ref:b,...I},!n))return S}}return _(!0),S};function loe(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=Tt(e)?r++:e[t[r++]];return e}function coe(e){for(const t in e)if(e.hasOwnProperty(t)&&!Tt(e[t]))return!1;return!0}function Ft(e,t){const n=Array.isArray(t)?t:D1(t)?[t]:a4(t),r=n.length===1?e:loe(e,n),i=n.length-1,s=n[i];return r&&delete r[s],i!==0&&(At(r)&&Bn(r)||Array.isArray(r)&&coe(r))&&Ft(e,n.slice(0,-1)),e}var Oy=()=>{let e=[];return{get observers(){return e},next:i=>{for(const s of e)s.next&&s.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(s=>s!==i)}}),unsubscribe:()=>{e=[]}}},gw=e=>Tn(e)||!i4(e);function Vs(e,t){if(gw(e)||gw(t))return e===t;if(oa(e)&&oa(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n){const s=e[i];if(!r.includes(i))return!1;if(i!=="ref"){const o=t[i];if(oa(s)&&oa(o)||At(s)&&At(o)||Array.isArray(s)&&Array.isArray(o)?!Vs(s,o):s!==o)return!1}}return!0}var g4=e=>e.type==="select-multiple",uoe=e=>F1(e)||Cf(e),Dy=e=>mm(e)&&e.isConnected,v4=e=>{for(const t in e)if(os(e[t]))return!0;return!1};function vm(e,t={}){const n=Array.isArray(e);if(At(e)||n)for(const r in e)Array.isArray(e[r])||At(e[r])&&!v4(e[r])?(t[r]=Array.isArray(e[r])?[]:{},vm(e[r],t[r])):Tn(e[r])||(t[r]=!0);return t}function y4(e,t,n){const r=Array.isArray(e);if(At(e)||r)for(const i in e)Array.isArray(e[i])||At(e[i])&&!v4(e[i])?Tt(t)||gw(n[i])?n[i]=Array.isArray(e[i])?vm(e[i],[]):{...vm(e[i])}:y4(e[i],Tn(t)?{}:t[i],n[i]):n[i]=!Vs(e[i],t[i]);return n}var uu=(e,t)=>y4(e,t,vm(t)),x4=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Tt(e)?e:t?e===""?NaN:e&&+e:n&&Ti(e)?new Date(e):r?r(e):e;function My(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return L1(t)?t.files:F1(t)?m4(e.refs).value:g4(t)?[...t.selectedOptions].map(({value:n})=>n):Cf(t)?p4(e.refs).value:x4(Tt(t.value)?e.ref.value:t.value,e)}var doe=(e,t,n,r)=>{const i={};for(const s of e){const o=oe(t,s);o&&Ge(i,s,o._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},du=e=>Tt(e)?e:gm(e)?e.source:At(e)?gm(e.value)?e.value.source:e.value:e;const zj="AsyncFunction";var foe=e=>(!e||!e.validate)&&!!(os(e.validate)&&e.validate.constructor.name===zj||At(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===zj)),hoe=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Bj(e,t,n){const r=oe(e,n);if(r||D1(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const s=i.join("."),o=oe(t,s),a=oe(e,s);if(o&&!Array.isArray(o)&&n!==s)return{name:n};if(a&&a.type)return{name:s,error:a};i.pop()}return{name:n}}var poe=(e,t,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:(n?r.isOnChange:i.isOnChange)?e:!0,moe=(e,t)=>!Fg(oe(e,t)).length&&Ft(e,t);const goe={mode:ei.onSubmit,reValidateMode:ei.onChange,shouldFocusError:!0};function voe(e={}){let t={...goe,...e},n={submitCount:0,isDirty:!1,isLoading:os(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},i=At(t.defaultValues)||At(t.values)?Un(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:Un(i),o={action:!1,mount:!1,watch:!1},a={mount:new Set,unMount:new Set,array:new Set,watch:new Set},l,u=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={values:Oy(),array:Oy(),state:Oy()},h=Dj(t.mode),p=Dj(t.reValidateMode),g=t.criteriaMode===ei.all,v=D=>U=>{clearTimeout(u),u=setTimeout(D,U)},w=async D=>{if(!e.disabled&&(d.isValid||D)){const U=t.resolver?Bn((await C()).errors):await T(r,!0);U!==n.isValid&&f.state.next({isValid:U})}},y=(D,U)=>{!e.disabled&&(d.isValidating||d.validatingFields)&&((D||Array.from(a.mount)).forEach(B=>{B&&(U?Ge(n.validatingFields,B,U):Ft(n.validatingFields,B))}),f.state.next({validatingFields:n.validatingFields,isValidating:!Bn(n.validatingFields)}))},x=(D,U=[],B,ae,re=!0,X=!0)=>{if(ae&&B&&!e.disabled){if(o.action=!0,X&&Array.isArray(oe(r,D))){const G=B(oe(r,D),ae.argA,ae.argB);re&&Ge(r,D,G)}if(X&&Array.isArray(oe(n.errors,D))){const G=B(oe(n.errors,D),ae.argA,ae.argB);re&&Ge(n.errors,D,G),moe(n.errors,D)}if(d.touchedFields&&X&&Array.isArray(oe(n.touchedFields,D))){const G=B(oe(n.touchedFields,D),ae.argA,ae.argB);re&&Ge(n.touchedFields,D,G)}d.dirtyFields&&(n.dirtyFields=uu(i,s)),f.state.next({name:D,isDirty:I(D,U),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Ge(s,D,U)},b=(D,U)=>{Ge(n.errors,D,U),f.state.next({errors:n.errors})},_=D=>{n.errors=D,f.state.next({errors:n.errors,isValid:!1})},S=(D,U,B,ae)=>{const re=oe(r,D);if(re){const X=oe(s,D,Tt(B)?oe(i,D):B);Tt(X)||ae&&ae.defaultChecked||U?Ge(s,D,U?X:My(re._f)):A(D,X),o.mount&&w()}},E=(D,U,B,ae,re)=>{let X=!1,G=!1;const J={name:D};if(!e.disabled){const je=!!(oe(r,D)&&oe(r,D)._f&&oe(r,D)._f.disabled);if(!B||ae){d.isDirty&&(G=n.isDirty,n.isDirty=J.isDirty=I(),X=G!==J.isDirty);const Se=je||Vs(oe(i,D),U);G=!!(!je&&oe(n.dirtyFields,D)),Se||je?Ft(n.dirtyFields,D):Ge(n.dirtyFields,D,!0),J.dirtyFields=n.dirtyFields,X=X||d.dirtyFields&&G!==!Se}if(B){const Se=oe(n.touchedFields,D);Se||(Ge(n.touchedFields,D,B),J.touchedFields=n.touchedFields,X=X||d.touchedFields&&Se!==B)}X&&re&&f.state.next(J)}return X?J:{}},k=(D,U,B,ae)=>{const re=oe(n.errors,D),X=d.isValid&&_r(U)&&n.isValid!==U;if(e.delayError&&B?(l=v(()=>b(D,B)),l(e.delayError)):(clearTimeout(u),l=null,B?Ge(n.errors,D,B):Ft(n.errors,D)),(B?!Vs(re,B):re)||!Bn(ae)||X){const G={...ae,...X&&_r(U)?{isValid:U}:{},errors:n.errors,name:D};n={...n,...G},f.state.next(G)}},C=async D=>{y(D,!0);const U=await t.resolver(s,t.context,doe(D||a.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return y(D),U},P=async D=>{const{errors:U}=await C(D);if(D)for(const B of D){const ae=oe(U,B);ae?Ge(n.errors,B,ae):Ft(n.errors,B)}else n.errors=U;return U},T=async(D,U,B={valid:!0})=>{for(const ae in D){const re=D[ae];if(re){const{_f:X,...G}=re;if(X){const J=a.array.has(X.name),je=re._f&&foe(re._f);je&&d.validatingFields&&y([ae],!0);const Se=await Vj(re,s,g,t.shouldUseNativeValidation&&!U,J);if(je&&d.validatingFields&&y([ae]),Se[X.name]&&(B.valid=!1,U))break;!U&&(oe(Se,X.name)?J?aoe(n.errors,Se,X.name):Ge(n.errors,X.name,Se[X.name]):Ft(n.errors,X.name))}!Bn(G)&&await T(G,U,B)}}return B.valid},N=()=>{for(const D of a.unMount){const U=oe(r,D);U&&(U._f.refs?U._f.refs.every(B=>!Dy(B)):!Dy(U._f.ref))&&he(D)}a.unMount=new Set},I=(D,U)=>!e.disabled&&(D&&U&&Ge(s,D,U),!Vs(z(),i)),O=(D,U,B)=>f4(D,a,{...o.mount?s:Tt(U)?i:Ti(D)?{[D]:U}:U},B,U),j=D=>Fg(oe(o.mount?s:i,D,e.shouldUnregister?oe(i,D,[]):[])),A=(D,U,B={})=>{const ae=oe(r,D);let re=U;if(ae){const X=ae._f;X&&(!X.disabled&&Ge(s,D,x4(U,X)),re=mm(X.ref)&&Tn(U)?"":U,g4(X.ref)?[...X.ref.options].forEach(G=>G.selected=re.includes(G.value)):X.refs?Cf(X.ref)?X.refs.length>1?X.refs.forEach(G=>(!G.defaultChecked||!G.disabled)&&(G.checked=Array.isArray(re)?!!re.find(J=>J===G.value):re===G.value)):X.refs[0]&&(X.refs[0].checked=!!re):X.refs.forEach(G=>G.checked=G.value===re):L1(X.ref)?X.ref.value="":(X.ref.value=re,X.ref.type||f.values.next({name:D,values:{...s}})))}(B.shouldDirty||B.shouldTouch)&&E(D,re,B.shouldTouch,B.shouldDirty,!0),B.shouldValidate&&H(D)},V=(D,U,B)=>{for(const ae in U){const re=U[ae],X=`${D}.${ae}`,G=oe(r,X);(a.array.has(D)||At(re)||G&&!G._f)&&!oa(re)?V(X,re,B):A(X,re,B)}},$=(D,U,B={})=>{const ae=oe(r,D),re=a.array.has(D),X=Un(U);Ge(s,D,X),re?(f.array.next({name:D,values:{...s}}),(d.isDirty||d.dirtyFields)&&B.shouldDirty&&f.state.next({name:D,dirtyFields:uu(i,s),isDirty:I(D,X)})):ae&&!ae._f&&!Tn(X)?V(D,X,B):A(D,X,B),Mj(D,a)&&f.state.next({...n}),f.values.next({name:o.mount?D:void 0,values:{...s}})},R=async D=>{o.mount=!0;const U=D.target;let B=U.name,ae=!0;const re=oe(r,B),X=()=>U.type?My(re._f):s4(D),G=J=>{ae=Number.isNaN(J)||oa(J)&&isNaN(J.getTime())||Vs(J,oe(s,B,J))};if(re){let J,je;const Se=X(),nt=D.type===pm.BLUR||D.type===pm.FOCUS_OUT,Jt=!hoe(re._f)&&!t.resolver&&!oe(n.errors,B)&&!re._f.deps||poe(nt,oe(n.touchedFields,B),n.isSubmitted,p,h),bn=Mj(B,a,nt);Ge(s,B,Se),nt?(re._f.onBlur&&re._f.onBlur(D),l&&l(0)):re._f.onChange&&re._f.onChange(D);const _n=E(B,Se,nt,!1),$r=!Bn(_n)||bn;if(!nt&&f.values.next({name:B,type:D.type,values:{...s}}),Jt)return d.isValid&&(e.mode==="onBlur"?nt&&w():w()),$r&&f.state.next({name:B,...bn?{}:_n});if(!nt&&bn&&f.state.next({...n}),t.resolver){const{errors:Ur}=await C([B]);if(G(Se),ae){const mi=Bj(n.errors,r,B),yr=Bj(Ur,r,mi.name||B);J=yr.error,B=yr.name,je=Bn(Ur)}}else y([B],!0),J=(await Vj(re,s,g,t.shouldUseNativeValidation))[B],y([B]),G(Se),ae&&(J?je=!1:d.isValid&&(je=await T(r,!0)));ae&&(re._f.deps&&H(re._f.deps),k(B,je,J,_n))}},L=(D,U)=>{if(oe(n.errors,U)&&D.focus)return D.focus(),1},H=async(D,U={})=>{let B,ae;const re=Yu(D);if(t.resolver){const X=await P(Tt(D)?D:re);B=Bn(X),ae=D?!re.some(G=>oe(X,G)):B}else D?(ae=(await Promise.all(re.map(async X=>{const G=oe(r,X);return await T(G&&G._f?{[X]:G}:G)}))).every(Boolean),!(!ae&&!n.isValid)&&w()):ae=B=await T(r);return f.state.next({...!Ti(D)||d.isValid&&B!==n.isValid?{}:{name:D},...t.resolver||!D?{isValid:B}:{},errors:n.errors}),U.shouldFocus&&!ae&&Qu(r,L,D?re:a.mount),ae},z=D=>{const U={...o.mount?s:i};return Tt(D)?U:Ti(D)?oe(U,D):D.map(B=>oe(U,B))},Q=(D,U)=>({invalid:!!oe((U||n).errors,D),isDirty:!!oe((U||n).dirtyFields,D),error:oe((U||n).errors,D),isValidating:!!oe(n.validatingFields,D),isTouched:!!oe((U||n).touchedFields,D)}),de=D=>{D&&Yu(D).forEach(U=>Ft(n.errors,U)),f.state.next({errors:D?n.errors:{}})},ne=(D,U,B)=>{const ae=(oe(r,D,{_f:{}})._f||{}).ref,re=oe(n.errors,D)||{},{ref:X,message:G,type:J,...je}=re;Ge(n.errors,D,{...je,...U,ref:ae}),f.state.next({name:D,errors:n.errors,isValid:!1}),B&&B.shouldFocus&&ae&&ae.focus&&ae.focus()},ye=(D,U)=>os(D)?f.values.subscribe({next:B=>D(O(void 0,U),B)}):O(D,U,!0),he=(D,U={})=>{for(const B of D?Yu(D):a.mount)a.mount.delete(B),a.array.delete(B),U.keepValue||(Ft(r,B),Ft(s,B)),!U.keepError&&Ft(n.errors,B),!U.keepDirty&&Ft(n.dirtyFields,B),!U.keepTouched&&Ft(n.touchedFields,B),!U.keepIsValidating&&Ft(n.validatingFields,B),!t.shouldUnregister&&!U.keepDefaultValue&&Ft(i,B);f.values.next({values:{...s}}),f.state.next({...n,...U.keepDirty?{isDirty:I()}:{}}),!U.keepIsValid&&w()},Pe=({disabled:D,name:U,field:B,fields:ae,value:re})=>{if(_r(D)&&o.mount||D){const X=D?void 0:Tt(re)?My(B?B._f:oe(ae,U)._f):re;Ge(s,U,X),E(U,X,!1,!1,!0)}},Ue=(D,U={})=>{let B=oe(r,D);const ae=_r(U.disabled)||_r(e.disabled);return Ge(r,D,{...B||{},_f:{...B&&B._f?B._f:{ref:{name:D}},name:D,mount:!0,...U}}),a.mount.add(D),B?Pe({field:B,disabled:_r(U.disabled)?U.disabled:e.disabled,name:D,value:U.value}):S(D,!0,U.value),{...ae?{disabled:U.disabled||e.disabled}:{},...t.progressive?{required:!!U.required,min:du(U.min),max:du(U.max),minLength:du(U.minLength),maxLength:du(U.maxLength),pattern:du(U.pattern)}:{},name:D,onChange:R,onBlur:R,ref:re=>{if(re){Ue(D,U),B=oe(r,D);const X=Tt(re.value)&&re.querySelectorAll&&re.querySelectorAll("input,select,textarea")[0]||re,G=uoe(X),J=B._f.refs||[];if(G?J.find(je=>je===X):X===B._f.ref)return;Ge(r,D,{_f:{...B._f,...G?{refs:[...J.filter(Dy),X,...Array.isArray(oe(i,D))?[{}]:[]],ref:{type:X.type,name:D}}:{ref:X}}}),S(D,!1,void 0,X)}else B=oe(r,D,{}),B._f&&(B._f.mount=!1),(t.shouldUnregister||U.shouldUnregister)&&!(o4(a.array,D)&&o.action)&&a.unMount.add(D)}}},Ae=()=>t.shouldFocusError&&Qu(r,L,a.mount),Fe=D=>{_r(D)&&(f.state.next({disabled:D}),Qu(r,(U,B)=>{const ae=oe(r,B);ae&&(U.disabled=ae._f.disabled||D,Array.isArray(ae._f.refs)&&ae._f.refs.forEach(re=>{re.disabled=ae._f.disabled||D}))},0,!1))},wt=(D,U)=>async B=>{let ae;B&&(B.preventDefault&&B.preventDefault(),B.persist&&B.persist());let re=Un(s);if(f.state.next({isSubmitting:!0}),t.resolver){const{errors:X,values:G}=await C();n.errors=X,re=G}else await T(r);if(Ft(n.errors,"root"),Bn(n.errors)){f.state.next({errors:{}});try{await D(re,B)}catch(X){ae=X}}else U&&await U({...n.errors},B),Ae(),setTimeout(Ae);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Bn(n.errors)&&!ae,submitCount:n.submitCount+1,errors:n.errors}),ae)throw ae},jt=(D,U={})=>{oe(r,D)&&(Tt(U.defaultValue)?$(D,Un(oe(i,D))):($(D,U.defaultValue),Ge(i,D,Un(U.defaultValue))),U.keepTouched||Ft(n.touchedFields,D),U.keepDirty||(Ft(n.dirtyFields,D),n.isDirty=U.defaultValue?I(D,Un(oe(i,D))):I()),U.keepError||(Ft(n.errors,D),d.isValid&&w()),f.state.next({...n}))},xe=(D,U={})=>{const B=D?Un(D):i,ae=Un(B),re=Bn(D),X=re?i:ae;if(U.keepDefaultValues||(i=B),!U.keepValues){if(U.keepDirtyValues){const G=new Set([...a.mount,...Object.keys(uu(i,s))]);for(const J of Array.from(G))oe(n.dirtyFields,J)?Ge(X,J,oe(s,J)):$(J,oe(X,J))}else{if(O1&&Tt(D))for(const G of a.mount){const J=oe(r,G);if(J&&J._f){const je=Array.isArray(J._f.refs)?J._f.refs[0]:J._f.ref;if(mm(je)){const Se=je.closest("form");if(Se){Se.reset();break}}}}r={}}s=e.shouldUnregister?U.keepDefaultValues?Un(i):{}:Un(X),f.array.next({values:{...X}}),f.values.next({values:{...X}})}a={mount:U.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!d.isValid||!!U.keepIsValid||!!U.keepDirtyValues,o.watch=!!e.shouldUnregister,f.state.next({submitCount:U.keepSubmitCount?n.submitCount:0,isDirty:re?!1:U.keepDirty?n.isDirty:!!(U.keepDefaultValues&&!Vs(D,i)),isSubmitted:U.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:re?{}:U.keepDirtyValues?U.keepDefaultValues&&s?uu(i,s):n.dirtyFields:U.keepDefaultValues&&D?uu(i,D):U.keepDirty?n.dirtyFields:{},touchedFields:U.keepTouched?n.touchedFields:{},errors:U.keepErrors?n.errors:{},isSubmitSuccessful:U.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},qt=(D,U)=>xe(os(D)?D(s):D,U);return{control:{register:Ue,unregister:he,getFieldState:Q,handleSubmit:wt,setError:ne,_executeSchema:C,_getWatch:O,_getDirty:I,_updateValid:w,_removeUnmounted:N,_updateFieldArray:x,_updateDisabledField:Pe,_getFieldArray:j,_reset:xe,_resetDefaultValues:()=>os(t.defaultValues)&&t.defaultValues().then(D=>{qt(D,t.resetOptions),f.state.next({isLoading:!1})}),_updateFormState:D=>{n={...n,...D}},_disableForm:Fe,_subjects:f,_proxyFormState:d,_setErrors:_,get _fields(){return r},get _formValues(){return s},get _state(){return o},set _state(D){o=D},get _defaultValues(){return i},get _names(){return a},set _names(D){a=D},get _formState(){return n},set _formState(D){n=D},get _options(){return t},set _options(D){t={...t,...D}}},trigger:H,register:Ue,handleSubmit:wt,watch:ye,setValue:$,getValues:z,reset:qt,resetField:jt,clearErrors:de,unregister:he,setError:ne,setFocus:(D,U={})=>{const B=oe(r,D),ae=B&&B._f;if(ae){const re=ae.refs?ae.refs[0]:ae.ref;re.focus&&(re.focus(),U.shouldSelect&&re.select())}},getFieldState:Q}}function vw(e={}){const t=F.useRef(),n=F.useRef(),[r,i]=F.useState({isDirty:!1,isValidating:!1,isLoading:os(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:os(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...voe(e),formState:r});const s=t.current.control;return s._options=e,M1({subject:s._subjects.state,next:o=>{u4(o,s._proxyFormState,s._updateFormState,!0)&&i({...s._formState})}}),F.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),F.useEffect(()=>{if(s._proxyFormState.isDirty){const o=s._getDirty();o!==r.isDirty&&s._subjects.state.next({isDirty:o})}},[s,r.isDirty]),F.useEffect(()=>{e.values&&!Vs(e.values,n.current)?(s._reset(e.values,s._options.resetOptions),n.current=e.values,i(o=>({...o}))):s._resetDefaultValues()},[e.values,s]),F.useEffect(()=>{e.errors&&s._setErrors(e.errors)},[e.errors,s]),F.useEffect(()=>{s._state.mount||(s._updateValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),F.useEffect(()=>{e.shouldUnregister&&s._subjects.values.next({values:s._getWatch()})},[e.shouldUnregister,s]),F.useEffect(()=>{t.current&&(t.current.watch=t.current.watch.bind({}))},[r]),t.current.formState=c4(r,s),t.current}const yw=noe,w4=m.createContext({}),Ei=({...e})=>c.jsx(w4.Provider,{value:{name:e.name},children:c.jsx(ooe,{...e})}),Ug=()=>{const e=m.useContext(w4),t=m.useContext(b4),{getFieldState:n,formState:r}=$g(),i=n(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:s}=t;return{id:s,name:e.name,formItemId:`${s}-form-item`,formDescriptionId:`${s}-form-item-description`,formMessageId:`${s}-form-item-message`,...i}},b4=m.createContext({}),or=m.forwardRef(({className:e,...t},n)=>{const r=m.useId();return c.jsx(b4.Provider,{value:{id:r},children:c.jsx("div",{ref:n,className:K("space-y-2",e),...t})})});or.displayName="FormItem";const ar=m.forwardRef(({className:e,...t},n)=>{const{error:r,formItemId:i}=Ug();return c.jsx(Co,{ref:n,className:K(r&&"text-destructive",e),htmlFor:i,...t})});ar.displayName="FormLabel";const kr=m.forwardRef(({...e},t)=>{const{error:n,formItemId:r,formDescriptionId:i,formMessageId:s}=Ug();return c.jsx(ps,{ref:t,id:r,"aria-describedby":n?`${i} ${s}`:`${i}`,"aria-invalid":!!n,...e})});kr.displayName="FormControl";const xw=m.forwardRef(({className:e,...t},n)=>{const{formDescriptionId:r}=Ug();return c.jsx("p",{ref:n,id:r,className:K("text-sm text-muted-foreground",e),...t})});xw.displayName="FormDescription";const Jr=m.forwardRef(({className:e,children:t,...n},r)=>{const{error:i,formMessageId:s}=Ug(),o=i?String(i==null?void 0:i.message):t;return o?c.jsx("p",{ref:r,id:s,className:K("text-sm font-medium text-destructive",e),...n,children:o}):null});Jr.displayName="FormMessage";var qe;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const s={};for(const o of i)s[o]=o;return s},e.getValidEnumValues=i=>{const s=e.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(const a of s)o[a]=i[a];return e.objectValues(o)},e.objectValues=i=>e.objectKeys(i).map(function(s){return i[s]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},e.find=(i,s)=>{for(const o of i)if(s(o))return o},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}e.joinValues=r,e.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(qe||(qe={}));var ww;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(ww||(ww={}));const fe=qe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),zs=e=>{switch(typeof e){case"undefined":return fe.undefined;case"string":return fe.string;case"number":return isNaN(e)?fe.nan:fe.number;case"boolean":return fe.boolean;case"function":return fe.function;case"bigint":return fe.bigint;case"symbol":return fe.symbol;case"object":return Array.isArray(e)?fe.array:e===null?fe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?fe.promise:typeof Map<"u"&&e instanceof Map?fe.map:typeof Set<"u"&&e instanceof Set?fe.set:typeof Date<"u"&&e instanceof Date?fe.date:fe.object;default:return fe.unknown}},te=qe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),yoe=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class dr extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(s){return s.message},r={_errors:[]},i=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let a=r,l=0;for(;l<o.path.length;){const u=o.path[l];l===o.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(n(o))):a[u]=a[u]||{_errors:[]},a=a[u],l++}}};return i(this),r}static assert(t){if(!(t instanceof dr))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,qe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}dr.create=e=>new dr(e);const gc=(e,t)=>{let n;switch(e.code){case te.invalid_type:e.received===fe.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case te.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,qe.jsonStringifyReplacer)}`;break;case te.unrecognized_keys:n=`Unrecognized key(s) in object: ${qe.joinValues(e.keys,", ")}`;break;case te.invalid_union:n="Invalid input";break;case te.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${qe.joinValues(e.options)}`;break;case te.invalid_enum_value:n=`Invalid enum value. Expected ${qe.joinValues(e.options)}, received '${e.received}'`;break;case te.invalid_arguments:n="Invalid function arguments";break;case te.invalid_return_type:n="Invalid function return type";break;case te.invalid_date:n="Invalid date";break;case te.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:qe.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case te.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case te.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case te.custom:n="Invalid input";break;
vendor: 6,146 bytes, line 517
517case te.invalid_intersection_types:n="Intersection results could not be merged";break;case te.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case te.not_finite:n="Number must be finite";break;default:n=t.defaultError,qe.assertNever(e)}return{message:n}};let _4=gc;function xoe(e){_4=e}function ym(){return _4}const xm=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,s=[...n,...i.path||[]],o={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let a="";const l=r.filter(u=>!!u).slice().reverse();for(const u of l)a=u(o,{data:t,defaultError:a}).message;return{...i,path:s,message:a}},woe=[];function le(e,t){const n=ym(),r=xm({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===gc?void 0:gc].filter(i=>!!i)});e.common.issues.push(r)}class xn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return Ce;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n){const s=await i.key,o=await i.value;r.push({key:s,value:o})}return xn.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return Ce;s.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(r[s.value]=o.value)}return{status:t.value,value:r}}}const Ce=Object.freeze({status:"aborted"}),jl=e=>({status:"dirty",value:e}),An=e=>({status:"valid",value:e}),bw=e=>e.status==="aborted",_w=e=>e.status==="dirty",Ud=e=>e.status==="valid",Vd=e=>typeof Promise<"u"&&e instanceof Promise;function wm(e,t,n,r){if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function S4(e,t,n,r,i){if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var ge;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(ge||(ge={}));var ku,Cu;class $i{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Wj=(e,t)=>{if(Ud(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new dr(e.common.issues);return this._error=n,this._error}}};function Re(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(o,a)=>{var l,u;const{message:d}=e;return o.code==="invalid_enum_value"?{message:d??a.defaultError}:typeof a.data>"u"?{message:(l=d??r)!==null&&l!==void 0?l:a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:(u=d??n)!==null&&u!==void 0?u:a.defaultError}},description:i}}class Me{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return zs(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:zs(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new xn,ctx:{common:t.parent.common,data:t.data,parsedType:zs(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Vd(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:zs(t)},s=this._parseSync({data:t,path:i.path,parent:i});return Wj(i,s)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:zs(t)},i=this._parse({data:t,path:r.path,parent:r}),s=await(Vd(i)?i:Promise.resolve(i));return Wj(r,s)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,s)=>{const o=t(i),a=()=>s.addIssue({code:te.custom,...r(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(t,n){return this._refinement((r,i)=>
vendor: 43,758 bytes, line 517
517t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new li({schema:this,typeName:Ee.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Oi.create(this,this._def)}nullable(){return Ro.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ii.create(this,this._def)}promise(){return yc.create(this,this._def)}or(t){return qd.create([this,t],this._def)}and(t){return Hd.create(this,t,this._def)}transform(t){return new li({...Re(this._def),schema:this,typeName:Ee.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Xd({...Re(this._def),innerType:this,defaultValue:n,typeName:Ee.ZodDefault})}brand(){return new $1({typeName:Ee.ZodBranded,type:this,...Re(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Zd({...Re(this._def),innerType:this,catchValue:n,typeName:Ee.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Tf.create(this,t)}readonly(){return Jd.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const boe=/^c[^\s-]{8,}$/i,_oe=/^[0-9a-z]+$/,Soe=/^[0-9A-HJKMNP-TV-Z]{26}$/,Eoe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,koe=/^[a-z0-9_-]{21}$/i,Coe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Toe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,joe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ly;const Poe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Noe=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Roe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,E4="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Ioe=new RegExp(`^${E4}$`);function k4(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function Aoe(e){return new RegExp(`^${k4(e)}$`)}function C4(e){let t=`${E4}T${k4(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function Ooe(e,t){return!!((t==="v4"||!t)&&Poe.test(e)||(t==="v6"||!t)&&Noe.test(e))}class ti extends Me{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==fe.string){const s=this._getOrReturnCtx(t);return le(s,{code:te.invalid_type,expected:fe.string,received:s.parsedType}),Ce}const r=new xn;let i;for(const s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(i=this._getOrReturnCtx(t,i),le(i,{code:te.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")t.data.length>s.value&&(i=this._getOrReturnCtx(t,i),le(i,{code:te.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const o=t.data.length>s.value,a=t.data.length<s.value;(o||a)&&(i=this._getOrReturnCtx(t,i),o?le(i,{code:te.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&le(i,{code:te.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")Toe.test(t.data)||(i=this._getOrReturnCtx(t,i),le(i,{validation:"email",code:te.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")Ly||(Ly=new RegExp(joe,"u")),Ly.test(t.data)||(i=this._getOrReturnCtx(t,i),le(i,{validation:"emoji",code:te.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")Eoe.test(t.data)||(i=this._getOrReturnCtx(t,i),le(i,{validation:"uuid",code:te.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")koe.test(t.data)||(i=this._getOrReturnCtx(t,i),le(i,{validation:"nanoid",code:te.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")boe.test(t.data)||(i=this._getOrReturnCtx(t,i),le(i,{validation:"cuid",code:te.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")_oe.test(t.data)||(i=this._getOrReturnCtx(t,i),le(i,{validation:"cuid2",code:te.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")Soe.test(t.data)||(i=this._getOrReturnCtx(t,i),le(i,{validation:"ulid",code:te.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),le(i,{validation:"url",code:te.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),le(i,{validation:"regex",code:te.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(t,i),le(i,{code:te.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(i=this._getOrReturnCtx(t,i),le(i,{code:te.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(i=this._getOrReturnCtx(t,i),le(i,{code:te.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?C4(s).test(t.data)||(i=this._getOrReturnCtx(t,i),le(i,{code:te.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?Ioe.test(t.data)||(i=this._getOrReturnCtx(t,i),le(i,{code:te.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?Aoe(s).test(t.data)||(i=this._getOrReturnCtx(t,i),le(i,{code:te.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?Coe.test(t.data)||(i=this._getOrReturnCtx(t,i),le(i,{validation:"duration",code:te.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?Ooe(t.data,s.version)||(i=this._getOrReturnCtx(t,i),le(i,{validation:"ip",code:te.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?Roe.test(t.data)||(i=this._getOrReturnCtx(t,i),le(i,{validation:"base64",code:te.invalid_string,message:s.message}),r.dirty()):qe.assertNever(s);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(i=>t.test(i),{validation:n,code:te.invalid_string,...ge.errToObj(r)})}_addCheck(t){return new ti({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ge.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ge.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ge.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ge.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...ge.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ge.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ge.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ge.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...ge.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ge.errToObj(t)})}datetime(t){var n,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,local:(r=t==null?void 0:t.local)!==null&&r!==void 0?r:!1,...ge.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...ge.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...ge.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...ge.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...ge.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...ge.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...ge.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...ge.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...ge.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...ge.errToObj(n)})}nonempty(t){return this.min(1,ge.errToObj(t))}trim(){return new ti({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ti({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ti({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}ti.create=e=>{var t;return new ti({checks:[],typeName:Ee.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Re(e)})};function Doe(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,s=parseInt(e.toFixed(i).replace(".","")),o=parseInt(t.toFixed(i).replace(".",""));return s%o/Math.pow(10,i)}class jo extends Me{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==fe.number){const s=this._getOrReturnCtx(t);return le(s,{code:te.invalid_type,expected:fe.number,received:s.parsedType}),Ce}let r;const i=new xn;for(const s of this._def.checks)s.kind==="int"?qe.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),le(r,{code:te.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(r=this._getOrReturnCtx(t,r),le(r,{code:te.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),le(r,{code:te.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?Doe(t.data,s.value)!==0&&(r=this._getOrReturnCtx(t,r),le(r,{code:te.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),le(r,{code:te.not_finite,message:s.message}),i.dirty()):qe.assertNever(s);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,ge.toString(n))}gt(t,n){return this.setLimit("min",t,!1,ge.toString(n))}lte(t,n){return this.setLimit("max",t,!0,ge.toString(n))}lt(t,n){return this.setLimit("max",t,!1,ge.toString(n))}setLimit(t,n,r,i){return new jo({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:ge.toString(i)}]})}_addCheck(t){return new jo({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ge.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ge.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ge.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ge.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ge.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:ge.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:ge.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ge.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ge.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&qe.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}jo.create=e=>new jo({checks:[],typeName:Ee.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Re(e)});class Po extends Me{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==fe.bigint){const s=this._getOrReturnCtx(t);return le(s,{code:te.invalid_type,expected:fe.bigint,received:s.parsedType}),Ce}let r;const i=new xn;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(r=this._getOrReturnCtx(t,r),le(r,{code:te.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),le(r,{code:te.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),le(r,{code:te.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):qe.assertNever(s);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,ge.toString(n))}gt(t,n){return this.setLimit("min",t,!1,ge.toString(n))}lte(t,n){return this.setLimit("max",t,!0,ge.toString(n))}lt(t,n){return this.setLimit("max",t,!1,ge.toString(n))}setLimit(t,n,r,i){return new Po({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:ge.toString(i)}]})}_addCheck(t){return new Po({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ge.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ge.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ge.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ge.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:ge.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Po.create=e=>{var t;return new Po({checks:[],typeName:Ee.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Re(e)})};class zd extends Me{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==fe.boolean){const r=this._getOrReturnCtx(t);return le(r,{code:te.invalid_type,expected:fe.boolean,received:r.parsedType}),Ce}return An(t.data)}}zd.create=e=>new zd({typeName:Ee.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Re(e)});class Oa extends Me{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==fe.date){const s=this._getOrReturnCtx(t);return le(s,{code:te.invalid_type,expected:fe.date,received:s.parsedType}),Ce}if(isNaN(t.data.getTime())){const s=this._getOrReturnCtx(t);return le(s,{code:te.invalid_date}),Ce}const r=new xn;let i;for(const s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(i=this._getOrReturnCtx(t,i),le(i,{code:te.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(i=this._getOrReturnCtx(t,i),le(i,{code:te.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):qe.assertNever(s);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Oa({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:ge.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:ge.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}Oa.create=e=>new Oa({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Ee.ZodDate,...Re(e)});class bm extends Me{_parse(t){if(this._getType(t)!==fe.symbol){const r=this._getOrReturnCtx(t);return le(r,{code:te.invalid_type,expected:fe.symbol,received:r.parsedType}),Ce}return An(t.data)}}bm.create=e=>new bm({typeName:Ee.ZodSymbol,...Re(e)});class Bd extends Me{_parse(t){if(this._getType(t)!==fe.undefined){const r=this._getOrReturnCtx(t);return le(r,{code:te.invalid_type,expected:fe.undefined,received:r.parsedType}),Ce}return An(t.data)}}Bd.create=e=>new Bd({typeName:Ee.ZodUndefined,...Re(e)});class Wd extends Me{_parse(t){if(this._getType(t)!==fe.null){const r=this._getOrReturnCtx(t);return le(r,{code:te.invalid_type,expected:fe.null,received:r.parsedType}),Ce}return An(t.data)}}Wd.create=e=>new Wd({typeName:Ee.ZodNull,...Re(e)});class vc extends Me{constructor(){super(...arguments),this._any=!0}_parse(t){return An(t.data)}}vc.create=e=>new vc({typeName:Ee.ZodAny,...Re(e)});class ba extends Me{constructor(){super(...arguments),this._unknown=!0}_parse(t){return An(t.data)}}ba.create=e=>new ba({typeName:Ee.ZodUnknown,...Re(e)});class ys extends Me{_parse(t){const n=this._getOrReturnCtx(t);return le(n,{code:te.invalid_type,expected:fe.never,received:n.parsedType}),Ce}}ys.create=e=>new ys({typeName:Ee.ZodNever,...Re(e)});class _m extends Me{_parse(t){if(this._getType(t)!==fe.undefined){const r=this._getOrReturnCtx(t);return le(r,{code:te.invalid_type,expected:fe.void,received:r.parsedType}),Ce}return An(t.data)}}_m.create=e=>new _m({typeName:Ee.ZodVoid,...Re(e)});class ii extends Me{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==fe.array)return le(n,{code:te.invalid_type,expected:fe.array,received:n.parsedType}),Ce;if(i.exactLength!==null){const o=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(o||a)&&(le(n,{code:o?te.too_big:te.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(le(n,{code:te.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(le(n,{code:te.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,a)=>i.type._parseAsync(new $i(n,o,n.path,a)))).then(o=>xn.mergeArray(r,o));const s=[...n.data].map((o,a)=>i.type._parseSync(new $i(n,o,n.path,a)));return xn.mergeArray(r,s)}get element(){return this._def.type}min(t,n){return new ii({...this._def,minLength:{value:t,message:ge.toString(n)}})}max(t,n){return new ii({...this._def,maxLength:{value:t,message:ge.toString(n)}})}length(t,n){return new ii({...this._def,exactLength:{value:t,message:ge.toString(n)}})}nonempty(t){return this.min(1,t)}}ii.create=(e,t)=>new ii({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ee.ZodArray,...Re(t)});function al(e){if(e instanceof pt){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Oi.create(al(r))}return new pt({...e._def,shape:()=>t})}else return e instanceof ii?new ii({...e._def,type:al(e.element)}):e instanceof Oi?Oi.create(al(e.unwrap())):e instanceof Ro?Ro.create(al(e.unwrap())):e instanceof Ui?Ui.create(e.items.map(t=>al(t))):e}class pt extends Me{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=qe.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==fe.object){const u=this._getOrReturnCtx(t);return le(u,{code:te.invalid_type,expected:fe.object,received:u.parsedType}),Ce}const{status:r,ctx:i}=this._processInputParams(t),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof ys&&this._def.unknownKeys==="strip"))for(const u in i.data)o.includes(u)||a.push(u);const l=[];for(const u of o){const d=s[u],f=i.data[u];l.push({key:{status:"valid",value:u},value:d._parse(new $i(i,f,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof ys){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of a)l.push({key:{status:"valid",value:d},value:{status:"valid",value:i.data[d]}});else if(u==="strict")a.length>0&&(le(i,{code:te.unrecognized_keys,keys:a}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of a){const f=i.data[d];l.push({key:{status:"valid",value:d},value:u._parse(new $i(i,f,i.path,d)),alwaysSet:d in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of l){const f=await d.key,h=await d.value;u.push({key:f,value:h,alwaysSet:d.alwaysSet})}return u}).then(u=>xn.mergeObjectSync(r,u)):xn.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return ge.errToObj,new pt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,s,o,a;const l=(o=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,n,r).message)!==null&&o!==void 0?o:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=ge.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new pt({...this._def,unknownKeys:"strip"})}passthrough(){return new pt({...this._def,unknownKeys:"passthrough"})}extend(t){return new pt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new pt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Ee.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new pt({...this._def,catchall:t})}pick(t){const n={};return qe.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new pt({...this._def,shape:()=>n})}omit(t){const n={};return qe.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new pt({...this._def,shape:()=>n})}deepPartial(){return al(this)}partial(t){const n={};return qe.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new pt({...this._def,shape:()=>n})}required(t){const n={};return qe.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof Oi;)s=s._def.innerType;n[r]=s}}),new pt({...this._def,shape:()=>n})}keyof(){return T4(qe.objectKeys(this.shape))}}pt.create=(e,t)=>new pt({shape:()=>e,unknownKeys:"strip",catchall:ys.create(),typeName:Ee.ZodObject,...Re(t)});pt.strictCreate=(e,t)=>new pt({shape:()=>e,unknownKeys:"strict",catchall:ys.create(),typeName:Ee.ZodObject,...Re(t)});pt.lazycreate=(e,t)=>new pt({shape:e,unknownKeys:"strip",catchall:ys.create(),typeName:Ee.ZodObject,...Re(t)});class qd extends Me{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(a=>new dr(a.ctx.common.issues));return le(n,{code:te.invalid_union,unionErrors:o}),Ce}if(n.common.async)return Promise.all(r.map(async s=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(i);{let s;const o=[];for(const l of r){const u={...n,common:{...n.common,issues:[]},parent:null},d=l._parseSync({data:n.data,path:n.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!s&&(s={result:d,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(l=>new dr(l));return le(n,{code:te.invalid_union,unionErrors:a}),Ce}}get options(){return this._def.options}}qd.create=(e,t)=>new qd({options:e,typeName:Ee.ZodUnion,...Re(t)});const Zi=e=>e instanceof Kd?Zi(e.schema):e instanceof li?Zi(e.innerType()):e instanceof Yd?[e.value]:e instanceof No?e.options:e instanceof Qd?qe.objectValues(e.enum):e instanceof Xd?Zi(e._def.innerType):e instanceof Bd?[void 0]:e instanceof Wd?[null]:e instanceof Oi?[void 0,...Zi(e.unwrap())]:e instanceof Ro?[null,...Zi(e.unwrap())]:e instanceof $1||e instanceof Jd?Zi(e.unwrap()):e instanceof Zd?Zi(e._def.innerType):[];class Vg extends Me{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==fe.object)return le(n,{code:te.invalid_type,expected:fe.object,received:n.parsedType}),Ce;const r=this.discriminator,i=n.data[r],s=this.optionsMap.get(i);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(le(n,{code:te.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Ce)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const s of n){const o=Zi(s.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of o){if(i.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);i.set(a,s)}}return new Vg({typeName:Ee.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...Re(r)})}}function Sw(e,t){const n=zs(e),r=zs(t);if(e===t)return{valid:!0,data:e};if(n===fe.object&&r===fe.object){const i=qe.objectKeys(t),s=qe.objectKeys(e).filter(a=>i.indexOf(a)!==-1),o={...e,...t};for(const a of s){const l=Sw(e[a],t[a]);if(!l.valid)return{valid:!1};o[a]=l.data}return{valid:!0,data:o}}else if(n===fe.array&&r===fe.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let s=0;s<e.length;s++){const o=e[s],a=t[s],l=Sw(o,a);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===fe.date&&r===fe.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Hd extends Me{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(s,o)=>{if(bw(s)||bw(o))return Ce;const a=Sw(s.value,o.value);return a.valid?((_w(s)||_w(o))&&n.dirty(),{status:n.value,value:a.data}):(le(r,{code:te.invalid_intersection_types}),Ce)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Hd.create=(e,t,n)=>new Hd({left:e,right:t,typeName:Ee.ZodIntersection,...Re(n)});class Ui extends Me{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==fe.array)return le(r,{code:te.invalid_type,expected:fe.array,received:r.parsedType}),Ce;if(r.data.length<this._def.items.length)return le(r,{code:te.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ce;!this._def.rest&&r.data.length>this._def.items.length&&(le(r,{code:te.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((o,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new $i(r,o,r.path,a)):null}).filter(o=>!!o);return r.common.async?Promise.all(s).then(o=>xn.mergeArray(n,o)):xn.mergeArray(n,s)}get items(){return this._def.items}rest(t){return new Ui({...this._def,rest:t})}}Ui.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ui({items:e,typeName:Ee.ZodTuple,rest:null,...Re(t)})};class Gd extends Me{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==fe.object)return le(r,{code:te.invalid_type,expected:fe.object,received:r.parsedType}),Ce;const i=[],s=this._def.keyType,o=this._def.valueType;for(const a in r.data)i.push({key:s._parse(new $i(r,a,r.path,a)),value:o._parse(new $i(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?xn.mergeObjectAsync(n,i):xn.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Me?new Gd({keyType:t,valueType:n,typeName:Ee.ZodRecord,...Re(r)}):new Gd({keyType:ti.create(),valueType:t,typeName:Ee.ZodRecord,...Re(n)})}}class Sm extends Me{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==fe.map)return le(r,{code:te.invalid_type,expected:fe.map,received:r.parsedType}),Ce;const i=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([a,l],u)=>({key:i._parse(new $i(r,a,r.path,[u,"key"])),value:s._parse(new $i(r,l,r.path,[u,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of o){const u=await l.key,d=await l.value;if(u.status==="aborted"||d.status==="aborted")return Ce;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),a.set(u.value,d.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of o){const u=l.key,d=l.value;if(u.status==="aborted"||d.status==="aborted")return Ce;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),a.set(u.value,d.value)}return{status:n.value,value:a}}}}Sm.create=(e,t,n)=>new Sm({valueType:t,keyType:e,typeName:Ee.ZodMap,...Re(n)});class Da extends Me{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==fe.set)return le(r,{code:te.invalid_type,expected:fe.set,received:r.parsedType}),Ce;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(le(r,{code:te.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(le(r,{code:te.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const s=this._def.valueType;function o(l){const u=new Set;for(const d of l){if(d.status==="aborted")return Ce;d.status==="dirty"&&n.dirty(),u.add(d.value)}return{status:n.value,value:u}}const a=[...r.data.values()].map((l,u)=>s._parse(new $i(r,l,r.path,u)));return r.common.async?Promise.all(a).then(l=>o(l)):o(a)}min(t,n){return new Da({...this._def,minSize:{value:t,message:ge.toString(n)}})}max(t,n){return new Da({...this._def,maxSize:{value:t,message:ge.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Da.create=(e,t)=>new Da({valueType:e,minSize:null,maxSize:null,typeName:Ee.ZodSet,...Re(t)});class Vl extends Me{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==fe.function)return le(n,{code:te.invalid_type,expected:fe.function,received:n.parsedType}),Ce;function r(a,l){return xm({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ym(),gc].filter(u=>!!u),issueData:{code:te.invalid_arguments,argumentsError:l}})}function i(a,l){return xm({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ym(),gc].filter(u=>!!u),issueData:{code:te.invalid_return_type,returnTypeError:l}})}const s={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof yc){const a=this;return An(async function(...l){const u=new dr([]),d=await a._def.args.parseAsync(l,s).catch(p=>{throw u.addIssue(r(l,p)),u}),f=await Reflect.apply(o,this,d);return await a._def.returns._def.type.parseAsync(f,s).catch(p=>{throw u.addIssue(i(f,p)),u})})}else{const a=this;return An(function(...l){const u=a._def.args.safeParse(l,s);if(!u.success)throw new dr([r(l,u.error)]);const d=Reflect.apply(o,this,u.data),f=a._def.returns.safeParse(d,s);if(!f.success)throw new dr([i(d,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Vl({...this._def,args:Ui.create(t).rest(ba.create())})}returns(t){return new Vl({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new Vl({args:t||Ui.create([]).rest(ba.create()),returns:n||ba.create(),typeName:Ee.ZodFunction,...Re(r)})}}class Kd extends Me{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Kd.create=(e,t)=>new Kd({getter:e,typeName:Ee.ZodLazy,...Re(t)});class Yd extends Me{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return le(n,{received:n.data,code:te.invalid_literal,expected:this._def.value}),Ce}return{status:"valid",value:t.data}}get value(){return this._def.value}}Yd.create=(e,t)=>new Yd({value:e,typeName:Ee.ZodLiteral,...Re(t)});function T4(e,t){return new No({values:e,typeName:Ee.ZodEnum,...Re(t)})}class No extends Me{constructor(){super(...arguments),ku.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return le(n,{expected:qe.joinValues(r),received:n.parsedType,code:te.invalid_type}),Ce}if(wm(this,ku)||S4(this,ku,new Set(this._def.values)),!wm(this,ku).has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return le(n,{received:n.data,code:te.invalid_enum_value,options:r}),Ce}return An(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return No.create(t,{...this._def,...n})}exclude(t,n=this._def){return No.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}ku=new WeakMap;No.create=T4;class Qd extends Me{constructor(){super(...arguments),Cu.set(this,void 0)}_parse(t){const n=qe.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==fe.string&&r.parsedType!==fe.number){const i=qe.objectValues(n);return le(r,{expected:qe.joinValues(i),received:r.parsedType,code:te.invalid_type}),Ce}if(wm(this,Cu)||S4(this,Cu,new Set(qe.getValidEnumValues(this._def.values))),!wm(this,Cu).has(t.data)){const i=qe.objectValues(n);return le(r,{received:r.data,code:te.invalid_enum_value,options:i}),Ce}return An(t.data)}get enum(){return this._def.values}}Cu=new WeakMap;Qd.create=(e,t)=>new Qd({values:e,typeName:Ee.ZodNativeEnum,...Re(t)});class yc extends Me{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==fe.promise&&n.common.async===!1)return le(n,{code:te.invalid_type,expected:fe.promise,received:n.parsedType}),Ce;const r=n.parsedType===fe.promise?n.data:Promise.resolve(n.data);return An(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}yc.create=(e,t)=>new yc({type:e,typeName:Ee.ZodPromise,...Re(t)});class li extends Me{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ee.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,s={addIssue:o=>{le(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const o=i.transform(r.data,s);if(r.common.async)return Promise.resolve(o).then(async a=>{if(n.value==="aborted")return Ce;const l=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return l.status==="aborted"?Ce:l.status==="dirty"||n.value==="dirty"?jl(l.value):l});{if(n.value==="aborted")return Ce;const a=this._def.schema._parseSync({data:o,path:r.path,parent:r});return a.status==="aborted"?Ce:a.status==="dirty"||n.value==="dirty"?jl(a.value):a}}if(i.type==="refinement"){const o=a=>{const l=i.refinement(a,s);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Ce:(a.status==="dirty"&&n.dirty(),o(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?Ce:(a.status==="dirty"&&n.dirty(),o(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Ud(o))return o;const a=i.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>Ud(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:n.value,value:a})):o);qe.assertNever(i)}}li.create=(e,t,n)=>new li({schema:e,typeName:Ee.ZodEffects,effect:t,...Re(n)});li.createWithPreprocess=(e,t,n)=>new li({schema:t,effect:{type:"preprocess",transform:e},typeName:Ee.ZodEffects,...Re(n)});class Oi extends Me{_parse(t){return this._getType(t)===fe.undefined?An(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Oi.create=(e,t)=>new Oi({innerType:e,typeName:Ee.ZodOptional,...Re(t)});class Ro extends Me{_parse(t){return this._getType(t)===fe.null?An(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Ro.create=(e,t)=>new Ro({innerType:e,typeName:Ee.ZodNullable,...Re(t)});class Xd extends Me{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===fe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Xd.create=(e,t)=>new Xd({innerType:e,typeName:Ee.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Re(t)});class Zd extends Me{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Vd(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new dr(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new dr(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Zd.create=(e,t)=>new Zd({innerType:e,typeName:Ee.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Re(t)});class Em extends Me{_parse(t){if(this._getType(t)!==fe.nan){const r=this._getOrReturnCtx(t);return le(r,{code:te.invalid_type,expected:fe.nan,received:r.parsedType}),Ce}return{status:"valid",value:t.data}}}Em.create=e=>new Em({typeName:Ee.ZodNaN,...Re(e)});const Moe=Symbol("zod_brand");class $1 extends Me{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Tf extends Me{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Ce:s.status==="dirty"?(n.dirty(),jl(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Ce:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new Tf({in:t,out:n,typeName:Ee.ZodPipeline})}}class Jd extends Me{_parse(t){const n=this._def.innerType._parse(t),r=i=>(Ud(i)&&(i.value=Object.freeze(i.value)),i);return Vd(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}Jd.create=(e,t)=>new Jd({innerType:e,typeName:Ee.ZodReadonly,...Re(t)});function j4(e,t={},n){return e?vc.create().superRefine((r,i)=>{var s,o;if(!e(r)){const a=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,l=(o=(s=a.fatal)!==null&&s!==void 0?s:n)!==null&&o!==void 0?o:!0,u=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...u,fatal:l})}}):vc.create()}const Loe={object:pt.lazycreate};var Ee;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Ee||(Ee={}));const Foe=(e,t={message:`Input not instance of ${e.name}`})=>j4(n=>n instanceof e,t),P4=ti.create,N4=jo.create,$oe=Em.create,Uoe=Po.create,R4=zd.create,Voe=Oa.create,zoe=bm.create,Boe=Bd.create,Woe=Wd.create,qoe=vc.create,Hoe=ba.create,Goe=ys.create,Koe=_m.create,Yoe=ii.create,Qoe=pt.create,Xoe=pt.
517strictCreate,Zoe=qd.create,Joe=Vg.create,eae=Hd.create,tae=Ui.create,nae=Gd.create,rae=Sm.create,iae=Da.create,sae=Vl.create,oae=Kd.create,aae=Yd.create,lae=No.create,cae=Qd.create,uae=yc.create,qj=li.create,dae=Oi.create,fae=Ro.create,hae=li.createWithPreprocess,pae=Tf.create,mae=()=>P4().optional(),gae=()=>N4().optional(),vae=()=>R4().optional(),yae={string:e=>ti.create({...e,coerce:!0}),number:e=>jo.create({...e,coerce:!0}),boolean:e=>zd.create({...e,coerce:!0}),bigint:e=>Po.create({...e,coerce:!0}),date:e=>Oa.create({...e,coerce:!0})},xae=Ce;var Hn=Object.freeze({__proto__:null,defaultErrorMap:gc,setErrorMap:xoe,getErrorMap:ym,makeIssue:xm,EMPTY_PATH:woe,addIssueToContext:le,ParseStatus:xn,INVALID:Ce,DIRTY:jl,OK:An,isAborted:bw,isDirty:_w,isValid:Ud,isAsync:Vd,get util(){return qe},get objectUtil(){return ww},ZodParsedType:fe,getParsedType:zs,ZodType:Me,datetimeRegex:C4,ZodString:ti,ZodNumber:jo,ZodBigInt:Po,ZodBoolean:zd,ZodDate:Oa,ZodSymbol:bm,ZodUndefined:Bd,ZodNull:Wd,ZodAny:vc,ZodUnknown:ba,ZodNever:ys,ZodVoid:_m,ZodArray:ii,ZodObject:pt,ZodUnion:qd,ZodDiscriminatedUnion:Vg,ZodIntersection:Hd,ZodTuple:Ui,ZodRecord:Gd,ZodMap:Sm,ZodSet:Da,ZodFunction:Vl,ZodLazy:Kd,ZodLiteral:Yd,ZodEnum:No,ZodNativeEnum:Qd,ZodPromise:yc,ZodEffects:li,ZodTransformer:li,ZodOptional:Oi,ZodNullable:Ro,ZodDefault:Xd,ZodCatch:Zd,ZodNaN:Em,BRAND:Moe,ZodBranded:$1,ZodPipeline:Tf,ZodReadonly:Jd,custom:j4,Schema:Me,ZodSchema:Me,late:Loe,get ZodFirstPartyTypeKind(){return Ee},coerce:yae,any:qoe,array:Yoe,bigint:Uoe,boolean:R4,date:Voe,discriminatedUnion:Joe,effect:qj,enum:lae,function:sae,instanceof:Foe,intersection:eae,lazy:oae,literal:aae,map:rae,nan:$oe,nativeEnum:cae,never:Goe,null:Woe,nullable:fae,number:N4,object:Qoe,oboolean:vae,onumber:gae,optional:dae,ostring:mae,pipeline:pae,preprocess:hae,promise:uae,record:nae,set:iae,strictObject:Xoe,string:P4,symbol:zoe,transformer:qj,tuple:tae,undefined:Boe,union:Zoe,unknown:Hoe,void:Koe,NEVER:xae,ZodIssueCode:te,quotelessJson:yoe,ZodError:dr});const Hj=(e,t,n)=>{if(e&&"reportValidity"in e){const r=oe(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},I4=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?Hj(r.ref,n,e):r.refs&&r.refs.forEach(i=>Hj(i,n,e))}},wae=(e,t)=>{t.shouldUseNativeValidation&&I4(e,t);const n={};for(const r in e){const i=oe(t.fields,r),s=Object.assign(e[r]||{},{ref:i&&i.ref});if(bae(t.names||Object.keys(e),r)){const o=Object.assign({},oe(n,r));Ge(o,"root",s),Ge(n,r,o)}else Ge(n,r,s)}return n},bae=(e,t)=>e.some(n=>n.startsWith(t+"."));var _ae=function(e,t){for(var n={};e.length;){var r=e[0],i=r.code,s=r.message,o=r.path.join(".");if(!n[o])if("unionErrors"in r){var a=r.unionErrors[0].errors[0];n[o]={message:a.message,type:a.code}}else n[o]={message:s,type:i};if("unionErrors"in r&&r.unionErrors.forEach(function(d){return d.errors.forEach(function(f){return e.push(f)})}),t){var l=n[o].types,u=l&&l[r.code];n[o]=h4(o,t,n,i,u?[].concat(u,r.message):r.message)}e.shift()}return n},Ew=function(e,t,n){return n===void 0&&(n={}),function(r,i,s){try{return Promise.resolve(function(o,a){try{var l=Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(u){return s.shouldUseNativeValidation&&I4({},s),{errors:{},values:n.raw?r:u}})}catch(u){return a(u)}return l&&l.then?l.then(void 0,a):l}(0,function(o){if(function(a){return Array.isArray(a==null?void 0:a.errors)}(o))return{values:{},errors:wae(_ae(o.errors,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw o}))}catch(o){return Promise.reject(o)}}};const Sae=Hn.object({email:Hn.string().email("Please enter a valid email address"),password:Hn.string().min(6,"Password must be at least 6 characters")}),Eae=Hn.object({firstName:Hn.string().min(1,"First name is required"),lastName:Hn.string().min(1,"Last name is required"),email:Hn.string().email("Please enter a valid email address"),password:Hn.string().min(6,"Password must be at least 6 characters")}),kae=({isOpen:e,onClose:t,defaultTab:n="login"})=>{const[r,i]=m.useState(n),[s,o]=m.useState(!1),[a,l]=m.useState(!1),[u,d]=m.useState(""),[f,h]=m.useState(!1),{signIn:p,signUp:g,signInWithProvider:v,isLoading:w}=Zt(),{toast:y}=zi(),x=vr();m.useEffect(()=>{e&&n&&i(n)},[n,e]),m.useEffect(()=>{e||(l(!1),d(""),o(!1),h(!1))},[e]);const b=vw({resolver:Ew(Sae),defaultValues:{email:"",password:""}}),_=vw({resolver:Ew(Eae),defaultValues:{firstName:"",lastName:"",email:"",password:""}}),S=T=>{i(T)},E=async T=>{x.track("auth_login_attempted",{auth_method:"email"});try{await p(T.email,T.password),x.track("auth_login_success",{auth_method:"email"}),t()}catch(N){x.track("auth_login_failed",{auth_method:"email",error_type:N instanceof Error?N.name:"unknown_error"})}},k=async T=>{x.track("auth_registration_started",{auth_method:"email",registration_source:"auth_modal"});try{await g(T.email,T.password,T.firstName,T.lastName),x.track("auth_registration_success",{auth_method:"email",registration_source:"auth_modal"}),d(T.email),l(!0)}catch(N){x.track("auth_registration_failed",{auth_method:"email",registration_source:"auth_modal",error_type:N instanceof Error?N.name:"unknown_error"})}},C=async()=>
517{if(u)try{h(!0);const{firstName:T,lastName:N,password:I}=_.getValues();await g(u,I,T,N),y({title:"Email sent!",description:"We've sent another verification email to your inbox.",duration:4e3})}catch{y({title:"Error",description:"Failed to resend verification email. Please try again.",variant:"destructive",duration:4e3})}finally{h(!1)}},P=async()=>{const T=r==="signup";x.track(T?"auth_registration_started":"auth_login_attempted",{auth_method:"google",registration_source:T?"auth_modal":void 0});try{await v("google",r==="signup"),x.track(T?"auth_registration_success":"auth_login_success",{auth_method:"google",registration_source:T?"auth_modal":void 0})}catch(N){x.track(T?"auth_registration_failed":"auth_login_failed",{auth_method:"google",registration_source:T?"auth_modal":void 0,error_type:N instanceof Error?N.name:"unknown_error"})}};return a?c.jsx(hm,{open:e,onOpenChange:T=>!T&&t(),children:c.jsxs(Ld,{className:"sm:max-w-md p-0 gap-0 overflow-hidden",children:[c.jsx(Fd,{className:"sr-only",children:"Email Verification Required"}),c.jsxs("div",{className:"p-6 text-center space-y-6",children:[c.jsx("div",{className:"flex justify-center",children:c.jsx("div",{className:"w-16 h-16 bg-green-100 rounded-full flex items-center justify-center",children:c.jsx(sy,{className:"w-8 h-8 text-green-600"})})}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("h2",{className:"text-2xl font-display font-semibold",children:"Check your email"}),c.jsx("p",{className:"text-muted-foreground",children:"We've sent a verification link to"}),c.jsx("p",{className:"font-medium text-sm",children:u})]}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"bg-blue-50 p-4 rounded-lg text-left",children:[c.jsx("h3",{className:"font-medium text-sm mb-2",children:"Next steps:"}),c.jsxs("ol",{className:"text-sm text-muted-foreground space-y-1",children:[c.jsx("li",{children:"1. Check your inbox for an email from MealMuse"}),c.jsx("li",{children:"2. Click the verification link in the email"}),c.jsx("li",{children:"3. Return here to sign in to your account"})]})]}),c.jsx("div",{className:"text-xs text-muted-foreground",children:c.jsx("p",{children:"Don't see the email? Check your spam folder or try resending it."})})]}),c.jsxs("div",{className:"space-y-3",children:[c.jsx(ie,{variant:"outline",className:"w-full",onClick:C,disabled:f,children:f?c.jsxs(c.Fragment,{children:[c.jsx(Wt,{className:"mr-2 h-4 w-4 animate-spin"}),"Sending..."]}):c.jsxs(c.Fragment,{children:[c.jsx(hg,{className:"mr-2 h-4 w-4"}),"Resend verification email"]})}),c.jsx(ie,{variant:"ghost",className:"w-full",onClick:()=>{l(!1),i("login")},children:"Back to sign in"}),c.jsx(ie,{variant:"ghost",className:"w-full text-xs",onClick:t,children:"I'll verify later"})]})]})]})}):c.jsx(hm,{open:e,onOpenChange:T=>!T&&t(),children:c.jsxs(Ld,{className:"sm:max-w-md p-0 gap-0 overflow-hidden",children:[c.jsx(Fd,{className:"sr-only",children:r==="login"?"Log In":"Sign Up"}),c.jsx("div",{className:"pt-6 px-6 flex justify-between items-center",children:c.jsx("h2",{className:"text-2xl font-display font-semibold",children:r==="login"?"Welcome back":"Create an account"})}),c.jsxs(A1,{value:r,onValueChange:S,className:"w-full",children:[c.jsx("div",{className:"px-6 pt-3",children:c.jsxs(Lg,{className:"grid grid-cols-2 w-full",children:[c.jsx(go,{value:"login",children:"Log In"}),c.jsx(go,{value:"signup",children:"Sign Up"})]})}),c.jsxs($d,{value:"login",className:"m-0 p-6",children:[c.jsxs("div",{className:"space-y-4",children:[c.jsxs(ie,{type:"button",variant:"outline",className:"w-full flex items-center justify-center gap-2",onClick:P,disabled:w,children:[c.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"Google",className:"h-4 w-4"}),"Continue with Google"]}),c.jsxs("div",{className:"relative",children:[c.jsx("div",{className:"absolute inset-0 flex items-center",children:c.jsx("span",{className:"w-full border-t"})}),c.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:c.jsx("span",{className:"bg-background px-2 text-muted-foreground",children:"Or continue with"})})]})]}),c.jsx(yw,{...b,children:c.jsxs("form",{onSubmit:b.handleSubmit(E),className:"space-y-4 mt
517-4",children:[c.jsx(Ei,{control:b.control,name:"email",render:({field:T})=>c.jsxs(or,{className:"space-y-2",children:[c.jsx(ar,{children:"Email"}),c.jsxs("div",{className:"relative",children:[c.jsx(sy,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),c.jsx(kr,{children:c.jsx(Pn,{type:"email",className:"pl-10",placeholder:"[email protected]",...T})})]}),c.jsx(Jr,{})]})}),c.jsx(Ei,{control:b.control,name:"password",render:({field:T})=>c.jsxs(or,{className:"space-y-2",children:[c.jsx(ar,{children:"Password"}),c.jsxs("div",{className:"relative",children:[c.jsx(NC,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),c.jsx(kr,{children:c.jsx(Pn,{type:s?"text":"password",className:"pl-10 pr-10",...T})}),c.jsx(ie,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-10 w-10",onClick:()=>o(!s),children:s?c.jsx(TC,{className:"h-4 w-4"}):c.jsx(jC,{className:"h-4 w-4"})})]}),c.jsx(Jr,{})]})}),c.jsx(ie,{type:"submit",className:"w-full bg-primary hover:bg-primary/90 py-6",disabled:w,children:w?c.jsxs(c.Fragment,{children:[c.jsx(Wt,{className:"mr-2 h-4 w-4 animate-spin"}),"Logging in..."]}):"Log In"})]})})]}),c.jsxs($d,{value:"signup",className:"m-0 p-6",children:[c.jsxs("div",{className:"space-y-4",children:[c.jsxs(ie,{type:"button",variant:"outline",className:"w-full flex items-center justify-center gap-2",onClick:P,disabled:w,children:[c.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"Google",className:"h-4 w-4"}),"Continue with Google"]}),c.jsxs("div",{className:"relative",children:[c.jsx("div",{className:"absolute inset-0 flex items-center",children:c.jsx("span",{className:"w-full border-t"})}),c.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:c.jsx("span",{className:"bg-background px-2 text-muted-foreground",children:"Or continue with"})})]})]}),c.jsx(yw,{..._,children:c.jsxs("form",{onSubmit:_.handleSubmit(k),className:"space-y-4 mt-4",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsx(Ei,{control:_.control,name:"firstName",render:({field:T})=>c.jsxs(or,{className:"space-y-2",children:[c.jsx(ar,{children:"First Name"}),c.jsx(kr,{children:c.jsx(Pn,{...T})}),c.jsx(Jr,{})]})}),c.jsx(Ei,{control:_.control,name:"lastName",render:({field:T})=>c.jsxs(or,{className:"space-y-2",children:[c.jsx(ar,{children:"Last Name"}),c.jsx(kr,{children:c.jsx(Pn,{...T})}),c.jsx(Jr,{})]})})]}),c.jsx(Ei,{control:_.control,name:"email",render:({field:T})=>c.jsxs(or,{className:"space-y-2",children:[c.jsx(ar,{children:"Email"}),c.jsxs("div",{className:"relative",children:[c.jsx(sy,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),c.jsx(kr,{children:c.jsx(Pn,{type:"email",className:"pl-10",placeholder:"[email protected]",...T})})]}),c.jsx(Jr,{})]})}),c.jsx(Ei,{control:_.control,name:"password",render:({field:T})=>c.jsxs(or,{className:"space-y-2",children:[c.jsx(ar,{children:"Password"}),c.jsxs("div",{className:"relative",children:[c.jsx(NC,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),c.jsx(kr,{children:c.jsx(Pn,{type:s?"text":"password",className:"pl-10 pr-10",...T})}),c.jsx(ie,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-10 w-10",onClick:()=>o(!s),children:s?c.jsx(TC,{className:"h-4 w-4"}):c.jsx(jC,{className:"h-4 w-4"})})]}),c.jsx(Jr,{}),c.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Password must be at least 6 characters long"})]})}),c.jsx(ie,{type:"submit",className:"w-full bg-primary hover:bg-primary/90 py-6",disabled:w,children:w?c.jsxs(c.Fragment,{children:[c.jsx(Wt,{className:"mr-2 h-4 w-4 animate-spin"}),"Creating account..."]}):"Create Account"}),c.jsxs("p",{className:"text-xs text-center text-muted-foreground",children:["By creating an account, you agree to our"," ",c.jsx("a",{href:"/terms-of-service",className:"underline underline-offset-2 hover:text-foreground",children:"Terms of Service"})," ","and"," ",c.jsx("a",{href:"/privacy-policy",className:"underline underline-offset-2 hover:text-foreground",children:"Privacy Policy"})]})]})})]})]})]})})},Cae=()=>{const[e,t]=m.useState(!1),[n,r]=m.useState("login"),{user:i,needsOnboarding:s,isLoading:o,isRedirecting:a}=Zt(),l=wn();m.useEffect(()=>{document.title="MealMuse - Smart Meal Planning, Simplified"},[]),m.useEffect(()=>{if(!o&&!a&&i){const f=setTimeout(()=>{l(s?"/onboarding/welcome":"/dashboard")},100);return()=>clearTimeout(f)}},[i,s,o,a,l]);const u=f=>{r(f),t(!0)},d=()=>{t(!1)};return(o||a||i)&&!e?c.jsxs("div",{className:"flex h-screen w-full flex-col items-center justify-center",children:[c.jsx(Wt,{className:"h-10 w-10 animate-spin text-primary"}),c.jsx("p",{className:"mt-4 text-sm text-muted-foreground",children:o?"Getting you signed in...":a?"Completing sign in...":"Taking you to your dashboard..."})]}):c.jsxs("div",{className:"min-h-screen flex flex-col",children:[c.jsx(Wi,{onOpenAuth:u}),c.jsxs("main",{className:"flex-grow",children:[c.jsx(OJ,{onOpenAuth:u}),c.jsx(Uee,{onOpenAuth:u}),c.jsx(Kse,{}),c.jsx(Yse,{})]}),c.jsx(N1,{}),c.jsx(kae,{isOpen:e,onClose:d,defaultTab:n})]})};var Gj=["light","dark"],Tae="(prefers-color-scheme: dark)",jae=m.createContext(void 0),Pae={setTheme:e=>{},themes:[]},Nae=()=>{var e;return(e=m.useContext(jae))!=null?e:Pae};m.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:s,value:o,attrs:a,nonce:l})=>{let u=s==="system",d=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${a.map(g=>`'${g}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,f=i?Gj.includes(s)&&s?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${s}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",h=(g,v=!1,w=!0)=>{let y=o?o[g]:g,x=v?g+"|| ''":`'${y}'`,b="";return i&&w&&!v&&Gj.includes(g)&&(b+=`d.style.colorScheme = '${g}';`),n==="class"?v||y?b+=`c.add(${x})`:b+="null":y&&(b+=`d[s](n,${x})`),b},p=e?`!function(){${d}${h(e)}}()`:r?`!function(){try{${d}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${u})){var t='${Tae}',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)}}${u?"":"else{"+h(s,!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(s,!1,!1)};}${f}}catch(t){}}();`;return m.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:p}})});var Rae=e=>{switch(e){case"success":return Oae;case"info":return Mae;case"warning":return Dae;case"error":return Lae;default:return null}},Iae=Array(12).fill(0),Aae=({visible:e})=>F.createElement("div",{className:"sonner-loading-wrapper","data-visible":e},F.createElement("div",{className:"sonner-spinner"},Iae.map((t,n)=>F.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),Oae=F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},F.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"})),Dae=F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"
517currentColor",height:"20",width:"20"},F.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"})),Mae=F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},F.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"})),Lae=F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},F.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"})),Fae=()=>{let[e,t]=F.useState(document.hidden);return F.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},kw=1,$ae=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,i=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:kw++,s=this.toasts.find(a=>a.id===i),o=e.dismissible===void 0?!0:e.dismissible;return s?this.toasts=this.toasts.map(a=>a.id===i?(this.publish({...a,...e,id:i,title:n}),{...a,...e,id:i,dismissible:o,title:n}):a):this.addToast({title:n,...r,dismissible:o,id:i}),i},this.dismiss=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)=>
517this.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(),i=n!==void 0;return r.then(async s=>{if(Vae(s)&&!s.ok){i=!1;let o=typeof t.error=="function"?await t.error(`HTTP error! status: ${s.status}`):t.error,a=typeof t.description=="function"?await t.description(`HTTP error! status: ${s.status}`):t.description;this.create({id:n,type:"error",message:o,description:a})}else if(t.success!==void 0){i=!1;let o=typeof t.success=="function"?await t.success(s):t.success,a=typeof t.description=="function"?await t.description(s):t.description;this.create({id:n,type:"success",message:o,description:a})}}).catch(async s=>{if(t.error!==void 0){i=!1;let o=typeof t.error=="function"?await t.error(s):t.error,a=typeof t.description=="function"?await t.description(s):t.description;this.create({id:n,type:"error",message:o,description:a})}}).finally(()=>{var s;i&&(this.dismiss(n),n=void 0),(s=t.finally)==null||s.call(t)}),n},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||kw++;return this.create({jsx:e(n),id:n,...t}),n},this.subscribers=[],this.toasts=[]}},rr=new $ae,Uae=(e,t)=>{let n=(t==null?void 0:t.id)||kw++;return rr.addToast({title:e,...t,id:n}),n},Vae=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",zae=Uae,Bae=()=>rr.toasts,Wae=Object.assign(zae,{success:rr.success,info:rr.info,warning:rr.warning,error:rr.error,custom:rr.custom,message:rr.message,promise:rr.promise,dismiss:rr.dismiss,loading:rr.loading},{getHistory:Bae});function qae(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))}qae(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-bottom))}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;
517left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;background:var(--gray1);color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:0;right:0;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}
517:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
518`);function kh(e){return e.label!==void 0}var Hae=3,Gae="32px",Kae=4e3,Yae=356,Qae=14,Xae=20,Zae=200;function Jae(...e){return e.filter(Boolean).join(" ")}var ele=e=>{var t,n,r,i,s,o,a,l,u,d;let{invert:f,toast:h,unstyled:p,interacting:g,setHeights:v,visibleToasts:w,heights:y,index:x,toasts:b,expanded:_,removeToast:S,defaultRichColors:E,closeButton:k,style:C,cancelButtonStyle:P,actionButtonStyle:T,className:N="",descriptionClassName:I="",duration:O,position:j,gap:A,loadingIcon:V,expandByDefault:$,classNames:R,icons:L,closeButtonAriaLabel:H="Close toast",pauseWhenPageIsHidden:z,cn:Q}=e,[de,ne]=F.useState(!1),[ye,he]=F.useState(!1),[Pe,Ue]=F.useState(!1),[Ae,Fe]=F.useState(!1),[wt,jt]=F.useState(0),[xe,qt]=F.useState(0),Fr=F.useRef(null),ln=F.useRef(null),er=x===0,D=x+1<=w,U=h.type,B=h.dism
518issible!==!1,ae=h.className||"",re=h.descriptionClassName||"",X=F.useMemo(()=>y.findIndex(ee=>ee.toastId===h.id)||0,[y,h.id]),G=F.useMemo(()=>{var ee;return(ee=h.closeButton)!=null?ee:k},[h.closeButton,k]),J=F.useMemo(()=>h.duration||O||Kae,[h.duration,O]),je=F.useRef(0),Se=F.useRef(0),nt=F.useRef(0),Jt=F.useRef(null),[bn,_n]=j.split("-"),$r=F.useMemo(()=>y.reduce((ee,ve,be)=>be>=X?ee:ee+ve.height,0),[y,X]),Ur=Fae(),mi=h.invert||f,yr=U==="loading";Se.current=F.useMemo(()=>X*A+$r,[X,$r]),F.useEffect(()=>{ne(!0)},[]),F.useLayoutEffect(()=>{if(!de)return;let ee=ln.current,ve=ee.style.height;ee.style.height="auto";let be=ee.getBoundingClientRect().height;ee.style.height=ve,qt(be),v(Be=>Be.find($e=>$e.toastId===h.id)?Be.map($e=>$e.toastId===h.id?{...$e,height:be}:$e):[{toastId:h.id,height:be,position:h.position},...Be])},[de,h.title,h.description,v,h.id]);let Fn=F.useCallback(()=>{he(!0),jt(Se.current),v(ee=>ee.filter(ve=>ve.toastId!==h.id)),setTimeout(()=>{S(h)},Zae)},[h,S,v,Se]);F.useEffect(()=>{if(h.promise&&U==="loading"||h.duration===1/0||h.type==="loading")return;let ee,ve=J;return _||g||z&&Ur?(()=>{if(nt.current<je.current){let be=new Date().getTime()-je.current;ve=ve-be}nt.current=new Date().getTime()})():ve!==1/0&&(je.current=new Date().getTime(),ee=setTimeout(()=>{var be;(be=h.onAutoClose)==null||be.call(h,h),Fn()},ve)),()=>clearTimeout(ee)},[_,g,$,h,J,Fn,h.promise,U,z,Ur]),F.useEffect(()=>{let ee=ln.current;if(ee){let ve=ee.getBoundingClientRect().height;return qt(ve),v(be=>[{toastId:h.id,height:ve,position:h.position},...be]),()=>v(be=>be.filter(Be=>Be.toastId!==h.id))}},[v,h.id]),F.useEffect(()=>{h.delete&&Fn()},[Fn,h.delete]);function zo(){return L!=null&&L.loading?F.createElement("div",{className:"sonner-loader","data-visible":U==="loading"},L.loading):V?F.createElement("div",{className:"sonner-loader","data-visible":U==="loading"},V):F.createElement(Aae,{visible:U==="loading"})}return F.createElement("li",{"aria-live":h.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:ln,className:Q(N,ae,R==null?void 0:R.toast,(t=h==null?void 0:h.classNames)==null?void 0:t.toast,R==null?void 0:R.default,R==null?void 0:R[U],(n=h==null?void 0:h.classNames)==null?void 0:n[U]),"data-sonner-toast":"","data-rich-colors":(r=h.richColors)!=null?r:E,"data-styled":!(h.jsx||h.unstyled||p),"data-mounted":de,"data-promise":!!h.promise,"data-removed":ye,"data-visible":D,"data-y-position":bn,"data-x-position":_n,"data-index":x,"data-front":er,"data-swiping":Pe,"data-dismissible":B,"data-type":U,"data-invert":mi,"data-swipe-out":Ae,"data-expanded":!!(_||$&&de),style:{"--index":x,"--toasts-before":x,"--z-index":b.length-x,"--offset":`${ye?wt:Se.current}px`,"--initial-height":$?"auto":`${xe}px`,...C,...h.style},onPointerDown:ee=>{yr||!B||(Fr.current=new Date,jt(Se.current),ee.target.setPointerCapture(ee.pointerId),ee.target.tagName!=="BUTTON"&&(Ue(!0),Jt.current={x:ee.clientX,y:ee.clientY}))},onPointerUp:()=>{var ee,ve,be,Be;if(Ae||!B)return;Jt.current=null;let $e=Number(((ee=ln.current)==null?void 0:ee.style.getPropertyValue("--swipe-amount").replace("px",""))||0),en=new Date().getTime()-((ve=Fr.current)==null?void 0:ve.getTime()),tn=Math.abs($e)/en;if(Math.abs($e)>=Xae||tn>.11){jt(Se.current),(be=h.onDismiss)==null||be.call(h,h),Fn(),Fe(!0);return}(Be=ln.current)==null||Be.style.setProperty("--swipe-amount","0px"),Ue(!1)},onPointerMove:ee=>{var ve;if(!Jt.current||!B)return;let be=ee.clientY-Jt.current.y,Be=ee.clientX-Jt.current.x,$e=(bn==="top"?Math.min:Math.max)(0,be),en=ee.pointerType==="touch"?10:2;Math.abs($e)>en?(ve=ln.current)==null||ve.style.setProperty("--swipe-amount",`${be}px`):Math.abs(Be)>en&&(Jt.current=null)}},G&&!h.jsx?F.createElement("button",{"aria-label":H,"data-disabled":yr,"data-close-button":!0,onClick:yr||!B?()=>{}:()=>{var ee;Fn(),(ee=h.onDismiss)==null||ee.call(h,h)},className:Q(R==null?void 0:R.closeButton,(i=h==null?void 0:h.classNames)==null?void 0:i.closeButton)},F.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"},F.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),F.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,h.jsx||F.isValidElement(h.title)?h.jsx||h.title:F.createElement(F.Fragment,null,U||h.icon||h.promise?F.createElement("div",{"data-icon":"",className:Q(R==null?void 0:R.icon,(s=h==null?void 0:h.classNames)==null?void 0:s.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||zo():null,h.type!=="loading"?h.icon||(L==null?void 0:L[U])||Rae(U):null):null,F.createElement("div",{"data-content":"",className:Q(R==null?void 0:R.content,(o=h==null?void 0:h.classNames)==null?void 0:o.content)},F.createElement("div",{"data-title":"",className:Q(R==null?void 0:R.title,(a=h==null?void 0:h.classNames)==null?void 0:a.title)},h.title),h.description?F.createElement("div",{"data-description":"",className:Q(I,re,R==null?void 0:R.description,(l=h==null?void 0:h.classNames)==null?void 0:l.description)},h.description):null),F.isValidElement(h.cancel)?h.cancel:h.cancel&&kh(h.cancel)?F.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||P,onClick:ee=>{var ve,be;kh(h.cancel)&&B&&((be=(ve=h.cancel).onClick)==null||be.call(ve,ee),Fn())},className:Q(R==null?void 0:R.cancelButton,(u=h==null?void 0:h.classNames)==null?void 0:u.cancelButton)},h.cancel.label):null,F.isValidElement(h.action)?h.action:h.action&&kh(h.action)?F.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||T,onClick:ee=>{var ve,be;kh(h.action)&&(ee.defaultPrevented||((be=(ve=h.action).onClick)==null||be.call(ve,ee),Fn()))},className:Q(R==null?void 0:R.actionButton,(d=h==null?void 0:h.classNames)==null?void 0:d.actionButton)},h.action.label):null))};function Kj(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}var tle=e=>{let{invert:t,position:n="bottom-right",hotkey:r=["altKey","KeyT"],expand:i,closeButton:s,className:o,offset:a,theme:l="light",richColors:u,duration:d,style:f,visibleToasts:h=Hae,toastOptions:p,dir:g=Kj(),gap:v=Qae,loadingIcon:w,icons:y,containerAriaLabel:x="Notifications",pauseWhenPageIsHidden:b,cn:_=Jae}=e,[S,E]=F.useState([]),k=F.useMemo(()=>Array.from(new Set([n].concat(S.filter(z=>z.position).map(z=>z.position)))),[S,n]),[C,P]=F.useState([]),[T,N]=F.useState(!1),[I,O]=F.useState(!1),[j,A]=F.useState(l!=="system"?l:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dar
518k":"light"),V=F.useRef(null),$=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),R=F.useRef(null),L=F.useRef(!1),H=F.useCallback(z=>{var Q;(Q=S.find(de=>de.id===z.id))!=null&&Q.delete||rr.dismiss(z.id),E(de=>de.filter(({id:ne})=>ne!==z.id))},[S]);return F.useEffect(()=>rr.subscribe(z=>{if(z.dismiss){E(Q=>Q.map(de=>de.id===z.id?{...de,delete:!0}:de));return}setTimeout(()=>{H2.flushSync(()=>{E(Q=>{let de=Q.findIndex(ne=>ne.id===z.id);return de!==-1?[...Q.slice(0,de),{...Q[de],...z},...Q.slice(de+1)]:[z,...Q]})})})}),[]),F.useEffect(()=>{if(l!=="system"){A(l);return}l==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?A("dark"):A("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:z})=>{A(z?"dark":"light")})},[l]),F.useEffect(()=>{S.length<=1&&N(!1)},[S]),F.useEffect(()=>{let z=Q=>{var de,ne;r.every(ye=>Q[ye]||Q.code===ye)&&(N(!0),(de=V.current)==null||de.focus()),Q.code==="Escape"&&(document.activeElement===V.current||(ne=V.current)!=null&&ne.contains(document.activeElement))&&N(!1)};return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[r]),F.useEffect(()=>{if(V.current)return()=>{R.current&&(R.current.focus({preventScroll:!0}),R.current=null,L.current=!1)}},[V.current]),S.length?F.createElement("section",{"aria-label":`${x} ${$}`,tabIndex:-1},k.map((z,Q)=>{var de;let[ne,ye]=z.split("-");return F.createElement("ol",{key:z,dir:g==="auto"?Kj():g,tabIndex:-1,ref:V,className:o,"data-sonner-toaster":!0,"data-theme":j,"data-y-position":ne,"data-x-position":ye,style:{"--front-toast-height":`${((de=C[0])==null?void 0:de.height)||0}px`,"--offset":typeof a=="number"?`${a}px`:a||Gae,"--width":`${Yae}px`,"--gap":`${v}px`,...f},onBlur:he=>{L.current&&!he.currentTarget.contains(he.relatedTarget)&&(L.current=!1,R.current&&(R.current.focus({preventScroll:!0}),R.current=null))},onFocus:he=>{he.target instanceof HTMLElement&&he.target.dataset.dismissible==="false"||L.current||(L.current=!0,R.current=he.relatedTarget)},onMouseEnter:()=>N(!0),onMouseMove:()=>N(!0),onMouseLeave:()=>{I||N(!1)},onPointerDown:he=>{he.target instanceof HTMLElement&&he.target.dataset.dismissible==="false"||O(!0)},onPointerUp:()=>O(!1)},S.filter(he=>!he.position&&Q===0||he.position===z).map((he,Pe)=>{var Ue,Ae;return F.createElement(ele,{key:he.id,icons:y,index:Pe,toast:he,defaultRichColors:u,duration:(Ue=p==null?void 0:p.duration)!=null?Ue:d,className:p==null?void 0:p.className,descriptionClassName:p==null?void 0:p.descriptionClassName,invert:t,visibleToasts:h,closeButton:(Ae=p==null?void 0:p.closeButton)!=null?Ae:s,interacting:I,position:z,style:p==null?void 0:p.style,unstyled:p==null?void 0:p.unstyled,classNames:p==null?void 0:p.classNames,cancelButtonStyle:p==null?void 0:p.cancelButtonStyle,actionButtonStyle:p==null?void 0:p.actionButtonStyle,removeToast:H,toasts:S.filter(Fe=>Fe.position==he.position),heights:C.filter(Fe=>Fe.position==he.position),setHeights:P,expandByDefault:i,gap:v,loadingIcon:w,expanded:T,pauseWhenPageIsHidden:b,cn:_})}))})):null};const A4=({...e})=>{const{theme:t="system"}=Nae();return c.jsx(tle,{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})},zg=({title:e})=>{const{profile:t}=Zt();return c.jsx("div",{className:"flex items-center gap-2",children:c.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:e||`Welcome${t!=null&&t.first_name?`, ${t.first_name}`:""}!`})})};function Ts({number:e,title:t,description:n,icon:r,buttonText:i,completedButtonText:s,linkTo:o,isCompleted:a,isDisabled:l=!1,isMobile:u=!1}){const[d,f]=m.useState(!1),h=m.useRef(null),[p,g]=m.useState(!1);m.useEffect(()=>{if(!u||!h.current)return;const w=()=>{const x=h.current;if(!x)return;const b=x.getBoundingClientRect(),_=window.innerWidth,S=b.left+b.width/2,E=_/2;g(Math.abs(S-E)<b.width/2)};w();const y=h.current.parentElement;if(y)return y.addEventListener("scroll",w),()=>{y.removeEventListener("scroll",w)}},[u]);const v=()=>{u&&!l&&(f(!0),setTimeout(()=>f(!1),300))};return c.jsxs(di,{ref:h,className:K("overflow-hidden transition-all duration-300 flex flex-col",a?"border-primary/30 bg-primary/5":"",u?"w-64 flex-shrink-0 snap-start pb-2":"",u&&p?"transform scale-[1.03]":"",d?"transform scale-[0.97]":"",u?"pt-4":""),children:[c.jsxs("div",{className:"relative",children:[c.jsx("div",{className:K("absolute left-6 top-6 flex h-8 w-8 items-center justify-center rounded-full text-sm font-bold",a?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"),children:a?c.jsx(Ra,{className:"h-5 w-5"}):e}),a&&c.jsx("div",{className:"absolute right-6 top-6",children:c.jsx("span",{className:"inline-flex items-center rounded-full bg-primary/10 px-2.5 py-0.5 text-xs font-medium text-primary",children:"Completed"})})]}),c.jsx(fi,{className:"pt-14 flex-grow",children:c.jsxs("div",{className:"flex items-start gap-4",children:[c.jsx("div",{className:K("flex h-14 w-14 shrink-0 items-center justify-center rounded-full",a?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"),children:r}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-xl font-semibold",children:t}),c.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:n})]})]})}),c.jsx(bf,{className:"pb-6 mt-auto",children:c.jsx(ie,{asChild:!0,variant:a?"outline":"default",className:K("w-full justify-center",a&&"border-primary/30 text-primary hover:border-primary/60"),disabled:l,onTouchStart:v,onMouseDown:v,children:c.jsx(Nt,{to:o,children:a?s:i})})})]})}function hi(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 Ma(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const O4=6048e5,nle=864e5;let rle={};function Bg(){return rle}function ef(e,t){var a,l,u,d;const n=Bg(),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=(u=n.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,i=hi(e),s=i.getDay(),o=(s<r?7:0)+s-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function km(e){return ef(e,{weekStartsOn:1}
vendor: 10,137 bytes, line 518
518)}function D4(e){const t=hi(e),n=t.getFullYear(),r=Ma(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const i=km(r),s=Ma(e,0);s.setFullYear(n,0,4),s.setHours(0,0,0,0);const o=km(s);return t.getTime()>=i.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}function Yj(e){const t=hi(e);return t.setHours(0,0,0,0),t}function Qj(e){const t=hi(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function ile(e,t){const n=Yj(e),r=Yj(t),i=+n-Qj(n),s=+r-Qj(r);return Math.round((i-s)/nle)}function sle(e){const t=D4(e),n=Ma(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),km(n)}function ole(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function ale(e){if(!ole(e)&&typeof e!="number")return!1;const t=hi(e);return!isNaN(Number(t))}function lle(e){const t=hi(e),n=Ma(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}const cle={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"}},ule=(e,t,n)=>{let r;const i=cle[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Fy(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const dle={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},fle={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},hle={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ple={date:Fy({formats:dle,defaultWidth:"full"}),time:Fy({formats:fle,defaultWidth:"full"}),dateTime:Fy({formats:hle,defaultWidth:"full"})},mle={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},gle=(e,t,n,r)=>mle[e];function fu(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):o;i=e.formattingValues[a]||e.formattingValues[o]}else{const o=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[a]||e.values[o]}const s=e.argumentCallback?e.argumentCallback(t):t;return i[s]}}const vle={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},yle={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},xle={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"]},wle={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"]},ble={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"}},_le={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"}},Sle=(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"},Ele={ordinalNumber:Sle,era:fu({values:vle,defaultWidth:"wide"}),quarter:fu({values:yle,defaultWidth:"wide",argumentCallback:e=>e-1}),month:fu({values:xle,defaultWidth:"wide"}),day:fu({values:wle,defaultWidth:"wide"}),dayPeriod:fu({values:ble,defaultWidth:"wide",formattingValues:_le,defaultFormattingWidth:"wide"})};function hu(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(i);if(!s)return null;const o=s[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?Cle(a,f=>f.test(o)):kle(a,f=>f.test(o));let u;u=e.valueCallback?e.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;const d=t.slice(o.length);return{value:u,rest:d}}}function kle(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Cle(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Tle(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],s=t.match(e.parsePattern);if(!s)return null;let o=e.valueCallback?e.valueCallback(s[0]):s[0];o=n.valueCallback?n.valueCallback(o):o;const a=t.slice(i.length);return{value:o,rest:a}}}const jle=/^(\d+)(th|st|nd|rd)?/i,Ple=/\d+/i,Nle={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},Rle={any:[/^b/i,/^(a|c)/i]},Ile={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ale={any:[/1/i,/2/i,/3/i,/4/i]},Ole={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},Dle={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]},Mle={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},Lle={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]},Fle={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},$le={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}},Ule={ordinalNumber:Tle({matchPattern:jle,parsePattern:Ple,valueCallback:e=>parseInt(e,10)}),era:hu({matchPatterns:Nle,defaultMatchWidth:"wide",parsePatterns:Rle,defaultParseWidth:"any"}),quarter:hu({matchPatterns:Ile,defaultMatchWidth:"wide",parsePatterns:Ale,defaultParseWidth:"any",valueCallback:e=>e+1}),month:hu({matchPatterns:Ole,defaultMatchWidth:"wide",parsePatterns:Dle,defaultParseWidth:"any"}),day:hu({matchPatterns:Mle,defaultMatchWidth:"wide",parsePatterns:Lle,defaultParseWidth:"any"}),dayPeriod:hu({matchPatterns:Fle,defaultMatchWidth:"any",parsePatterns:$le,defaultParseWidth:"any"})},Vle={code:"en-US",formatDistance:ule,formatLong:ple,formatRelative:gle,localize:Ele,match:Ule,options:{weekStartsOn:0,firstWeekContainsDate:1}};function zle(e){const t=hi(e);return ile(t,lle(t))+1}function Ble(e){const t=hi(e),n=+km(t)-+sle(t);return Math.round(n/O4)+1}function M4(e,t){var d,f,h,p;const n=hi(e),r=n.getFullYear(),i=Bg(),s=(t==null?void 0:t.firstWeekContainsDate)??((f=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??i.firstWeekContainsDate??((p=(h=i.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,o=Ma(e,0);o.setFullYear(r+1,0,s),o.setHours(0,0,0,0);const a=ef(o,t),l=Ma(e,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const u=ef(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1}function Wle(e,t){var a,l,u,d;const n=Bg(),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=(u=n.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??1,i=M4(e,t),s=Ma(e,0);return s.setFullYear(i,0,r),s.setHours(0,0,0,0),ef(s,t)}function qle(e,t){const n=hi(e),r=+ef(n,t)-+Wle(n,t);return Math.round(r/O4)+1}function Qe(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const js={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Qe(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Qe(n+1,2)},d(e,t){return Qe(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 Qe(e.getHours()%12||12,t.length)},H(e,t){return Qe(e.getHours(),t.length)},m(e,t){return Qe(e.getMinutes(),t.length)},s(e,t){return Qe(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return Qe(i,t.length)}},sl={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}
vendor: 4,664 bytes, line 518
518,Xj={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(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return js.y(e,t)},Y:function(e,t,n,r){const i=M4(e,r),s=i>0?i:1-i;if(t==="YY"){const o=s%100;return Qe(o,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):Qe(s,t.length)},R:function(e,t){const n=D4(e);return Qe(n,t.length)},u:function(e,t){const n=e.getFullYear();return Qe(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 Qe(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 Qe(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 js.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 Qe(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 i=qle(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):Qe(i,t.length)},I:function(e,t,n){const r=Ble(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Qe(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):js.d(e,t)},D:function(e,t,n){const r=zle(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Qe(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 i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Qe(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Qe(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return Qe(i,t.length);case"io":return n.ordinalNumber(i,{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 i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=sl.noon:r===0?i=sl.midnight:i=r/12>
vendor: 4,427 bytes, line 518
518=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=sl.evening:r>=12?i=sl.afternoon:r>=4?i=sl.morning:i=sl.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{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 js.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):js.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Qe(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Qe(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):js.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):js.s(e,t)},S:function(e,t){return js.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Jj(r);case"XXXX":case"XX":return Xo(r);case"XXXXX":case"XXX":default:return Xo(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Jj(r);case"xxxx":case"xx":return Xo(r);case"xxxxx":case"xxx":default:return Xo(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Zj(r,":");case"OOOO":default:return"GMT"+Xo(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Zj(r,":");case"zzzz":default:return"GMT"+Xo(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return Qe(r,t.length)},T:function(e,t,n){const r=e.getTime();return Qe(r,t.length)}};function Zj(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),s=r%60;return s===0?n+String(i):n+String(i)+t+Qe(s,2)}function Jj(e,t){return e%60===0?(e>0?"-":"+")+Qe(Math.abs(e)/60,2):Xo(e,t)}function Xo(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Qe(Math.trunc(r/60),2),s=Qe(r%60,2);return n+i+t+s}const eP=(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"})}},L4=(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"})}},Hle=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return eP(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",eP(r,t)).replace("{{time}}",L4(i,t))},Gle={p:L4,P:Hle},Kle=/^D+$/,Yle=/^Y+$/,Qle=["D","DD","YY","YYYY"];function Xle(e){return Kle.test(e)}function Zle(e){return Yle.test(e)}function Jle(e,t,n){const r=ece(e,t,n);if(console.warn(r),Qle.includes(e))throw new RangeError(r)}function ece(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 tce=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,nce=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,rce=/^'([^]*?)'?$/,ice=/''/g,sce=/[a-zA-Z]/;function Cw(e,t,n){var d,f,h,p;const r=Bg(),i=r.locale??Vle,s=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=hi(e);if(!ale(a))throw new RangeError("Invalid time value");let l=t.match(nce).map(g=>{const v=g[0];if(v==="p"||v==="P"){const w=Gle[v];return w(g,i.formatLong)}return g}).join("").match(tce).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const v=g[0];if(v==="'")return{isToken:!1,value:oce(g)};if(Xj[v])return{isToken:!0,value:g};
518if(v.match(sce))throw new RangeError("Format string contains an unescaped latin alphabet character `"+v+"`");return{isToken:!1,value:g}});i.localize.preprocessor&&(l=i.localize.preprocessor(a,l));const u={firstWeekContainsDate:s,weekStartsOn:o,locale:i};return l.map(g=>{if(!g.isToken)return g.value;const v=g.value;(Zle(v)||Xle(v))&&Jle(v,t,String(e));const w=Xj[v[0]];return w(a,v,i.localize,u)}).join("")}function oce(e){const t=e.match(rce);return t?t[1].replace(ice,"'"):e}const tP=e=>{const n=Cw(new Date,"MMMM d");switch(e){case"day":return`Meals for ${n}`;case"week":return`Week of ${n}`;case"two-weeks":return`Two Weeks from ${n}`;default:return"My Meal Plan"}},ace=(e,t)=>{const n=new Date(e);switch(t){case"day":break;case"week":n.setDate(n.getDate()+6);break;case"two-weeks":n.setDate(n.getDate()+13);break}return n},lce=async(e,{title:t,timePeriod:n,mealTypes:r,shoppingPreference:i})=>{try{const s=new Date,o=ace(s,n),{data:a,error:l}=await _e.from("meal_plans").insert({user_id:e,title:t,time_period:n,shopping_preference:i,start_date:s.toISOString(),end_date:o.toISOString(),is_active:!0}).select("id").single();if(l)throw l;const u=r.map(f=>({meal_plan_id:a.id,meal_type:f})),{error:d}=await _e.from("meal_plan_meals").insert(u);if(d)throw d;return a.id}catch(s){throw console.error("Error creating meal plan:",s),s}},U1=async e=>{try{const{data:t,error:n}=await _e.from("meal_plans").select("*").eq("user_id",e).eq("is_active",!0).maybeSingle();if(n)throw n;if(!t)return null;const{data:r,error:i}=await _e.from("meal_plan_meals").select("meal_type").eq("meal_plan_id",t.id);if(i)throw i;return{...t,meal_types:r.map(s=>s.meal_type)}}catch(t){return console.error("Error getting active meal plan:",t),null}},F4=e=>{const t={day:"Today",week:"This Week","two-weeks":"Next Two Weeks"},n={"use-what-i-have":"Use mostly what I have","some-shopping":"I'm okay shopping for a few things","full-shopping":"Let's go shopping!"},r=i=>!i||i.length===0?"No meals selected":i.map(s=>s.charAt(0).toUpperCase()+s.slice(1)).join(", ");return{timePeriodLabel:t[e.time_period]||e.time_period,shoppingPreferenceLabel:n[e.shopping_preference]||e.shopping_preference,mealTypesLabel:r(e.meal_types),startDate:new Date(e.start_date),endDate:new Date(e.end_date)}};function cce({mealPlan:e,onViewRecipes:t}){const n=vr();if(!e)return null;const{timePeriodLabel:r,mealTypesLabel:i,shoppingPreferenceLabel:s,startDate:o,endDate:a}=F4(e),l="MMM d, yyyy",u=Cw(o,l),d=Cw(a,l),f=o.toDateString()===a.toDateString()?u:`${u} - ${d}`,h=()=>{const p=e.time_period==="day"?1:e.time_period==="week"?7:14;n.track("meal_plan_viewed",{meal_plan_id:e.id,time_period:e.time_period,shopping_preference:e.shopping_preference,meal_types:e.meal_types||[],title:e.title,plan_duration:p,view_source:"meal_plan_card"}),t&&t(e.id)};return c.jsxs(di,{className:"border-primary/20 shadow-sm hover:shadow transition-shadow",children:[c.jsxs(qa,{className:"pb-2",children:[c.jsx("div",{className:"flex justify-between items-start",children:c.jsx(Vc,{className:"text-xl",children:e.title})}),c.jsxs(Rg,{className:"flex items-center gap-1",children:[c.jsx(hK,{className:"h-3.5 w-3.5"}),c.jsxs("span",{children:[r," • ",f]})]})]}),c.jsx(fi,{children:c.jsxs("div",{className:"flex flex-col space-y-3",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(NA,{className:"h-4 w-4 text-primary"}),c.jsx("span",{className:"text-sm font-medium",children:"Meal Types:"}),c.jsx("span",{className:"text-sm",children:i})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-sm font-medium",children:"Shopping Preference:"}),c.jsx("span",{className:"text-sm",children:s})]})]})}),c.jsx(bf,{children:c.jsxs(ie,{variant:"outline",className:"w-full gap-2 justify-between",onClick:h,children:[c.jsx("span",{children:"View Recipes"}),c.jsx(vA,{className:"h-4 w-4"})]})})]})}function V1(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var z1="Radio",[uce,$4]=Mn(z1),[dce,fce]=uce(z1),U4=m.forwardRef((e,t)=>
vendor: 2,665 bytes, line 518
518{const{__scopeRadio:n,name:r,checked:i=!1,required:s,disabled:o,value:a="on",onCheck:l,form:u,...d}=e,[f,h]=m.useState(null),p=Le(t,w=>h(w)),g=m.useRef(!1),v=f?u||!!f.closest("form"):!0;return c.jsxs(dce,{scope:n,checked:i,disabled:o,children:[c.jsx(me.button,{type:"button",role:"radio","aria-checked":i,"data-state":B4(i),"data-disabled":o?"":void 0,disabled:o,value:a,...d,ref:p,onClick:se(e.onClick,w=>{i||l==null||l(),v&&(g.current=w.isPropagationStopped(),g.current||w.stopPropagation())})}),v&&c.jsx(hce,{control:f,bubbles:!g.current,name:r,value:a,checked:i,required:s,disabled:o,form:u,style:{transform:"translateX(-100%)"}})]})});U4.displayName=z1;var V4="RadioIndicator",z4=m.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...i}=e,s=fce(V4,n);return c.jsx(Lt,{present:r||s.checked,children:c.jsx(me.span,{"data-state":B4(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:t})})});z4.displayName=V4;var hce=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,s=m.useRef(null),o=V1(n),a=Eg(t);return m.useEffect(()=>{const l=s.current,u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"checked").set;if(o!==n&&f){const h=new Event("click",{bubbles:r});f.call(l,n),l.dispatchEvent(h)}},[o,n,r]),c.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function B4(e){return e?"checked":"unchecked"}var pce=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],B1="RadioGroup",[mce,Lpe]=Mn(B1,[$o,$4]),W4=$o(),q4=$4(),[gce,vce]=mce(B1),H4=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:i,value:s,required:o=!1,disabled:a=!1,orientation:l,dir:u,loop:d=!0,onValueChange:f,...h}=e,p=W4(n),g=za(u),[v,w]=Jn({prop:s,defaultProp:i,onChange:f});return c.jsx(gce,{scope:n,name:r,required:o,disabled:a,value:v,onValueChange:w,children:c.jsx(Tg,{asChild:!0,...p,orientation:l,dir:g,loop:d,children:c.jsx(me.div,{role:"radiogroup","aria-required":o,"aria-orientation":l,"data-disabled":a?"":void 0,dir:g,...h,ref:t})})})});H4.displayName=B1;var G4="RadioGroupItem",K4=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...i}=e,s=vce(G4,n),o=s.disabled||r,a=W4(n),l=q4(n),u=m.useRef(null),d=Le(t,u),f=s.value===i.value,h=m.useRef(!1);return m.useEffect(()=>{const p=v=>{pce.includes(v.key)&&(h.current=!0)},g=()=>h.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",g),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",g)}},[]),c.jsx(jg,{asChild:!0,...a,focusable:!o,active:f,children:c.jsx(U4,{disabled:o,required:s.required,
518checked:f,...l,...i,name:s.name,ref:d,onCheck:()=>s.onValueChange(i.value),onKeyDown:se(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:se(i.onFocus,()=>{var p;h.current&&((p=u.current)==null||p.click())})})})});K4.displayName=G4;var yce="RadioGroupIndicator",Y4=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,i=q4(n);return c.jsx(z4,{...i,...r,ref:t})});Y4.displayName=yce;var Q4=H4,X4=K4,xce=Y4;const Tw=m.forwardRef(({className:e,...t},n)=>c.jsx(Q4,{className:K("grid gap-2",e),...t,ref:n}));Tw.displayName=Q4.displayName;const jw=m.forwardRef(({className:e,...t},n)=>c.jsx(X4,{ref:n,className:K("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:c.jsx(xce,{className:"flex items-center justify-center",children:c.jsx(wA,{className:"h-2.5 w-2.5 fill-current text-current"})})}));jw.displayName=X4.displayName;function wce(e,t=[]){let n=[];function r(s,o){const a=m.createContext(o),l=n.length;n=[...n,o];function u(f){const{scope:h,children:p,...g}=f,v=(h==null?void 0:h[e][l])||a,w=m.useMemo(()=>g,Object.values(g));return c.jsx(v.Provider,{value:w,children:p})}function d(f,h){const p=(h==null?void 0:h[e][l])||a,g=m.useContext(p);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return u.displayName=s+"Provider",[u,d]}const i=()=>{const s=n.map(o=>m.createContext(o));return function(a){const l=(a==null?void 0:a[e])||s;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,bce(i,...t)]}function bce(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((a,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...a,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var _ce="Toggle",W1=m.forwardRef((e,t)=>
518{const{pressed:n,defaultPressed:r=!1,onPressedChange:i,...s}=e,[o=!1,a]=Jn({prop:n,onChange:i,defaultProp:r});return c.jsx(me.button,{type:"button","aria-pressed":o,"data-state":o?"on":"off","data-disabled":e.disabled?"":void 0,...s,ref:t,onClick:se(e.onClick,()=>{e.disabled||a(!o)})})});W1.displayName=_ce;var Z4=W1,qc="ToggleGroup",[J4,Fpe]=wce(qc,[$o]),e3=$o(),q1=F.forwardRef((e,t)=>{const{type:n,...r}=e;if(n==="single"){const i=r;return c.jsx(Sce,{...i,ref:t})}if(n==="multiple"){const i=r;return c.jsx(Ece,{...i,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${qc}\``)});q1.displayName=qc;var[t3,n3]=J4(qc),Sce=F.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...s}=e,[o,a]=Jn({prop:n,defaultProp:r,onChange:i});return c.jsx(t3,{scope:e.__scopeToggleGroup,type:"single",value:o?[o]:[],onItemActivate:a,onItemDeactivate:F.useCallback(()=>a(""),[a]),children:c.jsx(r3,{...s,ref:t})})}),Ece=F.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...s}=e,[o=[],a]=Jn({prop:n,defaultProp:r,onChange:i}),l=F.useCallback(d=>a((f=[])=>[...f,d]),[a]),u=F.useCallback(d=>a((f=[])=>f.filter(h=>h!==d)),[a]);return c.jsx(t3,{scope:e.__scopeToggleGroup,type:"multiple",value:o,onItemActivate:l,onItemDeactivate:u,children:c.jsx(r3,{...s,ref:t})})});q1.displayName=qc;var[kce,Cce]=J4(qc),r3=F.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:s,dir:o,loop:a=!0,...l}=e,u=e3(n),d=za(o),f={role:"group",dir:d,...l};return c.jsx(kce,{scope:n,rovingFocus:i,disabled:r,children:i?c.jsx(Tg,{asChild:!0,...u,orientation:s,dir:d,loop:a,children:c.jsx(me.div,{...f,ref:t})}):c.jsx(me.div,{...f,ref:t})})}),Cm="ToggleGroupItem",i3=F.forwardRef((e,t)=>{const n=n3(Cm,e.__scopeToggleGroup),r=Cce(Cm,e.__scopeToggleGroup),i=e3(e.__scopeToggleGroup),s=n.value.includes(e.value),o=r.disabled||e.disabled,a={...e,pressed:s,disabled:o},l=F.useRef(null);return r.rovingFocus?c.jsx(jg,{asChild:!0,...i,focusable:!o,active:s,ref:l,children:c.jsx(nP,{...a,ref:t})}):c.jsx(nP,{...a,ref:t})});i3.displayName=Cm;var nP=F.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:r,...i}=e,s=n3(Cm,n),o={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},a=s.type==="single"?o:void 0;return c.jsx(W1,{...a,...i,ref:t,onPressedChange:l=>{l?s.onItemActivate(r):s.onItemDeactivate(r)}})}),s3=q1,o3=i3;const a3=Va("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}),Tce=m.forwardRef(({className:e,variant:t,size:n,...r},i)=>c.jsx(Z4,{ref:i,className:K(a3({variant:t,size:n,className:e})),...r}));Tce.displayName=Z4.displayName;const l3=m.createContext({size:"default",variant:"default"}),c3=m.forwardRef(({className:e,variant:t,size:n,children:r,...i},s)=>c.jsx(s3,{ref:s,className:K("flex items-center justify-center gap-1",e),...i,children:c.jsx(l3.Provider,{value:{variant:t,size:n},children:r})}));c3.displayName=s3.displayName;const u3=m.forwardRef(({className:e,children:t,variant:n,size:r,...i},s)=>{const o=m.useContext(l3);return c.jsx(o3,{ref:s,className:K(a3({variant:o.variant||n,size:o.size||r}),e),...i,children:t})});u3.displayName=o3.displayName;const jce=Hn.object({title:Hn.string().min(1,"Title is required"),timePeriod:Hn.enum(["day","week","two-weeks"]),mealTypes:Hn.array(Hn.enum(["breakfast","lunch","dinner"])).min(1,"Select at least one meal type"),shoppingPreference:Hn.enum(["use-what-i-have","some-shopping","full-shopping"])}),Pce=[{value:"day",label:"Today"},{value:"week",label:"This Week"},{value:"two-weeks",label:"Next Two Weeks"}],Nce=[{value:"breakfast",label:"Breakfast",icon:c.jsx(_A,{className:"h-4 w-4"})},{value:"lunch",label:"Lunch",icon:c.jsx(NA,{className:"h-4 w-4"})},{value:"dinner",label:"Dinner",icon:c.jsx(EA,{className:"h-4 w-4"})}],Rce=[{value:"use-what-i-have",label:"Use mostly what I have",description:"Suggest recipes that primarily use ingredients in your inventory"},{value:"some-shopping",label:"I'm okay shopping for a few things",description:"Balance between using your inventory and adding new ingredients"},{value:"full-shopping",label:"Let's go shopping!",description:"Maximum flexibility in recipe suggestions"}];function Ice({open:e,onOpenChange:t,onSuccess:n}){const{user:r}=Zt(),{toast:i}=zi(),[s,o]=m.useState(!1),a=wn(),l=vr(),u=vw({resolver:Ew(jce),defaultValues:{title:"My Meal Plan",timePeriod:"week",mealTypes:["dinner"],shoppingPreference:"some-shopping"}}),d=u.watch("timePeriod");m.useEffect(()=>
518{if(e){const h=tP(d);u.setValue("title",h)}},[d,e,u]);const f=async h=>{if(!r){i({title:"Authentication required",description:"You must be logged in to create a meal plan.",variant:"destructive"});return}l.track("meal_plan_creation_started",{time_period:h.timePeriod,shopping_preference:h.shoppingPreference,meal_types:h.mealTypes,title:h.title}),o(!0);try{const p=await lce(r.id,h),g=h.timePeriod==="day"?1:h.timePeriod==="week"?7:14;l.track("meal_plan_creation_success",{meal_plan_id:p,time_period:h.timePeriod,shopping_preference:h.shoppingPreference,meal_types:h.mealTypes,title:h.title,plan_duration:g}),i({title:"Meal plan created!",description:"Heading to recipe selection..."}),u.reset(),t(!1),n&&n(p),a(`/meal-plan/${p}/recipes`)}catch(p){console.error("Error creating meal plan:",p),l.track("meal_plan_creation_failed",{time_period:h.timePeriod,shopping_preference:h.shoppingPreference,meal_types:h.mealTypes,title:h.title,error_type:p instanceof Error?p.name:"unknown_error",error_message:p instanceof Error?p.message:"Unknown error"}),i({title:"Failed to create meal plan",description:"Please try again later.",variant:"destructive"})}finally{o(!1)}};return c.jsx(hm,{open:e,onOpenChange:t,children:c.jsxs(Ld,{className:"sm:max-w-[550px]",children:[c.jsxs(zL,{children:[c.jsx(Fd,{children:"Create a Meal Plan"}),c.jsx(WL,{children:"Set up your meal plan preferences to get personalized recipe suggestions"})]}),c.jsx(yw,{...u,children:c.jsxs("form",{onSubmit:u.handleSubmit(f),className:"space-y-6",children:[c.jsx(Ei,{control:u.control,name:"title",render:({field:h})=>c.jsxs(or,{children:[c.jsx(ar,{children:"Meal Plan Title"}),c.jsx(kr,{children:c.jsx(Pn,{placeholder:tP(d),...h})}),c.jsx(Jr,{})]})}),c.jsx(Ei,{control:u.control,name:"timePeriod",render:({field:h})=>c.jsxs(or,{className:"space-y-3",children:[c.jsx(ar,{children:"Time Period"}),c.jsx(kr,{children:c.jsx(Tw,{onValueChange:h.onChange,defaultValue:h.value,className:"flex flex-col space-y-1",children:Pce.map(p=>c.jsxs(or,{className:"flex items-center space-x-3 space-y-0",children:[c.jsx(kr,{children:c.jsx(jw,{value:p.value})}),c.jsx(ar,{className:"font-normal cursor-pointer",children:p.label})]},p.value))})}),c.jsx(Jr,{})]})}),c.jsx(Ei,{control:u.control,name:"mealTypes",render:({field:h})=>c.jsxs(or,{children:[c.jsx(ar,{children:"Meal Types"}),c.jsx(xw,{children:"Select which meals you want to plan"}),c.jsx("div",{className:"mt-2",children:c.jsx(c3,{type:"multiple",className:"flex justify-start gap-3",value:h.value,onValueChange:p=>{p.length>0&&h.onChange(p)},children:Nce.map(p=>c.jsxs(u3,{value:p.value,"aria-label":p.label,className:"flex items-center gap-1.5 rounded-md border border-input data-[state=on]:border-primary",children:[p.icon,c.jsx("span",{children:p.label})]},p.value))})}),c.jsx(Jr,{})]})}),c.jsx(Ei,{control:u.control,name:"shoppingPreference",render:({field:h})=>c.jsxs(or,{className:"space-y-2",children:[c.jsx(ar,{children:"Shopping Preference"}),c.jsx(kr,{children:c.jsx(Tw,{onValueChange:h.onChange,defaultValue:h.value,className:"flex flex-col space-y-0",children:Rce.map(p=>c.jsxs(or,{className:"flex items-start space-x-3 space-y-0 py-1",children:[c.jsx(kr,{children:c.jsx(jw,{value:p.value,className:"mt-1"})}),c.jsxs("div",{children:[c.jsx(ar,{className:"font-medium cursor-pointer",children:p.label}),c.jsx(xw,{className:"mt-0",children:p.description})]})]},p.value))})}),c.jsx(Jr,{})]})}),c.jsxs(BL,{className:"flex-col space-y-3 sm:space-y-0 sm:flex-row sm:space-x-3",children:[c.jsx(ie,{type:"button",variant:"outline",onClick:()=>t(!1),disabled:s,className:"w-full sm:w-auto",children:"Cancel"}),c.jsxs(ie,{type:"submit",disabled:s,className:"gap-2 w-full sm:w-auto",children:[c.jsx(kd,{className:"h-4 w-4"}),"Find Recipes"]})]})]})})]})})}function Ace({onMealPlanCreated:e}){const{user:t}=Zt(),n=wn(),[r,i]=m.useState(null),[s,o]=m.useState(!0),[a,l]=m.useState(!1),u=async()=>{if(t){o(!0);try{const h=await U1(t.id);i(h)}catch(h){console.error("Error fetching active meal plan:",h)}finally{o(!1)}}};m.useEffect(()=>{u()},[t]);const d=h=>{e&&e(),n(`/meal-plan/${h}/recipes`)},f=h=>{n(`/meal-plan/${h}/recipes`)};return c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h3",{className:"text-lg font-semibold",children:"Your Meal Plan"}),c.jsxs(ie,{onClick:()=>l(!0),size:"sm",variant:"outline",className:"gap-1",children:[c.jsx(Px,{className:"h-4 w-4"}),"Create Plan"]})]}),s?c.jsx("div",{className:"h-32 flex items-center justify-center",children:c.jsx("div",{className:"animate-pulse text-muted-foreground",children:"Loading..."})}):r?c.jsx(cce,{mealPlan:r,onViewRecipes:f}):c.jsxs("div",{className:"bg-muted/50 rounded-lg p-6 text-center",children:[c.jsx(kd,{className:"mx-auto h-10 w-10 text-muted-foreground opacity-50 mb-3"}),c.jsx("h4",{className:"text-lg font-medium mb-2",children:"No Active Meal Plan"}),c.jsx("p",{className:"text-muted-foreground mb-4",children:"Create a meal plan to get personalized recipe suggestions based on your preferences."}),c.jsxs(ie,{onClick:()=>l(!0),className:"gap-2",children:[c.jsx(Px,{className:"h-4 w-4"}),"Create Your First Plan"]})]}),c.jsx(Ice,{open:a,onOpenChange:l,onSuccess:d})]})}async function H1(){try{const{data:e,error:t}=await _e.from("user_inventory").select(`
519        id,
520        quantity,
521        unit,
522        ingredients (
523          id,
524          name,
525          category,
526          image_url
527        )
528      `);if(t)throw t;return{success:!0,inventory:e}}catch(e){return console.error("Error fetching user inventory:",e),{success:!1,error:e}}}async function Oce(e){try{const t=(await _e.auth.getUser()).data.user;if(!t)throw new Error("User not authenticated");return{success:!0,results:await Promise.all(e.map(async r=>{var f,h;const i=r.name.trim().toLowerCase();let{data:s,error:o}=await _e.from("ingredients").select("id, name, category").ilike("name",i);if(o)throw o;let a;if(!s||s.length===0){const{data:p,error:g}=await _e.from("ingredients").insert({name:r.name.trim(),category:r.category}).select("id").single();if(g)if(g.code==="23505"){const{data:v}=await _e.from("ingredients").select("id").ilike("name",i).single();if(v)a=v.id;else throw g}else throw g;else a=p.id}else a=s[0].id;const l=((f=r.quantity)==null?void 0:f.trim())||null,u=((h=r.unit)==null?void 0:h.trim())||null,{data:d}=await _e.from("user_inventory").select("id").eq("user_id",t.id).eq("ingredient_id",a).single();if(d){const{error:p}=await _e.from("user_inventory").update({quantity:l,unit:u}).eq("id",d.id);if(p)throw p}else{const{error:p}=await _e.from("user_inventory").insert({user_id:t.id,ingredient_id:a,quantity:l,unit:u});if(p)if(p.code==="23505")console.log("Ingredient already in user inventory:",r.name);else throw p}return{name:r.name,success:!0}}))}}catch(t){return console.error("Error adding ingredients to inventory:",t),{success:!1,error:t}}}async function Dce(e){try{const{error:t}=await _e.from("user_inventory").delete().eq("id",e);if(t)throw t;return{success:!0}}catch(t){return console.error("Error removing ingredient from inventory:",t),{success:!1,error:t}}}async function Mce(e){try{if(e.length===0)return{success:!0};const{error:t}=await _e.from("user_inventory").delete().in("id",e);if(t)throw t;return{success:!0}}catch(t){return console.error("Error removing ingredients from inventory:",t),{success:!1,error:t}}}async function Lce(e,t,n){try{const{error:r}=await _e.from("user_inventory").update({quantity:t,unit:n}).eq("id",e);if(r)throw r;return{success:!0}}catch(r){return console.error("Error updating ingredient quantity:",r),{success:!1,error:r}}}async function Fce(){try{const e=(await _e.auth.getUser()).data.user;if(!e)throw new Error("User not authenticated");const{error:t}=await _e.from("user_inventory").delete().eq("user_id",e.id);if(t)throw t;return{success:!0}}catch(e){return console.error("Error clearing inventory:",e),{success:!1,error:e}}}let Ch;const $ce=new Uint8Array(16);function Uce(){if(!Ch&&(Ch=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ch))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ch($ce)}const nn=[];for(let e=0;e<256;++e)nn.push((e+256).toString(16).slice(1));function Vce(e,t=0){return nn[e[t+0]]+nn[e[t+1]]+nn[e[t+2]]+nn[e[t+3]]+"-"+nn[e[t+4]]+nn[e[t+5]]+"-"+nn[e[t+6]]+nn[e[t+7]]+"-"+nn[e[t+8]]+nn[e[t+9]]+"-"+nn[e[t+10]]+nn[e[t+11]]+nn[e[t+12]]+nn[e[t+13]]+nn[e[t+14]]+nn[e[t+15]]}const zce=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),rP={randomUUID:zce};function Bce(e,t,n){if(rP.randomUUID&&!t&&!e)return rP.randomUUID();e=e||{};const r=e.random||(e.rng||Uce)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Vce(r)}async function Wce(e,t){try{const n=(await _e.auth.getUser()).data.user;if(!n)throw new Error("User not authenticated");const r=e.name.split(".").pop(),s=`${`${n.id}/${Bce()}.${r}`}`,{error:o,data:a}=await _e.storage.from("inventory").upload(s,e);if(o)throw o;const{data:{publicUrl:l}}=_e.storage.from("inventory").getPublicUrl(s),u=t==="food"?"fridge":t,{error:d}=await _e.from("inventory_images").insert({user_id:n.id,image_url:l,image_type:u,processed:!1});if(d)throw d;return{success:!0,publicUrl:l}}catch(n){return console.error("Error uploading inventory image:",n),{success:!1,error:n}}}async function qce(e,t){try{console.log(`Processing ${t} image: ${e}`);const n=t==="food"?"fridge":t,{data:r,error:i}=await _e.functions.invoke("detect-ingredients",{body:{imageUrl:e,imageType:n}});if(i)throw console.error("Error calling detect-ingredients function:",i),new Error("Failed to process image with AI: "+i.message);if(console.log("AI Detection result:",r),!r.success)throw new Error(r.error||"Failed to detect ingredients");const s=(await _e.auth.getUser()).data.user;if(s){const{error:o}=await _e.from("inventory_images").update({processed:!0}).eq("image_url",e).eq("user_id",s.id);o&&console.error("Error updating inventory_images record:",o)}return r.noFoodDetected?{success:!0,detectedIngredients:[],noFoodDetected:!0,noFoodReason:r.
528noFoodReason||"No food detected in image"}:{success:!0,detectedIngredients:r.detectedIngredients,noFoodDetected:!1}}catch(n){return console.error("Error in processInventoryImage:",n),{success:!1,error:n instanceof Error?n.message:"Unknown error occurred"}}}const Hce=async(e,t)=>{try{const{data:n,error:r}=await _e.from("meal_plan_recipes").select(`
529        recipes (id, title)
530      `).eq("meal_plan_id",e);r&&console.error("Error fetching existing recipes:",r);const i=n?n.map(a=>a.recipes.title).filter(Boolean):[];console.log("Existing recipe titles:",i);const{data:s,error:o}=await _e.functions.invoke("generate-recipes",{body:{mealPlanId:e,userId:t,existingRecipeTitles:i}});if(o)throw console.error("Error generating recipes:",o),new Error(o.message);if(!s.success)throw console.error("API error when generating recipes:",s.error),new Error(s.error||"Failed to generate recipes");return s.recipes}catch(n){throw console.error("Error calling recipe generation function:",n),n}},d3=async e=>{try{const{data:t,error:n}=await _e.from("meal_plan_recipes").select(`
531        is_confirmed,
532        recipe_id,
533        recipes (*)
534      `).eq("meal_plan_id",e);if(n)throw n;return t.map(r=>{let i=[];try{if(Array.isArray(r.recipes.ingredients))i=r.recipes.ingredients.map(l=>typeof l=="object"&&l!==null?{name:l.name||"",quantity:l.quantity||"",unit:l.unit||""}:{name:typeof l=="string"?l:"Unknown ingredient",quantity:"",unit:""});else if(typeof r.recipes.ingredients=="string"){const l=JSON.parse(r.recipes.ingredients);Array.isArray(l)&&(i=l.map(u=>({name:u.name||"",quantity:u.quantity||"",unit:u.unit||""})))}}catch(l){console.error("Error parsing ingredients:",l),i=[]}let s=[];try{Array.isArray(r.recipes.instructions)?s=r.recipes.instructions.map((l,u)=>typeof l=="string"?{step_number:u+1,text:l}:typeof l=="object"&&l!==null&&"step"in l&&"instruction"in l?{step_number:l.step,text:l.instruction}:typeof l=="object"&&l!==null&&"step_number"in l&&"text"in l?l:{step_number:u+1,text:"Unknown instruction format"}):typeof r.recipes.instructions=="string"&&(s=JSON.parse(r.recipes.instructions).map((u,d)=>typeof u=="string"?{step_number:d+1,text:u}:typeof u=="object"&&"step"in u?{step_number:u.step,text:u.instruction}:u))}catch(l){console.error("Error parsing instructions:",l),s=[]}let o=[];try{if(Array.isArray(r.recipes.meal_types))o=r.recipes.meal_types.map(l=>typeof l=="string"?l:String(l));else if(typeof r.recipes.meal_types=="string"){const l=JSON.parse(r.recipes.meal_types);Array.isArray(l)&&(o=l.map(u=>String(u)))}}catch(l){console.error("Error parsing meal_types:",l),o=[]}let a=[];try{if(Array.isArray(r.recipes.tags))a=r.recipes.tags.map(l=>typeof l=="string"?l:String(l));else if(typeof r.recipes.tags=="string"){const l=JSON.parse(r.recipes.tags);Array.isArray(l)&&(a=l.map(u=>String(u)))}}catch(l){console.error("Error parsing tags:",l),a=[]}return{recipe:{...r.recipes,ingredients:i,instructions:s,meal_types:o,tags:a},isConfirmed:r.is_confirmed}})}catch(t){return console.error("Error fetching recipes for meal plan:",t),[]}},Gce=async(e,t)=>{try{const{error:n}=await _e.from("meal_plan_recipes").update({is_confirmed:!0}).eq("meal_plan_id",e).eq("recipe_id",t);if(n)throw n;return!0}catch(n){return console.error("Error confirming recipe:",n),!1}},Kce=async(e,t)=>{try{const{error:n}=await _e.from("meal_plan_recipes").update({is_confirmed:!1}).eq("meal_plan_id",e).eq("recipe_id",t);if(n)throw n;return!0}catch(n){return console.error("Error unconfirming recipe:",n),!1}},Yce=async e=>{try{console.log("Calling Supabase speech-to-text Edge Function...");const{data:t,error:n}=await _e.functions.invoke("speech-to-text",{body:{audio:e}});return n?(console.error("Error calling speech-to-text function:",n),{success:!1,error:{message:n.message||"An error occurred processing the audio"}}):(console.log("Speech-to-text function response:",t),t)}catch(t){return console.error("Error converting speech to text:",t),{success:!1,error:{message:t instanceof Error?t.message:"Unknown error occurred"}}}},Qce=async e=>{try{console.log("Calling Supabase text-to-ingredients Edge Function...");const{data:t,error:n}=await _e.functions.invoke("text-to-ingredients",{body:{text:e}});return n?(console.error("Error calling text-to-ingredients function:",n),{success:!1,error:{message:n.message||"An error occurred processing the text"}}):(console.log("Text-to-ingredients function response:",t),t.detectedIngredients&&(t.detectedIngredients=t.detectedIngredients.map(r=>({...r,voiceTranscript:e}))),t)}catch(t){return console.error("Error converting text to ingredients:",t),{success:!1,error:{message:t instanceof Error?t.message:"Unknown error occurred"}}}},Xce=e=>new Promise((t,n)=>{const r=new FileReader;r.onloadend=()=>{typeof r.result=="string"?t(r.result):n(new Error("Failed to convert blob to base64"))},r.onerror=()=>{n(new Error("Failed to read blob"))}
534,r.readAsDataURL(e)}),Zce=async(e,t)=>{try{console.log(`Generating shopping list for meal plan ${e} and user ${t}`);const{data:n,error:r}=await _e.functions.invoke("generate-shopping-list",{body:{mealPlanId:e,userId:t}});if(r)throw console.error("Error generating shopping list:",r),new Error(r.message);console.log("Shopping list generation response:",n);let i=[];return n.missingIngredients&&Array.isArray(n.missingIngredients)?i=n.missingIngredients:n.ingredients&&Array.isArray(n.ingredients)?i=n.ingredients:n.items&&Array.isArray(n.items)&&(i=n.items),console.log(`Generated ${i.length} shopping list items`),f3(e)}catch(n){throw console.error("Error in generateShoppingList:",n),n}},f3=async e=>{try{console.log(`Fetching shopping list for meal plan ${e}`);const{data:t,error:n}=await _e.from("shopping_list_items").select("*").eq("meal_plan_id",e).order("category").order("name");if(n)throw console.error("Error fetching shopping list:",n),n;return console.log(`Found ${(t==null?void 0:t.length)||0} shopping list items`),t}catch(t){return console.error("Error fetching shopping list:",t),[]}},Jce=async(e,t)=>{try{const{error:n}=await _e.from("shopping_list_items").update({is_checked:t,updated_at:new Date().toISOString()}).eq("id",e);if(n)throw n;return!0}catch(n){return console.error("Error toggling shopping list item:",n),!1}},h3=async e=>{try{console.log(`Getting active shopping list for user ${e}`);const{data:t,error:n}=await _e.from("meal_plans").select("id, title").eq("user_id",e).eq("is_active",!0).maybeSingle();if(n)throw console.error("Error getting active meal plan:",n),n;if(!t)return console.log("No active meal plan found"),{items:[],mealPlanId:null,mealPlanTitle:null};console.log(`Found active meal plan: ${t.id} - ${t.title}`);const r=await f3(t.id);return console.log(`Found ${r.length} shopping list items`),{items:r,mealPlanId:t.id,mealPlanTitle:t.title}}catch(t){return console.error("Error getting active shopping list:",t),{items:[],mealPlanId:null,mealPlanTitle:null}}},$y=640;function an(){const[e,t]=m.useState(void 0);return m.useEffect(()=>{const n=window.matchMedia(`(max-width: ${$y-1}px)`),r=()=>{t(window.innerWidth<$y)};return n.addEventListener("change",r),t(window.innerWidth<$y),()=>n.removeEventListener("change",r)},[]),!!e}const eue=()=>{const{user:e,profile:t}=Zt(),[n,r]=m.useState(!0),[i,s]=m.useState(!1),[o,a]=m.useState(!1),[l,u]=m.useState(!1),[d,f]=m.useState(null),h=an(),[p,g]=m.useState(!1),v=m.useRef(null),w=()=>{!p&&v.current&&g(!0)};return m.useEffect(()=>{(async()=>{if(!e)return;const x=localStorage.getItem(`completion-states-${e.id}`);if(x)try{const{hasInventory:b,hasMealPlan:_,activeMealPlanId:S,hasShoppingList:E}=JSON.parse(x);s(b),a(_),f(S),u(E),r(!1);return}catch(b){console.error("Failed to parse cached states:",b)}r(!0);try{const b=await H1(),_=b.success&&b.inventory&&b.inventory.length>0;s(_);const S=await U1(e.id),E=!!S;a(E),f(E?S.id:null);let k=!1;if(E&&(S!=null&&S.id)){const{items:P}=await h3(e.id);k=P&&P.length>0,u(k),console.log(`Found ${P.length} shopping list items for meal plan ${S.id}`)}const C={hasInventory:_,hasMealPlan:E,activeMealPlanId:E?S.id:null,hasShoppingList:k};localStorage.setItem(`completion-states-${e.id}`,JSON.stringify(C))}catch(b){console.error("Error checking completion states:",b)}finally{r(!1)}})()},[e]),c.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[c.jsx(Wi,{}),c.jsx(A4,{}),c.jsx("main",{className:"flex-1 container py-8",children:c.jsxs("div",{className:"space-y-8",children:[c.jsx(zg,{}),c.jsxs("section",{children:[c.jsx("h2",{className:"text-2xl font-semibold mb-6",children:"Get Started with MealMuse"}),h?c.jsxs("div",{className:"relative",children:[c.jsxs("div",{ref:v,className:"flex space-x-4 overflow-x-auto snap-x snap-mandatory pb-4 -mx-4 px-4",onScroll:w,children:[c.jsx(Ts,{number:1,title:"Set Preferences",description:"Tell us about your dietary needs and favorite cuisines.",icon:c.jsx(Nx,{className:"h-7 w-7"}),buttonText:"Edit Preferences",completedButtonText:"Edit Preferences",linkTo:"/profile",isCompleted:!!t&&(!!t.dietary_preferences||!!t.cuisine_preferences),isMobile:!0}),c.jsx(Ts,{number:2,title:"Add Ingredients",description:"Upload photos of your fridge, pantry, or tell us what ingredients you have.",icon:c.jsx(uc,{className:"h-7 w-7"}),buttonText:"Manage Inventory",completedButtonText:"Manage Inventory",linkTo:"/inventory",isCompleted:i,isMobile:!0}),c.jsx(Ts,{number:3,title:"Create Meal Plan",description:"Get personalized recipes using your ingredients and preferences.",icon:c.jsx(kd,{className:"h-7 w-7"}),buttonText:"Plan Meals",completedButtonText:"View Recipes",linkTo:o&&d?`/meal-plan/${d}/recipes`:"/meal-plan-create",isCompleted:o,isDisabled:!i,isMobile:!0}),c.jsx(Ts,{number:4,title:"Get Shopping List",description:"See what you need to buy for your planned meals.",icon:c.jsx(Xp,{className:"h-7 w-7"}),buttonText:"View List",completedButtonText:"View List",linkTo:"/shopping-list",isCompleted:l,isDisabled:!o,isMobile:!0})]}),c.jsx("div",{className:K("absolute right-4 bottom-0 text-xs text-muted-foreground bg-background/80 px-2 py-1 rounded-full transition-opacity duration-300",p?"opacity-0":"opacity-100"),children:"Swipe to continue →"})]}):c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[c.jsx(Ts,{number:1,title:"Set Preferences",description:"Tell us about your dietary needs and favorite cuisines.",icon:c.jsx(Nx,{className:"h-7 w-7"}),buttonText:"Edit Preferences",completedButtonText:"Edit Preferences",linkTo:"/profile",isCompleted:!!t&&(!!t.dietary_preferences||!!t.cuisine_preferences)}),c.jsx(Ts,{number:2,title:"Add Ingredients",description:"Upload photos of your fridge, pantry, or tell us what ingredients you have.",icon:c.jsx(uc,{className:"h-7 w-7"}),buttonText:"Manage Inventory",completedButtonText:"Manage Inventory",linkTo:"/inventory",isCompleted:i}),c.jsx(Ts,{number:3,title:"Create Meal Plan",description:"Get personalized recipes using your ingredients and preferences.",icon:c.jsx(kd,{className:"h-7 w-7"}),buttonText:"Plan Meals",completedButtonText:"View Recipes",linkTo:o&&d?`/meal-plan/${d}/recipes`:"/meal-plan-create",isCompleted:o,isDisabled:!i}),c.jsx(Ts,{number:4,title:"Get Shopping List",description:"See what you need to buy for your planned meals.",icon:c.jsx(Xp,{className:"h-7 w-7"}),buttonText:"View List",completedButtonText:"View List",linkTo:"/shopping-list",isCompleted:l,isDisabled:!o})]})]}),c.jsx("section",{className:"pt-4",children:c.jsx(Ace,{onMealPlanCreated:()=>
vendor: 4,996 bytes, line 534
534{if(a(!0),e){const y=localStorage.getItem(`completion-states-${e.id}`);if(y)try{const x=JSON.parse(y);x.hasMealPlan=!0,localStorage.setItem(`completion-states-${e.id}`,JSON.stringify(x))}catch(x){console.error("Failed to update cached states:",x)}}}})})]})})]})};var tue="Separator",iP="horizontal",nue=["horizontal","vertical"],p3=m.forwardRef((e,t)=>{const{decorative:n,orientation:r=iP,...i}=e,s=rue(r)?r:iP,a=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return c.jsx(me.div,{"data-orientation":s,...a,...i,ref:t})});p3.displayName=tue;function rue(e){return nue.includes(e)}var m3=p3;const _a=m.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},i)=>c.jsx(m3,{ref:i,decorative:n,orientation:t,className:K("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));_a.displayName=m3.displayName;var G1="Popover",[g3,$pe]=Mn(G1,[Uc]),jf=Uc(),[iue,Vo]=g3(G1),v3=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:o=!1}=e,a=jf(t),l=m.useRef(null),[u,d]=m.useState(!1),[f=!1,h]=Jn({prop:r,defaultProp:i,onChange:s});return c.jsx(O_,{...a,children:c.jsx(iue,{scope:t,contentId:Ni(),triggerRef:l,open:f,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(p=>!p),[h]),hasCustomAnchor:u,onCustomAnchorAdd:m.useCallback(()=>d(!0),[]),onCustomAnchorRemove:m.useCallback(()=>d(!1),[]),modal:o,children:n})})};v3.displayName=G1;var y3="PopoverAnchor",sue=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Vo(y3,n),s=jf(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:a}=i;return m.useEffect(()=>(o(),()=>a()),[o,a]),c.jsx(kg,{...s,...r,ref:t})});sue.displayName=y3;var x3="PopoverTrigger",w3=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Vo(x3,n),s=jf(n),o=Le(t,i.triggerRef),a=c.jsx(me.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":k3(i.open),...r,ref:o,onClick:se(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?a:c.jsx(kg,{asChild:!0,...s,children:a})});w3.displayName=x3;var K1="PopoverPortal",[oue,aue]=g3(K1,{forceMount:void 0}),b3=e=>{const{__scopePopover:t,forceMount:n,children:r,container:i}=e,s=Vo(K1,t);return c.jsx(oue,{scope:t,forceMount:n,children:c.jsx(Lt,{present:n||s.open,children:c.jsx(gf,{asChild:!0,container:i,children:r})})})};b3.displayName=K1;var xc="PopoverContent",_3=m.forwardRef((e,t)=>{const n=aue(xc,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,s=Vo(xc,e.__scopePopover);return c.jsx(Lt,{present:r||s.open,children:s.modal?c.jsx(lue,{...i,ref:t}):c.jsx(cue,{...i,ref:t})})});_3.displayName=xc;var lue=m.forwardRef((e,t)=>{const n=Vo(xc,e.__scopePopover),r=m.useRef(null),i=Le(t,r),s=m.useRef(!1);return m.useEffect(()=>{const o=r.current;if(o)return w_(o)},[]),c.jsx(vg,{as:ps,allowPinchZoom:!0,children:c.jsx(S3,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:se(e.onCloseAutoFocus,o=>{var a;o.preventDefault(),s.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:se(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,u=a.button===2||l;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:se(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),cue=m.forwardRef((e,t)=>{const n=Vo(xc,e.__scopePopover),r=m.useRef(!1),i=m.useRef(!1);return c.jsx(S3,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o,a;(o=e.onCloseAutoFocus)==null||o.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),S3=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:o,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,...f}=e,h=Vo(xc,n),p=jf(n);return x_(),c.jsx(mg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:c.jsx(Ac,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:d,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>h.onOpenChange(!1),children:c.jsx(D_,{"data-state":k3(h.open),role:"dialog",id:h.contentId,...p,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),E3="PopoverClose",uue=m.forwardRef((e,t)=>
534{const{__scopePopover:n,...r}=e,i=Vo(E3,n);return c.jsx(me.button,{type:"button",...r,ref:t,onClick:se(e.onClick,()=>i.onOpenChange(!1))})});uue.displayName=E3;var due="PopoverArrow",fue=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=jf(n);return c.jsx(M_,{...i,...r,ref:t})});fue.displayName=due;function k3(e){return e?"open":"closed"}var hue=v3,pue=w3,mue=b3,C3=_3;const gue=hue,vue=pue,T3=m.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},i)=>c.jsx(mue,{children:c.jsx(C3,{ref:i,align:t,sideOffset:n,className:K("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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),...r})}));T3.displayName=C3.displayName;const yue=Va("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground",static:"border-transparent transition-none"}},defaultVariants:{variant:"default"}});function vo({className:e,variant:t,...n}){return c.jsx("div",{className:K(yue({variant:t}),e),...n})}function j3({options:e,value:t,onChange:n,placeholder:r="Select items...",selectAllLabel:i,selectAllValue:s,disabled:o=!1,className:a}){const[l,u]=m.useState(!1),[d,f]=m.useState(!1),h=v=>{if(s&&v===s)t.includes(s)?n([]):n([s]);else{const w=t.includes(v)?t.filter(y=>y!==v&&y!==s):[...t.filter(y=>y!==s),v];n(w)}},p=v=>{f(!0),n(s&&v===s?[]:t.filter(w=>w!==v)),setTimeout(()=>f(!1),100)},g=v=>{d&&v||u(v)};return c.jsxs(gue,{open:l,onOpenChange:g,children:[c.jsx(vue,{asChild:!0,children:c.jsxs(ie,{variant:"outline",role:"combobox","aria-expanded":l,className:K("w-full justify-between min-h-10 h-auto p-3 hover:bg-background rounded-md",o&&"opacity-50 cursor-not-allowed",a),disabled:o,children:[c.jsxs("div",{className:"flex flex-wrap gap-1 flex-1 min-w-0",children:[t.length===0&&c.jsx("span",{className:"text-muted-foreground",children:r}),s&&t.includes(s)&&c.jsxs(vo,{variant:"secondary",className:"bg-green-100 text-green-800 border-green-300 text-xs py-1 px-2",children:[i||"All selected",c.jsx(Di,{className:"ml-1 h-3 w-3 cursor-pointer",onClick:v=>{v.preventDefault(),v.stopPropagation(),p(s)}})]}),!t.includes(s||"")&&e.filter(v=>t.includes(v.value)).map(v=>c.jsxs(vo,{variant:"secondary",className:"bg-green-100 text-green-800 border-green-300 text-xs py-1 px-2",children:[v.label,c.jsx(Di,{className:"ml-1 h-3 w-3 cursor-pointer",onClick:w=>{w.preventDefault(),w.stopPropagation(),p(v.value)}})]},v.value))]}),c.jsx(u_,{className:"h-4 w-4 shrink-0 opacity-50"})]})}),c.jsx(T3,{className:"w-full p-0",align:"start",children:c.jsxs("div",{className:"max-h-60 overflow-y-auto",children:[i&&s&&c.jsxs("div",{className:K("flex items-center px-3 py-2 text-sm cursor-pointer hover:bg-accent",t.includes(s)&&"bg-accent"),onClick:()=>h(s),children:[c.jsx(Ra,{className:K("mr-2 h-4 w-4",t.includes(s)?"opacity-100":"opacity-0")}),c.jsx("span",{className:"font-medium text-green-600",children:i})]}),e.map(v=>c.jsxs("div",{className:K("flex items-center px-3 py-2 text-sm cursor-pointer hover:bg-accent",t.includes(v.value)&&!t.includes(s||"")&&"bg-accent"),onClick:()=>h(v.value),children:[c.jsx(Ra,{className:K("mr-2 h-4 w-4",t.includes(v.value)&&!t.includes(s||"")?"opacity-100":"opacity-0")}),v.label]},v.value))]})})]})}const xue=[{value:"vegetarian",label:"Vegetarian"},{value:"vegan",label:"Vegan"},{value:"pescatarian",label:"Pescatarian"},{value:"gluten-free",label:"Gluten-Free"},{value:"dairy-free",label:"Dairy-Free"},{value:"keto",label:"Keto"},{value:"paleo",label:"Paleo"},{value:"low-carb",label:"Low Carb"},{value:"nut-free",label:"Nut-Free"},{value:"shellfish-free",label:"Shellfish-Free"}],wue=({selectedDietary:e,onSelectionChange:t,disabled:n=!1})=>c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx("h3",{className:"text-lg font-semibold",children:"Dietary Preferences"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Select any dietary restrictions or preferences you have."})]}
534),c.jsx(j3,{options:xue,value:e,onChange:t,placeholder:"Select dietary preferences...",disabled:n,className:"w-full"})]}),sP=[{value:"italian",label:"Italian"},{value:"mexican",label:"Mexican"},{value:"chinese",label:"Chinese"},{value:"japanese",label:"Japanese"},{value:"indian",label:"Indian"},{value:"thai",label:"Thai"},{value:"mediterranean",label:"Mediterranean"},{value:"french",label:"French"},{value:"spanish",label:"Spanish"},{value:"korean",label:"Korean"},{value:"american",label:"American"},{value:"middle-eastern",label:"Middle Eastern"},{value:"vietnamese",label:"Vietnamese"},{value:"greek",label:"Greek"},{value:"caribbean",label:"Caribbean"}],bue=({selectedCuisines:e,everythingSelected:t,onSelectionChange:n,onEverythingSelectedChange:r,disabled:i=!1})=>{const s=a=>{if(a.includes("all")){const l=sP.map(u=>u.value);n(l),r(!0)}else n(a),r(!1)},o=t?["all"]:e;return c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx("h3",{className:"text-lg font-semibold",children:"Cuisine Preferences"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Select the cuisines you enjoy. This will help us recommend recipes tailored to your taste."})]}),c.jsx(j3,{options:sP,value:o,onChange:s,placeholder:"Select cuisines you enjoy...",selectAllLabel:"I like everything!",selectAllValue:"all",disabled:i,className:"w-full"})]})},_ue=[{value:"no-spice",label:"No Spice",color:"#F2FCE2",textColor:"#333",icon:f_,iconCount:1},{value:"mild",label:"Mild",color:"#FEF7CD",textColor:"#333",icon:Kt,iconCount:1},{value:"medium",label:"Medium",color:"#FEC6A1",textColor:"#333",icon:Kt,iconCount:2},{value:"spicy",label:"Spicy",color:"#F97316",textColor:"white",icon:Kt,iconCount:3},{value:"very-spicy",label:"Very Spicy",color:"#ea384c",textColor:"white",icon:Kt,iconCount:4}],Sue=({spiceTolerance:e,onSpiceChange:t,disabled:n=!1})=>{const r=(i,s)=>{const o=i.icon,a=[],l=s&&i.value==="no-spice"||s?i.textColor:i.value==="no-spice"?"#D3E4FD":"#ea384c";for(let u=0;u<i.iconCount;u++)a.push(c.jsx(o,{className:"h-5 w-5",color:l},u));return c.jsx("div",{className:"flex gap-1 justify-center",children:a})};return c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx("h3",{className:"text-lg font-semibold",children:"Spice Tolerance"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"How much spice can you handle?"})]}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-5 gap-4",children:_ue.map(i=>{const s=e===i.value;return c.jsxs("div",{className:`flex flex-col items-center space-y-3 p-4 rounded-md transition-all border ${n?"opacity-50 cursor-not-allowed":`cursor-pointer ${s?"ring-2 ring-primary border-primary shadow-md":"border-input hover:bg-accent hover:shadow-sm"}`}`,style:!n&&s?{backgroundColor:i.color,color:i.textColor}:{},onClick:()=>!n&&t(i.value),children:[r(i,s),c.jsx(Co,{className:`font-medium ${n?"cursor-not-allowed":"cursor-pointer"}`,children:i.label})]},i.value)})})]})};function Y1(e,[t,n]){return Math.min(n,Math.max(t,e))}var P3=["PageUp","PageDown"],N3=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],R3={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Hc="Slider",[Pw,Eue,kue]=wg(Hc),[I3,Upe]=Mn(Hc,[kue]),[Cue,Wg]=I3(Hc),A3=m.forwardRef((e,t)=>{const{name:n,min:r=0,max:i=100,step:s=1,orientation:o="horizontal",disabled:a=!1,minStepsBetweenThumbs:l=0,defaultValue:u=[r],value:d,onValueChange:f=()=>{},onValueCommit:h=()=>{},inverted:p=!1,form:g,...v}=e,w=m.useRef(new Set),y=m.useRef(0),b=o==="horizontal"?Tue:jue,[_=[],S]=Jn({prop:d,defaultProp:u,onChange:N=>{var O;(O=[...w.current][y.current])==null||O.focus(),f(N)}}),E=m.useRef(_);function k(N){const I=Aue(_,N);T(N,I)}function C(N){T(N,y.current)}function P(){const N=E.current[y.current];_[y.current]!==N&&h(_)}function T(N,I,{commit:O}={commit:!1}){const j=Lue(s),A=Fue(Math.round((N-r)/s)*s+r,j),V=Y1(A,[r,i]);S(($=[])=>{const R=Rue($,V,I);if(Mue(R,l*s)){y.current=R.indexOf(V);const L=String(R)!==String($);return L&&O&&h(R),L?R:$}else return $})}return c.jsx(Cue,{scope:e.__scopeSlider,name:n,disabled:a,min:r,max:i,valueIndexToChangeRef:y,thumbs:w.current,values:_,orientation:o,form:g,children:c.jsx(Pw.Provider,{scope:e.__scopeSlider,children:c.jsx(Pw.Slot,{scope:e.__scopeSlider,children:c.jsx(b,{"aria-disabled":a,"data-disabled":a?"":void 0,...v,ref:t,onPointerDown:se(v.onPointerDown,()=>{a||(E.current=_)}),min:r,max:i,inverted:p,onSlideStart:a?void 0:k,onSlideMove:a?void 0:C,onSlideEnd:a?void 0:P,onHomeKeyDown:()=>!a&&T(r,0,{commit:!0}),onEndKeyDown:()=>!a&&T(i,_.length-1,{commit:!0}),onStepKeyDown:({event:N,direction:I})=>{if(!a){const A=P3.includes(N.key)||N.shiftKey&&N3.includes(N.key)?10:1,V=y.current,$=_[V],R=s*A*I;T($+R,V,{commit:!0})}}})})})})});A3.displayName=Hc;var[O3,D3]=I3(Hc,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Tue=m.forwardRef((e,t)=>
534{const{min:n,max:r,dir:i,inverted:s,onSlideStart:o,onSlideMove:a,onSlideEnd:l,onStepKeyDown:u,...d}=e,[f,h]=m.useState(null),p=Le(t,b=>h(b)),g=m.useRef(),v=za(i),w=v==="ltr",y=w&&!s||!w&&s;function x(b){const _=g.current||f.getBoundingClientRect(),S=[0,_.width],k=Q1(S,y?[n,r]:[r,n]);return g.current=_,k(b-_.left)}return c.jsx(O3,{scope:e.__scopeSlider,startEdge:y?"left":"right",endEdge:y?"right":"left",direction:y?1:-1,size:"width",children:c.jsx(M3,{dir:v,"data-orientation":"horizontal",...d,ref:p,style:{...d.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:b=>{const _=x(b.clientX);o==null||o(_)},onSlideMove:b=>{const _=x(b.clientX);a==null||a(_)},onSlideEnd:()=>{g.current=void 0,l==null||l()},onStepKeyDown:b=>{const S=R3[y?"from-left":"from-right"].includes(b.key);u==null||u({event:b,direction:S?-1:1})}})})}),jue=m.forwardRef((e,t)=>{const{min:n,max:r,inverted:i,onSlideStart:s,onSlideMove:o,onSlideEnd:a,onStepKeyDown:l,...u}=e,d=m.useRef(null),f=Le(t,d),h=m.useRef(),p=!i;function g(v){const w=h.current||d.current.getBoundingClientRect(),y=[0,w.height],b=Q1(y,p?[r,n]:[n,r]);return h.current=w,b(v-w.top)}return c.jsx(O3,{scope:e.__scopeSlider,startEdge:p?"bottom":"top",endEdge:p?"top":"bottom",size:"height",direction:p?1:-1,children:c.jsx(M3,{"data-orientation":"vertical",...u,ref:f,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:v=>{const w=g(v.clientY);s==null||s(w)},onSlideMove:v=>{const w=g(v.clientY);o==null||o(w)},onSlideEnd:()=>{h.current=void 0,a==null||a()},onStepKeyDown:v=>{const y=R3[p?"from-bottom":"from-top"].includes(v.key);l==null||l({event:v,direction:y?-1:1})}})})}),M3=m.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:s,onHomeKeyDown:o,onEndKeyDown:a,onStepKeyDown:l,...u}=e,d=Wg(Hc,n);return c.jsx(me.span,{...u,ref:t,onKeyDown:se(e.onKeyDown,f=>{f.key==="Home"?(o(f),f.preventDefault()):f.key==="End"?(a(f),f.preventDefault()):P3.concat(N3).includes(f.key)&&(l(f),f.preventDefault())}),onPointerDown:se(e.onPointerDown,f=>{const h=f.target;h.setPointerCapture(f.pointerId),f.preventDefault(),d.thumbs.has(h)?h.focus():r(f)}),onPointerMove:se(e.onPointerMove,f=>{f.target.hasPointerCapture(f.pointerId)&&i(f)}),onPointerUp:se(e.onPointerUp,f=>{const h=f.target;h.hasPointerCapture(f.pointerId)&&(h.releasePointerCapture(f.pointerId),s(f))})})}),L3="SliderTrack",F3=m.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=Wg(L3,n);return c.jsx(me.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...r,ref:t})});F3.displayName=L3;var Nw="SliderRange",$3=m.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=Wg(Nw,n),s=D3(Nw,n),o=m.useRef(null),a=Le(t,o),l=i.values.length,u=i.values.map(h=>V3(h,i.min,i.max)),d=l>1?Math.min(...u):0,f=100-Math.max(...u);return c.jsx(me.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...r,ref:a,style:{...e.style,[s.startEdge]:d+"%",[s.endEdge]:f+"%"}})});$3.displayName=Nw;var Rw="SliderThumb",U3=m.forwardRef((e,t)=>{const n=Eue(e.__scopeSlider),[r,i]=m.useState(null),s=Le(t,a=>i(a)),o=m.useMemo(()=>r?n().findIndex(a=>a.ref.current===r):-1,[n,r]);return c.jsx(Pue,{...e,ref:s,index:o})}),Pue=m.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:i,...s}=e,o=Wg(Rw,n),a=D3(Rw,n),[l,u]=m.useState(null),d=Le(t,x=>u(x)),f=l?o.form||!!l.closest("form"):!0,h=Eg(l),p=o.values[r],g=p===void 0?0:V3(p,o.min,o.max),v=Iue(r,o.values.length),w=h==null?void 0:h[a.size],y=w?Oue(w,g,a.direction):0;return m.useEffect(()=>{if(l)return o.thumbs.add(l),()=>{o.thumbs.delete(l)}},[l,o.thumbs]),c.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${g}% + ${y}px)`},children:[c.jsx(Pw.ItemSlot,{scope:e.__scopeSlider,children:c.jsx(me.span,{role:"slider","aria-label":e["aria-label"]||v,"aria-valuemin":o.min,"aria-valuenow":p,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,tabIndex:o.disabled?void 0:0,...s,ref:d,style:p===void 0?{display:"none"}:e.style,onFocus:se(e.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),f&&c.jsx(Nue,{name:i??(o.name?o.name+(o.values.length>1?"[]":""):void 0),form:o.form,value:p},r)]})});U3.displayName=Rw;var Nue=e=>{const{value:t,...n}=e,r=m.useRef(null),i=V1(t);return m.useEffect(()=>{const s=r.current,o=window.HTMLInputElement.prototype,l=Object.getOwnPropertyDescriptor(o,"value").set;if(i!==t&&l){const u=new Event("input",{bubbles:!0});l.call(s,t),s.dispatchEvent(u)}},[i,t]),c.jsx("input",{style:{display:"none"},...n,ref:r,defaultValue:t})};function Rue(e=[],t,n){const r=[...e];return r[n]=t,r.sort((i,s)=>i-s)}function V3(e,t,n){const s=100/(n-t)*(e-t);return Y1(s,[0,100])}function Iue(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Aue(e,t){if(e.length===1)return 0;const n=e.map(i=>
534Math.abs(i-t)),r=Math.min(...n);return n.indexOf(r)}function Oue(e,t,n){const r=e/2,s=Q1([0,50],[0,r]);return(r-s(t)*n)*n}function Due(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Mue(e,t){if(t>0){const n=Due(e);return Math.min(...n)>=t}return!0}function Q1(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Lue(e){return(String(e).split(".")[1]||"").length}function Fue(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var z3=A3,$ue=F3,Uue=$3,Vue=U3;const X1=m.forwardRef(({className:e,...t},n)=>c.jsxs(z3,{ref:n,className:K("relative flex w-full touch-none select-none items-center",e),...t,children:[c.jsx($ue,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:c.jsx(Uue,{className:"absolute h-full bg-primary"})}),c.jsx(Vue,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background 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"})]}));X1.displayName=z3.displayName;const zue=({servings:e,onServingsChange:t,disabled:n=!1})=>c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx("h3",{className:"text-lg font-semibold",children:"Default Servings"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"How many people are you typically cooking for?"})]}),c.jsxs("div",{className:`space-y-6 ${n?"opacity-50":""}`,children:[c.jsx(X1,{value:[e],min:1,max:10,step:1,onValueChange:r=>!n&&t(r[0]),disabled:n,className:"w-full"}),c.jsxs("div",{className:"text-center",children:[c.jsx("span",{className:"text-2xl font-bold",children:e}),c.jsx("span",{className:"text-muted-foreground ml-2",children:e===1?"person":"people"})]})]})]}),oP=["italian","mexican","chinese","japanese","indian","thai","mediterranean","french","spanish","korean","american","middle-eastern","vietnamese","greek","caribbean"],Bue=({profile:e,updateProfile:t,isLoading:n})=>{const[r,i]=m.useState([]),[s,o]=m.useState([]),[a,l]=m.useState(!1),[u,d]=m.useState(""),[f,h]=m.useState(2),[p,g]=m.useState(!1),[v,w]=m.useState(!1),y=n||v,x=(_,S)=>JSON.stringify([..._].sort())===JSON.stringify([...S].sort());m.useEffect(()=>{if(e){i(e.dietary_preferences||[]),o(e.cuisine_preferences||[]),d(e.spice_tolerance||"medium"),h(e.default_servings||2);const _=e.cuisine_preferences||[],S=oP.length===_.length&&oP.every(E=>_.includes(E));l(S)}},[e]),m.useEffect(()=>{if(e){const _=!x(r,e.dietary_preferences||[])||!x(s,e.cuisine_preferences||[])||u!==(e.spice_tolerance||"medium")||f!==(e.default_servings||2);g(_)}},[r,s,u,f,e]);const b=async()=>{w(!0);try{const _={};x(r,e.dietary_preferences||[])||(_.dietary_preferences=r),x(s,e.cuisine_preferences||[])||(_.cuisine_preferences=s),u!==(e.spice_tolerance||"medium")&&(_.spice_tolerance=u),f!==(e.default_servings||2)&&(_.default_servings=f),Object.keys(_).length>0&&await t(_)}catch(_){console.error("Error saving preferences:",_)}finally{w(!1)}};return c.jsxs("div",{className:"space-y-8",role:"main","aria-labelledby":"preferences-title",children:[c.jsxs("header",{className:"space-y-2",children:[c.jsx("h2",{id:"preferences-title",className:"text-2xl font-bold",children:"Preferences"}),c.jsx("p",{className:"text-muted-foreground",children:"Update your dietary preferences, cuisine choices, and other settings."})]}),c.jsx(di,{children:c.jsxs(fi,{className:"space-y-8 pt-6",children:[c.jsx(wue,{selectedDietary:r,onSelectionChange:i,disabled:y}),c.jsx(_a,{}),c.jsx(bue,{selectedCuisines:s,everythingSelected:a,onSelectionChange:o,onEverythingSelectedChange:l,disabled:y}),c.jsx(_a,{}),c.jsx(Sue,{spiceTolerance:u,onSpiceChange:d,disabled:y}),c.jsx(_a,{}),c.jsx(zue,{servings:f,onServingsChange:h,disabled:y})]})}),c.jsxs("div",{className:"flex justify-end pt-4",children:[c.jsx(ie,{onClick:b,disabled:!p||v||n,className:"min-w-32",size:"lg","aria-describedby":p?void 0:"no-changes-message",children:v?c.jsxs(c.Fragment,{children:[c.jsx(Wt,{className:"mr-2 h-4 w-4 animate-spin","aria-hidden":"true"}),"Saving..."]}):"Save Changes"}
534),!p&&!v&&!n&&c.jsx("p",{id:"no-changes-message",className:"sr-only",children:"No changes to save. Make changes to your preferences to enable the save button."})]})]})},Wue=()=>{const{profile:e,updateProfile:t,isUpdatingProfile:n}=Zt(),[r,i]=m.useState((e==null?void 0:e.first_name)||""),[s,o]=m.useState((e==null?void 0:e.last_name)||""),[a,l]=m.useState(!1),u=async()=>{l(!0);try{await t({first_name:r,last_name:s})}finally{l(!1)}};return c.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[c.jsx(Wi,{}),c.jsx("main",{className:"flex-1 container py-8",children:c.jsxs("div",{className:"space-y-6 max-w-3xl mx-auto",children:[c.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:"Profile Settings"}),c.jsxs(A1,{defaultValue:"account",children:[c.jsxs(Lg,{className:"grid w-full grid-cols-2",children:[c.jsx(go,{value:"account",children:"Account"}),c.jsx(go,{value:"preferences",children:"Preferences"})]}),c.jsx($d,{value:"account",className:"space-y-6 pt-6",children:c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Co,{htmlFor:"firstName",children:"First Name"}),c.jsx(Pn,{id:"firstName",value:r,onChange:d=>i(d.target.value)})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Co,{htmlFor:"lastName",children:"Last Name"}),c.jsx(Pn,{id:"lastName",value:s,onChange:d=>o(d.target.value)})]})]}),c.jsx(ie,{onClick:u,disabled:a,children:a?"Updating...":"Update Profile"})]})}),c.jsx($d,{value:"preferences",className:"space-y-6 pt-6",children:c.jsx(Bue,{profile:e,updateProfile:t,isLoading:n})})]})]})})]})},que=()=>{const e=ws(),t=wn(),{user:n}=Zt();m.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]);const r=()=>{window.history.back()},i=()=>{t(n?"/dashboard":"/")};return c.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[c.jsx(Wi,{}),c.jsx("div",{className:"flex-1 flex items-center justify-center p-4",children:c.jsxs("div",{className:"max-w-md w-full glass-card rounded-3xl p-8 flex flex-col items-center",children:[c.jsx("div",{className:"relative animate-float mb-6",children:c.jsx("img",{src:"/lovable-uploads/e8d3b6ee-4823-4bd0-9aee-72874fb5f3c0.png",alt:"404 - Page not found",className:"w-full h-auto"})}),c.jsx("h2",{className:"text-2xl text-sage-800 font-medium text-center mb-2",children:"We can't find that page!"}),c.jsx("p",{className:"text-sage-600 text-center mb-6",children:"The page you're looking for has been eaten or doesn't exist. Let's get you back to cooking!"}),c.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 w-full",children:[c.jsxs(ie,{variant:"outline",className:"flex-1 gap-2",onClick:r,children:[c.jsx(c_,{size:18}),c.jsx("span",{children:"Go Back"})]}),c.jsxs(ie,{variant:"bubble",className:"flex-1 gap-2",onClick:i,children:[c.jsx(bK,{size:18}),c.jsx("span",{children:"Home"})]})]}),c.jsxs("div",{className:"mt-8 flex items-center gap-2 text-muted-foreground",children:[c.jsx(Yp,{size:16,className:"animate-wiggle"}),c.jsx("span",{className:"text-sm",children:"Let's cook up something else!"})]})]})}),c.jsx("div",{className:"fixed top-[10%] left-[10%] w-16 h-16 text-primary/30",children:c.jsx(kd,{size:64,className:"animate-float"})}),c.jsx("div",{className:"fixed bottom-[10%] right-[10%] w-16 h-16 text-primary/30",children:c.jsx(Yp,{size:64,className:"animate-float delay-300"})}),c.jsx("div",{className:"fixed top-[30%] right-[20%] w-4 h-4 rounded-full bg-secondary/20 animate-float delay-200"}),c.jsx("div",{className:"fixed top-[40%] left-[30%] w-3 h-3 rounded-full bg-primary/20 animate-float delay-400"}),c.jsx("div",{className:"fixed bottom-[30%] left-[20%] w-5 h-5 rounded-full bg-secondary/20 animate-float delay-600"})]})};function Hue(e,t=[]){let n=[];function r(s,o){const a=m.createContext(o),l=n.length;n=[...n,o];function u(f){const{scope:h,children:p,...g}=f,v=(h==null?void 0:h[e][l])||a,w=m.useMemo(()=>g,Object.values(g));return c.jsx(v.Provider,{value:w,children:p})}function d(f,h){const p=(h==null?void 0:h[e][l])||a,g=m.useContext(p);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return u.displayName=s+"Provider",[u,d]}const i=()=>{const s=n.map(o=>m.createContext(o));return function(a){const l=(a==null?void 0:a[e])||s;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,Gue(i,...t)]}function Gue(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((a,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...a,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var Z1="Progress",J1=100,[Kue,Vpe]=Hue(Z1),[Yue,Que]=Kue(Z1),B3=m.forwardRef((e,t)=>
534{const{__scopeProgress:n,value:r=null,max:i,getValueLabel:s=Xue,...o}=e;(i||i===0)&&!aP(i)&&console.error(Zue(`${i}`,"Progress"));const a=aP(i)?i:J1;r!==null&&!lP(r,a)&&console.error(Jue(`${r}`,"Progress"));const l=lP(r,a)?r:null,u=Tm(l)?s(l,a):void 0;return c.jsx(Yue,{scope:n,value:l,max:a,children:c.jsx(me.div,{"aria-valuemax":a,"aria-valuemin":0,"aria-valuenow":Tm(l)?l:void 0,"aria-valuetext":u,role:"progressbar","data-state":H3(l,a),"data-value":l??void 0,"data-max":a,...o,ref:t})})});B3.displayName=Z1;var W3="ProgressIndicator",q3=m.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,i=Que(W3,n);return c.jsx(me.div,{"data-state":H3(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:t})});q3.displayName=W3;function Xue(e,t){return`${Math.round(e/t*100)}%`}function H3(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Tm(e){return typeof e=="number"}function aP(e){return Tm(e)&&!isNaN(e)&&e>0}function lP(e,t){return Tm(e)&&!isNaN(e)&&e<=t&&e>=0}function Zue(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${J1}\`.`}function Jue(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
535  - a positive number
536  - less than the value passed to \`max\` (or ${J1} if no \`max\` prop is set)
537  - \`null\` or \`undefined\` if the progress is indeterminate.
538
539Defaulting to \`null\`.`}var G3=B3,ede=q3;const K3=m.forwardRef(({className:e,value:t,...n},r)=>c.jsx(G3,{ref:r,className:K("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:c.jsx(ede,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));K3.displayName=G3.displayName;const Uy=[{path:"/onboarding/welcome",label:"Welcome"},{path:"/onboarding/dietary",label:"Dietary Preferences"},{path:"/onboarding/cuisine",label:"Cuisine Preferences"},{path:"/onboarding/preferences",label:"Preferences"},{path:"/onboarding/complete",label:"Complete"}],tde=({children:e})=>{const t=ws();wn();const n=Uy.findIndex(i=>i.path===t.pathname),r=n>=0?n/(Uy.length-1)*100:0;return c.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[c.jsxs("header",{className:"border-b",children:[c.jsxs("div",{className:"container py-4 flex items-center",children:[c.jsxs("h1",{className:"text-xl font-bold tracking-tight flex items-center gap-2",children:[c.jsx("img",{src:"/lovable-uploads/c1f40201-c4cd-4e2f-85e8-7f3803684d6f.png",alt:"MealMuse Logo",className:"h-6 w-6"}),"MealMuse"]}),c.jsxs("div",{className:"ml-auto text-sm text-muted-foreground flex items-center gap-2",children:[c.jsx(SK,{className:"h-4 w-4 text-primary"}),c.jsxs("span",{className:"font-medium",children:["Step ",n+1," of ",Uy.length]})]})]}),c.jsx(K3,{value:r,className:"h-2 rounded-none bg-secondary/20"})]}),c.jsxs("main",{className:"flex-1 container py-8 md:py-12 relative",children:[c.jsx("div",{className:"absolute top-0 right-0 w-64 h-64 rounded-full bg-primary/5 blur-3xl -z-10"}),c.jsx("div",{className:"absolute bottom-0 left-0 w-64 h-64 rounded-full bg-secondary/5 blur-3xl -z-10"}),c.jsx("div",{className:"max-w-3xl mx-auto playful-card p-8 animate-fade-in",children:e})]})]})},nde=()=>c.jsx(tde,{children:c.jsx(rR,{})}),rde=()=>{const e=wn(),{profile:t}=Zt(),n=()=>{e("/onboarding/dietary")};return c.jsxs("div",{className:"max-w-3xl mx-auto space-y-8",children:[c.jsxs("div",{className:"space-y-2 text-center",children:[c.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:"Welcome to MealMuse!"}),c.jsxs("p",{className:"text-muted-foreground",children:["Hello ",(t==null?void 0:t.first_name)||"there","! Let's personalize your experience by setting up your preferences."]})]}),c.jsx("div",{className:"bg-card rounded-lg border p-6 shadow-sm",children:c.jsxs("div",{className:"space-y-4",children:[c.jsx("h2",{className:"text-xl font-semibold",children:"Onboarding Steps"}),c.jsxs("ul",{className:"space-y-2",children:[c.jsxs("li",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"bg-primary text-primary-foreground rounded-full w-6 h-6 flex items-center justify-center text-sm",children:"1"}),c.jsx("span",{children:"Set your dietary preferences and restrictions"})]}),c.jsxs("li",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"bg-primary text-primary-foreground rounded-full w-6 h-6 flex items-center justify-center text-sm",children:"2"}),c.jsx("span",{children:"Choose your favorite cuisines"})]}),c.jsxs("li",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"bg-primary text-primary-foreground rounded-full w-6 h-6 flex items-center justify-center text-sm",children:"3"}),c.jsx("span",{children:"Set your spice tolerance and serving size"})]})]})]})}),c.jsx("div",{className:"flex justify-end",children:c.jsx(ie,{onClick:n,children:"Let's Get Started"})})]})},ide=[{id:"vegetarian",label:"Vegetarian"},{id:"vegan",label:"Vegan"},{id:"pescatarian",label:"Pescatarian"},{id:"gluten-free",label:"Gluten-Free"},{id:"dairy-free",label:"Dairy-Free"},{id:"keto",label:"Keto"},{id:"paleo",label:"Paleo"},{id:"low-carb",label:"Low Carb"},{id:"nut-free",label:"Nut-Free"},{id:"shellfish-free",label:"Shellfish-Free"}],sde=()=>{const e=wn(),{profile:t,updateProfile:n,isUpdatingProfile:r}=Zt(),[i,s]=m.useState((t==null?void 0:t.dietary_preferences)||[]),o=u=>{let d=[...i];i.includes(u)?d=d.filter(f=>f!==u):d=[...d,u],s(d)},a=async()=>{await n({dietary_preferences:i}),e("/onboarding/cuisine")},l=()=>{e("/onboarding/welcome")};
539return c.jsxs("div",{className:"max-w-3xl mx-auto space-y-8",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:"Dietary Preferences"}),c.jsx("p",{className:"text-muted-foreground",children:"Select any dietary restrictions or preferences you have."})]}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:ide.map(u=>c.jsx("div",{className:`flex items-center space-x-2 border rounded-md p-4 cursor-pointer hover:bg-accent transition-all ${i.includes(u.id)?"bg-primary/10 border-primary text-primary font-medium shadow-sm":"hover:shadow-sm"}`,onClick:()=>o(u.id),children:u.label},u.id))}),c.jsxs("div",{className:"flex justify-between",children:[c.jsx(ie,{variant:"outline",onClick:l,disabled:r,children:"Back"}),c.jsx(ie,{onClick:a,disabled:r,children:r?"Saving...":"Next"})]})]})},cP=[{id:"italian",label:"Italian"},{id:"mexican",label:"Mexican"},{id:"chinese",label:"Chinese"},{id:"japanese",label:"Japanese"},{id:"indian",label:"Indian"},{id:"thai",label:"Thai"},{id:"mediterranean",label:"Mediterranean"},{id:"french",label:"French"},{id:"spanish",label:"Spanish"},{id:"korean",label:"Korean"},{id:"american",label:"American"},{id:"middle-eastern",label:"Middle Eastern"},{id:"vietnamese",label:"Vietnamese"},{id:"greek",label:"Greek"},{id:"caribbean",label:"Caribbean"}],ode=()=>{const e=wn(),{profile:t,updateProfile:n,isUpdatingProfile:r}=Zt(),[i,s]=m.useState((t==null?void 0:t.cuisine_preferences)||[]),[o,a]=m.useState(!1),l=h=>{o&&a(!1),i.includes(h)?s(i.filter(p=>p!==h)):s([...i,h])},u=()=>{const h=cP.map(p=>p.id);s(h),a(!0)},d=async()=>{await n({cuisine_preferences:i}),e("/onboarding/preferences")},f=()=>{e("/onboarding/dietary")};return c.jsxs("div",{className:"max-w-3xl mx-auto space-y-8",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:"Cuisine Preferences"}),c.jsx("p",{className:"text-muted-foreground",children:"Select the cuisines you enjoy. This will help us recommend recipes tailored to your taste."})]}),c.jsxs("div",{className:`p-6 rounded-lg cursor-pointer transition-all flex flex-col items-center justify-center gap-3 hover:shadow-md ${o?"bg-gradient-to-r from-primary/20 to-primary/10 border-primary border-2":"border-2 border-dashed border-primary/40 bg-primary/5 hover:bg-primary/10"}`,onClick:u,children:[c.jsxs("div",{className:"flex items-center justify-center gap-2",children:[o?c.jsx(SA,{className:"h-6 w-6 text-primary animate-pulse",fill:"currentColor"}):c.jsx(MK,{className:"h-6 w-6 text-primary"}),c.jsx(TA,{className:"h-6 w-6 text-primary"})]}),c.jsx("span",{className:"font-semibold text-lg text-primary",children:"I like everything!"}),c.jsx("p",{className:"text-sm text-primary/80",children:"Select all cuisines at once and explore global flavors"})]}),c.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-3",children:cP.map(h=>c.jsx("div",{className:`border rounded-md p-3 cursor-pointer transition-all ${i.includes(h.id)?"bg-primary/10 text-primary border-primary font-medium shadow-sm":"hover:bg-accent"}`,onClick:()=>l(h.id),children:h.label},h.id))}),c.jsxs("div",{className:"flex justify-between",children:[c.jsx(ie,{variant:"outline",onClick:f,disabled:r,children:"Back"}),c.jsx(ie,{onClick:d,disabled:i.length===0||r,children:r?"Saving...":"Next"})]})]})},ade=[{value:"no-spice",label:"No Spice",color:"#F2FCE2",textColor:"#333",icon:f_,iconCount:1},{value:"mild",label:"Mild",color:"#FEF7CD",textColor:"#333",icon:Kt,iconCount:1},{value:"medium",label:"Medium",color:"#FEC6A1",textColor:"#333",icon:Kt,iconCount:2},{value:"spicy",label:"Spicy",color:"#F97316",textColor:"white",icon:Kt,iconCount:3},{value:"very-spicy",label:"Very Spicy",color:"#ea384c",textColor:"white",icon:Kt,iconCount:4}],lde=()=>{const e=wn(),{profile:t,updateProfile:n,isUpdatingProfile:r}=Zt(),[i,s]=m.useState((t==null?void 0:t.spice_tolerance)||"medium"),[o,a]=m.useState((t==null?void 0:t.default_servings)||2),l=async()=>{await n({spice_tolerance:i,default_servings:o}),e("/onboarding/complete")},u=()=>{e("/onboarding/cuisine")},d=(f,h)=>{const p=f.icon,g=[],v=h&&f.value==="no-spice"||h?f.textColor:f.value==="no-spice"?"#D3E4FD":"#ea384c";for(let w=0;w<f.iconCount;w++)g.push(c.jsx(p,{className:"h-5 w-5",color:v},w));return c.jsx("div",{className:"flex gap-1 justify-center",children:g})};
539return c.jsxs("div",{className:"max-w-3xl mx-auto space-y-8",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:"Additional Preferences"}),c.jsx("p",{className:"text-muted-foreground",children:"Set your spice tolerance and default servings for recipes."})]}),c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"space-y-3",children:[c.jsx("h2",{className:"text-xl font-semibold",children:"Spice Tolerance"}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-5 gap-4",children:ade.map(f=>{const h=i===f.value;return c.jsxs("div",{className:`flex flex-col items-center space-y-3 p-4 rounded-md cursor-pointer transition-all border ${h?"ring-2 ring-primary border-primary shadow-md":"border-input hover:bg-accent hover:shadow-sm"}`,style:{backgroundColor:h?f.color:"",color:h?f.textColor:""},onClick:()=>s(f.value),children:[d(f,h),c.jsx(Co,{className:"cursor-pointer font-medium",children:f.label})]},f.value)})})]}),c.jsxs("div",{className:"space-y-3",children:[c.jsx("h2",{className:"text-xl font-semibold",children:"Default Servings"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"How many people are you typically cooking for?"}),c.jsxs("div",{className:"space-y-6",children:[c.jsx(X1,{value:[o],min:1,max:10,step:1,onValueChange:f=>a(f[0]),className:"w-full"}),c.jsxs("div",{className:"text-center",children:[c.jsx("span",{className:"text-2xl font-bold",children:o}),c.jsx("span",{className:"text-muted-foreground ml-2",children:o===1?"person":"people"})]})]})]})]}),c.jsxs("div",{className:"flex justify-between",children:[c.jsx(ie,{variant:"outline",onClick:u,disabled:r,children:"Back"}),c.jsx(ie,{onClick:l,disabled:r,children:r?"Saving...":"Next"})]})]})},Vy={"no-spice":"#F2FCE2",mild:"#FEF7CD",medium:"#FEC6A1",spicy:"#F97316","very-spicy":"#ea384c"},cde={"no-spice":e=>c.jsx(f_,{...e}),mild:e=>c.jsx(Kt,{...e}),medium:e=>c.jsxs(c.Fragment,{children:[c.jsx(Kt,{...e}),c.jsx(Kt,{...e})]}),spicy:e=>c.jsxs(c.Fragment,{children:[c.jsx(Kt,{...e}),c.jsx(Kt,{...e}),c.jsx(Kt,{...e})]}),"very-spicy":e=>c.jsxs(c.Fragment,{children:[c.jsx(Kt,{...e}),c.jsx(Kt,{...e}),c.jsx(Kt,{...e}),c.jsx(Kt,{...e})]})},ude=()=>{const e=wn(),{profile:t}=Zt(),{toast:n}=zi();m.useEffect(()=>{n({title:"Preferences saved",description:"Your preferences have been saved successfully."})},[n]);const r=()=>{e("/dashboard")},i=a=>a&&Vy[a]||Vy.medium,s=a=>a==="spicy"||a==="very-spicy"?"text-white":"text-foreground",o=a=>{a||(a="medium");const l=cde[a];return c.jsx("div",{className:"flex space-x-1",children:c.jsx(l,{className:"h-3 w-3"})})};return c.jsxs("div",{className:"max-w-3xl mx-auto space-y-8",children:[c.jsxs("div",{className:"text-center space-y-4",children:[c.jsx("div",{className:"flex justify-center",children:c.jsx(xA,{size:64,className:"text-primary"})}),c.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:"All Set!"}),c.jsxs("p",{className:"text-muted-foreground max-w-md mx-auto",children:["Thanks, ",t==null?void 0:t.first_name,"! Your preferences have been saved. Now you can start exploring recipes tailored to your taste."]}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Don't worry, you can update these preferences anytime from your profile settings."})]}),c.jsxs("div",{className:"bg-card rounded-lg border p-6 shadow-sm space-y-6",children:[c.jsx("h2",{className:"text-xl font-semibold",children:"Your Preferences"}),c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx("h3",{className:"font-medium",children:"Dietary Preferences"}),c.jsx("div",{className:"flex flex-wrap gap-2",children:t!=null&&t.dietary_preferences&&t.dietary_preferences.length>0?t.dietary_preferences.map(a=>c.jsx(vo,{variant:"outline",className:"bg-primary/5 text-primary border-primary/20",children:a.charAt(0).toUpperCase()+a.slice(1).replace(/-/g," ")},a)):c.jsx("span",{className:"text-sm text-muted-foreground",children:"None selected"})})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("h3",{className:"font-medium",children:"Cuisine Preferences"}),c.jsx("div",{className:"flex flex-wrap gap-2",children:t!=null&&t.cuisine_preferences&&t.cuisine_preferences.length>0?t.cuisine_preferences.map(a=>c.jsx(vo,{variant:"outline",className:"bg-secondary/10 text-secondary-foreground border-secondary/20",children:a.charAt(0).toUpperCase()+a.slice(1).replace(/-/g," ")},a)):c.jsx("span",{className:"text-sm text-muted-foreground",children:"None selected"})})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("h3",{className:"font-medium",children:"Spice Tolerance"}),c.jsx("div",{className:"flex items-center gap-2",children:c.jsxs(vo,{className:`flex items-center gap-1.5 px-3 py-1 ${s(t==null?void 0:t.spice_tolerance)}`,style:{backgroundColor:i(t==null?void 0:t.spice_tolerance)},children:[o(t==null?void 0:t.spice_tolerance),t!=null&&t.spice_tolerance?t.spice_tolerance.charAt(0).toUpperCase()+t.spice_tolerance.slice(1).replace(/-/g," "):"Medium"]})})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("h3",{className:"font-medium",children:"Default Servings"}),c.jsxs("p",{className:"text-sm",children:[(t==null?void 0:t.default_servings)||2," ",((t==null?void 0:t.default_servings)||2)===1?"person":"people"]})]})]})]}),c.jsx("div",{className:"flex justify-center",children:c.jsx(ie,{onClick:r,size:"lg",children:"Go to Dashboard"})})]})};function dde(e){const{user:t}
539=Zt(),{toast:n}=zi(),r=Bb(),i=vr(),[s,o]=m.useState(!1),[a,l]=m.useState(0),[u,d]=m.useState(null),[f,h]=m.useState(null),[p,g]=m.useState(new Set),v=2,{data:w=[],isLoading:y,isError:x,error:b,refetch:_}=B6({queryKey:["mealPlanRecipes",e],queryFn:()=>d3(e),enabled:!!e}),S=Rv({mutationFn:()=>{if(!(t!=null&&t.id))throw new Error("User not authenticated");return i.track("recipe_generation_requested",{generation_type:w.length===0?"initial":"additional",meal_plan_id:e,time_period:(u==null?void 0:u.time_period)||"unknown",shopping_preference:(u==null?void 0:u.shopping_preference)||"unknown",cuisine_preferences:(f==null?void 0:f.cuisine_preferences)||[],dietary_restrictions:(f==null?void 0:f.dietary_preferences)||[],spice_tolerance:(f==null?void 0:f.spice_tolerance)||"medium",existing_recipe_count:w.length,retry_count:a}),o(!0),Hce(e,t.id)},onSuccess:j=>{l(0),i.track("recipe_generation_success",{generation_type:w.length===0?"initial":"additional",meal_plan_id:e,time_period:(u==null?void 0:u.time_period)||"unknown",shopping_preference:(u==null?void 0:u.shopping_preference)||"unknown",cuisine_preferences:(f==null?void 0:f.cuisine_preferences)||[],dietary_restrictions:(f==null?void 0:f.dietary_preferences)||[],spice_tolerance:(f==null?void 0:f.spice_tolerance)||"medium",recipes_generated:(j==null?void 0:j.length)||0,existing_recipe_count:w.length,total_recipe_count:w.length+((j==null?void 0:j.length)||0)}),n({title:"Recipes generated successfully",description:"New recipes have been added to your meal plan."}),r.invalidateQueries({queryKey:["mealPlanRecipes",e]})},onError:j=>{i.track("recipe_generation_failed",{generation_type:w.length===0?"initial":"additional",meal_plan_id:e,time_period:(u==null?void 0:u.time_period)||"unknown",shopping_preference:(u==null?void 0:u.shopping_preference)||"unknown",cuisine_preferences:(f==null?void 0:f.cuisine_preferences)||[],dietary_restrictions:(f==null?void 0:f.dietary_preferences)||[],spice_tolerance:(f==null?void 0:f.spice_tolerance)||"medium",existing_recipe_count:w.length,retry_count:a,error_type:j instanceof Error?j.name:"unknown_error",error_message:(j==null?void 0:j.message)||"Unknown error"}),n({title:"Failed to generate recipes",description:`${j.message||"Please try again later."} (Attempt ${a+1})`,variant:"destructive"}),a<v&&l(A=>A+1)}}),E=Rv({mutationFn:j=>{var V,$;const A=w.find(R=>R.recipe.id===j);return i.track("recipe_selected",{recipe_id:j,meal_plan_id:e,meal_type:((V=A==null?void 0:A.recipe.meal_types)==null?void 0:V[0])||"unknown",cuisine_type:(($=A==null?void 0:A.recipe.tags)==null?void 0:$.find(R=>R.includes("cuisine")))||"unknown",view_source:"meal_plan"}),Gce(e,j)},onSuccess:()=>{r.invalidateQueries({queryKey:["mealPlanRecipes",e]})},onError:()=>{n({title:"Failed to confirm recipe",description:"Please try again later.",variant:"destructive"})}}),k=Rv({mutationFn:j=>Kce(e,j),onSuccess:()=>{r.invalidateQueries({queryKey:["mealPlanRecipes",e]})},onError:()=>{n({title:"Failed to remove recipe",description:"Please try again later.",variant:"destructive"})}});m.useEffect(()=>{(async()=>{if(e)try{const{data:A,error:V}=await _e.from("meal_plans").select("*").eq("id",e).single();if(V)throw V;d(A)}catch(A){console.error("Error fetching meal plan details:",A)}})()},[e]),m.useEffect(()=>{(async()=>{if(t!=null&&t.id)try{const{data:A,error:V}=await _e.from("profiles").select("dietary_preferences, cuisine_preferences, spice_tolerance, default_servings").eq("id",t.id).single();if(V)throw V;h(A)}catch(A){console.error("Error fetching user profile:",A)}})()},[t==null?void 0:t.id]),m.useEffect(()=>{let j;return!s&&w.length===0&&!y&&!S.isPending&&a<v&&(j=setTimeout(()=>{console.log("Auto-generating recipes, attempt:",a+1),T()},a*2e3)),()=>{j&&clearTimeout(j)}},[w,y,S.isPending,s,a]),m.useEffect(()=>{if(!e||p.size===0)return;const j=setInterval(async()=>{const{data:A,error:V}=await _e.from("recipes").select("id, image_url").in("id",Array.from(p)).not("image_url","is",null);if(V){console.error("Error polling for image updates:",V);return}A&&A.length>0&&(g($=>{const R=new Set($);return A.forEach(L=>R.delete(L.id)),R}),n({title:"Recipe images ready!",description:`${A.length} recipe image(s) have been generated.`}),r.invalidateQueries({queryKey:["mealPlanRecipes",e]}))},3e3);return()=>{clearInterval(j)}},[e,p,r,n,g]),m.useEffect(()=>{if(w.length>0){const j=w.filter(A=>!A.recipe.image_url);g(A=>{const V=new Set(A);
539return j.forEach($=>V.add($.recipe.id)),V})}},[w]);const C=async j=>{await E.mutateAsync(j)},P=async j=>{await k.mutateAsync(j)},T=async()=>{await S.mutateAsync()},N=()=>{if(!u)return 1;switch(u.time_period){case"day":return 1;case"week":return 3;case"two-weeks":return 5;default:return 2}},I=w.filter(j=>j.isConfirmed).length,O=N();return{recipes:w,isLoading:y,isError:x,error:b,refetch:_,mealPlanData:u,generateRecipesMutation:S,confirmedCount:I,recommendedRecipeCount:O,pendingImageGenerations:p,handleConfirmRecipe:C,handleUnconfirmRecipe:P,handleGenerateMore:T}}function fde({confirmedCount:e,isGenerating:t}){const n=wn(),{toast:r}=zi(),i=()=>{r({title:"Meal plan finalized",description:`Your meal plan with ${e} recipes has been successfully saved.`}),n("/dashboard")};return c.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-4",children:[c.jsxs(ie,{variant:"outline",size:"sm",className:"gap-2",onClick:()=>n("/dashboard"),children:[c.jsx(c_,{className:"h-4 w-4"}),"Back to Dashboard"]}),c.jsxs(ie,{className:"gap-2",disabled:e===0||t,onClick:i,children:[c.jsx(xA,{className:"h-4 w-4"}),"Finalize Meal Plan"]})]})}const Y3=m.createContext(void 0),hde=()=>{const e=m.useContext(Y3);if(!e)throw new Error("useModal must be used within a ModalProvider");return e};function pde({children:e}){const[t,n]=m.useState(!1);return c.jsx(Y3.Provider,{value:{open:t,setOpen:n},children:e({open:t,setOpen:n})})}const mde=({children:e,className:t})=>{const{open:n,setOpen:r}=hde(),i=m.useRef(null);m.useEffect(()=>(n?document.body.style.overflow="hidden":document.body.style.overflow="auto",()=>{document.body.style.overflow="auto"}),[n]),m.useEffect(()=>{const o=a=>{i.current&&!i.current.contains(a.target)&&r(!1)};return n&&document.addEventListener("mousedown",o),()=>{document.removeEventListener("mousedown",o)}},[n,r]);const s=c.jsx(qne,{children:n&&c.jsxs(mo.div,{initial:{opacity:0}
539,animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 flex items-center justify-center p-4",style:{zIndex:2147483647,isolation:"isolate"},children:[c.jsx(mo.div,{className:"fixed inset-0 bg-black/60 backdrop-blur-sm",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>r(!1)}),c.jsxs(mo.div,{ref:i,className:K("max-h-[85vh] w-[90vw] md:w-[600px] bg-background border rounded-xl relative flex flex-col overflow-hidden shadow-2xl",t),style:{zIndex:1,isolation:"isolate"},initial:{opacity:0,scale:.5,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.8,y:10},transition:{type:"spring",stiffness:260,damping:20},children:[c.jsxs("button",{onClick:()=>r(!1),className:"absolute right-4 top-4 z-10 rounded-full p-1 text-muted-foreground hover:bg-muted hover:text-foreground transition-colors",children:[c.jsx(Di,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]}),e]})]})});return typeof window>"u"?null:kc.createPortal(s,document.body)},gde=({children:e,className:t})=>c.jsx("div",{className:K("flex flex-col flex-1 overflow-y-auto",t),children:e}),vde=({children:e,className:t})=>c.jsx("div",{className:K("flex justify-end gap-2 p-4 border-t bg-muted/30",t),children:e});function yde(e,t={}){const{lazy:n=!0,threshold:r=.1,enableProgressiveLoading:i=!0,respectReducedMotion:s=!0,connectionAware:o=!0}=t,[a,l]=m.useState({isInView:!1,isLoading:!1,isLoaded:!1,error:!1,shouldLoad:!1,loadingStrategy:n?"lazy":"immediate",networkQuality:"high"}),u=m.useRef(null),d=m.useRef(null),f=m.useCallback(()=>{if(typeof navigator<"u"&&"connection"in navigator){const S=navigator.connection;return{effectiveType:S.effectiveType||"4g",downlink:S.downlink||10,saveData:S.saveData||!1}}return null},[]),h=m.useCallback(()=>{if(!o)return"high";const S=f();return S?S.saveData||S.effectiveType==="2g"||S.effectiveType==="slow-2g"?"low":S.effectiveType==="3g"||S.downlink<1.5?"medium":"high":"high"},[o,f]),p=m.useCallback(()=>s?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1,[s]),g=m.useCallback(()=>{const S=h(),E=p();return n?S==="low"?"deferred":S==="medium"&&i?"progressive":E?"immediate":"lazy":"immediate"},[n,i,h,p]);m.useEffect(()=>{if(!n||!u.current)return;const S=new IntersectionObserver(E=>{E.forEach(k=>{k.isIntersecting&&l(C=>({...C,isInView:!0,shouldLoad:!0}))})},{threshold:r,rootMargin:`${Math.max(50,window.innerHeight*.1)}px`});return S.observe(u.current),d.current=S,()=>{S.disconnect()}},[n,r]),m.useEffect(()=>{const S=h(),E=g();l(k=>({...k,networkQuality:S,loadingStrategy:E,shouldLoad:!n||k.isInView||E==="immediate"}))},[n,h,g]);const v=m.useCallback(()=>{l(S=>({...S,isLoading:!1,isLoaded:!0,error:!1}))},[]),w=m.useCallback(()=>{l(S=>({...S,isLoading:!1,error:!0}))},[]),y=m.useCallback(()=>{l(S=>({...S,isLoading:!0,error:!1}))},[]);m.useEffect(()=>{a.shouldLoad&&e&&!a.isLoaded&&!a.isLoading&&!a.error&&y()},[a.shouldLoad,e,a.isLoaded,a.isLoading,a.error,y]);const x=m.useCallback(()=>{const S={onLoad:v,onError:w,loading:n?"lazy":"eager",decoding:"async"};return a.networkQuality==="low"?S.fetchpriority="low":a.networkQuality==="high"&&(S.fetchpriority="high"),S},[n,a.networkQuality,v,w]),b=m.useCallback(()=>{switch(a.networkQuality){case"low":return 1e4;case"medium":return 8e3;case"high":return 5e3;default:return 8e3}},[a.networkQuality]),_=m.useCallback((S="high")=>e,[e,i]);return{elementRef:u,state:a,getImageAttributes:x,getLoadingTimeout:b,getProgressiveImageUrl:_,shouldShowSkeleton:a.isLoading||n&&!a.isInView,shouldShowImage:a.shouldLoad&&!a.error,canAnimate:!p(),networkQuality:a.networkQuality,loadingStrategy:a.loadingStrategy}}function pu({className:e,...t}){return c.jsx("div",{className:K("animate-pulse rounded-md bg-muted",e),...t})}function xde({className:e,showTitle:t=!0,showMetadata:n=!0}){return c.jsxs("div",{className:K("relative overflow-hidden",e),children:[c.jsxs("div",{className:"absolute inset-0",children:[c.jsx(pu,{className:"w-full h-full bg-gradient-to-br from-sage-100 via-terracotta-50 to-mint-50 animate-pulse"}),c.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent animate-shimmer"}),c.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-black/30 via-black/20 to-transparent"})]}),t&&c.jsxs("div",{className:"absolute top-4 left-4 right-4 z-20 space-y-2",children:[c.jsx(pu,{className:"h-4 w-3/4 bg-white/30"}),c.jsx(pu,{className:"h-4 w-1/2 bg-white/30"})]}),n&&c.jsxs("div",{className:"absolute bottom-4 left-4 flex gap-2 z-20",children:[c.jsx(pu,{className:"h-6 w-16 rounded-full bg-white/40"}),c.jsx(pu,{className:"h-6 w-20 rounded-full bg-white/40"})]})]})}const eS=m.forwardRef(({src:e,alt:t,className:n,fallbackContent:r,lazy:i=!0,threshold:s=.1,enableProgressiveLoading:o=!0,respectReducedMotion:a=!0,connectionAware:l=!0,showSkeleton:u=!0,skeletonClassName:d,containerClassName:f,animationType:h="fade-in",animationDelay:p=0,sizes:g,priority:v=!1,placeholder:w="empty",...y},x)=>{const{elementRef:b,state:_,getImageAttributes:S,getLoadingTimeout:E,shouldShowSkeleton:k,shouldShowImage:C,canAnimate:P,networkQuality:T,loadingStrategy:N}=yde(e,{lazy:i&&!v,threshold:s,enableProgressiveLoading:o,respectReducedMotion:a,connectionAware:l}),I=()=>!P||h==="none"?"":T==="low"?"animate-image-fade-in":`animate-image-${h}`,O=()=>{if(g)return g;switch(T){case"low":return"(max-width: 640px) 280px, (max-width: 768px) 320px, 400px";case"medium":return"(max-width: 640px) 320px, (max-width: 768px) 400px, 500px";case"high":default:return"(max-width: 640px) 400px, (max-width: 768px) 500px, 600px"}};return E(),c.jsxs("div",{ref:j=>{typeof x=="function"?x(j):x&&(x.current=j),b.current=j},className:K("relative overflow-hidden",f),children:[k&&u&&c.jsx("div",{className:"absolute inset-0",children:c.jsx(xde,{className:K("w-full h-full",d),showTitle:!1,showMetadata:!1})}),C&&e&&c.jsx("img",{src:e,alt:t,className:K("w-full h-full object-cover transition-all duration-300",_.isLoading?"opacity-0 scale-98":`opacity-100 scale-100 ${I()}`,n),style:{animationDelay:P?`${p}ms`:void 0},sizes:O(),...S(),...y}),(!e||_.error)&&!_.isLoading&&r&&c.jsx("div",{className:K("absolute inset-0 flex items-center justify-center",P?I():"",n),style:{animationDelay:P?`${p}ms`:void 0},children:r}),(!e||_.error)&&!_.isLoading&&!r&&c.jsx("div",{className:K("absolute inset-0 w-full h-full bg-gradient-to-br from-sage-100 to-terracotta-100 flex items-center justify-center",P?I():"",n),style:{animationDelay:P?`${p}ms`:void 0},children:c.jsxs("div",{className:"text-center px-4",children:[c.jsx("div",{className:"w-12 h-12 bg-sage-200 rounded-full flex items-center justify-center mx-auto mb-2",children:c.jsx("svg",{className:"w-6 h-6 text-sage-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),c.jsx("p",{className:"text-xs text-sage-600 font-medium",children:_.error?"Image Unavailable":"Image"})]})}),_.isLoading&&c.jsx("div",{className:"absolute bottom-2 left-2 z-20",children:c.jsxs("div",{className:"flex items-center gap-1 bg-black/50 rounded-full px-2 py-1",children:[c.jsx("div",{className:"w-1 h-1 bg-white rounded-full animate-pulse"}),c.jsx("span",{className:"text-xs text-white font-medium",children:N==="deferred"?"Queued":"Loading"})]})})]})});eS.displayName="OptimizedImage";function wde({recipe:e,isImageGenerating:t=!1}){return c.jsxs("div",{className:"relative h-44 w-full overflow-hidden",children:[c.jsx(eS,{src:e.image_url,alt:e.title,className:"w-full h-full object-cover",containerClassName:"absolute inset-0",animationType:"fade-in-up",lazy:!1,connectionAware:!0,enableProgressiveLoading:!0,respectReducedMotion:!0,priority:!0,sizes:"(max-width: 640px) 100v
539w, (max-width: 768px) 90vw, 80vw",fallbackContent:c.jsx("div",{className:"w-full h-full bg-white flex items-center justify-center"})}),t&&!e.image_url&&c.jsx("div",{className:"absolute bottom-4 right-4 z-10",children:c.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[c.jsx(Wt,{className:"w-3 h-3 animate-spin text-green-700"}),c.jsx("span",{className:"text-xs text-green-700 font-medium leading-none",children:"Cooking"}),c.jsx("span",{className:"text-xs text-green-700 font-medium leading-none",children:"up Image"})]})}),e.image_url&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/70 to-transparent"}),c.jsx("div",{className:"absolute bottom-3 left-6 right-6",children:c.jsx("h2",{className:"text-xl font-bold text-white drop-shadow-md",children:e.title})})]}),!e.image_url&&c.jsx("div",{className:"absolute bottom-3 left-6 right-6",children:c.jsx("h2",{className:"text-xl font-bold text-gray-900",children:e.title})})]})}function bde({recipe:e}){const t=an();return c.jsxs("div",{className:K("flex flex-wrap gap-4 py-1",t?"gap-y-0.5":"gap-y-2"),children:[c.jsxs("div",{className:"flex items-center gap-1 bg-white/90 rounded-full px-2 py-0.5 shadow-sm",children:[c.jsx(bA,{className:K("text-gray-700",t?"w-3.5 h-3.5":"w-4 h-4")}),c.jsxs("span",{className:K("text-gray-800",t&&"text-xs"),children:[e.cooking_time||"?"," min"]})]}),c.jsxs("div",{className:"flex items-center gap-1 bg-white/90 rounded-full px-2 py-0.5 shadow-sm",children:[c.jsx(PA,{className:K("text-gray-700",t?"w-3.5 h-3.5":"w-4 h-4")}),c.jsxs("span",{className:K("text-gray-800",t&&"text-xs"),children:[e.servings||"4"," servings"]})]}),e.difficulty_level&&c.jsxs("div",{className:"flex items-center gap-1 bg-white/90 rounded-full px-2 py-0.5 shadow-sm",children:[c.jsx(Yp,{className:K("text-gray-700",t?"w-3.5 h-3.5":"w-4 h-4")}),c.jsx("span",{className:K("text-gray-800",t&&"text-xs"),children:e.difficulty_level})]})]})}function _de({recipe:e}){return!e.tags||e.tags.length===0?null:c.jsx("div",{className:"flex flex-wrap gap-1 relative",children:e.tags.map((t,n)=>c.jsxs(vo,{variant:"outline",className:"text-xs relative",children:[c.jsx(OK,{className:"w-3 h-3 mr-1"}),t]},n))})}function Sde({recipe:e}){const t=an();return e.description?c.jsxs("div",{children:[c.jsx("h3",{className:K("text-md font-medium mb-1",t&&"text-sm mb-0.5"),children:"Description"}),c.jsx("p",{className:K("text-sm text-muted-foreground",t&&"text-xs"),children:e.description})]}):null}function Ede({recipe:e}){const t=an();return!e.ingredients||e.ingredients.length===0?null:c.jsxs("div",{children:[c.jsx("h3",{className:K("text-md font-medium mb-2",t&&"text-sm mb-1"),children:"Ingredients"}),c.jsx("ul",{className:"grid grid-cols-1 md:grid-cols-2 gap-1",children:e.ingredients.map((n,r)=>c.jsxs("li",{className:"flex items-start gap-2",children:[c.jsx("span",{className:K("inline-block w-2 h-2 rounded-full bg-primary mt-2 flex-shrink-0",t&&"w-1.5 h-1.5 mt-1.5")}),c.jsxs("span",{className:K("text-sm",t&&"text-xs"),children:[n.quantity," ",n.unit," ",n.name]})]},r))})]})}function kde({recipe:e}){const t=an();if(!e.instructions||e.instructions.length===0)return null;const n=F.useMemo(()=>e.instructions.map((r,i)=>{if(typeof r=="object"&&r!==null&&"step_number"in r&&"text"in r)return r;if(typeof r=="object"&&r!==null&&"step"in r&&"instruction"in r){const s=r;return{step_number:s.step,text:s.instruction}}return typeof r=="string"?{step_number:i+1,text:r}:{step_number:i+1,text:"Unknown instruction format"}}),[e.instructions]);return c.jsxs("div",{children:[c.jsx("h3",{className:K("text-md font-medium mb-2",t&&"text-sm mb-1"),children:"Instructions"}),c.jsx("ol",{className:"space-y-2",children:n.map((r,i)=>c.jsxs("li",{className:"flex gap-2",children:[c.jsx("span",{className:K("flex-shrink-0 inline-flex items-center justify-center w-5 h-5 rounded-full bg-primary/10 text-primary text-xs font-medium",t&&"w-4 h-4 text-[10px]"),children:r.step_number}),c.jsx("span",{className:K("text-sm",t&&"text-xs"),children:r.text})]},i))})]})}function Cde({recipe:e}){const t=an(),n=e.source==="AI Generated"?"Generated by MealMuse":e.source;return c.jsxs("div",{className:"space-y-3",children:[c.jsx(bde,{recipe:e}),c.jsx(_de,{recipe:e}),c.jsx(Sde,{recipe:e}),c.jsx(_a,{className:K("my-2",t&&"my-1.5")}),c.jsx(Ede,{recipe:e}),c.jsx(_a,{className:K("my-2",t&&"my-1.5")}),c.jsx(kde,{recipe:e}),c.jsxs("div",{className:K("text-xs text-muted-foreground pt-1",t&&"text-[10px] pt-0.5"),children:["Source: ",n]})]})}class Tde{constructor(t={}){Hi(this,"queue",[]);Hi(this,"loading",new Set);Hi(this,"maxConcurrent",3);Hi(this,"respectDataSaver",!0);Hi(this,"minNetworkSpeed",1);this.maxConcurrent=t.maxConcurrent||3,this.respectDataSaver=t.respectDataSaver??!0,this.minNetworkSpeed=t.minNetworkSpeed||1}getNetworkInfo(){if(typeof navigator<"u"&&"connection"in navigator){const t=navigator.connection;return{effectiveType:t.effectiveType||"4g",downlink:t.downlink||
53910,saveData:t.saveData||!1}}return{effectiveType:"4g",downlink:10,saveData:!1}}shouldPreload(){const t=this.getNetworkInfo();return!(this.respectDataSaver&&t.saveData||t.downlink<this.minNetworkSpeed||t.effectiveType==="2g"||t.effectiveType==="slow-2g")}createImageElement(t){return new Promise((n,r)=>{const i=new Image;i.onload=()=>{this.loading.delete(t),n()},i.onerror=()=>{this.loading.delete(t),r(new Error(`Failed to preload image: ${t}`))},i.decoding="async",i.loading="eager",i.fetchPriority="low",i.src=t})}async processQueue(){if(!this.shouldPreload())return;this.queue.sort((n,r)=>{const i={high:3,medium:2,low:1};return i[r.priority]-i[n.priority]});const t=[];for(const n of this.queue){if(n.loaded||n.error||this.loading.has(n.url))continue;if(t.length>=this.maxConcurrent){await Promise.race(t);continue}this.loading.add(n.url);const r=this.createImageElement(n.url).then(()=>{n.loaded=!0}).catch(()=>{n.error=!0});n.promise=r,t.push(r)}await Promise.allSettled(t)}preload(t,n="medium"){if(!t||this.loading.has(t))return Promise.resolve();const r=this.queue.find(s=>s.url===t);if(r)return(n==="high"||n==="medium"&&r.priority==="low")&&(r.priority=n),r.promise||Promise.resolve();const i={url:t,priority:n};return this.queue.push(i),n==="high"?this.processQueue().then(()=>{if(i.error)throw new Error(`Failed to preload high priority image: ${t}`)}):(setTimeout(()=>this.processQueue(),100),Promise.resolve())}preloadMultiple(t){const n=t.map(({url:r,priority:i="medium"})=>this.preload(r,i));return Promise.all(n)}isLoaded(t){const n=this.queue.find(r=>r.url===t);return(n==null?void 0:n.loaded)||!1}clear(){this.queue=[],this.loading.clear()}getStats(){const t=this.queue.filter(i=>i.loaded).length,n=this.queue.filter(i=>i.error).length,r=this.queue.filter(i=>!i.loaded&&!i.error).length;return{total:this.queue.length,loaded:t,error:n,pending:r,loadingNow:this.loading.size}}}const uP=new Tde({maxConcurrent:2,respectDataSaver:!0,minNetworkSpeed:1});
539function jde({recipe:e,isConfirmed:t,onConfirm:n,onUnconfirm:r,triggerClassName:i,isImageGenerating:s=!1}){const[o,a]=F.useState(!1),[l,u]=F.useState(!1),{toast:d}=zi(),f=F.useCallback(()=>{e.image_url&&uP.preload(e.image_url,"high")},[e.image_url]),h=F.useCallback(()=>{u(!0),e.image_url&&uP.preload(e.image_url,"high")},[e.image_url]),p=F.useCallback(()=>{u(!1)},[]),g=async v=>{try{a(!0),t?(await r(e.id),d({title:"Recipe removed",description:`${e.title} has been removed from your selection.`,variant:"destructive"}),v(),p()):(await n(e.id),d({title:"Recipe selected",description:`${e.title} has been added to your selection.`}))}finally{a(!1)}};return c.jsx(pde,{children:({open:v,setOpen:w})=>c.jsxs(c.Fragment,{children:[c.jsx(ie,{variant:"secondary",size:"sm",className:K("w-full justify-center",i),onClick:()=>{w(!0),h()},onMouseEnter:f,onFocus:f,children:"View Details"}),c.jsxs(mde,{children:[c.jsx(wde,{recipe:e,isImageGenerating:s}),c.jsx(gde,{className:"pt-2 pb-4 px-5",children:c.jsx(Cde,{recipe:e})}),c.jsxs(vde,{children:[c.jsx(ie,{variant:"outline",onClick:()=>{w(!1),p()},className:"rounded-full hover:-translate-y-0.5 transition-all duration-300",children:"Close"}),c.jsx(ie,{variant:t?"outline":"default",className:K("rounded-full hover:-translate-y-0.5 transition-all duration-300",t?"border-red-500 text-red-500 hover:bg-red-50 hover:text-red-600 hover:border-red-600":""),onClick:()=>g(()=>{w(!1),p()}),disabled:o,children:t?"Remove from selection":"Select this recipe"})]})]})]})})}function Pde({recipe:e,isConfirmed:t,onConfirm:n,onUnconfirm:r,isActionLoading:i=!1,animationDelay:s=0,isImageGenerating:o=!1,mealPlanId:a}){const[l,u]=m.useState(i),d=an(),f=vr(),h=async()=>{var p,g,v,w;try{u(!0),t?(f.track("meal_plan_recipe_unconfirmed",{recipe_id:e.id,meal_plan_id:a,meal_type:((p=e.meal_types)==null?void 0:p[0])||"unknown",cuisine_type:((g=e.tags)==null?void 0:g.find(y=>y.includes("cuisine")))||"unknown"}),await r(e.id)):(f.track("meal_plan_recipe_confirmed",{recipe_id:e.id,meal_plan_id:a,meal_type:((v=e.meal_types)==null?void 0:v[0])||"unknown",cuisine_type:((w=e.tags)==null?void 0:w.find(y=>y.includes("cuisine")))||"unknown"}),await n(e.id))}finally{u(!1)}};return c.jsxs(di,{className:K("h-full flex flex-col transition-all relative overflow-hidden group",t?"ring-2 ring-green-500 ring-offset-2":""),children:[c.jsxs("div",{className:"absolute top-0 left-0 w-full h-32 rounded-t-lg z-0 overflow-hidden",children:[c.jsx(eS,{src:e.image_url,alt:e.title,className:"w-full h-full object-cover rounded-t-lg group-hover:brightness-110",containerClassName:"w-full h-full",animationType:"fade-in",animationDelay:s,lazy:!0,connectionAware:!0,enableProgressiveLoading:!0,respectReducedMotion:!0,sizes:"(max-width: 640px) 400px, (max-width: 768px) 500px, 600px",fallbackContent:c.jsxs("div",{className:"text-center px-4",children:[c.jsx("div",{className:"w-16 h-16 bg-sage-200 rounded-full flex items-center justify-center mx-auto mb-3",children:c.jsx("svg",{className:"w-8 h-8 text-sage-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})})}),c.jsx("p",{className:"text-sm text-sage-700 font-medium",children:"Recipe"})]})}),e.image_url&&c.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-black/50 via-transparent to-transparent rounded-t-lg z-10"})]}),t&&c.jsx(vo,{className:K("absolute top-2 right-2 z-10 bg-green-500 text-white px-3 py-1","shadow-[0_2px_8px_rgba(0,0,0,0.12)] animate-bounce-light"),variant:"static",children:"Selected"}),!e.image_url&&c.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-slate-100 via-sage-50 to-mint-100 rounded-t-lg z-0 border border-slate-200/50"}),o&&!e.image_url&&c.jsx("div",{className:"absolute bottom-20 right-2 z-5",children:c.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[c.jsx(Wt,{className:"w-2.5 h-2.5 animate-spin text-green-700"}),c.jsx("span",{className:"text-[10px] text-green-700 font-medium leading-none",children:"Cooking"}),c.jsx("span",{className:"text-[10px] text-green-700 font-medium leading-none",children:"up Image"})]})}),c.jsx(qa,{className:"pb-1 relative z-10",children:c.jsx(Vc,{className:K("line-clamp-3 text-lg relative z-10",!d&&"min-h-[4.5rem]",d&&"min-h-[4.5rem]",e.image_url?"text-white font-medium":"text-slate-800 font-semibold"),style:e.image_url?{textShadow:"0 2px 8px rgba(0,0,0,0.9), 0 1px 3px rgba(0,0,0,0.8)"}:void 0,children:e.title})}),c.jsx(fi,{className:"pt-0 flex-grow relative z-10",children:c.jsxs("div",{className:"flex items-center gap-4 mt-auto",children:[c.jsxs("div",{className:"flex items-center gap-1 text-xs bg-white/90 rounded-full px-2 py-0.5 
539shadow-sm",children:[c.jsx(bA,{className:"w-3 h-3 flex-shrink-0 text-gray-700"}),c.jsxs("span",{className:"text-gray-800",children:[e.cooking_time||"?"," min"]})]}),c.jsxs("div",{className:"flex items-center gap-1 text-xs bg-white/90 rounded-full px-2 py-0.5 shadow-sm",children:[c.jsx(PA,{className:"w-3 h-3 flex-shrink-0 text-gray-700"}),c.jsxs("span",{className:"text-gray-800",children:[e.servings||"4"," servings"]})]})]})}),c.jsxs(bf,{className:"flex items-center gap-2 pt-0 pb-4 relative z-10 mt-auto",children:[c.jsx(jde,{recipe:e,isConfirmed:t,onConfirm:n,onUnconfirm:r,triggerClassName:"text-sm flex-1 bg-gray-500 hover:bg-gray-700 text-white border-gray-600 hover:border-gray-800 rounded-full hover:-translate-y-0.5 transition-all duration-300",isImageGenerating:o}),c.jsx(ie,{variant:t?"outline":"default",className:K("flex-1",t?"border-red-500 text-red-500 hover:bg-red-50 hover:text-red-600 hover:border-red-600":""),onClick:h,disabled:l,size:"sm",children:t?"Remove":"Select"})]})]})}function Nde({title:e,selectedCount:t}){return c.jsx("div",{className:"flex items-center justify-between",children:c.jsxs("h3",{className:"text-lg font-medium",children:[e,t>0&&c.jsxs("span",{className:"ml-2 text-sm text-muted-foreground",children:["(",t," selected)"]})]})})}function Rde({title:e,recipes:t,onConfirmRecipe:n,onUnconfirmRecipe:r,pendingImageGenerations:i=new Set,mealPlanId:s}){if(t.length===0)return null;const o=t.filter(l=>l.isConfirmed).length,a=[...t].sort((l,u)=>l.recipe.id.localeCompare(u.recipe.id));return c.jsxs("div",{className:"space-y-4",children:[c.jsx(Nde,{title:e,selectedCount:o}),c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:a.map(({recipe:l,isConfirmed:u})=>c.jsx(Pde,{recipe:l,isConfirmed:u,onConfirm:n,onUnconfirm:r,isImageGenerating:i.has(l.id),mealPlanId:s},l.id))})]})}function Ide({onGenerateMore:e,isGenerating:t=!1}){return c.jsxs("div",{className:"p-8 text-center border rounded-lg bg-muted/20",children:[c.jsx("p",{className:"text-muted-foreground mb-4",children:"No recipes available. Try generating some recipes."}),e&&c.jsx(ie,{onClick:e,disabled:t,className:"gap-2",children:"Generate Recipes"})]})}function Ade({onGenerateMore:e,isGenerating:t}){return c.jsx("div",{className:"flex justify-center mt-6",children:c.jsxs(ie,{onClick:e,variant:"outline",size:"lg",className:"gap-2",disabled:t,children:[c.jsx(hg,{className:`h-4 w-4 ${t?"animate-spin":""}`}),"Generate More Recipes"]})})}function Ode({recipes:e,onConfirmRecipe:t,onUnconfirmRecipe:n,onGenerateMore:r,isGenerating:i=!1,pendingImageGenerations:s=new Set,mealPlanId:o}){an();const a=new Set;e.forEach(({recipe:h})=>{if(h.meal_types&&h.meal_types.length>0){const p=h.meal_types[0];p&&a.add(p)}else a.add("other")});const l=["breakfast","lunch","dinner","snack","dessert","other"],u=Array.from(a).sort((h,p)=>{const g=l.indexOf(h),v=l.indexOf(p);return g-v}),d={};u.forEach(h=>{d[h]=[]}),e.forEach(h=>{const{recipe:p}=h;if(p.meal_types&&p.meal_types.length>0){const g=p.meal_types[0];d[g].push(h)}else d.other.push(h)});const f={breakfast:"Breakfast",lunch:"Lunch",dinner:"Dinner",snack:"Snacks",dessert:"Desserts",other:"Other Recipes"};return c.jsxs("div",{className:"space-y-8",children:[u.map(h=>c.jsx(Rde,{title:f[h]||h.charAt(0).toUpperCase()+h.slice(1),recipes:d[h],onConfirmRecipe:t,onUnconfirmRecipe:n,pendingImageGenerations:s,mealPlanId:o},h)),e.length===0&&c.jsx(Ide,{onGenerateMore:r,isGenerating:i}),e.length>0&&r&&c.jsx(Ade,{onGenerateMore:r,isGenerating:i})]})}function Dde({message:e="Loading recipes..."}){return c.jsxs("div",{className:"flex justify-center items-center py-20",children:[c.jsx(Wt,{className:"h-8 w-8 animate-spin text-primary"}),c.jsx("span",{className:"ml-2 text-lg",children:e})]})}const Mde=Va("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Pf=m.forwardRef(({className:e,variant:t,...n},r)=>c.jsx("div",{ref:r,role:"alert",className:K(Mde({variant:t}),e),...n}));Pf.displayName="Alert";const qg=m.forwardRef(({className:e,...t},n)=>c.jsx("h5",{ref:n,className:K("mb-1 font-medium leading-none tracking-tight",e),...t}));qg.displayName="AlertTitle";const Nf=m.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:K("text-sm [&_p]:leading-relaxed",e),...t}));
539Nf.displayName="AlertDescription";function Lde({message:e="Failed to load recipes. Please try again.",onRetry:t}){return c.jsxs(Pf,{variant:"destructive",children:[c.jsx(h_,{className:"h-4 w-4"}),c.jsx(qg,{children:"Error"}),c.jsxs(Nf,{children:[e,t&&c.jsx(ie,{className:"mt-2",variant:"outline",size:"sm",onClick:t,children:"Retry"})]})]})}function Fde({onRetry:e,isRetrying:t}){return c.jsxs(Pf,{className:"bg-red-50 text-red-800 border-red-300",children:[c.jsx(h_,{className:"h-4 w-4 text-red-800"}),c.jsx(qg,{children:"Recipe Generation Failed"}),c.jsxs(Nf,{className:"space-y-4",children:[c.jsx("p",{children:"We couldn't generate recipes at this time. This could be due to:"}),c.jsxs("ul",{className:"list-disc pl-5 space-y-1",children:[c.jsx("li",{children:"Limited ingredients in your inventory"}),c.jsx("li",{children:"Temporary service unavailability"}),c.jsx("li",{children:"Connectivity issues"})]}),c.jsx(ie,{onClick:e,variant:"outline",disabled:t,className:"mt-2",children:"Try Again"})]})]})}function $de(){return c.jsxs("div",{className:"flex flex-col justify-center items-center py-20 space-y-4",children:[c.jsx(Wt,{className:"h-8 w-8 animate-spin text-primary"}),c.jsx("span",{className:"text-lg",children:"Generating recipes based on your inventory..."}),c.jsx("p",{className:"text-sm text-muted-foreground max-w-md text-center",children:"We're crafting delicious recipes tailored to your preferences and available ingredients. This may take a moment."})]})}function Ude({recommendedCount:e,timePeriod:t="meal"}){return c.jsxs("p",{className:"text-sm text-muted-foreground mb-4",children:["Please select at least ",e," ",e===1?"recipe":"recipes"," for your ",t," plan.",c.jsx(vo,{variant:"outline",className:"ml-2 bg-amber-50 text-amber-700 border-amber-200",children:"Selection needed"})]})}function Vde({title:e,recommendedCount:t,timePeriod:n="meal",confirmedCount:r}){return c.jsxs(qa,{children:[c.jsxs(Vc,{children:[c.jsx("span",{className:"text-muted-foreground font-normal mr-2",children:"Meal Plan:"}),c.jsx("span",{children:e})]}),c.jsxs(Rg,{children:["Choose recipes for your meal plan. We recommend selecting at least ",t," ",t===1?"recipe":"recipes"," for your ",n," plan.",r>0&&c.jsxs("span",{className:"ml-2 text-green-600 font-medium",children:["You've selected ",r," ",r===1?"recipe":"recipes","."]})]})]})}function zde({title:e,recommendedCount:t,timePeriod:n,confirmedCount:r,recipes:i,isLoading:s,isError:o,error:a,refetch:l,generateRecipesMutation:u,onConfirmRecipe:d,onUnconfirmRecipe:f,onGenerateMore:h,pendingImageGenerations:p=new Set,mealPlanId:g}){const v=vr();return m.useEffect(()=>{i&&i.length>0&&g&&v.track("meal_plan_recipes_viewed",{meal_plan_id:g,recipe_count:i.length,confirmed_recipe_count:r})},[i,g,r,v]),c.jsxs(di,{className:"w-full",children:[c.jsx(Vde,{title:e,recommendedCount:t,timePeriod:n,confirmedCount:r}),c.jsx(fi,{className:"space-y-4",children:s?c.jsx(Dde,{}):o?c.jsx(Lde,{message:(a==null?void 0:a.message)||"Failed to load recipes. Please try again.",onRetry:()=>l()}):u.isPending?c.jsx($de,{}):u.isError&&i.length===0?c.jsx(Fde,{onRetry:h,isRetrying:u.isPending}):c.jsxs("div",{className:"space-y-6",children:[r===0&&c.jsx(Ude,{recommendedCount:t,timePeriod:n}),c.jsx(Ode,{recipes:i,onConfirmRecipe:d,onUnconfirmRecipe:f,onGenerateMore:h,isGenerating:u.isPending,pen
539dingImageGenerations:p,mealPlanId:g})]})})]})}var Bde="VisuallyHidden",Hg=m.forwardRef((e,t)=>c.jsx(me.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Hg.displayName=Bde;var Wde=Hg,tS="ToastProvider",[nS,qde,Hde]=wg("Toast"),[Q3,zpe]=Mn("Toast",[Hde]),[Gde,Gg]=Q3(tS),X3=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:i="right",swipeThreshold:s=50,children:o}=e,[a,l]=m.useState(null),[u,d]=m.useState(0),f=m.useRef(!1),h=m.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${tS}\`. Expected non-empty \`string\`.`),c.jsx(nS.Provider,{scope:t,children:c.jsx(Gde,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:s,toastCount:u,viewport:a,onViewportChange:l,onToastAdd:m.useCallback(()=>d(p=>p+1),[]),onToastRemove:m.useCallback(()=>d(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:h,children:o})})};X3.displayName=tS;var Z3="ToastViewport",Kde=["F8"],Iw="toast.viewportPause",Aw="toast.viewportResume",J3=m.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=Kde,label:i="Notifications ({hotkey})",...s}=e,o=Gg(Z3,n),a=qde(n),l=m.useRef(null),u=m.useRef(null),d=m.useRef(null),f=m.useRef(null),h=Le(t,f,o.onViewportChange),p=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),g=o.toastCount>0;m.useEffect(()=>{const w=y=>{var b;r.length!==0&&r.every(_=>y[_]||y.code===_)&&((b=f.current)==null||b.focus())};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[r]),m.useEffect(()=>{const w=l.current,y=f.current;if(g&&w&&y){const x=()=>{if(!o.isClosePausedRef.current){const E=new CustomEvent(Iw);y.dispatchEvent(E),o.isClosePausedRef.current=!0}},b=()=>{if(o.isClosePausedRef.current){const E=new CustomEvent(Aw);y.dispatchEvent(E),o.isClosePausedRef.current=!1}},_=E=>{!w.contains(E.relatedTarget)&&b()},S=()=>{w.contains(document.activeElement)||b()};return w.addEventListener("focusin",x),w.addEventListener("focusout",_),w.addEventListener("pointermove",x),w.addEventListener("pointerleave",S),window.addEventListener("blur",x),window.addEventListener("focus",b),()=>{w.removeEventListener("focusin",x),w.removeEventListener("focusout",_),w.removeEventListener("pointermove",x),w.removeEventListener("pointerleave",S),window.removeEventListener("blur",x),window.removeEventListener("focus",b)}}},[g,o.isClosePausedRef]);const v=m.useCallback(({tabbingDirection:w})=>{const x=a().map(b=>{const _=b.ref.current,S=[_,...afe(_)];return w==="forwards"?S:S.reverse()});return(w==="forwards"?x.reverse():x).flat()},[a]);return m.useEffect(()=>{const w=f.current;if(w){const y=x=>{var S,E,k;const b=x.altKey||x.ctrlKey||x.metaKey;if(x.key==="Tab"&&!b){const C=document.activeElement,P=x.shiftKey;if(x.target===w&&P){(S=u.current)==null||S.focus();return}const I=v({tabbingDirection:P?"backwards":"forwards"}),O=I.findIndex(j=>j===C);zy(I.slice(O+1))?x.preventDefault():P?(E=u.current)==null||E.focus():(k=d.current)==null||k.focus()}};return w.addEventListener("keydown",y),()=>w.removeEventListener("keydown",y)}},[a,v]),c.jsxs(LY,{ref:l,role:"region","aria-label":i.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:g?void 0:"none"},children:[g&&c.jsx(Ow,{ref:u,onFocusFromOutsideViewport:()=>{const w=v({tabbingDirection:"forwards"});zy(w)}}),c.jsx(nS.Slot,{scope:n,children:c.jsx(me.ol,{tabIndex:-1,...s,ref:h})}),g&&c.jsx(Ow,{ref:d,onFocusFromOutsideViewport:()=>{const w=v({tabbingDirection:"backwards"});zy(w)}})]})});J3.displayName=Z3;var eF="ToastFocusProxy",Ow=m.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,s=Gg(eF,n);return c.jsx(Hg,{"aria-hidden":!0,tabIndex:0,...i,ref:t,style:{position:"fixed"},onFocus:o=>{var u;const a=o.relatedTarget;!((u=s.viewport)!=null&&u.contains(a))&&r()}})});Ow.displayName=eF;var Kg="Toast",Yde="toast.swipeStart",Qde="toast.swipeMove",Xde="toast.swipeCancel",Zde="toast.swipeEnd",tF=m.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:i,onOpenChange:s,...o}=e,[a=!0,l]=Jn({prop:r,defaultProp:i,onChange:s});return c.jsx(Lt,{present:n||a,children:c.jsx(tfe,{open:a,...o,ref:t,onClose:()=>l(!1),onPause:gt(e.onPause),onResume:gt(e.onResume),onSwipeStart:se(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:se(e.onSwipeMove,u=>{const{x:d,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:se(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:se(e.onSwipeEnd,u=>{const{x:d,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),l(!1)})})})});tF.displayName=Kg;var[Jde,efe]=Q3(Kg,{onClose(){}}),tfe=m.forwardRef((e,t)=>
539{const{__scopeToast:n,type:r="foreground",duration:i,open:s,onClose:o,onEscapeKeyDown:a,onPause:l,onResume:u,onSwipeStart:d,onSwipeMove:f,onSwipeCancel:h,onSwipeEnd:p,...g}=e,v=Gg(Kg,n),[w,y]=m.useState(null),x=Le(t,j=>y(j)),b=m.useRef(null),_=m.useRef(null),S=i||v.duration,E=m.useRef(0),k=m.useRef(S),C=m.useRef(0),{onToastAdd:P,onToastRemove:T}=v,N=gt(()=>{var A;(w==null?void 0:w.contains(document.activeElement))&&((A=v.viewport)==null||A.focus()),o()}),I=m.useCallback(j=>{!j||j===1/0||(window.clearTimeout(C.current),E.current=new Date().getTime(),C.current=window.setTimeout(N,j))},[N]);m.useEffect(()=>{const j=v.viewport;if(j){const A=()=>{I(k.current),u==null||u()},V=()=>{const $=new Date().getTime()-E.current;k.current=k.current-$,window.clearTimeout(C.current),l==null||l()};return j.addEventListener(Iw,V),j.addEventListener(Aw,A),()=>{j.removeEventListener(Iw,V),j.removeEventListener(Aw,A)}}},[v.viewport,S,l,u,I]),m.useEffect(()=>{s&&!v.isClosePausedRef.current&&I(S)},[s,S,v.isClosePausedRef,I]),m.useEffect(()=>(P(),()=>T()),[P,T]);const O=m.useMemo(()=>w?lF(w):null,[w]);return v.viewport?c.jsxs(c.Fragment,{children:[O&&c.jsx(nfe,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:O}),c.jsx(Jde,{scope:n,onClose:N,children:kc.createPortal(c.jsx(nS.ItemSlot,{scope:n,children:c.jsx(MY,{asChild:!0,onEscapeKeyDown:se(a,()=>{v.isFocusedToastEscapeKeyDownRef.current||N(),v.isFocusedToastEscapeKeyDownRef.current=!1}),children:c.jsx(me.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":v.swipeDirection,...g,ref:x,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:se(e.onKeyDown,j=>{j.key==="Escape"&&(a==null||a(j.nativeEvent),j.nativeEvent.defaultPrevented||(v.isFocusedToastEscapeKeyDownRef.current=!0,N()))}),onPointerDown:se(e.onPointerDown,j=>{j.button===0&&(b.current={x:j.clientX,y:j.clientY})}),onPointerMove:se(e.onPointerMove,j=>{if(!b.current)return;const A=j.clientX-b.current.x,V=j.clientY-b.current.y,$=!!_.current,R=["left","right"].includes(v.swipeDirection),L=["left","up"].includes(v.swipeDirection)?Math.min:Math.max,H=R?L(0,A):0,z=R?0:L(0,V),Q=j.pointerType==="touch"?10:2,de={x:H,y:z},ne={originalEvent:j,delta:de};$?(_.current=de,Th(Qde,f,ne,{discrete:!1})):dP(de,v.swipeDirection,Q)?(_.current=de,Th(Yde,d,ne,{discrete:!1}),j.target.setPointerCapture(j.pointerId)):(Math.abs(A)>Q||Math.abs(V)>Q)&&(b.current=null)}),onPointerUp:se(e.onPointerUp,j=>{const A=_.current,V=j.target;if(V.hasPointerCapture(j.pointerId)&&V.releasePointerCapture(j.pointerId),_.current=null,b.current=null,A){const $=j.currentTarget,R={originalEvent:j,delta:A};dP(A,v.swipeDirection,v.swipeThreshold)?Th(Zde,p,R,{discrete:!0}):Th(Xde,h,R,{discrete:!0}),$.addEventListener("click",L=>L.preventDefault(),{once:!0})}})})})}),v.viewport)})]}):null}),nfe=e=>{const{__scopeToast:t,children:n,...r}=e,i=Gg(Kg,t),[s,o]=m.useState(!1),[a,l]=m.useState(!1);return sfe(()=>o(!0)),m.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:c.jsx(gf,{asChild:!0,children:c.jsx(Hg,{...r,children:s&&c.jsxs(c.Fragment,{children:[i.label," ",n]})})})},rfe="ToastTitle",nF=m.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return c.jsx(me.div,{...r,ref:t})});nF.displayName=rfe;var ife="ToastDescription",rF=m.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return c.jsx(me.div,{...r,ref:t})});rF.displayName=ife;var iF="ToastAction",sF=m.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?c.jsx(aF,{altText:n,asChild:!0,children:c.jsx(rS,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${iF}\`. Expected non-empty \`string\`.`),null)});sF.displayName=iF;var oF="ToastClose",rS=m.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,i=efe(oF,n);return c.jsx(aF,{asChild:!0,children:c.jsx(me.button,{type:"button",...r,ref:t,onClick:se(e.onClick,i.onClose)})})});rS.displayName=oF;var aF=m.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...i}=e;return c.jsx(me.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...i,ref:t})});function lF(e){const t=[];
539return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),ofe(r)){const i=r.ariaHidden||r.hidden||r.style.display==="none",s=r.dataset.radixToastAnnounceExclude==="";if(!i)if(s){const o=r.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...lF(r))}}),t}function Th(e,t,n,{discrete:r}){const i=n.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?y_(i,s):i.dispatchEvent(s)}var dP=(e,t,n=0)=>{const r=Math.abs(e.x),i=Math.abs(e.y),s=r>i;return t==="left"||t==="right"?s&&r>n:!s&&i>n};function sfe(e=()=>{}){const t=gt(e);Dr(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function ofe(e){return e.nodeType===e.ELEMENT_NODE}function afe(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function zy(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var lfe=X3,cF=J3,uF=tF,dF=nF,fF=rF,hF=sF,pF=rS;const cfe=lfe,mF=m.forwardRef(({className:e,...t},n)=>c.jsx(cF,{ref:n,className:K("fixed bottom-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:right-0 sm:flex-col md:max-w-[420px]",e),...t}));mF.displayName=cF.displayName;const ufe=Va("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-4 pr-6 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-bottom-full",{variants:{variant:{default:"border bg-background/95 text-foreground backdrop-blur-sm",destructive:"destructive group border-destructive bg-destructive/95 text-destructive-foreground backdrop-blur-sm"}},defaultVariants:{variant:"default"}}),gF=m.forwardRef(({className:e,variant:t,...n},r)=>c.jsx(uF,{ref:r,className:K(ufe({variant:t}),e),...n}));gF.displayName=uF.displayName;const dfe=m.forwardRef(({className:e,...t},n)=>c.jsx(hF,{ref:n,className:K("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));dfe.displayName=hF.displayName;const vF=m.forwardRef(({className:e,...t},n)=>c.jsx(pF,{ref:n,className:K("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:c.jsx(Di,{className:"h-4 w-4"})}));vF.displayName=pF.displayName;const yF=m.forwardRef(({className:e,...t},n)=>c.jsx(dF,{ref:n,className:K("text-sm font-semibold",e),...t}));yF.displayName=dF.displayName;const xF=m.forwardRef(({className:e,...t},n)=>c.jsx(fF,{ref:n,className:K("text-sm opacity-90",e),...t}));xF.displayName=fF.displayName;function iS(){const{toasts:e}=zi();return c.jsxs(cfe,{children:[e.map(function({id:t,title:n,description:r,action:i,...s}){return c.jsxs(gF,{...s,children:[c.jsxs("div",{className:"grid gap-1",children:[n&&c.jsx(yF,{children:n}),r&&c.jsx(xF,{children:r})]}),i,c.jsx(vF,{})]},t)}),c.jsx(mF,{})]})}function fP(){const{mealPlanId:e}=UV(),t=wn();if(!e)return t("/dashboard"),null;const{recipes:n,isLoading:r,isError:i,error:s,refetch:o,mealPlanData:a,generateRecipesMutation:l,confirmedCount:u,recommendedRecipeCount:d,pendingImageGenerations:f,handleConfirmRecipe:h,handleUnconfirmRecipe:p,handleGenerateMore:g}=dde(e);return a&&F4(a),c.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[c.jsx(Wi,{}),c.jsx(iS,{}),c.jsx("main",{className:"flex-1 container py-8",children:c.jsxs("div",{className:"space-y-6",children:[c.jsx(fde,{confirmedCount:u,isGenerating:l.isPending}),c.jsx(zde,{title:(a==null?void 0:a.title)||"Recipe Selection",recommendedCount:d,timePeriod:(a==null?void 0:a.time_period)||"meal",confirmedCount:u,recipes:n,isLoading:r,isError:i,error:s,refetch:o,generateRecipesMutation:l,onConfirmRecipe:h,onUnconfirmRecipe:p,onGenerateMore:g,pendingImageGenerations:f,mealPlanId:e})]})})]})}const wF=e=>{const t=["Scanning for avocados...","Identifying rogue bananas...","Counting the carrots...","Locating lost limes...","Detecting deliciousness...","Sorting the spices...","Peeling the pixels...","Marinating the metadata..."],n=["Tallying the transactions...","Deciphering discounts...","Extracting every expense...","Parsing purchase particulars...","Adding up the acquisitions...","Itemizing each ingredient...","Digitizing the deductions...","Verifying value vouchers..."],r=["Transcribing tasty talk...","Convert
539ing cravings to code...","Decoding delectable details...","Listening for luscious lists...","Hearing hints of hunger...","Parsing palatable pronouncements...","Recognizing recipe recitations...","Interpreting ingredient intentions..."];let i;return e==="receipt"?i=n:e==="voice"?i=r:i=t,i[Math.floor(Math.random()*i.length)]},ffe=()=>{const e=["Oops! Looks like our AI went on a diet and couldn't find any food.","Our scanners must be on strike. No ingredients detected!","Did you accidentally upload a picture of your pet rock? No food here!","Error 404: Deliciousness not found. Please try again.","Our AI is currently fasting. Upload a real meal, please!","Houston, we have a problem: No food detected in your image.","Warning: May contain traces of non-food items. Please upload a valid image.","Our AI thinks this is abstract art. Can you upload something edible?"];return e[Math.floor(Math.random()*e.length)]},bF=e=>{const t=e.toLowerCase();return t.includes("produce")||t.includes("fruit")||t.includes("vegetable")?lK:t.includes("meat")||t.includes("beef")||t.includes("poultry")?uK:t.includes("dairy")||t.includes("milk")||t.includes("cheese")?TK:t.includes("bakery")||t.includes("bread")?FK:t.includes("snack")||t.includes("cookie")||t.includes("candy")?vK:t.includes("beverage")||t.includes("drink")?_A:t.includes("alcohol")||t.includes("wine")||t.includes("beer")?$K:t.includes("baby")?cK:t.includes("prepared")||t.includes("ready")?EA:t.includes("seafood")||t.includes("fish")?wK:t.includes("egg")?xK:t.includes("frozen")?IK:t.includes("canned")||t.includes("jar")?jK:CA};function sS({children:e,as:t="p",className:n,duration:r=1,zDistance:i=10,xDistance:s=2,yDistance:o=-2,spread:a=1,scaleDistance:l=1.1,rotateYDistance:u=10,transition:d,baseColor:f,gradientColor:h}){const p=mo(t);return c.jsx(p,{className:K("relative inline-block [perspective:500px]","[--base-color:#a1a1aa] [--base-gradient-color:#000]","dark:[--base-color:#71717a] dark:[--base-gradient-color:#ffffff]",n),style:{color:f||"var(--base-color)","--base-gradient-color":h||"var(--base-gradient-color)"},children:e.split("").map((g,v)=>{const w=v*r*(1/a)/e.length;return c.jsx(mo.span,{className:K("inline-block whitespace-pre [transform-style:preserve-3d]"),initial:{translateZ:0,scale:1,rotateY:0,color:f||"var(--base-color)"},animate:{translateZ:[0,i,0],translateX:[0,s,0],translateY:[0,o,0],scale:[1,l,1],rotateY:[0,u,0],color:[f||"var(--base-color)",h||"var(--base-gradient-color)",f||"var(--base-color)"]},transition:{duration:r,repeat:1/0,repeatDelay:e.length*.05/a,delay:w,ease:"easeInOut",...d},children:g},v)})})}const hfe=["Try better lighting","Get closer to the items","Open drawers/containers","Take multiple photos","Make sure food items are visible"],pfe=({errorMessage:e,onRetry:t,imageType:n="food"})=>{const r=n==="food"||n==="receipt";return c.jsxs("div",{className:"space-y-4",children:[c.jsxs(Pf,{variant:"destructive",children:[c.jsx(h_,{className:"h-4 w-4"}),c.jsx(qg,{children:n==="voice"?"No Voice Data Detected":"No Food Detected"}),c.jsxs(Nf,{className:"flex items-center gap-2",children:[c.jsx(yK,{className:"h-5 w-5 flex-shrink-0"}),c.jsx("span",{children:e||"We couldn't detect any food items in your image."})]})]}),r&&c.jsxs("div",{className:"space-y-2",children:[c.jsx("h4",{className:"text-sm font-medium",children:"Tips for better photos:"}),c.jsx("ul",{className:"list-disc pl-5 text-sm space-y-1",children:hfe.map((i,s)=>c.jsx("li",{children:i},s))})]}),c.jsx("div",{className:"flex justify-center pt-2",children:c.jsxs(ie,{onClick:t,size:"sm",children:[c.jsx(hg,{className:"mr-2 h-4 w-4"}),"Try Again"]})})]})};var[Yg,Bpe]=Mn("Tooltip",[Uc]),Qg=Uc(),_F="TooltipProvider",mfe=700,Dw="tooltip.open",[gfe,oS]=Yg(_F),SF=e=>{const{__scopeTooltip:t,delayDuration:n=mfe,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:s}=e,[o,a]=m.useState(!0),l=m.useRef(!1),u=m.useRef(0);return m.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),c.jsx(gfe,{scope:t,isOpenDelayed:o,delayDuration:n,onOpen:m.useCallback(()=>{window.clearTimeout(u.current),a(!1)},[]),onClose:m.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:m.useCallback(d=>{l.current=d}
vendor: 4,901 bytes, line 539
539,[]),disableHoverableContent:i,children:s})};SF.displayName=_F;var Xg="Tooltip",[vfe,Zg]=Yg(Xg),EF=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i=!1,onOpenChange:s,disableHoverableContent:o,delayDuration:a}=e,l=oS(Xg,e.__scopeTooltip),u=Qg(t),[d,f]=m.useState(null),h=Ni(),p=m.useRef(0),g=o??l.disableHoverableContent,v=a??l.delayDuration,w=m.useRef(!1),[y=!1,x]=Jn({prop:r,defaultProp:i,onChange:k=>{k?(l.onOpen(),document.dispatchEvent(new CustomEvent(Dw))):l.onClose(),s==null||s(k)}}),b=m.useMemo(()=>y?w.current?"delayed-open":"instant-open":"closed",[y]),_=m.useCallback(()=>{window.clearTimeout(p.current),p.current=0,w.current=!1,x(!0)},[x]),S=m.useCallback(()=>{window.clearTimeout(p.current),p.current=0,x(!1)},[x]),E=m.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{w.current=!0,x(!0),p.current=0},v)},[v,x]);return m.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),c.jsx(O_,{...u,children:c.jsx(vfe,{scope:t,contentId:h,open:y,stateAttribute:b,trigger:d,onTriggerChange:f,onTriggerEnter:m.useCallback(()=>{l.isOpenDelayed?E():_()},[l.isOpenDelayed,E,_]),onTriggerLeave:m.useCallback(()=>{g?S():(window.clearTimeout(p.current),p.current=0)},[S,g]),onOpen:_,onClose:S,disableHoverableContent:g,children:n})})};EF.displayName=Xg;var Mw="TooltipTrigger",kF=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Zg(Mw,n),s=oS(Mw,n),o=Qg(n),a=m.useRef(null),l=Le(t,a,i.onTriggerChange),u=m.useRef(!1),d=m.useRef(!1),f=m.useCallback(()=>u.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),c.jsx(kg,{asChild:!0,...o,children:c.jsx(me.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:se(e.onPointerMove,h=>{h.pointerType!=="touch"&&!d.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),d.current=!0)}),onPointerLeave:se(e.onPointerLeave,()=>{i.onTriggerLeave(),d.current=!1}),onPointerDown:se(e.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:se(e.onFocus,()=>{u.current||i.onOpen()}),onBlur:se(e.onBlur,i.onClose),onClick:se(e.onClick,i.onClose)})})});kF.displayName=Mw;var yfe="TooltipPortal",[Wpe,xfe]=Yg(yfe,{forceMount:void 0}),wc="TooltipContent",CF=m.forwardRef((e,t)=>{const n=xfe(wc,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...s}=e,o=Zg(wc,e.__scopeTooltip);return c.jsx(Lt,{present:r||o.open,children:o.disableHoverableContent?c.jsx(TF,{side:i,...s,ref:t}):c.jsx(wfe,{side:i,...s,ref:t})})}),wfe=m.forwardRef((e,t)=>{const n=Zg(wc,e.__scopeTooltip),r=oS(wc,e.__scopeTooltip),i=m.useRef(null),s=Le(t,i),[o,a]=m.useState(null),{trigger:l,onClose:u}=n,d=i.current,{onPointerInTransitChange:f}=r,h=m.useCallback(()=>{a(null),f(!1)},[f]),p=m.useCallback((g,v)=>{const w=g.currentTarget,y={x:g.clientX,y:g.clientY},x=Efe(y,w.getBoundingClientRect()),b=kfe(y,x),_=Cfe(v.getBoundingClientRect()),S=jfe([...b,..._]);a(S),f(!0)},[f]);return m.useEffect(()=>()=>h(),[h]),m.useEffect(()=>{if(l&&d){const g=w=>p(w,d),v=w=>p(w,l);return l.addEventListener("pointerleave",g),d.addEventListener("pointerleave",v),()=>{l.removeEventListener("pointerleave",g),d.removeEventListener("pointerleave",v)}}},[l,d,p,h]),m.useEffect(()=>{if(o){const g=v=>{const w=v.target,y={x:v.clientX,y:v.clientY},x=(l==null?void 0:l.contains(w))||(d==null?void 0:d.contains(w)),b=!Tfe(y,o);x?h():b&&(h(),u())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[l,d,o,u,h]),c.jsx(TF,{...e,ref:s})}),[bfe,_fe]=Yg(Xg,{isInside:!1}),TF=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:o,...a}=e,l=Zg(wc,n),u=Qg(n),{onClose:d}=l;return m.useEffect(()=>(document.addEventListener(Dw,d),()=>document.removeEventListener(Dw,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]),c.jsx(Ac,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:c.jsxs(D_,{"data-state":l.stateAttribute,...u,...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:[c.jsx(m_,{children:r}),c.jsx(bfe,{scope:n,isInside:!0,children:c.jsx(Wde,{id:l.contentId,role:"tooltip",children:i||r})})]})})});CF.displayName=wc;var jF="TooltipArrow",Sfe=m.forwardRef((e,t)=>
539{const{__scopeTooltip:n,...r}=e,i=Qg(n);return _fe(jF,n).isInside?null:c.jsx(M_,{...i,...r,ref:t})});Sfe.displayName=jF;function Efe(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,i,s)){case s:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function kfe(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 Cfe(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function Tfe(e,t){const{x:n,y:r}=e;let i=!1;for(let s=0,o=t.length-1;s<t.length;o=s++){const a=t[s].x,l=t[s].y,u=t[o].x,d=t[o].y;l>r!=d>r&&n<(u-a)*(r-l)/(d-l)+a&&(i=!i)}return i}function jfe(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),Pfe(t)}function Pfe(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const s=t[t.length-1],o=t[t.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const s=n[n.length-1],o=n[n.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))n.pop();else break}n.push(i)}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 Nfe=SF,Rfe=EF,Ife=kF,PF=CF;const Afe=({delayDuration:e=200,...t})=>c.jsx(Nfe,{delayDuration:e,...t}),Ofe=Rfe,Dfe=Ife,NF=m.forwardRef(({className:e,sideOffset:t=4,...n},r)=>c.jsx(PF,{ref:r,sideOffset:t,className:K("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}));NF.displayName=PF.displayName;const Mfe=({onIngredientsDetected:e,onError:t})=>{const[n,r]=m.useState(!1),[i,s]=m.useState(null),[o,a]=m.useState(null),[l,u]=m.useState(!1),[d,f]=m.useState(null),[h,p]=m.useState(!1),[g,v]=m.useState(null),[w,y]=m.useState(0),x=m.useRef(null),b=m.useRef([]),_=m.useRef(null),S=an(),E=vr();m.useEffect(()=>()=>{x.current&&n&&x.current.stop(),o&&URL.revokeObjectURL(o)},[n,o]);const k=async()=>{try{f(null),b.current=[];const j=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}}),A=/iPad|iPhone|iPod/.test(navigator.userAgent),V=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);let $="audio/webm";A&&V?$="audio/mp4":MediaRecorder.isTypeSupported("audio/webm")||($="audio/mp3"),console.log(`Using MIME type: ${$} for recording on ${A?"iOS":"non-iOS"} device`);const R=new MediaRecorder(j,{mimeType:$,audioBitsPerSecond:128e3});x.current=R,R.ondataavailable=L=>{L.data.size>0&&b.current.push(L.data)},R.onstop=()=>{try{const L=new Blob(b.current,{type:$});console.log(`Audio recorded with type: ${$}, size: ${L.size} bytes`);const H=URL.createObjectURL(L);s(L),a(H),r(!1)}catch(L){console.error("Error creating audio blob:",L),t("Failed to process the recording. Please try again.")}finally{j.getTracks().forEach(L=>L.stop())}},A&&V?R.start(100):R.start(),r(!0)}catch(j){console.error("Error starting recording:",j),t("Could not access microphone. Please check permissions and try again.")}},C=()=>{x.current&&n&&x.current.stop()},P=()=>{_.current&&o&&(_.current.play(),u(!0))},T=()=>{u(!1)},N=()=>{o&&URL.revokeObjectURL(o),s(null),a(null),f(null)},I=async()=>{var A,V;if(!i)return;const j=Date.now();y(j),p(!0),v("Converting speech to text...");try{console.log(`Processing audio of type: ${i.type}, size: ${i.size} bytes`);const $=await Xce(i);console.log(`Audio converted to base64, length: ${$.length}`);const R=await Yce($);if(!R.success||!R.text){const Q=((A=R.error)==null?void 0:A.message)||"Failed to convert speech to text";throw console.error(Q),Dl({title:"Speech to Text Error",description:Q,variant:"destructive"}),new Error(Q)}f(R.text),v("Identifying ingredients..."),console.log(`Transcribed text: ${R.text}`);const L=await Qce(R.text);if(!L.success){const Q=((V=L.error)==null?void 0:V.message)||"Failed to i
539dentify ingredients";throw console.error(Q),new Error(Q)}if(L.noIngredientsDetected||!L.detectedIngredients||L.detectedIngredients.length===0){const Q=Date.now()-w;E.track("inventory_ingredient_uploaded",{upload_method:"voice",upload_type:"voice",processing_time:Q,upload_source:"microphone",error_type:"no_ingredients_detected",error_message:"No ingredients detected in voice recording"}),t("No ingredients were detected in your recording. Please try again and clearly list your ingredients."),p(!1);return}console.log(`Detected ${L.detectedIngredients.length} ingredients`);const H=Date.now()-w,z=[...new Set(L.detectedIngredients.map(Q=>Q.category||"Other"))];E.track("inventory_ingredient_uploaded",{upload_method:"voice",upload_type:"voice",ingredient_count:L.detectedIngredients.length,processing_time:H,categories_affected:z,upload_source:"microphone"}),e(L.detectedIngredients,"voice"),Dl({title:"Success!",description:`Detected ${L.detectedIngredients.length} ingredients from your recording.`,variant:"default"})}catch($){console.error("Error processing audio:",$);const R=Date.now()-w;E.track("inventory_ingredient_uploaded",{upload_method:"voice",upload_type:"voice",processing_time:R,upload_source:"microphone",error_type:$ instanceof Error?$.name:"unknown_error",error_message:$ instanceof Error?$.message:"Unknown error"}),t($.message||"An error occurred while processing your recording. Please try again.")}finally{p(!1),v(null)}},O=[{icon:c.jsx(LK,{className:"h-4 w-4 text-primary"}),text:"Speak clearly at a normal pace"},{icon:c.jsx(EK,{className:"h-4 w-4 text-primary"}),text:'Include quantities (e.g., "two chicken breasts")'},{icon:c.jsx(gK,{className:"h-4 w-4 text-primary"}),text:"List items one by one"},{icon:c.jsx(mK,{className:"h-4 w-4 text-primary"}),text:"Try to be specific about ingredients"}];return c.jsx("div",{className:"space-y-4",children:c.jsxs("div",{className:"flex flex-col items-center",children:[h?c.jsx("div",{className:"my-2 py-2 px-4 bg-primary/10 rounded-full",children:c.jsx(sS,{className:"[--base-color:#4CAF50] [--base-gradient-color:#2E7D32]",duration:1.5,spread:1.2,children:g||wF("voice")})}):d?c.jsx("div",{className:"bg-muted p-4 rounded-md w-full max-h-32 overflow-y-auto mb-4",children:c.jsxs("p",{className:"text-sm",children:[c.jsx("strong",{children:"You said:"})," ",d]})}):null,!h&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:`flex ${S?"flex-wrap justify-center gap-2":"justify-center items-center gap-3"} mb-4 w-full`,children:[!n&&!i&&c.jsxs("div",{className:"flex flex-col items-center gap-2 w-full",children:[c.jsxs(ie,{onClick:k,className:"flex items-center gap-2 mb-2",children:[c.jsx(Qp,{className:"h-4 w-4"}),"Start Recording"]}),S?c.jsx("div",{className:"w-full p-3 bg-muted rounded-lg",children:c.jsxs("div",{className:"space-y-1.5",children:[c.jsxs("h4",{className:"font-medium text-sm flex items-center gap-2",children:[c.jsx(PC,{className:"h-4 w-4"}),"For best results:"]}),c.jsx("ul",{className:"space-y-1",children:O.map((j,A)=>c.jsxs("li",{className:"flex items-start gap-2",children:[j.icon,c.jsx("span",{className:"text-xs",children:j.text})]},A))})]})}):c.jsx(Afe,{delayDuration:100,children:c.jsxs(Ofe,{children:[c.jsx(Dfe,{asChild:!0,children:c.jsxs("div",{className:"flex items-center gap-1.5 text-sm text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:[c.jsx("span",{children:"Recording Tips"}),c.jsx(PC,{className:"h-4 w-4"})]})}),c.jsx(NF,{side:"bottom",align:"center",className:"w-80",children:c.jsxs("div",{className:"space-y-2",children:[c.jsx("h4",{className:"font-medium text-sm",children:"For best results:"}),c.jsx("ul",{className:"space-y-3",children:O.map((j,A)=>c.jsxs("li",{className:"flex items-start gap-2",children:[j.icon,c.jsx("span",{className:"text-xs",children:j.text})]},A))})]})})]})})]}),n&&c.jsxs(ie,{onClick:C,variant:"destructive",className:"flex items-center gap-2",children:[c.jsx(AK,{className:"h-4 w-4"}),"Stop Recording"]}),i&&!n&&c.jsxs("div",{className:`flex ${S?"flex-wrap justify-center":""} gap-2`,children:[c.jsxs(ie,{onClick:P,variant:"outline",disabled:l,size:S?"sm":"default",className:"flex items-center gap-2",children:[c.jsx(NK,{className:"h-4 w-4"}),l?"Playing...":"Play"]}),c.jsxs(ie,{onClick:N,variant:"outline",size:S?"sm":"default",className:"flex items-center gap-2",children:[c.jsx(DK,{className:"h-4 w-4"}),"Clear"]}),c.jsx(ie,{onClick:I,className:"flex items-center gap-2",size:S?"sm":"default",disabled:h,children:h?c.jsxs(c.Fragment,{children:[c.jsx(Wt,{className:"h-4 w-4 animate-spin"}),"Processing..."]}):c.jsxs(c.Fragment,{children:[c.jsx(p_,{className:"h-4 w-4"}),"Process Audio"]})})]})]}),o&&c.jsx("audio",{ref:_,src:o,onEnded:T,style:{display:"none"}})]})]})})},Lfe=({activeTab:e,selectedFiles:t,imagePreviews:n,onFileChange:r,onRemoveFile:i,onVoiceIngredientsDetected:s,onVoiceError:o,maxFiles:a})=>{if(e==="voice")return c.jsx(Mfe,{onIngredientsDetected:s,onError:o});const l=m.useCallback(h=>{r({target:{files:h}})},[r]),{getRootProps:u,getInputProps:d,isDragActive:f}=G_({onDrop:l,accept:{"image/*":[".jpeg",".png",".jpg",".gif",".webp"]},maxFiles:a-t.length,disabled:t.length>=a});return c.jsx("div",{children:e!=="voice"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{...u(),className:`border-2 border-dashed rounded-md p-4 relative ${f?"border-primary":"border-muted-foreground
539/50"}`,children:[c.jsx("input",{...d(),id:"image-upload",multiple:!0}),c.jsx("div",{className:"text-center",children:f?c.jsx("p",{className:"text-sm",children:"Drop to upload"}):c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"text-sm",children:"Tap or drop photos here"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Supports PNG, JPEG, GIF, WEBP"})]})})]}),t.length>0&&c.jsxs("div",{className:"mt-4",children:[c.jsx(Co,{htmlFor:"image-upload",children:"Selected Files:"}),c.jsx("div",{className:"mt-2 grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-2",children:n.map((h,p)=>c.jsxs("div",{className:"relative group",children:[c.jsx("div",{className:"aspect-square overflow-hidden rounded-md border",children:c.jsx("img",{src:h,alt:`Preview ${p+1}`,className:"h-full w-full object-cover transition-transform group-hover:scale-105"})}),c.jsx(ie,{type:"button",variant:"ghost",size:"icon",onClick:()=>i(p),className:"absolute -top-2 -right-2 h-6 w-6 rounded-full bg-white shadow-md hover:bg-destructive hover:text-white",children:c.jsx(Di,{className:"h-3 w-3"})})]},p))})]})]})})},Ffe=({onImageProcessed:e})=>{const[t,n]=m.useState([]),[r,i]=m.useState([]),[s,o]=m.useState(!1),[a,l]=m.useState("food"),[u,d]=m.useState(!1),[f,h]=m.useState(""),[p,g]=m.useState(""),[v,w]=m.useState(""),[y,x]=m.useState(0),[b,_]=m.useState(0),S=an(),E=vr();m.useEffect(()=>{if(!s)return;const O=a==="receipt"?["Reading your grocery receipt...","Parsing your shopping list...","Extracting items from your receipt..."]:["Scanning your food items...","Analyzing what's in your kitchen...","Identifying those delicious ingredients..."];w(O[y%O.length]);const j=setInterval(()=>{x(A=>A+1)},3e3);return()=>clearInterval(j)},[s,y,a]);const k=O=>{if(O.target.files){const A=Array.from(O.target.files).slice(0,5-t.length);if(A.length===0)return;n(V=>[...V,...A]),d(!1),A.forEach(V=>{const $=new FileReader;$.onload=R=>{i(L=>{var H;return[...L,(H=R.target)==null?void 0:H.result]})},$.readAsDataURL(V)})}},C=O=>{n(j=>j.filter((A,V)=>V!==O)),i(j=>j.filter((A,V)=>V!==O))},P=(O,j)=>{const A=[...new Set(O.map(V=>V.category||"Other"))];E.track("inventory_ingredient_uploaded",{upload_method:"voice",upload_type:"voice",ingredient_count:O.length,categories_affected:A,upload_source:"microphone"}),console.log("Voice ingredients detected:",O),e(O,[],j)},T=O=>{d(!0),g(O),h("Error processing voice input")},N=async()=>{if(t.length===0){console.error("No files selected");return}const O=Date.now();_(O),o(!0),d(!1),E.track("inventory_ingredient_uploaded",{upload_method:a==="food"?"image_food":"image_receipt",upload_type:a,image_count:t.length,upload_source:"gallery"});try{const j=t.map(ne=>Wce(ne,a)),A=await Promise.all(j);if(A.some(ne=>!ne.success))throw new Error("Failed to upload one or more images");const V=A.map(ne=>ne.publicUrl);console.log("Images uploaded. Processing ingredients...");const $=V.map(ne=>qce(ne,a)),R=await Promise.all($);if(R.some(ne=>!ne.success))throw new Error("Failed to process one or more images");if(R.every(ne=>ne.noFoodDetected)){const ne=ffe();g(ne),d(!0),h("No food detected in any of your images"),console.error(ne),o(!1);return}const L=R.flatMap(ne=>ne.detectedIngredients||[]),H=Array.from(L.reduce((ne,ye)=>{const he=ye.name.toLowerCase();return(!ne.has(he)||ye.confidence>ne.get(he).confidence)&&ne.set(he,ye),ne},new Map)).map(([ne,ye])=>ye);console.log(`Found ${H.length} ingredients in your ${a==="receipt"?"receipt":"food images"}.`);const z=Date.now()-b,Q=H.map(ne=>ne.confidence||0),de=[...new Set(H.map(ne=>ne.category||"Other"))];E.track("inventory_ingredient_uploaded",{upload_method:a==="food"?"image_food":"image_receipt",upload_type:a,image_count:t.length,ingredient_count:H.length,processing_time:z,confidence_scores:Q,categories_affected:de,upload_source:"gallery"}),e(H,V,a),n([]),i([])}catch(j){console.error("Error in upload/process:",j);const A=Date.now()-b;E.track("inventory_ingredient_uploaded",{upload_method:a==="food"?"image_food":"image_receipt",upload_type:a,image_count:t.length,processing_time:A,upload_source:"gallery",error_type:j instanceof Error?j.name:"unknown_error",error_message:j instanceof Error?j.message:"Unknown error"}),d(!0)}finally{o(!1)}},I=()=>{d(!1),n([]),i([])};return c.jsxs(di,{className:"w-full",children:[c.jsxs(qa,{children:[c.jsx(Vc,{children:"Add to Your Inventory"}),c.jsx(Rg,{children:"Upload photos of your food, receipts, or tell us what you have."})]}),c.jsx(fi,{children:c.jsxs(A1,{defaultValue:"food",value:a,onValueChange:O=>{l(O),n([]),i([]),d(!1)},className:"w-full",children:[c.jsxs(Lg,{className:"grid w-full grid-cols-3",children:[c.jsxs(go,{value:"food",className:"flex items-center gap-1 px-2 sm:gap-2 sm:px-3",children:[c.jsx(uc,{className:"h-4 w-4"}),c.jsx("span",{className:"text-xs sm:text-sm",children:"Food"})]}),c.jsxs(go,{value:"receipt",className:"flex items-center gap-1 px-2 sm:gap-2 sm:px-3",children:[c.jsx(RK,{className:"h-4 w-4"}),c.jsx("span",{className:"text-xs sm:text-sm",children:"Receipts"})]}),c.jsxs(go,{value:"voice",className:"flex items-center gap-1 px-2 sm:gap-2 sm:px-3",children:[c.jsx(Qp,{className:"h-4 w-4"}),c.jsx("span",{className:"text-xs sm:text-sm",children:"Voice"})]})]}),c.jsx("div",{className:"mt-4",children:u?c.jsx(pfe,{errorMessage:p,onRetry:I,imageType:a}):c.jsx(Lfe,{activeTab:a,selectedFiles:t,imagePreviews:r,onFileChange:k,onRemoveFile:C,onVoiceIngredientsDetected:P,onVoiceError:T,maxFiles:5})})]})}),c.jsxs(bf,{className:"flex flex-col items-center space-y-3",children:[s&&c.jsx("div",{className:"my-2 py-2 px-4 bg-primary/10 rounded-full",children:c.jsx(sS,{className:"[--base-color:#4CAF50] [--base-gradient-color:#2E7D32]",duration:1.5,spread:1.2,children:v||wF(a)})}),!u&&a!=="voice"&&c.jsx(ie,{onClick:N,disabled:t.length===0||s,className:`${S?"w-full":"w-auto"}`,children:s?c.jsxs("div",{className:"flex items-center",children:[c.jsx(Wt,{className:"h-4 w-4 animate-spin"}),c.jsx("span",{className:"ml-2",children:"Processing"})]}):c.jsxs(c.Fragment,{children:[c.jsx(p_,{className:"mr-2 h-4 w-4"}),"Upload & Process ",t.length>1?`(${t.length} images)`:""]})})]})]})};var aS="Collapsible",[$fe,qpe]=Mn(aS),[Ufe,lS]=$fe(aS),RF=m.forwardRef((e,t)=>
539{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:s,onOpenChange:o,...a}=e,[l=!1,u]=Jn({prop:r,defaultProp:i,onChange:o});return c.jsx(Ufe,{scope:n,disabled:s,contentId:Ni(),open:l,onOpenToggle:m.useCallback(()=>u(d=>!d),[u]),children:c.jsx(me.div,{"data-state":uS(l),"data-disabled":s?"":void 0,...a,ref:t})})});RF.displayName=aS;var IF="CollapsibleTrigger",AF=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=lS(IF,n);return c.jsx(me.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":uS(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:se(e.onClick,i.onOpenToggle)})});AF.displayName=IF;var cS="CollapsibleContent",OF=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=lS(cS,e.__scopeCollapsible);return c.jsx(Lt,{present:n||i.open,children:({present:s})=>c.jsx(Vfe,{...r,ref:t,present:s})})});OF.displayName=cS;var Vfe=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...s}=e,o=lS(cS,n),[a,l]=m.useState(r),u=m.useRef(null),d=Le(t,u),f=m.useRef(0),h=f.current,p=m.useRef(0),g=p.current,v=o.open||a,w=m.useRef(v),y=m.useRef();return m.useEffect(()=>{const x=requestAnimationFrame(()=>w.current=!1);return()=>cancelAnimationFrame(x)},[]),Dr(()=>{const x=u.current;if(x){y.current=y.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const b=x.getBoundingClientRect();f.current=b.height,p.current=b.width,w.current||(x.style.transitionDuration=y.current.transitionDuration,x.style.animationName=y.current.animationName),l(r)}},[o.open,r]),c.jsx(me.div,{"data-state":uS(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!v,...s,ref:d,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...e.style},children:v&&i})});function uS(e){return e?"open":"closed"}var zfe=RF;const Bfe=zfe,Wfe=AF,qfe=OF;var dS="Checkbox",[Hfe,Hpe]=Mn(dS),[Gfe,Kfe]=Hfe(dS),DF=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:s,required:o,disabled:a,value:l="on",onCheckedChange:u,form:d,...f}=e,[h,p]=m.useState(null),g=Le(t,_=>p(_)),v=m.useRef(!1),w=h?d||!!h.closest("form"):!0,[y=!1,x]=Jn({prop:i,defaultProp:s,onChange:u}),b=m.useRef(y);return m.useEffect(()=>{const _=h==null?void 0:h.form;if(_){const S=()=>x(b.current);return _.addEventListener("reset",S),()=>_.removeEventListener("reset",S)}},[h,x]),c.jsxs(Gfe,{scope:n,state:y,disabled:a,children:[c.jsx(me.button,{type:"button",role:"checkbox","aria-checked":yo(y)?"mixed":y,"aria-required":o,"data-state":FF(y),"data-disabled":a?"":void 0,disabled:a,value:l,...f,ref:g,onKeyDown:se(e.onKeyDown,_=>{_.key==="Enter"&&_.preventDefault()}),onClick:se(e.onClick,_=>{x(S=>yo(S)?!0:!S),w&&(v.current=_.isPropagationStopped(),v.current||_.stopPropagation())})}),w&&c.jsx(Yfe,{control:h,bubbles:!v.current,name:r,value:l,checked:y,required:o,disabled:a,form:d,style:{transform:"translateX(-100%)"},defaultChecked:yo(s)?!1:s})]})});DF.displayName=dS;var MF="CheckboxIndicator",LF=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,s=Kfe(MF,n);return c.jsx(Lt,{present:r||yo(s.state)||s.state===!0,children:c.jsx(me.span,{"data-state":FF(s.state),"data-disabled":s.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});LF.displayName=MF;var Yfe=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:i,...s}=e,o=m.useRef(null),a=V1(n),l=Eg(t);m.useEffect(()=>{const d=o.current,f=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(f,"checked").set;if(a!==n&&p){const g=new Event("click",{bubbles:r});d.indeterminate=yo(n),p.call(d,yo(n)?!1:n),d.dispatchEvent(g)}},[a,n,r]);const u=m.useRef(yo(n)?!1:n);return c.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i??u.current,...s,tabIndex:-1,ref:o,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function yo(e){return e==="indeterminate"}function FF(e){return yo(e)?"indeterminate":e?"checked":"unchecked"}var $F=DF,Qfe=LF;const Jg=m.forwardRef(({className:e,...t},n)=>c.jsx($F,{ref:n,className:K("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:c.jsx(Qfe,{className:K("flex items-center justify-center text-current"),children:c.jsx(Ra,{className:"h-4 w-4"})})}));Jg.displayName=$F.displayName;const hP=({ingredient:e,index:t,isSelected:n,onToggle:r,onUpdateField:i})=>c.jsxs("div",{className:`flex items-center space-x-2 p-2 transition-colors rounded 
540        hover:bg-accent/30 ${n?"bg-accent/60":""}`,children:[c.jsx(Jg,{id:`ingredient-${t}`,checked:n,onCheckedChange:()=>r(t),className:"mt-0"}),c.jsxs("div",{className:"flex items-center space-x-2 flex-1",children:[c.jsxs("div",{className:"flex space-x-1",children:[c.jsx(Pn,{type:"text",value:e.quantity,onChange:s=>i(t,"quantity",s.target.value),className:"h-7 text-xs rounded-md w-[50px]",placeholder:"Qty"}),c.jsx(Pn,{type:"text",value:e.unit||"",onChange:s=>i(t,"unit",s.target.value),className:"h-7 text-xs rounded-md w-[100px]",placeholder:"--"})]}),c.jsx(_a,{orientation:"vertical",className:"h-5"}),c.jsx("label",{htmlFor:`ingredient-${t}`,className:"text-sm font-medium leading-none cursor-pointer ml-1 flex-1",children:e.name})]})]}),Xfe=({category:e,ingredients:t,selectedIngredients:n,originalIndices:r,onToggleIngredient:i,onUpdateIngredientField:s})=>{const[o,a]=m.useState(!0),l=an(),u=bF(e);return l?c.jsxs(Bfe,{open:o,onOpenChange:a,className:"border rounded-md overflow-hidden mb-2",children:[c.jsxs("div",{className:"flex justify-between items-center bg-muted/50 px-3 py-2",children:[c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx(u,{className:"h-4 w-4 text-primary"}),c.jsxs("h3",{className:"font-medium text-sm",children:[e," (",t.length,")"]})]}),c.jsx(Wfe,{asChild:!0,className:"p-1",children:c.jsx("button",{className:"focus:outline-none",children:c.jsx(u_,{className:`h-4 w-4 transition-transform duration-200 ${o?"transform rotate-180":""}`})})})]}),c.jsx(qfe,{className:"duration-300",children:c.jsx("div",{className:"space-y-1 p-1",children:t.map((d,f)=>c.jsx(hP,{ingredient:d,index:r[f],isSelected:n.has(r[f]),onToggle:i,onUpdateField:s},r[f]))})})]}):c.jsxs("div",{className:"border rounded-md overflow-hidden mb-2",children:[c.jsx("div",{className:"bg-muted/50 px-3 py-2",children:c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx(u,{className:"h-4 w-4 text-primary"}),c.jsxs("h3",{className:"font-medium text-sm",children:[e," (",t.length,")"]})]})}),c.jsx("div",{className:"space-y-1 p-1",children:t.map((d,f)=>c.jsx(hP,{ingredient:d,index:r[f],isSelected:n.has(r[f]),onToggle:i,onUpdateField:s},r[f]))})]})},Zfe=({ingredients:e,selectedIngredients:t,error:n,onToggleIngredient:r,onUpdateIngredientField:i,onSelectAll:s,onDeselectAll:o})=>{const a=m.useMemo(()=>{const l={};return e.forEach((u,d)=>{const f=u.category||"Other";l[f]||(l[f]={ingredients:[],indices:[]}),l[f].ingredients.push(u),l[f].indices.push(d)}),Object.entries(l).sort((u,d)=>u[0].localeCompare(d[0]))},[e]);return c.jsxs("div",{className:"md:w-2/3 space-y-4",children:[c.jsxs("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-center gap-2",children:[c.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"We detected the following ingredients. Uncheck any items you don't want to add."}),c.jsxs("div",{className:"flex gap-2 shrink-0",children:[c.jsx(ie,{variant:"outline",size:"sm",onClick:s,className:"text-xs",children:"Select All"}),c.jsx(ie,{variant:"outline",size:"sm",onClick:o,className:"text-xs",children:"Deselect All"})]})]}),n&&c.jsxs(Pf,{variant:"destructive",className:"mt-2",children:[c.jsx(pK,{className:"h-4 w-4"}),c.jsx(Nf,{children:n})]}),c.jsx("div",{className:"space-y-2 max-h-[calc(100vh-14rem)] overflow-y-auto pr-2",children:a.map(([l,{ingredients:u,indices:d}])=>c.jsx(Xfe,{category:l,ingredients:u,selectedIngredients:t,originalIndices:d,onToggleIngredient:r,onUpdateIngredientField:i},l))})]})};var UF="AlertDialog",[Jfe,Gpe]=Mn(UF,[QA]),bs=QA(),VF=e=>{const{__scopeAlertDialog:t,...n}=e,r=bs(t);return c.jsx(yg,{...r,...n,modal:!0})};VF.displayName=UF;var ehe="AlertDialogTrigger",the=m.forwardRef((e,t)=>
540{const{__scopeAlertDialog:n,...r}=e,i=bs(n);return c.jsx(k_,{...i,...r,ref:t})});the.displayName=ehe;var nhe="AlertDialogPortal",zF=e=>{const{__scopeAlertDialog:t,...n}=e,r=bs(t);return c.jsx(xg,{...r,...n})};zF.displayName=nhe;var rhe="AlertDialogOverlay",BF=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=bs(n);return c.jsx(Oc,{...i,...r,ref:t})});BF.displayName=rhe;var zl="AlertDialogContent",[ihe,she]=Jfe(zl),WF=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,s=bs(n),o=m.useRef(null),a=Le(t,o),l=m.useRef(null);return c.jsx(FQ,{contentName:zl,titleName:qF,docsSlug:"alert-dialog",children:c.jsx(ihe,{scope:n,cancelRef:l,children:c.jsxs(Dc,{role:"alertdialog",...s,...i,ref:a,onOpenAutoFocus:se(i.onOpenAutoFocus,u=>{var d;u.preventDefault(),(d=l.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[c.jsx(m_,{children:r}),c.jsx(ahe,{contentRef:o})]})})})});WF.displayName=zl;var qF="AlertDialogTitle",HF=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=bs(n);return c.jsx(Mc,{...i,...r,ref:t})});HF.displayName=qF;var GF="AlertDialogDescription",KF=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=bs(n);return c.jsx(Lc,{...i,...r,ref:t})});KF.displayName=GF;var ohe="AlertDialogAction",YF=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=bs(n);return c.jsx(vf,{...i,...r,ref:t})});YF.displayName=ohe;var QF="AlertDialogCancel",XF=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=she(QF,n),s=bs(n),o=Le(t,i);return c.jsx(vf,{...s,...r,ref:o})});XF.displayName=QF;var ahe=({contentRef:e})=>{const t=`\`${zl}\` requires a description for the component to be accessible for screen reader users.
541
542You can add a description to the \`${zl}\` by passing a \`${GF}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
543
544Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${zl}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
545
546For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return m.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},lhe=VF,che=zF,ZF=BF,JF=WF,e$=YF,t$=XF,n$=HF,r$=KF;const Lw=lhe,uhe=che,i$=m.forwardRef(({className:e,...t},n)=>c.jsx(ZF,{className:K("fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));i$.displayName=ZF.displayName;const jm=m.forwardRef(({className:e,...t},n)=>c.jsxs(uhe,{children:[c.jsx(i$,{}),c.jsx(JF,{ref:n,className:K("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));jm.displayName=JF.displayName;const Pm=({className:e,...t})=>c.jsx("div",{className:K("flex flex-col space-y-2 text-center sm:text-left",e),...t});Pm.displayName="AlertDialogHeader";const Nm=({className:e,...t})=>c.jsx("div",{className:K("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Nm.displayName="AlertDialogFooter";const Rm=m.forwardRef(({className:e,...t},n)=>c.jsx(n$,{ref:n,className:K("text-lg font-semibold",e),...t}));Rm.displayName=n$.displayName;const Im=m.forwardRef(({className:e,...t},n)=>c.jsx(r$,{ref:n,className:K("text-sm text-muted-foreground",e),...t}));Im.displayName=r$.displayName;const Am=m.forwardRef(({className:e,...t},n)=>c.jsx(e$,{ref:n,className:K(v_(),e),...t}));Am.displayName=e$.displayName;const Om=m.forwardRef(({className:e,...t},n)=>c.jsx(t$,{ref:n,className:K(v_({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Om.displayName=t$.displayName;const pP=({onCancel:e,onConfirm:t,isAdding:n,isMobile:r})=>{const[i,s]=m.useState(!1),o=an(),a=r!==void 0?r:o,l=()=>{s(!0)},u=()=>{s(!1),e()};return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:`flex flex-col gap-3 w-full ${a?"sticky bottom-0 bg-background p-4 border-t shadow-[0_-4px_10px_rgba(0,0,0,0.05)] z-10":""}`,children:[c.jsxs(ie,{variant:"outline",onClick:l,className:"w-full",children:[c.jsx(Di,{className:"h-4 w-4 mr-2"}),"Discard & Go Back"]}),c.jsx(ie,{onClick:t,disabled:n,className:"w-full",children:n?c.jsxs(c.Fragment,{children:[c.jsx(Wt,{className:"h-4 w-4 mr-2 animate-spin"}),"Adding..."]}):c.jsxs(c.Fragment,{children:[c.jsx(Ra,{className:"h-4 w-4 mr-2"}),"Add to Inventory"]})})]}),c.jsx(Lw,{open:i,onOpenChange:s,children:c.jsxs(jm,{children:[c.jsxs(Pm,{children:[c.jsx(Rm,{children:"Discard this scan?"}),c.jsx(Im,{children:"Are you sure you want to discard this scan? Your detected ingredients will not be saved."})]}),c.jsxs(Nm,{children:[c.jsx(Om,{children:"Cancel"}),c.jsx(Am,{onClick:u,children:"Yes, discard"})]})]})})]})};function dhe(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const s$=F.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{}
546,openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),Gc=()=>{const e=F.useContext(s$);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};dhe(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,100%,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,-100%,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(-100%,0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(100%,0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
547[data-state=closed]
548){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;
548left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,100%,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,100%,0)}}@keyframes slideFromTop{from{transform:translate3d(0,-100%,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,-100%,0)}}@keyframes slideFromLeft{from{transform:translate3d(-100%,0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(-100%,0,0)}}@keyframes slideFromRight{from{transform:translate3d(100%,0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(100%,0,0)}}`);const fhe=24,hhe=typeof window<"u"?m.useLayoutEffect:m.useEffect;function mP(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}function phe(){return fS(/^Mac/)}function mhe(){return fS(/^iPhone/)}function gP(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function ghe(){return fS(/^iPad/)||phe()&&navigator.maxTouchPoints>1}function o$(){return mhe()||ghe()}function fS(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const By=typeof document<"u"&&window.visualViewport;function vP(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function a$(e){for(vP(e)&&(e=e.parentElement);e&&!vP(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const vhe=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let jh=0,Wy;function yhe(e={}){let{isDisabled:t}=e;hhe(()=>{if(!t)return jh++,jh===1&&o$()&&(Wy=xhe()),()=>{jh--,jh===0&&(Wy==null||Wy())}},[t])}function xhe(){let e,t=0,n=f=>{e=a$(f.target),!(e===document.documentElement&&e===document.body)&&(t=f.changedTouches[0].pageY)},r=f=>{if(!e||e===document.documentElement||e===document.body){f.preventDefault();return}let h=f.changedTouches[0].pageY,p=e.scrollTop,g=e.scrollHeight-e.clientHeight;g!==0&&((p<=0&&h>t||p>=g&&h<t)&&f.preventDefault(),t=h)},i=f=>{let h=f.target;Fw(h)&&h!==document.activeElement&&(f.preventDefault(),h.style.transform="translateY(-2000px)",h.focus(),requestAnimationFrame(()=>{h.style.transform=""}))},s=f=>{let h=f.target;Fw(h)&&(h.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{h.style.transform="",By&&(By.height<window.innerHeight?requestAnimationFrame(()=>{yP(h)}):By.addEventListener("resize",()=>yP(h),{once:!0}))}))},o=()=>{window.scrollTo(0,0)},a=window.pageXOffset,l=window.pageYOffset,u=mP(whe(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let d=mP(mu(document,"touchstart",n,{passive:!1,capture:!0}),mu(document,"touchmove",r,{passive:!1,capture:!0}),mu(document,"touchend",i,{passive:!1,capture:!0}),mu(document,"focus",s,!0),mu(window,"scroll",o));return()=>{u(),d(),window.scrollTo(a,l)}}function whe(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function mu(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function yP(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let n=a$(e);if(n!==document.documentElement&&n!==document.body&&n!==e){let r=n.getBoundingClientRect().top,i=e.getBoundingClientRect().top,s=e.getBoundingClientRect().bottom;const o=n.getBoundingClientRect().bottom+fhe;s>o&&(n.scrollTop+=i-r)}e=n.parentElement}}function Fw(e){return e instanceof HTMLInputElement&&!vhe.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function bhe(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function _he(...e){return t=>e.forEach(n=>bhe(n,t))}function l$(...e){return m.useCallback(_he(...e),e)}const c$=new WeakMap;function $t(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([i,s])=>{if(i.startsWith("--")){e.style.setProperty(i,s);return}r[i]=e.style[i],e.style[i]=s}
548),!n&&c$.set(e,r)}function She(e,t){if(!e||!(e instanceof HTMLElement))return;let n=c$.get(e);n&&(e.style[t]=n[t])}const Ut=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function Ph(e,t){if(!e)return null;const n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform;let i=r.match(/^matrix3d\((.+)\)$/);return i?parseFloat(i[1].split(", ")[Ut(t)?13:12]):(i=r.match(/^matrix\((.+)\)$/),i?parseFloat(i[1].split(", ")[Ut(t)?5:4]):null)}function Ehe(e){return 8*(Math.log(e+1)-2)}function qy(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}function khe(...e){return(...t)=>{for(const n of e)typeof n=="function"&&n(...t)}}const ht={DURATION:.5,EASE:[.32,.72,0,1]},u$=.4,Che=.25,The=100,d$=8,Ho=16,$w=26,Hy="vaul-dragging";function f$(e){const t=F.useRef(e);return F.useEffect(()=>{t.current=e}),F.useMemo(()=>(...n)=>t.current==null?void 0:t.current.call(t,...n),[])}function jhe({defaultProp:e,onChange:t}){const n=F.useState(e),[r]=n,i=F.useRef(r),s=f$(t);return F.useEffect(()=>{i.current!==r&&(s(r),i.current=r)},[r,i,s]),n}function h$({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=jhe({defaultProp:t,onChange:n}),s=e!==void 0,o=s?e:r,a=f$(n),l=F.useCallback(u=>{if(s){const f=typeof u=="function"?u(e):u;f!==e&&a(f)}else i(u)},[s,e,i,a]);return[o,l]}function Phe({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:r,overlayRef:i,fadeFromIndex:s,onSnapPointChange:o,direction:a="bottom",container:l,snapToSequentialPoint:u}){const[d,f]=h$({prop:e,defaultProp:n==null?void 0:n[0],onChange:t}),[h,p]=F.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);F.useEffect(()=>{function k(){p({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",k),()=>window.removeEventListener("resize",k)},[]);const g=F.useMemo(()=>d===(n==null?void 0:n[n.length-1])||null,[n,d]),v=F.useMemo(()=>n==null?void 0:n.findIndex(k=>k===d),[n,d]),w=n&&n.length>0&&(s||s===0)&&!Number.isNaN(s)&&n[s]===d||!n,y=F.useMemo(()=>{const k=l?{width:l.getBoundingClientRect().width,height:l.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var C;return(C=n==null?void 0:n.map(P=>{const T=typeof P=="string";let N=0;if(T&&(N=parseInt(P,10)),Ut(a)){const O=T?N:h?P*k.height:0;return h?a==="bottom"?k.height-O:-k.height+O:O}const I=T?N:h?P*k.width:0;return h?a==="right"?k.width-I:-k.width+I:I}))!=null?C:[]},[n,h,l]),x=F.useMemo(()=>v!==null?y==null?void 0:y[v]:null,[y,v]),b=F.useCallback(k=>{var C;const P=(C=y==null?void 0:y.findIndex(T=>T===k))!=null?C:null;o(P),$t(r.current,{transition:`transform ${ht.DURATION}s cubic-bezier(${ht.EASE.join(",")})`,transform:Ut(a)?`translate3d(0, ${k}px, 0)`:`translate3d(${k}px, 0, 0)`}),y&&P!==y.length-1&&P!==s&&P<s?$t(i.current,{transition:`opacity ${ht.DURATION}s cubic-bezier(${ht.EASE.join(",")})`,opacity:"0"}):$t(i.current,{transition:`opacity ${ht.DURATION}s cubic-bezier(${ht.EASE.join(",")})`,opacity:"1"}),f(n==null?void 0:n[Math.max(P,0)])},[r.current,n,y,s,i,f]);F.useEffect(()=>{if(d||e){var k;const C=(k=n==null?void 0:n.findIndex(P=>P===e||P===d))!=null?k:-1;y&&C!==-1&&typeof y[C]=="number"&&b(y[C])}},[d,e,n,y,b]);function _({draggedDistance:k,closeDrawer:C,velocity:P,dismissible:T}){if(s===void 0)return;const N=a==="bottom"||a==="right"?(x??0)-k:(x??0)+k,I=v===s-1,O=v===0,j=k>0;if(I&&$t(i.current,{transition:`opacity ${ht.DURATION}s cubic-bezier(${ht.EASE.join(",")})`}),!u&&P>2&&!j){T?C():b(y[0]);return}if(!u&&P>2&&j&&y&&n){b(y[n.length-1]);return}const A=y==null?void 0:y.reduce(($,R)=>typeof $!="number"||typeof R!="number"?$:Math.abs(R-N)<Math.abs($-N)?R:$),V=Ut(a)?window.innerHeight:window.innerWidth;if(P>u$&&Math.abs(k)<V*.4){const $=j?1:-1;if($>0&&g){b(y[n.length-1]);return}if(O&&$<0&&T&&C(),v===null)return;b(y[v+$]);return}b(A)}function S({draggedDistance:k}){if(x===null)return;const C=a==="bottom"||a==="right"?x-k:x+k;(a==="bottom"||a==="right")&&C<y[y.length-1]||(a==="top"||a==="left")&&C>y[y.length-1]||$t(r.current,{transform:Ut(a)?`translate3d(0, ${C}px, 0)`:`translate3d(${C}px, 0, 0)`})}function E(k,C){if(!n||typeof v!="number"||!y||s===void 0)return null;const P=v===s-1;if(v>=s&&C)return 0;if(P&&!C)return 1;if(!w&&!P)return null;const N=P?v+1:v-1,I=P?y[N]-y[N-1]:y[N+1]-y[N],O=k/Math.abs(I);return P?1-O:O}return{isLastSnapPoint:g,activeSnapPoint:d,shouldFade:w,getPercentageDragged:E,setActiveSnapPoint:f,activeSnapPointIndex:v,onRelease:_,onDrag:S,snapPointsOffset:y}}const Nhe=()=>()=>{};
548function Rhe(){const{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:i}=Gc(),s=F.useRef(null),o=m.useMemo(()=>document.body.style.backgroundColor,[]);function a(){return(window.innerWidth-$w)/window.innerWidth}F.useEffect(()=>{if(t&&n){s.current&&clearTimeout(s.current);const l=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!l)return;khe(r&&!i?qy(document.body,{background:"black"}):Nhe,qy(l,{transformOrigin:Ut(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${ht.DURATION}s`,transitionTimingFunction:`cubic-bezier(${ht.EASE.join(",")})`}));const u=qy(l,{borderRadius:`${d$}px`,overflow:"hidden",...Ut(e)?{transform:`scale(${a()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${a()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{u(),s.current=window.setTimeout(()=>{o?document.body.style.background=o:document.body.style.removeProperty("background")},ht.DURATION*1e3)}}},[t,n,o])}let gu=null;function Ihe({isOpen:e,modal:t,nested:n,hasBeenOpened:r,preventScrollRestoration:i,noBodyStyles:s}){const[o,a]=F.useState(()=>typeof window<"u"?window.location.href:""),l=F.useRef(0),u=F.useCallback(()=>{if(gP()&&gu===null&&e&&!s){gu={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:f,innerHeight:h}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-l.current}px`,left:`${-f}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const p=h-window.innerHeight;p&&l.current>=h&&(document.body.style.top=`${-(l.current+p)}px`)}),300)}},[e]),d=F.useCallback(()=>{if(gP()&&gu!==null&&!s){const f=-parseInt(document.body.style.top,10),h=-parseInt(document.body.style.left,10);Object.assign(document.body.style,gu),window.requestAnimationFrame(()=>{if(i&&o!==window.location.href){a(window.location.href);return}window.scrollTo(h,f)}),gu=null}},[o]);return F.useEffect(()=>{function f(){l.current=window.scrollY}return f(),window.addEventListener("scroll",f),()=>{window.removeEventListener("scroll",f)}},[]),F.useEffect(()=>{n||!r||(e?(!window.matchMedia("(display-mode: standalone)").matches&&u(),t||window.setTimeout(()=>{d()},500)):d())},[e,r,o,t,n,u,d]),{restorePositionSetting:d}}function p$({open:e,onOpenChange:t,children:n,onDrag:r,onRelease:i,snapPoints:s,shouldScaleBackground:o=!1,setBackgroundColorOnScale:a=!0,closeThreshold:l=Che,scrollLockTimeout:u=The,dismissible:d=!0,handleOnly:f=!1,fadeFromIndex:h=s&&s.length-1,activeSnapPoint:p,setActiveSnapPoint:g,fixed:v,modal:w=!0,onClose:y,nested:x,noBodyStyles:b,direction:_="bottom",defaultOpen:S=!1,disablePreventScroll:E=!0,snapToSequentialPoint:k=!1,preventScrollRestoration:C=!1,repositionInputs:P=!0,onAnimationEnd:T,container:N,autoFocus:I=!1}){var O,j;const[A=!1,V]=h$({defaultProp:S,prop:e,onChange:ee=>{t==null||t(ee),!ee&&!x&&je(),setTimeout(()=>{T==null||T(ee)},ht.DURATION*1e3),ee&&!w&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),ee||(document.body.style.pointerEvents="auto")}}),[$,R]=F.useState(!1),[L,H]=F.useState(!1),[z,Q]=F.useState(!1),de=F.useRef(null),ne=F.useRef(null),ye=F.useRef(null),he=F.useRef(null),Pe=F.useRef(null),Ue=F.useRef(!1),Ae=F.useRef(null),Fe=F.useRef(0),wt=F.useRef(!1),jt=F.useRef(0),xe=F.useRef(null),qt=F.useRef(((O=xe.current)==null?void 0:O.getBoundingClientRect().height)||0),Fr=F.useRef(((j=xe.current)==null?void 0:j.getBoundingClientRect().width)||0),ln=F.useRef(0),er=F.useCallback(ee=>{s&&ee===re.length-1&&(ne.current=new Date)},[]),{activeSnapPoint:D,activeSnapPointIndex:U,setActiveSnapPoint:B,onRelease:ae,snapPointsOffset:re,onDrag:X,shouldFade:G,getPercentageDragged:J}=Phe({snapPoints:s,activeSnapPointProp:p,setActiveSnapPointProp:g,drawerRef:xe,fadeFromIndex:h,overlayRef:de,onSnapPointChange:er,direction:_,container:N,snapToSequentialPoint:k});yhe({isDisabled:!A||L||!w||z||!$||!P||!E});const{restorePositionSetting:je}=Ihe({isOpen:A,modal:w,nested:x,hasBeenOpened:$,preventScrollRestoration:C,noBodyStyles:b});function Se(){return(window.innerWidth-$w)/window.innerWidth}function nt(ee){var ve,be;!d&&!s||xe.current&&!xe.current.contains(ee.target)||(qt.current=((ve=xe.current)==null?void 0:ve.getBoundingClientRect().height)||0,Fr.current=((be=xe.current)==null?void 0:be.getBoundingClientRect().width)||0,H(!0),ye.current=ne
548w Date,o$()&&window.addEventListener("touchend",()=>Ue.current=!1,{once:!0}),ee.target.setPointerCapture(ee.pointerId),Fe.current=Ut(_)?ee.pageY:ee.pageX)}function Jt(ee,ve){var be,Be;let $e=ee;const en=(be=window.getSelection())==null?void 0:be.toString(),tn=xe.current?Ph(xe.current,_):null,tr=new Date;if($e.hasAttribute("data-vaul-no-drag")||$e.closest("[data-vaul-no-drag]"))return!1;if(_==="right"||_==="left")return!0;if(ne.current&&tr.getTime()-ne.current.getTime()<500)return!1;if(tn!==null&&(_==="bottom"?tn>0:tn<0))return!0;if(en&&en.length>0)return!1;if(tr.getTime()-((Be=Pe.current)==null?void 0:Be.getTime())<u&&tn===0||ve)return Pe.current=tr,!1;for(;$e;){if($e.scrollHeight>$e.clientHeight){if($e.scrollTop!==0)return Pe.current=new Date,!1;if($e.getAttribute("role")==="dialog")return!0}$e=$e.parentNode}return!0}function bn(ee){if(xe.current&&L){const ve=_==="bottom"||_==="right"?1:-1,be=(Fe.current-(Ut(_)?ee.pageY:ee.pageX))*ve,Be=be>0,$e=s&&!d&&!Be;if($e&&U===0)return;const en=Math.abs(be),tn=document.querySelector("[data-vaul-drawer-wrapper]"),tr=_==="bottom"||_==="top"?qt.current:Fr.current;let Vr=en/tr;const Bo=J(en,Be);if(Bo!==null&&(Vr=Bo),$e&&Vr>=1||!Ue.current&&!Jt(ee.target,Be))return;if(xe.current.classList.add(Hy),Ue.current=!0,$t(xe.current,{transition:"none"}),$t(de.current,{transition:"none"}),s&&X({draggedDistance:be}),Be&&!s){const gi=Ehe(be),Rf=Math.min(gi*-1,0)*ve;$t(xe.current,{transform:Ut(_)?`translate3d(0, ${Rf}px, 0)`:`translate3d(${Rf}px, 0, 0)`});return}const _s=1-Vr;if((G||h&&U===h-1)&&(r==null||r(ee,Vr),$t(de.current,{opacity:`${_s}`,transition:"none"},!0)),tn&&de.current&&o){const gi=Math.min(Se()+Vr*(1-Se()),1),Rf=8-Vr*8,yS=Math.max(0,14-Vr*14);$t(tn,{borderRadius:`${Rf}px`,transform:Ut(_)?`scale(${gi}) translate3d(0, ${yS}px, 0)`:`scale(${gi}) translate3d(${yS}px, 0, 0)`,transition:"none"},!0)}if(!s){const gi=en*ve;$t(xe.current,{transform:Ut(_)?`translate3d(0, ${gi}px, 0)`:`translate3d(${gi}px, 0, 0)`})}}}F.useEffect(()=>{var ee;function ve(){if(!xe.current||!P)return;const be=document.activeElement;if(Fw(be)||wt.current){var Be;const $e=((Be=window.visualViewport)==null?void 0:Be.height)||0,en=window.innerHeight;let tn=en-$e;const tr=xe.current.getBoundingClientRect().height||0,Vr=tr>en*.8;ln.current||(ln.current=tr);const Bo=xe.current.getBoundingClientRect().top;if(Math.abs(jt.current-tn)>60&&(wt.current=!wt.current),s&&s.length>0&&re&&U){const _s=re[U]||0;tn+=_s}if(jt.current=tn,tr>$e||wt.current){const _s=xe.current.getBoundingClientRect().height;let gi=_s;_s>$e&&(gi=$e-(Vr?Bo:$w)),v?xe.current.style.height=`${_s-Math.max(tn,0)}px`:xe.current.style.height=`${Math.max(gi,$e-Bo)}px`}else xe.current.style.height=`${ln.current}px`;s&&s.length>0&&!wt.current?xe.current.style.bottom="0px":xe.current.style.bottom=`${Math.max(tn,0)}px`}}return(ee=window.visualViewport)==null||ee.addEventListener("resize",ve),()=>{var be;return(be=window.visualViewport)==null?void 0:be.removeEventListener("resize",ve)}},[U,s,re]);function _n(ee){Ur(),y==null||y(),ee||V(!1),setTimeout(()=>{s&&B(s[0])},ht.DURATION*1e3)}function $r(){if(!xe.current)return;const ee=document.querySelector("[data-vaul-drawer-wrapper]"),ve=Ph(xe.current,_);$t(xe.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${ht.DURATION}s cubic-bezier(${ht.EASE.join(",")})`}),$t(de.current,{transition:`opacity ${ht.DURATION}s cubic-bezier(${ht.EASE.join(",")})`,opacity:"1"}),o&&ve&&ve>0&&A&&$t(ee,{borderRadius:`${d$}px`,overflow:"hidden",...Ut(_)?{transform:`scale(${Se()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${Se()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${ht.DURATION}s`,transitionTimingFunction:`cubic-bezier(${ht.EASE.join(",")})`},!0)}function Ur(){!L||!xe.current||(xe.current.classList.remove(Hy),Ue.current=!1,H(!1),he.current=new Date)}function mi(ee){if(!L||!xe.current)return;xe.current.classList.remove(Hy),Ue.current=!1,H(!1),he.current=new Date;const ve=Ph(xe.current,_);
548if(!Jt(ee.target,!1)||!ve||Number.isNaN(ve)||ye.current===null)return;const be=he.current.getTime()-ye.current.getTime(),Be=Fe.current-(Ut(_)?ee.pageY:ee.pageX),$e=Math.abs(Be)/be;if($e>.05&&(Q(!0),setTimeout(()=>{Q(!1)},200)),s){ae({draggedDistance:Be*(_==="bottom"||_==="right"?1:-1),closeDrawer:_n,velocity:$e,dismissible:d}),i==null||i(ee,!0);return}if(_==="bottom"||_==="right"?Be>0:Be<0){$r(),i==null||i(ee,!0);return}if($e>u$){_n(),i==null||i(ee,!1);return}var en;const tn=Math.min((en=xe.current.getBoundingClientRect().height)!=null?en:0,window.innerHeight);var tr;const Vr=Math.min((tr=xe.current.getBoundingClientRect().width)!=null?tr:0,window.innerWidth),Bo=_==="left"||_==="right";if(Math.abs(ve)>=(Bo?Vr:tn)*l){_n(),i==null||i(ee,!1);return}i==null||i(ee,!0),$r()}F.useEffect(()=>(A&&($t(document.documentElement,{scrollBehavior:"auto"}),ne.current=new Date),()=>{She(document.documentElement,"scrollBehavior")}),[A]);function yr(ee){const ve=ee?(window.innerWidth-Ho)/window.innerWidth:1,be=ee?-Ho:0;Ae.current&&window.clearTimeout(Ae.current),$t(xe.current,{transition:`transform ${ht.DURATION}s cubic-bezier(${ht.EASE.join(",")})`,transform:`scale(${ve}) translate3d(0, ${be}px, 0)`}),!ee&&xe.current&&(Ae.current=setTimeout(()=>{const Be=Ph(xe.current,_);$t(xe.current,{transition:"none",transform:Ut(_)?`translate3d(0, ${Be}px, 0)`:`translate3d(${Be}px, 0, 0)`})},500))}function Fn(ee,ve){if(ve<0)return;const be=(window.innerWidth-Ho)/window.innerWidth,Be=be+ve*(1-be),$e=-Ho+ve*Ho;$t(xe.current,{transform:Ut(_)?`scale(${Be}) translate3d(0, ${$e}px, 0)`:`scale(${Be}) translate3d(${$e}px, 0, 0)`,transition:"none"})}function zo(ee,ve){const be=Ut(_)?window.innerHeight:window.innerWidth,Be=ve?(be-Ho)/be:1,$e=ve?-Ho:0;ve&&$t(xe.current,{transition:`transform ${ht.DURATION}s cubic-bezier(${ht.EASE.join(",")})`,transform:Ut(_)?`scale(${Be}) translate3d(0, ${$e}px, 0)`:`scale(${Be}) translate3d(${$e}px, 0, 0)`})}return F.createElement(yg,{defaultOpen:S,onOpenChange:ee=>{!d&&!ee||(ee?R(!0):_n(!0),V(ee))},open:A},F.createElement(s$.Provider,{value:{activeSnapPoint:D,snapPoints:s,setActiveSnapPoint:B,drawerRef:xe,overlayRef:de,onOpenChange:t,onPress:nt,onRelease:mi,onDrag:bn,dismissible:d,handleOnly:f,isOpen:A,isDragging:L,shouldFade:G,closeDrawer:_n,onNestedDrag:Fn,onNestedOpenChange:yr,onNestedRelease:zo,keyboardIsOpen:wt,modal:w,snapPointsOffset:re,direction:_,shouldScaleBackground:o,setBackgroundColorOnScale:a,noBodyStyles:b,container:N,autoFocus:I}},n))}const m$=F.forwardRef(function({...e},t){const{overlayRef:n,snapPoints:r,onRelease:i,shouldFade:s,isOpen:o,modal:a}=Gc(),l=l$(t,n),u=r&&r.length>0;return a?F.createElement(Oc,{onMouseUp:i,ref:l,"data-vaul-overlay":"","data-vaul-snap-points":o&&u?"true":"false","data-vaul-snap-points-overlay":o&&s?"true":"false",...e}):(typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),null)});m$.displayName="Drawer.Overlay";const g$=F.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...r},i){const{drawerRef:s,onPress:o,onRelease:a,onDrag:l,keyboardIsOpen:u,snapPointsOffset:d,modal:f,isOpen:h,direction:p,snapPoints:g,container:v,handleOnly:w,autoFocus:y}=Gc(),[x,b]=F.useState(!1),_=l$(i,s),S=F.useRef(null),E=F.useRef(null),k=F.useRef(!1),C=g&&g.length>0;Rhe();const P=(N,I,O=0)=>{if(k.current)return!0;const j=Math.abs(N.y),A=Math.abs(N.x),V=A>j,$=["bottom","right"].includes(I)?1:-1;if(I==="left"||I==="right"){if(!(N.x*$<0)&&A>=0&&A<=O)return V}else if(!(N.y*$<0)&&j>=0&&j<=O)return!V;return k.current=!0,!0};F.useEffect(()=>{C&&window.requestAnimationFrame(()=>{b(!0)})},[]);function T(N){S.current=null,k.current=!1,a(N)}return F.createElement(Dc,{"data-vaul-drawer-direction":p,"data-vaul-drawer":"","data-vaul-delayed-snap-points":x?"true":"false","data-vaul-snap-points":h&&C?"true":"false","data-vaul-custom-container":v?"true":"false",...r,ref:_,style:d&&d.length>0?{"--snap-point-height":`${d[0]}px`,...t}:t,onPointerDown:N=>{w||(r.onPointerDown==null||r.onPointerDown.call(r,N),S.current={x:N.pageX,y:N.pageY},o(N))},onOpenAutoFocus:N=>{n==null||n(N),y||N.preventDefault()},onPointerDownOutside:N=>{if(e==null||e(N),!f||N.defaultPrevented){N.preventDefault();return}u.current&&(u.current=!1)},onFocusOutside:N=>{if(!f){N.preventDefault();return}},onPointerMove:N=>{if(E.current=N,w||(r.onPointerMove==null||r.onPointerMove.call(r,N),!S.current))return;const I=N.pageY-S.current.y,O=N.pageX-S.current.x,j=N.pointerType==="touch"?10:2;P({x:O,y:I},p,j)?l(N):(Math.abs(O)>j||Math.abs(I)>j)&&(S.current=null)},onPointerUp:N=>{r.onPointerUp==null||r.onPointerUp.call(r,N),S.current=null,k.current=!1,a(N)},onPointerOut:N=>{r.onPointerOut==null||r.onPointerOut.call(r,N),T(E.current)},onContextMenu:N=>{r.onContextMenu==null||r.onContextMenu.call(r,N),T(E.current)}})});g$.displayName="Drawer.Content";const Ahe=250,Ohe=120,v$=F.forwardRef(function({preventCycle:e=!1,children:t,...n},r){const{closeDrawer:i,isDragging:s,snapPoints:o,activeSnapPoint:a,setActiveSnapPoint:l,dismissible:u,handleOnly:d,isOpen:f,onPress:h,onDrag:p}=Gc(),g=F.useRef(null),v=F.useRef(!1);function w(){if(v.current){b();return}window.setTimeout(()=>{y()},Ohe)}function y(){if(s||e||v.current){b();return}if(b(),(!o||o.length===0)&&u){i();return}if(a===o[o.length-1]&&u){i();return}const S=o.findIndex(k=>k===a);if(S===-1)return;const E=o[S+1];l(E)}function x(){g.current=window.setTimeout(()=>{v.current=!0},Ahe)}function b(){window.clearTimeout(g.current),v.current=!1}return F.createElement("div",{onClick:w,onPointerCancel:b,onPointerDown:_=>{d&&h(_),x()},onPointerMove:_=>{d&&p(_)},ref:r,"data-vaul-drawer-visible":f?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},F.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});v$.displayName="Drawer.Handle";function Dhe({onDrag:e,onOpenChange:t,...n}){const{onNestedDrag:r,onNestedOpenChange:i,onNestedRelease:s}=Gc();if(!r)throw new Error("Drawer.NestedRoot must be placed in another drawer");return F.createElement(p$,{nested:!0,onClose:()=>{i(!1)},onDrag:(o,a)=>{r(o,a),e==null||e(o,a)},onOpenChange:o=>{o&&i(o)},onRelease:s,...n})}function Mhe(e){const t=Gc(),{container:n=t.container,...r}=e;return F.createElement(xg,{container:n,...r})}const pi={Root:p$,NestedRoot:Dhe,Content:g$,Overlay:m$,Trigger:k_,Portal:Mhe,Handle:v$,Close:vf,Title:Mc,Description:Lc}
548,y$=({shouldScaleBackground:e=!0,...t})=>c.jsx(pi.Root,{shouldScaleBackground:e,...t});y$.displayName="Drawer";const Lhe=pi.Trigger,Fhe=pi.Portal,$he=pi.Close,x$=m.forwardRef(({className:e,...t},n)=>c.jsx(pi.Overlay,{ref:n,className:K("fixed inset-0 z-50 bg-black/80",e),...t}));x$.displayName=pi.Overlay.displayName;const w$=m.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(Fhe,{children:[c.jsx(x$,{}),c.jsxs(pi.Content,{ref:r,className:K("fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",e),...n,children:[c.jsx("div",{className:"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted"}),t]})]}));w$.displayName="DrawerContent";const Uhe=m.forwardRef(({className:e,...t},n)=>c.jsx(pi.Title,{ref:n,className:K("text-lg font-semibold leading-none tracking-tight",e),...t}));Uhe.displayName=pi.Title.displayName;const Vhe=m.forwardRef(({className:e,...t},n)=>c.jsx(pi.Description,{ref:n,className:K("text-sm text-muted-foreground",e),...t}));Vhe.displayName=pi.Description.displayName;const zhe=({ingredients:e,imageUrls:t,imageType:n,onComplete:r})=>{var O;const[i,s]=m.useState(new Set(e.map((j,A)=>A))),[o,a]=m.useState(e.map(j=>({...j}))),[l,u]=m.useState(!1),[d,f]=m.useState(null),[h,p]=m.useState(0),[g,v]=m.useState(!1),w=an(),y=wn(),{toast:x}=zi(),b=vr(),_=j=>{const A=new Set(i);A.has(j)?A.delete(j):A.add(j),s(A),f(null)},S=(j,A,V)=>{const $=[...o];$[j]={...$[j],[A]:V},a($)},E=async()=>{var j;u(!0),f(null);try{const A=Array.from(i).map(R=>({name:o[R].name,category:o[R].category,quantity:o[R].quantity,unit:o[R].unit}));if(A.length===0){f("Please select at least one ingredient to add to your inventory."),u(!1);return}const V=await Oce(A);if(!V.success)throw new Error(((j=V.error)==null?void 0:j.message)||"Failed to add ingredients to inventory");const $=[...new Set(A.map(R=>R.category||"Other"))];b.track("inventory_ingredients_batch_added",{ingredient_count:A.length,upload_method:n==="voice"?"voice":n==="food"?"image_food":"image_receipt",upload_type:n,categories_affected:$,upload_source:n==="voice"?"microphone":"gallery"}),x({title:"Success!",description:`${A.length} ingredient${A.length>1?"s":""} added to your inventory.`}),y("/inventory/manage")}catch(A){console.error("Error adding ingredients to inventory:",A),b.track("inventory_ingredients_batch_added",{ingredient_count:Array.from(i).length,upload_method:n==="voice"?"voice":n==="food"?"image_food":"image_receipt",upload_type:n,upload_source:n==="voice"?"microphone":"gallery",error_type:A instanceof Error?A.name:"unknown_error",error_message:A instanceof Error?A.message:"Unknown error"}),f("Failed to add ingredients to your inventory. Please try again.")}finally{u(!1)}},k=()=>{s(new Set(e.map((j,A)=>A))),f(null)},C=()=>{s(new Set)},P=()=>{p(j=>(j+1)%t.length)},T=()=>{p(j=>(j-1+t.length)%t.length)},N=n==="voice"&&e.length>0&&((O=e[0])==null?void 0:O.voiceTranscript)||null,I=()=>c.jsx(c.Fragment,{children:t.length>0?c.jsxs("div",{className:"w-full",children:[t.length>1&&c.jsxs("div",{className:"flex justify-between items-center mb-2",children:[c.jsx("button",{className:"p-1 rounded hover:bg-accent/50",onClick:T,disabled:t.length<=1,children:c.jsx(yA,{className:"h-4 w-4"})}),c.jsxs("span",{className:"text-sm text-muted-foreground",children:["Image ",h+1," of ",t.length]}),c.jsx("button",{className:"p-1 rounded hover:bg-accent/50",onClick:P,disabled:t.length<=1,children:c.jsx(d_,{className:"h-4 w-4"})})]}),c.jsx("img",{src:t[h],alt:`${n} image`,className:"rounded-md w-full max-h-64 object-cover"})]}):n==="voice"?c.jsx("div",{className:"w-full flex flex-col items-center justify-center",children:c.jsxs("div",{className:"rounded-md w-full h-64 bg-muted flex flex-col items-center justify-center p-4",children:[c.jsx(Qp,{className:"h-10 w-10 text-muted-foreground opacity-30 mb-4"}),N?c.jsxs("div",{className:"text-center",children:[c.jsx("p",{className:"text-sm font-medium mb-2",children:"Speech Transcript:"}),c.jsx("p",{className:"text-sm text-muted-foreground italic",children:N})]}):c.jsx("p",{className:"text-sm text-center text-muted-foreground",children:"Voice recording processed"})]})}):null});return c.jsxs(di,{className:`${w?"w-full mx-0":"max-w-4xl mx-auto"}`,children:[c.jsx(qa,{children:c.jsx(Vc,{children:"Confirm Ingredients"})}),c.jsx(fi,{className:"grid gap-6",children:c.jsxs("div",{className:"flex flex-col md:flex-row gap-6",children:[!w&&c.jsxs("div",{className:"md:w-1/3 md:sticky md:top-20 md:self-start",children:[c.jsx(I,{}),c.jsx("div",{className:"mt-6",children:c.jsx(pP,{onCancel:()=>r(),onConfirm:E,isAdding:l,isMobile:!1})})]}),w&&(t.length>0||n==="voice")&&c.jsxs(y$,{open:g,onOpenChange:v,children:[c.jsx(Lhe,{asChild:!0,children:c.jsx(ie,{variant:"outline",className:"flex items-center justify-center gap-2 mb-2",children:n==="voice"?c.jsxs(c.Fragment,{children:[c.jsx(Qp,{className:"h-4 w-4"}),"View Voice Transcript"]}):c.jsxs(c.Fragment,{children:[c.jsx(_K,{className:"h-4 w-4"}),"View ",t.length>1?"Images":"Image"]})})}),c.jsxs(w$,{className:"p-4 max-h-[90vh]",children:[c.jsx("div",{className:"mb-4",children:c.jsx(I,{})}),c.jsx($he,{asChild:!0,children:c.jsx(ie,{variant:"outline",className:"w-full",children:"Close"})})]})]}),c.jsx(Zfe,{ingredients:o,selectedIngredients:i,error:d,onToggleIngredient:_,onUpdateIngredientField:S,onSelectAll:k,onDeselectAll:C})]})}),w&&c.jsx(pP,{onCancel:()=>r(),onConfirm:E,isAdding:l,isMobile:!0})]})},Bhe=()=>{const[e,t]=m.useState([]),[n,r]=m.useState([]),[i,s]=m.useState(null),o=an(),a=(u,d,f)=>{t(u),r(d),s(f)},l=()=>{t([]),r([]),s(null)};return c.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[c.jsx(Wi,{}),c.jsx(iS,{}),c.jsx("main",{className:"flex-1",children:c.jsx("div",{className:`${o?"px-2":"container"} py-8`,children:c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex justify-between items-center",children:[c.jsx(zg,{title:"Add to Your Inventory"}),c.jsx(ie,{asChild:!0,variant:"outline",className:"flex items-center gap-2",children:c.jsxs(Nt,{to:"/inventory/manage",children:[c.jsx(c_,{className:"h-4 w-4"}),"Back to Inventory"]})})]}),e.length>0?c.jsx(zhe,{ingredients:e,imageUrls:n,imageType:i||"food",onComplete:l}):c.jsx(Ffe,{onImageProcessed:a})]})})})]})},xP=({itemId:e,name:t,quantity:n,unit:r,onCancel:i,onSave:s})=>{const[o,a]=m.useState(n||""),[l,u]=m.useState(r||""),[d,f]=m.useState(!1);an();const h=async()=>{f(!0),await s(e,o,l),f(!1)};return c.jsx("div",{className:"p-3 border rounded-md bg-muted/10",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[c.jsx(Pn,{type:"text",value:o,onChange:p=>a(p.target.value),placeholder:"Qty",className:"h-8 w-14 text-sm","aria-label":"Quantity"}
548),c.jsx(Pn,{type:"text",value:l,onChange:p=>u(p.target.value),placeholder:"Unit",className:"h-8 w-24 text-sm","aria-label":"Unit"}),c.jsx("span",{className:"text-sm font-medium",style:{color:"#2c6139"},children:t})]}),c.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[c.jsx(ie,{type:"button",variant:"ghost",size:"icon",onClick:i,className:"h-7 w-7",children:c.jsx(Di,{className:"h-3.5 w-3.5 text-muted-foreground"})}),c.jsx(ie,{type:"button",variant:"ghost",size:"icon",onClick:h,disabled:d,className:"h-7 w-7",children:c.jsx(Ra,{className:"h-3.5 w-3.5 text-primary"})})]})]})})},wP=({id:e,name:t,quantity:n,unit:r,isSelected:i,onToggleSelect:s,onEdit:o,onRemove:a,removing:l})=>{an();const u=()=>n&&r?`${n} ${r}`:n||r||"";return c.jsxs("div",{className:`relative flex items-center gap-3 p-3 transition-colors rounded-md border
549        ${i?"bg-accent/30 border-primary/30":"bg-card hover:bg-accent/10"}`,children:[c.jsx(Jg,{id:`ingredient-${e}`,checked:i,onCheckedChange:d=>s(e,d===!0),className:"mt-0"}),c.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center gap-1 flex-1",children:c.jsxs("label",{htmlFor:`ingredient-${e}`,className:"cursor-pointer",children:[u()&&c.jsx("span",{className:"text-sm text-muted-foreground mr-2",children:u()}),c.jsx("span",{className:"text-sm font-medium",style:{color:"#2c6139"},children:t})]})}),c.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[c.jsx(ie,{variant:"ghost",size:"icon",onClick:o,className:"h-7 w-7",children:c.jsx(PK,{className:"h-3.5 w-3.5 text-muted-foreground"})}),c.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>a(e),disabled:l===e,className:"h-7 w-7",children:l===e?c.jsx(Wt,{className:"h-3.5 w-3.5 animate-spin"}):c.jsx(Rx,{className:"h-3.5 w-3.5 text-muted-foreground hover:text-destructive"})})]})]})},Whe=({category:e,items:t,onRemoveItem:n,onUpdateItem:r,removing:i,selectedItems:s,onToggleSelectItem:o})=>{const[a,l]=m.useState(null),[u,d]=m.useState(!0),f=an(),h=bF(e),p=w=>{l(w)},g=()=>{l(null)},v=async(w,y,x)=>{await r(w,y,x)&&l(null)};return c.jsxs("div",{className:"mb-8",children:[c.jsxs("div",{className:"flex items-center space-x-2 mb-3",children:[c.jsx(h,{className:"h-5 w-5 text-primary"}),c.jsxs("h3",{className:"text-md font-semibold text-foreground",children:[e," (",t.length,")"]}),f&&c.jsx(ie,{variant:"ghost",size:"sm",className:"ml-auto p-0 h-6 w-6",onClick:()=>d(!u),children:c.jsx(u_,{className:`h-4 w-4 transition-transform duration-200 ${u?"transform rotate-180":""}`})})]}),f?c.jsx("div",{className:"space-y-2",children:u&&t.map(w=>c.jsx("div",{children:a===w.id?c.jsx(xP,{itemId:w.id,name:w.ingredients.name,quantity:w.quantity,unit:w.unit,onCancel:g,onSave:v}):c.jsx(wP,{id:w.id,name:w.ingredients.name,quantity:w.quantity,unit:w.unit,isSelected:s.has(w.id),onToggleSelect:o,onEdit:()=>p(w.id),onRemove:n,removing:i})},w.id))}):c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2",children:t.map(w=>c.jsx("div",{children:a===w.id?c.jsx(xP,{itemId:w.id,name:w.ingredients.name,quantity:w.quantity,unit:w.unit,onCancel:g,onSave:v}):c.jsx(wP,{id:w.id,name:w.ingredients.name,quantity:w.quantity,unit:w.unit,isSelected:s.has(w.id),onToggleSelect:o,onEdit:()=>p(w.id),onRemove:n,removing:i})},w.id))})]})},qhe=()=>{const[e,t]=m.useState([]),[n,r]=m.useState([]),[i,s]=m.useState(!0),[o,a]=m.useState(""),[l,u]=m.useState(null),[d,f]=m.useState(!1),[h,p]=m.useState(!1),[g,v]=m.useState(new Set),[w,y]=m.useState(!1),{toast:x}=zi(),b=vr(),_=async()=>{s(!0);try{const N=await H1();if(N.success&&N.inventory)t(N.inventory),r(N.inventory);else throw new Error("Failed to fetch inventory")}catch(N){console.error("Error fetching inventory:",N)}finally{s(!1)}};m.useEffect(()=>{_()},[]),m.useEffect(()=>{if(o.trim()==="")r(e);else{const N=o.toLowerCase();r(e.filter(I=>{var O;return I.ingredients.name.toLowerCase().includes(N)||((O=I.ingredients.category)==null?void 0:O.toLowerCase().includes(N))}))}},[o,e]);const S=async N=>{u(N);const I=e.find(O=>O.id===N);try{if((await Dce(N)).success)b.track("inventory_ingredient_deleted",{ingredient_id:N,category:(I==null?void 0:I.ingredients.category)||"Other",ingredient_count:1}),t(e.filter(j=>j.id!==N)),v(j=>{const A=new Set(j);return A.delete(N),A}),x({title:"Ingredient removed",description:"Ingredient has been removed from your inventory."});else throw new Error("Failed to remove ingredient")}catch(O){console.error("Error removing ingredient:",O),b.track("inventory_ingredient_deleted",{ingredient_id:N,category:(I==null?void 0:I.ingredients.category)||"Other",ingredient_count:1,error_type:O instanceof Error?O.name:"unknown_error",error_message:O instanceof Error?O.message:"Unknown error"}),x({title:"Error",description:"Failed to remove ingredient. Please try again.",variant:"destructive"})}finally{u(null)}},E=async(N,I,O)=>{const j=e.find($=>
549$.id===N),A=(I.trim()||null)!==(j==null?void 0:j.quantity),V=(O.trim()||null)!==(j==null?void 0:j.unit);try{if((await Lce(N,I.trim()||null,O.trim()||null)).success)return b.track("inventory_ingredient_edited",{ingredient_id:N,category:(j==null?void 0:j.ingredients.category)||"Other",quantity_changed:A,unit_changed:V}),t(e.map(R=>R.id===N?{...R,quantity:I.trim()||null,unit:O.trim()||null}:R)),x({title:"Ingredient updated",description:"Ingredient has been updated in your inventory."}),!0;throw new Error("Failed to update ingredient")}catch($){return console.error("Error updating ingredient:",$),b.track("inventory_ingredient_edited",{ingredient_id:N,category:(j==null?void 0:j.ingredients.category)||"Other",quantity_changed:A,unit_changed:V,error_type:$ instanceof Error?$.name:"unknown_error",error_message:$ instanceof Error?$.message:"Unknown error"}),x({title:"Error",description:"Failed to update ingredient. Please try again.",variant:"destructive"}),!1}},k=async()=>{p(!0);const N=e.length,I=[...new Set(e.map(O=>O.ingredients.category||"Other"))];try{if((await Fce()).success)b.track("inventory_cleared",{ingredient_count:N,categories_affected:I}),t([]),r([]),v(new Set),x({title:"Inventory cleared",description:"Your inventory has been successfully cleared."});else throw new Error("Failed to clear inventory")}catch(O){console.error("Error clearing inventory:",O),b.track("inventory_cleared",{ingredient_count:N,categories_affected:I,error_type:O instanceof Error?O.name:"unknown_error",error_message:O instanceof Error?O.message:"Unknown error"}),x({title:"Error",description:"Failed to clear inventory. Please try again.",variant:"destructive"})}finally{p(!1),f(!1)}},C=(N,I)=>{v(O=>{const j=new Set(O);return I?j.add(N):j.delete(N),j})},P=async()=>{p(!0);const N=Array.from(g),I=e.filter(j=>g.has(j.id)),O=[...new Set(I.map(j=>j.ingredients.category||"Other"))];try{if((await Mce(N)).success)b.track("inventory_multiple_items_deleted",{selected_count:N.length,ingredient_count:N.length,categories_affected:O}),t(e.filter(A=>!g.has(A.id))),v(new Set),x({title:"Items deleted",description:`${N.length} ingredient${N.length>1?"s":""} successfully deleted.`});else throw new Error("Failed to delete selected ingredients")}catch(j){console.error("Error deleting selected ingredients:",j),b.track("inventory_multiple_items_deleted",{selected_count:N.length,ingredient_count:N.length,categories_affected:O,error_type:j instanceof Error?j.name:"unknown_error",error_message:j instanceof Error?j.message:"Unknown error"}),x({title:"Error",description:"Failed to delete selected ingredients. Please try again.",variant:"destructive"})}finally{p(!1),y(!1)}},T=n.reduce((N,I)=>{const O=I.ingredients.category||"Other";return N[O]||(N[O]=[]),N[O].push(I),N},{});return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex justify-between items-center",children:[c.jsxs("div",{className:"text-xl font-semibold",children:["Your Inventory",c.jsx("p",{className:"text-sm font-normal text-muted-foreground mt-1",children:e.length===0&&!i?"Upload images of your fridge, pantry, or receipts to start building your inventory.":`You have ${e.length} ingredient${e.length!==1?"s":""} in your inventory.`})]}),c.jsx("div",{children:g.size>0?c.jsxs(ie,{variant:"destructive",size:"sm",onClick:()=>y(!0),className:"flex items-center gap-2",children:[c.jsx(Rx,{className:"h-4 w-4"}),"Delete ",g.size," Item",g.size!==1?"s":""]}):e.length>0&&c.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>f(!0),className:"flex items-center gap-2",children:[c.jsx(Rx,{className:"h-4 w-4"}),"Clear Inventory"]})})]}),c.jsxs("div",{className:"relative",children:[c.jsx(kA,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),c.jsx(Pn,{type:"search",placeholder:"Search ingredients...",className:"pl-9 pr-4",value:o,onChange:N=>a(N.target.value)})]}),i?c.jsx("div",{className:"flex justify-center items-center py-12",children:c.jsx(Wt,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):e.length===0?c.jsx("div",{className:"text-center py-12 text-muted-foreground border rounded-lg",children:c.jsx("p",{children:"Your inventory is empty."})}):n.length===0?c.jsx("div",{className:"text-center py-12 text-muted-foreground border rounded-lg",children:c.jsx("p",{children:"No ingredients match your search."})}):c.jsx("div",{className:"space-y-4",children:Object.entries(T).map(([N,I])=>c.jsx(Whe,{category:N,items:I,onRemoveItem:S,onUpdateItem:E,removing:l,selectedItems:g,onToggleSelectItem:C},N))}),c.jsx(Lw,{open:d,onOpenChange:f,children:c.jsxs(jm,{children:[c.jsxs(Pm,{children:[c.jsx(Rm,{children:"Clear Entire Inventory"}),c.jsx(Im,{children:"Are you sure you want to clear your entire inventory? This action cannot be undone. All ingredients will be permanently removed from your inventory."})]}),c.jsxs(Nm,{children:[c.jsx(Om,{children:"Cancel"}),c.jsx(Am,{onClick:k,disabled:h,className:"bg-destructive hover:bg-destructive/90",children:h?c.jsxs(c.Fragment,{children:[c.jsx(Wt,{className:"mr-2 h-4 w-4 animate-spin"}),"Clearing..."]}):"Clear Inventory"})]})]})}),c.jsx(Lw,{open:w,onOpenChange:y,children:c.jsxs(jm,{children:[c.jsxs(Pm,{children:[c.jsx(Rm,{children:"Delete Selected Ingredients"}),c.jsxs(Im,{children:["Are you sure you want to delete ",g.size," selected ingredient",g.size!==1&&"s","? This action cannot be undone."]})]}),c.jsxs(Nm,{children:[c.jsx(Om,{children:"Cancel"}),c.jsx(Am,{onClick:P,disabled:h,className:"bg-destructive hover:bg-destructive/90",children:h?c.jsxs(c.Fragment,{children:[c.jsx(Wt,{className:"mr-2 h-4 w-4 animate-spin"}),"Deleting..."]}):`Delete ${g.size} Item${g.size!==1?"s":""}`})]})]})})]})},Hhe=()=>{const[e,t]=m.useState(0);return c.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[c.jsx(Wi,{}),c.jsx(iS,{}),c.jsx("main",{className:"flex-1 container py-8",children:c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex justify-between items-center",children:[c.jsx(zg,{title:"Manage Your Inventory"}),c.jsx(ie,{asChild:!0,className:"flex items-center gap-2 bg-primary hover:bg-primary/90",children:c.jsxs(Nt,{to:"/inventory/add",children:[c.jsx(Px,{className:"h-4 w-4"}),"Add Ingredients"]})})]}),c.jsx(qhe,{},e)]})})]})};function Ghe({mealPlanTitle:e,mealPlanId:t,hasItems:n,isGenerating:r,isDebugMode:i,hasConfirmedRecipes:s=!1,onGenerateList:o,onInstacartClick:a,onToggleDebugMode:l}){return c.jsx("div",{className:"flex flex-col gap-4",children:c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[c.jsx("h2",{className:"text-xl font-semibold",children:e?`Shopping List for "${e}"`:"Shopping List"}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[t&&c.jsx(ie,{variant:"outline",size:"sm",asChild:!0,disabled:!t,title:s?void 0:"Select recipes in your meal plan first",children:c.jsx(Nt,{to:`/meal-plan/${t}/recipes`,children:"Go to Meal Plan"})}),n&&c.jsx(ie,{variant:"outline",size:"sm",onClick:a,className:"flex items-center gap-1 w-full sm:w-auto justify-center bg-[#163d2a] hover:bg-[#204d37] text-white border-transparent hover:border-transparent",children:c.jsxs("div",{className:"flex items-center",children:[c.jsx("img",{src:"/assets/instacart-logo.svg",alt:"Instacart",className:"w-5 h-5 mr-2",style:{objectFit:"contain"}}),c.jsx("span",{style:{fontFamily:"'DM Sans', sans-serif",fontWeight:800},children:"Shop with Instacart"})]})}),c.jsx(ie,{variant:n?"outline":"default",size:"sm",onClick:o,disabled:r||!t,className:r?"animate-pulse":"",children:r?c.jsxs(c.Fragment,{children:[c.jsx(Wt,{className:"w-4 h-4 mr-1.5 animate-spin"}),"Generating..."]}):c.jsxs(c.Fragment,{children:[c.jsx(hg,{className:"w-4 h-4 mr-1.5"}),n?"Regenerate":"Generate"]})}),i&&c.jsxs(ie,{variant:"outline",size:"sm",onClick:l,className:"ml-2",children:[c.jsx(dK,{className:"w-4 h-4 mr-1.5"}),"Debug: ",i?"ON":"OFF"]})]})]})})}function Khe({id:e,name:t,quantity:n,unit:r,isChecked:i,onToggle:s}){const[o,a]=m.useState(!1),l=async d=>{a(!0);try{s(e,d),await Jce(e,d)}catch(f){console.error("Error toggling item:",f),s(e,i)}finally{a(!1)}}
549,u=[n,r,t].filter(Boolean).join(" ");return c.jsxs("div",{className:K("flex items-center py-3 transition-opacity",o?"opacity-70":"",i?"text-muted-foreground":""),children:[c.jsx(Jg,{id:`item-${e}`,checked:i,onCheckedChange:l,disabled:o,className:"mr-3 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground"}),c.jsx("div",{className:"flex-1",children:c.jsx("label",{htmlFor:`item-${e}`,className:K("text-sm font-medium cursor-pointer",i?"line-through":""),children:u})})]})}function Yhe({category:e,items:t,recipeTitle:n,onToggleItem:r}){const i=s=>s.charAt(0).toUpperCase()+s.slice(1);return c.jsxs("div",{className:"mb-6",children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("h3",{className:"text-md font-semibold",children:i(e)}),n&&c.jsxs("span",{className:"text-xs text-muted-foreground",children:["From: ",n]})]}),c.jsx("div",{className:K("border rounded-lg px-4",t.filter(s=>!s.is_checked).length===0?"bg-muted/30":"bg-card"),children:c.jsx("div",{className:K("grid gap-x-6",t.length>1?"grid-cols-1 lg:grid-cols-2":"grid-cols-1"),children:t.map((s,o)=>{const a=o%2===0,u=!(o<2),d=!a&&t.length>1;return c.jsx("div",{className:K(u&&"border-t",d&&"lg:border-l",u&&d&&"lg:border-t-0"),children:c.jsx(Khe,{id:s.id,name:s.name,quantity:s.quantity,unit:s.unit,isChecked:s.is_checked,onToggle:r})},s.id)})})})]})}function Qhe({hasActiveMealPlan:e,hasConfirmedRecipes:t,hasInventory:n=!0}){let r="No shopping list available",i="Start by creating a meal plan and confirming some recipes.",s=null;return e&&(t?n?(r="You're all set!",i="No missing ingredients needed for your confirmed recipes. Everything seems to be already in your inventory."):(r="Ready to generate",i="Click the Regenerate button to create your shopping list for this meal plan."):(r="No confirmed recipes",i="Please confirm at least one recipe in your meal plan to generate a shopping list.",s=c.jsx(ie,{variant:"default",size:"sm",asChild:!0,children:c.jsxs("a",{href:"/meal-plan",className:"flex items-center gap-2",children:[c.jsx(Xp,{className:"h-4 w-4"}),"Go to Meal Plan"]})}))),c.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center space-y-3",children:[c.jsx("div",{className:"h-12 w-12 rounded-full bg-muted flex items-center justify-center",children:c.jsx(Xp,{className:"h-6 w-6 text-muted-foreground"})}),c.jsx("h3",{className:"text-lg font-medium",children:r}),c.jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:i}),s&&c.jsx("div",{className:"mt-4",children:s})]})}function bP({mealPlanId:e,mealPlanTitle:t,hasConfirmedRecipes:n,hasInventory:r,recipes:i,inventory:s,shoppingItems:o}){const a=o&&o.length>0;return c.jsxs("div",{className:"mt-8 p-4 border rounded-lg bg-muted/30",children:[c.jsx("h3",{className:"font-semibold mb-2",children:"Debug Information"}),!a&&c.jsxs("div",{className:"space-y-4 text-xs",children:[c.jsxs("div",{children:[c.jsxs("h4",{className:"font-medium mb-1",children:["Meal Plan ID: ",e]}),c.jsxs("p",{children:["Title: ",t]}),c.jsxs("p",{children:["Has Confirmed Recipes: ",n?"Yes":"No"]}),c.jsxs("p",{children:["Has Inventory Items: ",r?"Yes":"No"]})]}),c.jsxs("div",{children:[c.jsxs("h4",{className:"font-medium mb-1",children:["Confirmed Recipe Count: ",i.length]}),c.jsx("div",{className:"max-h-48 overflow-y-auto",children:c.jsx("pre",{className:"text-xs whitespace-pre-wrap bg-background p-2 rounded",children:JSON.stringify(i,null,2)})})]}),c.jsxs("div",{children:[c.jsxs("h4",{className:"font-medium mb-1",children:["Inventory Count: ",s.length]}),c.jsx("div",{className:"max-h-48 overflow-y-auto",children:c.jsx("pre",{className:"text-xs whitespace-pre-wrap bg-background p-2 rounded",children:JSON.stringify(s,null,2)})})]})]}),a&&c.jsxs("div",{children:[c.jsxs("p",{children:["Shopping Items Count: ",o.length]}),c.jsxs("div",{className:"mt-4",children:[c.jsxs("h4",{className:"font-medium mb-1",children:["Confirmed Recipe Count: ",i.length]}),c.jsx("div",{className:"max-h-32 overflow-y-auto",children:c.jsx("pre",{className:"text-xs whitespace-pre-wrap bg-background p-2 rounded",children:JSON.stringify(i,null,2)})})]}),c.jsxs("div",{className:"mt-4",children:[c.jsxs("h4",{className:"font-medium mb-1",children:["Inventory Count: ",s.length]}),c.jsx("div",{className:"max-h-32 overflow-y-auto",children:c.jsx("pre",{className:"text-xs whitespace-pre-wrap bg-background p-2 rounded",children:JSON.stringify(s,null,2)})})]})]})]})}function Xhe({isLoading:e,shoppingItems:t,mealPlanId:n,mealPlanTitle:r,hasConfirmedRecipes:i,hasInventory:s,isDebugMode:o,debugInfo:a,onToggleItem:l}){if(e)return c.jsx("div",{className:"py-12 flex justify-center",children:c.jsx("div",{className:"animate-pulse text-muted-foreground",children:"Loading..."})});const u=t.length>0,d=t.some(p=>!p.is_checked),f=t.reduce((p,g)=>{const v=g.category||"Other";return p[v]||(p[v]=[]),p[v].push(g),p},{}),h=Object.keys(f).sort();return u?c.jsxs("div",{className:"mx-auto max-w-4xl",children:[!d&&c.jsx("div",{className:"flex justify-center mb-8",children:c.jsx(sS,{className:"text-sm font-medium text-center",baseColor:"#26402f",gradientColor:"#385944",duration:1.5,children:"You've checked off all items! Click 'Regenerate' to update your shopping list based on your meal plan."})}),h.map(p=>c.jsx(Yhe,{category:p,items:f[p],onToggleItem:l},p)),o&&c.jsx(bP,{mealPlanId:n,mealPlanTitle:r,hasConfirmedRecipes:i,hasInventory:s,recipes:a.recipes,inventory:a.inventory,shoppingItems:t})]}):c.jsxs(c.Fragment,{children:[c.jsx(Qhe,{hasActiveMealPlan:!!n,hasConfirmedRecipes:i,hasInventory:s}),o&&n&&c.jsx(bP,{mealPlanId:n,mealPlanTitle:r,hasConfirmedRecipes:i,hasInventory:s,recipes:a.recipes,inventory:a.inventory})]})}function Zhe({isOpen:e,onClose:t,onProceedToInstacart:n,mealPlanId:r,mealPlanTitle:i,itemCount:s}){const o=vr(),a=()=>{o.track("shopping_list_instacart_opened",{meal_plan_id:r||void 0,meal_plan_title:i||void 0,item_count:s||0,integration_type:"instacart",list_source:"meal_plan"}),Wae("We're working on it!",{description:"Want to send your MealMuse shopping list to purchase through Instacart? Stay tuned!"}),t()};return c.jsx(hm,{open:e,onOpenChange:t,children:c.jsxs(Ld,{className:"bg-[#343538] text-white border-none max-w-md p-6 rounded-lg",children:[c.jsx(Fd,{className:"sr-only",children:"Instacart Integration"}),c.jsxs("div",{className:"flex flex-col items-center text-center space-y-6",children:[c.jsx("div",{className:"flex items-center justify-center mb-2",children:c.jsx("img",{src:"/assets/instacart-logo.svg",alt:"Instacart",className:"w-16 h-16",style:{objectFit:"contain"}})}),c.jsx("h3",{className:"text-xl font-medium",style:{fontFamily:"'DM Sans', sans-serif",fontWeight:800},children:"The selected items will be placed in your Instacart shopping cart."}),c.jsx("p",{className:"text-gray-300 text-sm",children:"Please review quantities on Instacart before checkout."}),c.jsxs("div",{className:"w-full space-y-3 pt-2",children:[c.jsxs(ie,{onClick:a,className:"w-full bg-white hover:bg-white/90 text-[#343538] font-medium py-6 flex items-center justify-center gap-2",children:[c.jsx("img",{src:"/assets/instacart-logo.svg",alt:"Instacart",className:"w-5 h-5 mr-2",style:{objectFit:"contain"}}),c.jsx("span",{style:{fontFamily:"'DM Sans', sans-serif",fontWeight:800},children:"Take me to Instacart"})]}),c.jsx("button",{onClick:t,className:"w-full text-center py-2 text-gray-300 hover:text-white underline text-sm",children:"No, still working on my list"})]})]})]})})}const Jhe=!1,epe=()=>{const{user:e}=Zt(),t=vr(),[n,r]=m.useState(!0),[i,s]=m.useState(!1),[o,a]=m.useState([]),[l,u]=m.useState(null),[d,f]=m.useState(null),[h,p]=m.useState(!1),[g,v]=m.useState(!0),[w,y]=m.useState(!1),[x,b]=m.useState(!1),[_,S]=m.useState({inventory:[],recipes:[]}),E=async()=>
549{if(e){r(!0);try{const{items:O,mealPlanId:j,mealPlanTitle:A}=await h3(e.id);if(a(O),u(j),f(A),!j){const R=await U1(e.id);R&&(u(R.id),f(R.title))}if(j){const L=(await d3(j)).filter(H=>H.isConfirmed);p(L.length>0),S(H=>({...H,recipes:L.map(z=>z.recipe)}))}const{inventory:V,success:$}=await H1();$&&(v(V&&V.length>0),S(R=>({...R,inventory:V||[]}))),O.length>0&&t.track("shopping_list_viewed",{meal_plan_id:j||void 0,meal_plan_title:A||void 0,item_count:O.length,list_source:"meal_plan"})}catch(O){console.error("Error fetching shopping list:",O),Dl({title:"Error",description:"Failed to load shopping list",variant:"destructive"})}finally{r(!1)}}};m.useEffect(()=>{E()},[e,w]);const k=(O,j)=>{const A=o.find(V=>V.id===O);A&&t.track("shopping_list_item_toggled",{item_id:O,item_name:A.name,item_category:A.category||"unknown",item_checked:j,meal_plan_id:l||void 0,list_source:"meal_plan"}),a(V=>V.map($=>$.id===O?{...$,is_checked:j}:$))},C=async()=>{if(!e||!l)return;const j=o.length>0?"regenerate":"initial";t.track("shopping_list_generation_started",{meal_plan_id:l,meal_plan_title:d||void 0,generation_type:j,confirmed_recipe_count:_.recipes.length,inventory_item_count:_.inventory.length,list_source:"meal_plan"}),s(!0);try{const A=await Zce(l,e.id);t.track("shopping_list_generation_success",{meal_plan_id:l,meal_plan_title:d||void 0,generation_type:j,item_count:A.length,confirmed_recipe_count:_.recipes.length,inventory_item_count:_.inventory.length,list_source:"meal_plan"}),await E(),Dl({title:"Success",description:`Shopping list has been generated with ${A.length} items`})}catch(A){console.error("Error generating shopping list:",A),t.track("shopping_list_generation_failed",{meal_plan_id:l,meal_plan_title:d||void 0,generation_type:j,confirmed_recipe_count:_.recipes.length,inventory_item_count:_.inventory.length,list_source:"meal_plan",error_type:A instanceof Error?A.name:"unknown_error",error_message:A instanceof Error?A.message:"Unknown error"}),Dl({title:"Error",description:"Failed to generate shopping list",variant:"destructive"})}finally{s(!1)}},P=()=>{t.track("shopping_list_instacart_opened",{meal_plan_id:l||void 0,meal_plan_title:d||void 0,item_count:o.length,integration_type:"instacart",list_source:"meal_plan"}),b(!0)},T=()=>{window.open("https://www.instacart.com","_blank"),b(!1)},N=()=>{},I=o.length>0;return c.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[c.jsx(Wi,{}),c.jsx(A4,{}),c.jsx("main",{className:"flex-1 container py-8",children:c.jsxs("div",{className:"space-y-6",children:[c.jsx(zg,{title:"Shopping List"}),c.jsxs(di,{children:[c.jsx(qa,{children:c.jsx(Ghe,{mealPlanTitle:d,mealPlanId:l,hasItems:I,isGenerating:i,isDebugMode:w,onGenerateList:C,onInstacartClick:P,onToggleDebugMode:N,hasConfirmedRecipes:h})}),c.jsx(fi,{children:c.jsx(Xhe,{isLoading:n,shoppingItems:o,mealPlanId:l,mealPlanTitle:d,hasConfirmedRecipes:h,hasInventory:g,isDebugMode:w&&Jhe,debugInfo:_,onToggleItem:k})})]})]})}),c.jsx(Zhe,{isOpen:x,onClose:()=>b(!1),onProceedToInstacart:T,mealPlanId:l,mealPlanTitle:d,itemCount:o.length})]})};function tpe(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var hS="ScrollArea",[b$,Kpe]=Mn(hS),[npe,Lr]=b$(hS),_$=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:s=600,...o}=e,[a,l]=m.useState(null),[u,d]=m.useState(null),[f,h]=m.useState(null),[p,g]=m.useState(null),[v,w]=m.useState(null),[y,x]=m.useState(0),[b,_]=m.useState(0),[S,E]=m.useState(!1),[k,C]=m.useState(!1),P=Le(t,N=>l(N)),T=za(i);return c.jsx(npe,{scope:n,type:r,dir:T,scrollHideDelay:s,scrollArea:a,viewport:u,onViewportChange:d,content:f,onContentChange:h,scrollbarX:p,onScrollbarXChange:g,scrollbarXEnabled:S,onScrollbarXEnabledChange:E,scrollbarY:v,onScrollbarYChange:w,scrollbarYEnabled:k,onScrollbarYEnabledChange:C,onCornerWidthChange:x,onCornerHeightChange:_,children:c.jsx(me.div,{dir:T,...o,ref:P,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":b+"px",...e.style}})})});_$.displayName=hS;var S$="ScrollAreaViewport",E$=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,asChild:i,nonce:s,...o}=e,a=Lr(S$,n),l=m.useRef(null),u=Le(t,l,a.onViewportChange);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:`
550[data-radix-scroll-area-viewport] {
551  scrollbar-width: none;
552  -ms-overflow-style: none;
553  -webkit-overflow-scrolling: touch;
554}
555[data-radix-scroll-area-viewport]::-webkit-scrollbar {
556  display: none;
557}
558:where([data-radix-scroll-area-viewport]) {
559  display: flex;
560  flex-direction: column;
561  align-items: stretch;
562}
563:where([data-radix-scroll-area-content]) {
564  flex-grow: 1;
565}
566`},nonce:s}),c.jsx(me.div,{"data-radix-scroll-area-viewport":"",...o,asChild:i,ref:u,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:fpe({asChild:i,children:r},d=>c.jsx("div",{"data-radix-scroll-area-content":"",ref:a.onContentChange,style:{minWidth:a.scrollbarXEnabled?"fit-content":void 0},children:d}))})]})});E$.displayName=S$;var qi="ScrollAreaScrollbar",pS=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Lr(qi,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:o}=i,a=e.orientation==="horizontal";return m.useEffect(()=>(a?s(!0):o(!0),()=>{a?s(!1):o(!1)}),[a,s,o]),i.type==="hover"?c.jsx(rpe,{...r,ref:t,forceMount:n}):i.type==="scroll"?c.jsx(ipe,{...r,ref:t,forceMount:n}):i.type==="auto"?c.jsx(k$,{...r,ref:t,forceMount:n}):i.type==="always"?c.jsx(mS,{...r,ref:t}):null});pS.displayName=qi;var rpe=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Lr(qi,e.__scopeScrollArea),[s,o]=m.useState(!1);return m.useEffect(()=>{const a=i.scrollArea;let l=0;if(a){const u=()=>{window.clearTimeout(l),o(!0)},d=()=>{l=window.setTimeout(()=>o(!1),i.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",d),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",d)}}},[i.scrollArea,i.scrollHideDelay]),c.jsx(Lt,{present:n||s,children:c.jsx(k$,{"data-state":s?"visible":"hidden",...r,ref:t})})}),ipe=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Lr(qi,e.__scopeScrollArea),s=e.orientation==="horizontal",o=tv(()=>l("SCROLL_END"),100),[a,l]=tpe("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return m.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>l("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,i.scrollHideDelay,l]),m.useEffect(()=>{const u=i.viewport,d=s?"scrollLeft":"scrollTop";if(u){let f=u[d];const h=()=>{const p=u[d];f!==p&&(l("SCROLL"),o()),f=p};return u.addEventListener("scroll",h),()=>u.removeEventListener("scroll",h)}},[i.viewport,s,l,o]),c.jsx(Lt,{present:n||a!=="hidden",children:c.jsx(mS,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:se(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:se(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),k$=m.forwardRef((e,t)=>{const n=Lr(qi,e.__scopeScrollArea),{forceMount:r,...i}=e,[s,o]=m.useState(!1),a=e.orientation==="horizontal",l=tv(()=>{if(n.viewport){const u=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;o(a?u:d)}},10);return bc(n.viewport,l),bc(n.content,l),c.jsx(Lt,{present:r||s,children:c.jsx(mS,{"data-state":s?"visible":"hidden",...i,ref:t})})}),mS=m.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,i=Lr(qi,e.__scopeScrollArea),s=m.useRef(null),o=m.useRef(0),[a,l]=m.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=N$(a.viewport,a.content),d={...r,sizes:a,onSizesChange:l,hasThumb:u>0&&u<1,onThumbChange:h=>s.current=h,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:h=>o.current=h};function f(h,p){return upe(h,o.current,a,p)}return n==="horizontal"?c.jsx(spe,{...d,ref:t,onThumbPositionChange:()=>{if(i.viewport&&s.current){const h=i.viewport.scrollLeft,p=_P(h,a,i.dir);s.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:h=>{i.viewport&&(i.viewport.scrollLeft=h)},onDragScroll:h=>{i.viewport&&(i.viewport.scrollLeft=f(h,i.dir))}}):n==="vertical"?c.jsx(ope,{...d,ref:t,onThumbPositionChange:()=>{if(i.viewport&&s.current){const h=i.viewport.scrollTop,p=_P(h,a);s.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:h=>{i.viewport&&(i.viewport.scrollTop=h)},onDragScroll:h=>{i.viewport&&(i.viewport.scrollTop=f(h))}}):null}),spe=m.forwardRef((e,t)=>
vendor: 4,331 bytes, line 566
566{const{sizes:n,onSizesChange:r,...i}=e,s=Lr(qi,e.__scopeScrollArea),[o,a]=m.useState(),l=m.useRef(null),u=Le(t,l,s.onScrollbarXChange);return m.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),c.jsx(T$,{"data-orientation":"horizontal",...i,ref:u,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":ev(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,f)=>{if(s.viewport){const h=s.viewport.scrollLeft+d.deltaX;e.onWheelScroll(h),I$(h,f)&&d.preventDefault()}},onResize:()=>{l.current&&s.viewport&&o&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Mm(o.paddingLeft),paddingEnd:Mm(o.paddingRight)}})}})}),ope=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,s=Lr(qi,e.__scopeScrollArea),[o,a]=m.useState(),l=m.useRef(null),u=Le(t,l,s.onScrollbarYChange);return m.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),c.jsx(T$,{"data-orientation":"vertical",...i,ref:u,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":ev(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,f)=>{if(s.viewport){const h=s.viewport.scrollTop+d.deltaY;e.onWheelScroll(h),I$(h,f)&&d.preventDefault()}},onResize:()=>{l.current&&s.viewport&&o&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Mm(o.paddingTop),paddingEnd:Mm(o.paddingBottom)}})}})}),[ape,C$]=b$(qi),T$=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:s,onThumbPointerUp:o,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:u,onWheelScroll:d,onResize:f,...h}=e,p=Lr(qi,n),[g,v]=m.useState(null),w=Le(t,P=>v(P)),y=m.useRef(null),x=m.useRef(""),b=p.viewport,_=r.content-r.viewport,S=gt(d),E=gt(l),k=tv(f,10);function C(P){if(y.current){const T=P.clientX-y.current.left,N=P.clientY-y.current.top;u({x:T,y:N})}}return m.useEffect(()=>{const P=T=>{const N=T.target;(g==null?void 0:g.contains(N))&&S(T,_)};return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[b,g,_,S]),m.useEffect(E,[r,E]),bc(g,k),bc(p.content,k),c.jsx(ape,{scope:n,scrollbar:g,hasThumb:i,onThumbChange:gt(s),onThumbPointerUp:gt(o),onThumbPositionChange:E,onThumbPointerDown:gt(a),children:c.jsx(me.div,{...h,ref:w,style:{position:"absolute",...h.style},onPointerDown:se(e.onPointerDown,P=>{P.button===0&&(P.target.setPointerCapture(P.pointerId),y.current=g.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),C(P))}),onPointerMove:se(e.onPointerMove,C),onPointerUp:se(e.onPointerUp,P=>{const T=P.target;T.hasPointerCapture(P.pointerId)&&T.releasePointerCapture(P.pointerId),document.body.style.webkitUserSelect=x.current,p.viewport&&(p.viewport.style.scrollBehavior=""),y.current=null})})})}),Dm="ScrollAreaThumb",j$=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=C$(Dm,e.__scopeScrollArea);return c.jsx(Lt,{present:n||i.hasThumb,children:c.jsx(lpe,{ref:t,...r})})}),lpe=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,s=Lr(Dm,n),o=C$(Dm,n),{onThumbPositionChange:a}=o,l=Le(t,f=>o.onThumbChange(f)),u=m.useRef(),d=tv(()=>{u.current&&(u.current(),u.current=void 0)},100);return m.useEffect(()=>{const f=s.viewport;if(f){const h=()=>{if(d(),!u.current){const p=dpe(f,a);u.current=p,a()}};return a(),f.addEventListener("scroll",h),()=>f.removeEventListener("scroll",h)}},[s.viewport,d,a]),c.jsx(me.div,{"data-state":o.hasThumb?"visible":"hidden",...i,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:se(e.onPointerDownCapture,f=>{const p=f.target.getBoundingClientRect(),g=f.clientX-p.left,v=f.clientY-p.top;o.onThumbPointerDown({x:g,y:v})}),onPointerUp:se(e.onPointerUp,o.onThumbPointerUp)})});j$.displayName=Dm;var gS="ScrollAreaCorner",P$=m.forwardRef((e,t)=>
vendor: 6,939 bytes, line 566
566{const n=Lr(gS,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?c.jsx(cpe,{...e,ref:t}):null});P$.displayName=gS;var cpe=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=Lr(gS,n),[s,o]=m.useState(0),[a,l]=m.useState(0),u=!!(s&&a);return bc(i.scrollbarX,()=>{var f;const d=((f=i.scrollbarX)==null?void 0:f.offsetHeight)||0;i.onCornerHeightChange(d),l(d)}),bc(i.scrollbarY,()=>{var f;const d=((f=i.scrollbarY)==null?void 0:f.offsetWidth)||0;i.onCornerWidthChange(d),o(d)}),u?c.jsx(me.div,{...r,ref:t,style:{width:s,height:a,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Mm(e){return e?parseInt(e,10):0}function N$(e,t){const n=e/t;return isNaN(n)?0:n}function ev(e){const t=N$(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function upe(e,t,n,r="ltr"){const i=ev(n),s=i/2,o=t||s,a=i-o,l=n.scrollbar.paddingStart+o,u=n.scrollbar.size-n.scrollbar.paddingEnd-a,d=n.content-n.viewport,f=r==="ltr"?[0,d]:[d*-1,0];return R$([l,u],f)(e)}function _P(e,t,n="ltr"){const r=ev(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-i,o=t.content-t.viewport,a=s-r,l=n==="ltr"?[0,o]:[o*-1,0],u=Y1(e,l);return R$([0,o],[0,a])(u)}function R$(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function I$(e,t){return e>0&&e<t}var dpe=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){const s={left:e.scrollLeft,top:e.scrollTop},o=n.left!==s.left,a=n.top!==s.top;(o||a)&&t(),n=s,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function tv(e,t){const n=gt(e),r=m.useRef(0);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),m.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function bc(e,t){const n=gt(t);Dr(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}function fpe(e,t){const{asChild:n,children:r}=e;if(!n)return typeof t=="function"?t(r):t;const i=m.Children.only(r);return m.cloneElement(i,{children:typeof t=="function"?t(i.props.children):t})}var A$=_$,hpe=E$,ppe=P$;const vS=m.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(A$,{ref:r,className:K("relative overflow-hidden",e),...n,children:[c.jsx(hpe,{className:"h-full w-full rounded-[inherit]",children:t}),c.jsx(O$,{}),c.jsx(ppe,{})]}));vS.displayName=A$.displayName;const O$=m.forwardRef(({className:e,orientation:t="vertical",...n},r)=>c.jsx(pS,{ref:r,orientation:t,className:K("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:c.jsx(j$,{className:"relative flex-1 rounded-full bg-border"})}));O$.displayName=pS.displayName;function mpe(){const e=t=>{};return c.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[c.jsx(Wi,{onOpenAuth:e}),c.jsx("main",{className:"flex-grow",children:c.jsxs("div",{className:"container max-w-4xl mx-auto py-12 px-4",children:[c.jsx("h1",{className:"text-4xl font-display font-bold mb-8",children:"Privacy Policy"}),c.jsx(vS,{className:"h-[calc(100vh-300px)] pr-6",children:c.jsxs("div",{className:"space-y-8",children:[c.jsxs("section",{children:[c.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"Introduction"}),c.jsx("p",{className:"text-muted-foreground leading-relaxed",children:'MealMuse ("we," "our," or "us") is committed to protecting your privacy. This Privacy Policy explains how we collect, use, disclose, and safeguard your information when you use our meal planning application and related services.'})]}),c.jsxs("section",{children:[c.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"Information We Collect"}),c.jsxs("div",{className:"space-y-4",children:[c.jsx("h3",{className:"text-xl font-medium",children:"Personal Information"}),c.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[c.jsx("li",{children:"Email address and account credentials"}),c.jsx("li",{children:"Name and profile information"}),c.jsx("li",{children:"Dietary preferences and restrictions"}),c.jsx("li",{children:"Cuisine preferences"}),c.jsx("li",{children:"Household size and serving preferences"})]}),c.jsx("h3",{className:"text-xl font-medium",children:"Usage Information"}),c.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[c.jsx("li",{children:"Meal plans and saved recipes"}),c.jsx("li",{children:"Shopping lists and inventory data"}),c.jsx("li",{children:"Voice inputs when using speech-to-text features"}),c.jsx("li",{children:"Application usage patterns and preferences"})]})]})]}),c.jsxs("section",{children:[c.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"How We Use Your Information"}),c.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[c.jsx("li",{children:"Generate personalized meal plans and recipe recommendations"}),c.jsx("li",{children:"Create shopping lists based on your meal plans"}),c.jsx("li",{children:"Process voice inputs for the speech-to-text feature"}),c.jsx("li",{children:"Improve our AI algorithms and recipe generation"}),c.jsx("li",{children:"Enhance the user experience and application functionality"}),c.jsx("li",{children:"Send important updates and notifications"})]})]}),c.jsxs("section",{children:[c.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"Data Storage and Security"}),c.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"We use Supabase for secure data storage and implement industry-standard security measures to protect your information. Your data is encrypted both in transit and at rest."})]}),c.jsxs("section",{children:[c.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"Third-Party Services"}),c.jsx("p",{className:"text-muted-foreground leading-relaxed mb-4",children:"We use the following third-party services to provide our functionality:"}),c.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[c.jsx("li",{children:"OpenAI - For recipe generation and AI features"}),c.jsx("li",{children:"ElevenLabs - For speech-to-text processing"}),c.jsx("li",{children:"Supabase - For data storage and authentication"})]})]}),c.jsxs("section",{children:[c.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"Your Rights"}),c.jsx("p",{className:"text-muted-foreground leading-relaxed mb-4",children:"You have the right to:"}),c.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[c.jsx("li",{children:"Access your personal information"}),c.jsx("li",{children:"Correct inaccurate information"}
566),c.jsx("li",{children:"Request deletion of your information"}),c.jsx("li",{children:"Export your data"}),c.jsx("li",{children:"Opt-out of marketing communications"})]})]}),c.jsxs("section",{children:[c.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"Updates to Privacy Policy"}),c.jsx("p",{className:"text-muted-foreground leading-relaxed",children:'We may update this Privacy Policy from time to time. We will notify you of any changes by posting the new Privacy Policy on this page and updating the "Last Updated" date.'})]}),c.jsxs("section",{children:[c.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"Contact Us"}),c.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"If you have any questions about this Privacy Policy or our practices, please contact us at [email protected]"})]}),c.jsx("p",{className:"text-sm text-muted-foreground pt-8",children:"Last Updated: March 30, 2024"})]})})]})}),c.jsx(N1,{})]})}function gpe(){const e=t=>{};return c.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[c.jsx(Wi,{onOpenAuth:e}),c.jsx("main",{className:"flex-grow",children:c.jsxs("div",{className:"container max-w-4xl mx-auto py-12 px-4",children:[c.jsx("h1",{className:"text-4xl font-display font-bold mb-8",children:"Terms of Service"}),c.jsx(vS,{className:"h-[calc(100vh-300px)] pr-6",children:c.jsxs("div",{className:"space-y-8",children:[c.jsxs("section",{children:[c.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"Agreement to Terms"}),c.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"By accessing or using MealMuse, you agree to be bound by these Terms of Service and all applicable laws and regulations. If you do not agree with any of these terms, you are prohibited from using or accessing this service."})]}),c.jsxs("section",{children:[c.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"Use License"}),c.jsxs("div",{className:"space-y-4",children:[c.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Permission is granted to temporarily access and use MealMuse for personal, non-commercial use, subject to the following conditions:"}),c.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[c.jsx("li",{children:"You must not modify or copy the materials"}),c.jsx("li",{children:"You must not use the materials for any commercial purpose"}),c.jsx("li",{children:"You must not attempt to reverse engineer any software contained in MealMuse"}),c.jsx("li",{children:"You must not remove any copyright or proprietary notations from the materials"})]})]})]}),c.jsxs("section",{children:[c.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"User Accounts"}),c.jsxs("div",{className:"space-y-4",children:[c.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"To access certain features of MealMuse, you must create an account. You agree to:"}),c.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[c.jsx("li",{children:"Provide accurate and complete registration information"}),c.jsx("li",{children:"Maintain the security of your account credentials"}),c.jsx("li",{children:"Promptly notify us of any unauthorized access to your account"}),c.jsx("li",{children:"Accept responsibility for all activities that occur under your account"})]})]})]}),c.jsxs("section",{children:[c.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"User Content"}),c.jsxs("div",{className:"space-y-4",children:[c.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"When you create, upload, or share content through MealMuse, you:"}),c.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[c.jsx("li",{children:"Retain all ownership rights to your content"}),c.jsx("li",{children:"Grant us a license to use, store, and share your content"}),c.jsx("li",{children:"Are responsible for the content you share"}),c.jsx("li",{children:"Must not violate any third-party rights"})]})]})]}),c.jsxs("section",{children:[c.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"AI-Generated Content"}),c.jsxs("div",{className:"space-y-4",children:[c.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"MealMuse uses artificial intelligence to generate recipes and meal plans. You acknowledge that:"}),c.jsxs("ul",{className:"list-disc pl-6 text-muted-foreground space-y-2",children:[c.jsx("li",{children:"AI-generated content may not be perfect or complete"}),c.jsx("li",{children:"You should use your judgment when following AI-generated recipes"}),c.jsx("li",{children:"We are not responsible for the outcome of using AI-generated content"}),c.jsx("li",{children:"Generated content is for informational purposes only"})]})]})]}),c.jsxs("section",{children:[c.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"Disclaimer"}),c.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"MealMuse's materials are provided on an 'as is' basis. We make no warranties, expressed or implied, and hereby disclaim and negate all other warranties including, without limitation, implied warranties or conditions of merchantability, fitness for a particular purpose, or non-infringement of intellectual property or other violation of rights."})]}),c.jsxs("section",{children:[c.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"Limitations"}),c.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"In no event shall MealMuse or its suppliers be liable for any damages (including, without limitation, damages for loss of data or profit, or due to business interruption) arising out of the use or inability to use MealMuse's materials, even if MealMuse or a MealMuse authorized representative has been notified orally or in writing of the possibility of such damage."})]}),c.jsxs("section",{children:[c.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"Governing Law"}),c.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"These terms and conditions are governed by and construed in accordance with the laws of the United States, and you irrevocably submit to the exclusive jurisdiction of the courts in that location."})]}),c.jsxs("section",{children:[c.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"Changes to Terms"}),c.jsx("p",{className:"text-muted-foreground leading-relaxed",children:'We reserve the right to modify these terms of service at any time. We will notify users of any material changes by posting the new terms of service on this page and updating the "Last Updated" date.'})]}),c.jsxs("section",{children:[c.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"Contact Us"}),c.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"If you have any questions about these Terms of Service, please contact us at [email protected]"})]}),c.jsx("p",{className:"text-sm text-muted-foreground pt-8",children:"Last Updated: March 30, 2024"})]})})]})}),c.jsx(N1,{})]})}const vpe=new C6({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}});function ype(){return c.jsx(R6,{client:vpe,children:c.jsx(iK,{children:c.jsx(a6,{children:c.jsxs(e6,{children:[c.jsx(Ot,{path:"/",element:c.jsx(Cae,{})}),c.jsx(Ot,{path:"/privacy-policy",element:c.jsx(mpe,{})}),c.jsx(Ot,{path:"/terms-of-service",element:c.jsx(gpe,{})}),c.jsxs(Ot,{element:c.jsx(UK,{}),children:[c.jsxs(Ot,{path:"/onboarding",element:c.jsx(nde,{}),children:[c.jsx(Ot,{path:"welcome",element:c.jsx(rde,{})}),c.jsx(Ot,{path:"dietary",element:c.jsx(sde,{})}),c.jsx(Ot,{path:"cuisine",element:c.jsx(ode,{})}),c.jsx(Ot,{path:"preferences",element:c.jsx(lde,{})}),c.jsx(Ot,{path:"complete",element:c.jsx(ude,{})})]}),c.jsx(Ot,{path:"/dashboard",element:c.jsx(eue,{})}),c.jsx(Ot,{path:"/profile",element:c.jsx(Wue,{})}),c.jsx(Ot,{path:"/inventory",element:c.jsx(U0,{to:"/inventory/manage",replace:!0})}),c.jsx(Ot,{path:"/inventory/add",element:c.jsx(Bhe,{})}),c.jsx(Ot,{path:"/inventory/manage",element:c.jsx(Hhe,{})}),c.jsx(Ot,{path:"/shopping-list",element:c.jsx(epe,{})}),c.jsx(Ot,{path:"/meal-plan/:mealPlanId/recipes",element:c.jsx(fP,{})}),c.jsx(Ot,{path:"/meal-plan-create",element:c.jsx(fP,{})})]}),c.jsx(Ot,{path:"*",element:c.jsx(que,{})})]})})})})}(async()=>{try{await Zr.init()}catch(e){console.error("Failed to initialize analytics service:",e)}})();G2(document.getElementById("root")).render(c.jsx(ype,{}));export{W as _,q as a,et as g};

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.