vendor: 6,122 bytes, lines 1-9
1var om=e=>{throw TypeError(e)};var Ru=(e,t,r)=>t.has(e)||om("Cannot "+r);var T=(e,t,r)=>(Ru(e,t,"read from private field"),r?r.call(e):t.get(e)),fe=(e,t,r)=>t.has(e)?om("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),se=(e,t,r,n)=>(Ru(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),st=(e,t,r)=>(Ru(e,t,"access private method"),r);var Ua=(e,t,r,n)=>({set _(s){se(e,t,s,r)},get _(){return T(e,t,n)}});function $S(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(n,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>n[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(s){if(s.ep)return;s.ep=!0;const i=r(s);fetch(s.href,i)}})();function py(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var my={exports:{}},$c={},gy={exports:{}},ce={};/** 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 Sa=Symbol.for("react.element"),FS=Symbol.for("react.portal"),US=Symbol.for("react.fragment"),zS=Symbol.for("react.strict_mode"),BS=Symbol.for("react.profiler"),VS=Symbol.for("react.provider"),WS=Symbol.for("react.context"),HS=Symbol.for("react.forward_ref"),qS=Symbol.for("react.suspense"),KS=Symbol.for("react.memo"),GS=Symbol.for("react.lazy"),am=Symbol.iterator;function JS(e){return e===null||typeof e!="object"?null:(e=am&&e[am]||e["@@iterator"],typeof e=="function"?e:null)}var vy={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},yy=Object.assign,xy={};function Qi(e,t,r){this.props=e,this.context=t,this.refs=xy,this.updater=r||vy}Qi.prototype.isReactComponent={};Qi.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")};Qi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function wy(){}wy.prototype=Qi.prototype;function ff(e,t,r){this.props=e,this.context=t,this.refs=xy,this.updater=r||vy}var pf=ff.prototype=new wy;pf.constructor=ff;yy(pf,Qi.prototype);pf.isPureReactComponent=!0;var lm=Array.isArray,by=Object.prototype.hasOwnProperty,mf={current:null},_y={key:!0,ref:!0,__self:!0,__source:!0};function Sy(e,t,r){var n,s={},i=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)by.call(t,n)&&!_y.hasOwnProperty(n)&&(s[n]=t[n]);var l=arguments.length-2;if(l===1)s.children=r;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];s.children=c}if(e&&e.defaultProps)for(n in l=e.defaultProps,l)s[n]===void 0&&(s[n]=l[n]);return{$$typeof:Sa,type:e,key:i,ref:o,props:s,_owner:mf.current}}function YS(e,t){return{$$typeof:Sa,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function gf(e){return typeof e=="object"&&e!==null&&e.$$typeof===Sa}function QS(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var cm=/\/+/g;function Pu(e,t){return typeof e=="object"&&e!==null&&e.key!=null?QS(""+e.key):t.toString(36)}function bl(e,t,r,n,s){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Sa:case FS:o=!0}}if(o)return o=e,s=s(o),e=n===""?"."+Pu(o,0):n,lm(s)?(r="",e!=null&&(r=e.replace(cm,"$&/")+"/"),bl(s,t,r,"",function(u){return u})):s!=null&&(gf(s)&&(s=YS(s,r+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(cm,"$&/")+"/")+e)),t.push(s)),1;if(o=0,n=n===""?".":n+":",lm(e))for(var l=0;l<e.length;l++){i=e[l];var c=n+Pu(i,l);o+=bl(i,t,r,c,s)}else if(c=JS(e),typeof c=="function")for(e=c.call(e),l=0;!(i=e.next()).done;)i=i.value,c=n+Pu(i,l++),o+=bl(i,t,r,c,s);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function za(e,t,r){if(e==null)return e;var n=[],s=0;return bl(e,n,"","",function(i){return t.call(r,i,s++)}),n}function XS(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var gt={current:null},_l={transition:null},ZS={ReactCurrentDispatcher:gt,ReactCurrentBatchConfig:_l,ReactCurrentOwner:mf};function jy(){throw Error("act(...) is not supported in production builds of React.")}ce.Children={map:za,forEach:function(e,t,r){za(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return za(e,function(){t++}),t},toArray:function(e){return za(e,function(t){return t})||[]},only:function(e){if(!gf(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ce.Component=Qi;ce.Fragment=US;ce.Profiler=BS;ce.PureComponent=ff;ce.StrictMode=zS;ce.Suspense=qS;
vendor: 9,039 bytes, lines 9-33
9ce.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ZS;ce.act=jy;ce.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=yy({},e.props),s=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=mf.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)by.call(t,c)&&!_y.hasOwnProperty(c)&&(n[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)n.children=r;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];n.children=l}return{$$typeof:Sa,type:e.type,key:s,ref:i,props:n,_owner:o}};ce.createContext=function(e){return e={$$typeof:WS,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:VS,_context:e},e.Consumer=e};ce.createElement=Sy;ce.createFactory=function(e){var t=Sy.bind(null,e);return t.type=e,t};ce.createRef=function(){return{current:null}};ce.forwardRef=function(e){return{$$typeof:HS,render:e}};ce.isValidElement=gf;ce.lazy=function(e){return{$$typeof:GS,_payload:{_status:-1,_result:e},_init:XS}};ce.memo=function(e,t){return{$$typeof:KS,type:e,compare:t===void 0?null:t}};ce.startTransition=function(e){var t=_l.transition;_l.transition={};try{e()}finally{_l.transition=t}};ce.unstable_act=jy;ce.useCallback=function(e,t){return gt.current.useCallback(e,t)};ce.useContext=function(e){return gt.current.useContext(e)};ce.useDebugValue=function(){};ce.useDeferredValue=function(e){return gt.current.useDeferredValue(e)};ce.useEffect=function(e,t){return gt.current.useEffect(e,t)};ce.useId=function(){return gt.current.useId()};ce.useImperativeHandle=function(e,t,r){return gt.current.useImperativeHandle(e,t,r)};ce.useInsertionEffect=function(e,t){return gt.current.useInsertionEffect(e,t)};ce.useLayoutEffect=function(e,t){return gt.current.useLayoutEffect(e,t)};ce.useMemo=function(e,t){return gt.current.useMemo(e,t)};ce.useReducer=function(e,t,r){return gt.current.useReducer(e,t,r)};ce.useRef=function(e){return gt.current.useRef(e)};ce.useState=function(e){return gt.current.useState(e)};ce.useSyncExternalStore=function(e,t,r){return gt.current.useSyncExternalStore(e,t,r)};ce.useTransition=function(){return gt.current.useTransition()};ce.version="18.3.1";gy.exports=ce;var f=gy.exports;const O=py(f),vf=$S({__proto__:null,default:O},[f]);/** 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 ej=f,tj=Symbol.for("react.element"),rj=Symbol.for("react.fragment"),nj=Object.prototype.hasOwnProperty,sj=ej.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ij={key:!0,ref:!0,__self:!0,__source:!0};function Ey(e,t,r){var n,s={},i=null,o=null;r!==void 0&&(i=""+r),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(n in t)nj.call(t,n)&&!ij.hasOwnProperty(n)&&(s[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)s[n]===void 0&&(s[n]=t[n]);return{$$typeof:tj,type:e,key:i,ref:o,props:s,_owner:sj.current}}$c.Fragment=rj;$c.jsx=Ey;$c.jsxs=Ey;my.exports=$c;var a=my.exports,Cy={exports:{}},Ft={},Ny={exports:{}},ky={};/** 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(k,P){var U=k.length;k.push(P);e:for(;0<U;){var ee=U-1>>>1,G=k[ee];if(0<s(G,P))k[ee]=P,k[U]=G,U=ee;else break e}}function r(k){return k.length===0?null:k[0]}function n(k){if(k.length===0)return null;var P=k[0],U=k.pop();if(U!==P){k[0]=U;e:for(var ee=0,G=k.length,ae=G>>>1;ee<ae;){var re=2*(ee+1)-1,be=k[re],Re=re+1,z=k[Re];if(0>s(be,U))Re<G&&0>s(z,be)?(k[ee]=z,k[Re]=U,ee=Re):(k[ee]=be,k[re]=U,ee=re);else if(Re<G&&0>s(z,U))k[ee]=z,k[Re]=U,ee=Re;else break e}}return P}function s(k,P){var U=k.sortIndex-P.sortIndex;return U!==0?U:k.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,h=null,m=3,p=!1,w=!1,g=!1,v=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(k){for(var P=r(u);P!==null;){if(P.callback===null)n(u);else if(P.startTime<=k)n(u),P.sortIndex=P.expirationTime,t(c,P);else break;P=r(u)}}function S(k){if(g=!1,b(k),!w)if(r(c)!==null)w=!0,H(_);else{var P=r(u);P!==null&&X(S,P.startTime-k)}}function _(k,P){w=!1,g&&(g=!1,x(C),C=-1),p=!0;var U=m;try{for(b(P),h=r(c);h!==null&&(!(h.expirationTime>P)||k&&!F());){var ee=h.callback;if(typeof ee=="function"){h.callback=null,m=h.priorityLevel;var G=ee(h.expirationTime<=P);P=e.unstable_now(),typeof G=="function"?h.callback=G:h===r(c)&&n(c),b(P)}else n(c);h=r(c)}if(h!==null)var ae=!0;else{var re=r(u);re!==null&&X(S,re.startTime-P),ae=!1}return ae}finally{h=null,m=U,p=!1}}var j=!1,E=null,C=-1,N=5,R=-1;function F(){return!(e.unstable_now()-R<N)}function I(){if(E!==null){var k=e.unstable_now();R=k;var P=!0;try{P=E(!0,k)}finally{P?J():(j=!1,E=null)}}else j=!1}var J;if(typeof y=="function")J=function(){y(I)};else if(typeof MessageChannel<"u"){var D=new MessageChannel,Z=D.port2;D.port1.onmessage=I,J=function(){Z.postMessage(null)}}else J=function(){v(I,0)};function H(k){E=k,j||(j=!0,J())}function X(k,P){C=v(function(){k(e.unstable_now())},P)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(k){k.callback=null},e.unstable_continueExecution=function(){w||p||(w=!0,H(_))},e.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):N=0<k?Math.floor(1e3/k):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return r(c)},e.unstable_next=function(k){switch(m){case 1:case 2:case 3:var P=3;break;default:P=m}var U=m;m=P;try{return k()}finally{m=U}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(k,P){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var U=m;m=k;try{return P()}finally{m=U}},e.unstable_scheduleCallback=function(k,P,U){var ee=e.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?ee+U:ee):U=ee,k){case 1:var G=-1;break;case 2:G=250;break;case 5:G=1073741823;break;case 4:G=1e4;break;default:G=5e3}return G=U+G,k={id:d++,callback:P,priorityLevel:k,startTime:U,expirationTime:G,sortIndex:-1},U>ee?(k.sortIndex=U,t(u,k),r(c)===null&&k===r(u)&&(g?(x(C),C=-1):g=!0,X(S,U-ee))):(k.sortIndex=G,t(c,k),w||p||(w=!0,H(_))),k},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(k){var P=m;return function(){var U=m;m=P;try{return k.apply(this,arguments)}finally{m=U}}}})(ky);Ny.exports=ky;var oj=Ny.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 aj=f,Dt=oj;function A(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Ty=new Set,Bo={};function Ms(e,t){Mi(e,t),Mi(e+"Capture",t)}function Mi(e,t){for(Bo[e]=t,e=0;e<t.length;e++)Ty.add(t[e])}var tn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),kd=Object.prototype.hasOwnProperty,lj=/^[: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]*$/,um={},dm={};function cj(e){return kd.call(dm,e)?!0:kd.call(um,e)?!1:lj.test(e)?dm[e]=!0:(um[e]=!0,!1)}function uj(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function dj(e,t,r,n){if(t===null||typeof t>"u"||uj(e,t,r,n))return!0;
vendor: 5,200 bytes, lines 33-34
33if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function vt(e,t,r,n,s,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=s,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var tt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){tt[e]=new vt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];tt[t]=new vt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){tt[e]=new vt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){tt[e]=new vt(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){tt[e]=new vt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){tt[e]=new vt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){tt[e]=new vt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){tt[e]=new vt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){tt[e]=new vt(e,5,!1,e.toLowerCase(),null,!1,!1)});var yf=/[\-:]([a-z])/g;function xf(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(yf,xf);tt[t]=new vt(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(yf,xf);tt[t]=new vt(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(yf,xf);tt[t]=new vt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){tt[e]=new vt(e,1,!1,e.toLowerCase(),null,!1,!1)});tt.xlinkHref=new vt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){tt[e]=new vt(e,1,!1,e.toLowerCase(),null,!0,!0)});function wf(e,t,r,n){var s=tt.hasOwnProperty(t)?tt[t]:null;(s!==null?s.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(dj(t,r,s,n)&&(r=null),n||s===null?cj(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):s.mustUseProperty?e[s.propertyName]=r===null?s.type===3?!1:"":r:(t=s.attributeName,n=s.attributeNamespace,r===null?e.removeAttribute(t):(s=s.type,r=s===3||s===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var hn=aj.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ba=Symbol.for("react.element"),ni=Symbol.for("react.portal"),si=Symbol.for("react.fragment"),bf=Symbol.for("react.strict_mode"),Td=Symbol.for("react.profiler"),Ry=Symbol.for("react.provider"),Py=Symbol.for("react.context"),_f=Symbol.for("react.forward_ref"),Rd=Symbol.for("react.suspense"),Pd=Symbol.for("react.suspense_list"),Sf=Symbol.for("react.memo"),_n=Symbol.for("react.lazy"),Ay=Symbol.for("react.offscreen"),hm=Symbol.iterator;function uo(e){return e===null||typeof e!="object"?null:(e=hm&&e[hm]||e["@@iterator"],typeof e=="function"?e:null)}var Te=Object.assign,Au;function So(e){if(Au===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);Au=t&&t[1]||""}return` 34`+Au+e}var Ou=!1;function Iu(e,t){if(!e||Ou)return"";Ou=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var n=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){n=u}e.call(t.prototype)}else{try{throw Error()}catch(u){n=u}e()}}
vendor: 14,090 bytes, lines 34-37
34catch(u){if(u&&n&&typeof u.stack=="string"){for(var s=u.stack.split(` 35`),i=n.stack.split(` 36`),o=s.length-1,l=i.length-1;1<=o&&0<=l&&s[o]!==i[l];)l--;for(;1<=o&&0<=l;o--,l--)if(s[o]!==i[l]){if(o!==1||l!==1)do if(o--,l--,0>l||s[o]!==i[l]){var c=` 37`+s[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{Ou=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?So(e):""}function hj(e){switch(e.tag){case 5:return So(e.type);case 16:return So("Lazy");case 13:return So("Suspense");case 19:return So("SuspenseList");case 0:case 2:case 15:return e=Iu(e.type,!1),e;case 11:return e=Iu(e.type.render,!1),e;case 1:return e=Iu(e.type,!0),e;default:return""}}function Ad(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 si:return"Fragment";case ni:return"Portal";case Td:return"Profiler";case bf:return"StrictMode";case Rd:return"Suspense";case Pd:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Py:return(e.displayName||"Context")+".Consumer";case Ry:return(e._context.displayName||"Context")+".Provider";case _f:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Sf:return t=e.displayName||null,t!==null?t:Ad(e.type)||"Memo";case _n:t=e._payload,e=e._init;try{return Ad(e(t))}catch{}}return null}function fj(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 Ad(t);case 8:return t===bf?"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 Hn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Oy(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function pj(e){var t=Oy(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var s=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){n=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Va(e){e._valueTracker||(e._valueTracker=pj(e))}function Iy(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=Oy(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Bl(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 Od(e,t){var r=t.checked;return Te({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function fm(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Hn(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Dy(e,t){t=t.checked,t!=null&&wf(e,"checked",t,!1)}function Id(e,t){Dy(e,t);var r=Hn(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Dd(e,t.type,r):t.hasOwnProperty("defaultValue")&&Dd(e,t.type,Hn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function pm(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Dd(e,t,r){(t!=="number"||Bl(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var jo=Array.isArray;function mi(e,t,r,n){if(e=e.options,t){t={};for(var s=0;s<r.length;s++)t["$"+r[s]]=!0;for(r=0;r<e.length;r++)s=t.hasOwnProperty("$"+e[r].value),e[r].selected!==s&&(e[r].selected=s),s&&n&&(e[r].defaultSelected=!0)}else{for(r=""+Hn(r),t=null,s=0;s<e.length;s++){if(e[s].value===r){e[s].selected=!0,n&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Ld(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(A(91));return Te({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function mm(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(A(92));if(jo(r)){if(1<r.length)throw Error(A(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Hn(r)}}function Ly(e,t){var r=Hn(t.value),n=Hn(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function gm(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function My(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 Md(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?My(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Wa,$y=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,s){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Wa=Wa||document.createElement("div"),Wa.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Wa.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Vo(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Po={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},mj=["Webkit","ms","Moz","O"];Object.keys(Po).forEach(function(e){mj.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Po[t]=Po[e]})});function Fy(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Po.hasOwnProperty(e)&&Po[e]?(""+t).trim():t+"px"}function Uy(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,s=Fy(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,s):e[r]=s}}var gj=Te({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function $d(e,t){if(t){if(gj[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(A(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(A(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(A(61))}if(t.style!=null&&typeof t.style!="object")throw Error(A(62))}}function Fd(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ud=null;function jf(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var zd=null,gi=null,vi=null;function vm(e){if(e=Ca(e)){if(typeof zd!="function")throw Error(A(280));var t=e.stateNode;t&&(t=Vc(t),zd(e.stateNode,e.type,t))}}function zy(e){gi?vi?vi.push(e):vi=[e]:gi=e}function By(){if(gi){var e=gi,t=vi;if(vi=gi=null,vm(e),t)for(e=0;e<t.length;e++)vm(t[e])}}function Vy(e,t){return e(t)}function Wy(){}var Du=!1;function Hy(e,t,r){if(Du)return e(t,r);Du=!0;try{return Vy(e,t,r)}finally{Du=!1,(gi!==null||vi!==null)&&(Wy(),By())}}function Wo(e,t){var r=e.stateNode;if(r===null)return null;var n=Vc(r);if(n===null)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(A(231,t,typeof r));return r}var Bd=!1;if(tn)try{var ho={};Object.defineProperty(ho,"passive",{get:function(){Bd=!0}}),window.addEventListener("test",ho,ho),window.removeEventListener("test",ho,ho)}catch{Bd=!1}function vj(e,t,r,n,s,i,o,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(r,u)}catch(d){this.onError(d)}}var Ao=!1,Vl=null,Wl=!1,Vd=null,yj={onError:function(e){Ao=!0,Vl=e}};function xj(e,t,r,n,s,i,o,l,c){Ao=!1,Vl=null,vj.apply(yj,arguments)}function wj(e,t,r,n,s,i,o,l,c){if(xj.apply(this,arguments),Ao){if(Ao){var u=Vl;Ao=!1,Vl=null}else throw Error(A(198));Wl||(Wl=!0,Vd=u)}}function $s(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function qy(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 ym(e){if($s(e)!==e)throw Error(A(188))}function bj(e){var t=e.alternate;if(!t){if(t=$s(e),t===null)throw Error(A(188));return t!==e?null:e}for(var r=e,n=t;;){var s=r.return;if(s===null)break;var i=s.alternate;if(i===null){if(n=s.return,n!==null){r=n;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===r)return ym(s),e;if(i===n)return ym(s),t;i=i.sibling}throw Error(A(188))}if(r.return!==n.return)r=s,n=i;else{for(var o=!1,l=s.child;l;){if(l===r){o=!0,r=s,n=i;break}if(l===n){o=!0,n=s,r=i;break}l=l.sibling}if(!o){for(l=i.child;l;){if(l===r){o=!0,r=i,n=s;break}if(l===n){o=!0,n=i,r=s;break}l=l.sibling}if(!o)throw Error(A(189))}}if(r.alternate!==n)throw Error(A(190))}if(r.tag!==3)throw Error(A(188));return r.stateNode.current===r?e:t}function Ky(e){return e=bj(e),e!==null?Gy(e):null}function Gy(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Gy(e);if(t!==null)return t;e=e.sibling}return null}var Jy=Dt.unstable_scheduleCallback,xm=Dt.unstable_cancelCallback,_j=Dt.unstable_shouldYield,Sj=Dt.unstable_requestPaint,Le=Dt.unstable_now,jj=Dt.unstable_getCurrentPriorityLevel,Ef=Dt.unstable_ImmediatePriority,Yy=Dt.unstable_UserBlockingPriority,Hl=Dt.unstable_NormalPriority,Ej=Dt.unstable_LowPriority,Qy=Dt.unstable_IdlePriority,Fc=null,Pr=null;function Cj(e){if(Pr&&typeof Pr.onCommitFiberRoot=="function")try{Pr.onCommitFiberRoot(Fc,e,void 0,(e.current.flags&128)===128)}catch{}}var gr=Math.clz32?Math.clz32:Tj,Nj=Math.log,kj=Math.LN2;function Tj(e){return e>>>=0,e===0?32:31-(Nj(e)/kj|0)|0}var Ha=64,qa=4194304;function Eo(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 ql(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,s=e.suspendedLanes,i=e.pingedLanes,o=r&268435455;if(o!==0){var l=o&~s;l!==0?n=Eo(l):(i&=o,i!==0&&(n=Eo(i)))}else o=r&~s,o!==0?n=Eo(o):i!==0&&(n=Eo(i));if(n===0)return 0;if(t!==0&&t!==n&&!(t&s)&&(s=n&-n,i=t&-t,s>=i||s===16&&(i&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-gr(t),s=1<<r,n|=e[r],t&=~s;return n}function Rj(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 Pj(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-gr(i),l=1<<o,c=s[o];c===-1?(!(l&r)||l&n)&&(s[o]=Rj(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}}function Wd(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Xy(){var e=Ha;return Ha<<=1,!(Ha&4194240)&&(Ha=64),e}function Lu(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}
vendor: 2,647 bytes, line 37
37function ja(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-gr(t),e[t]=r}function Aj(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var s=31-gr(r),i=1<<s;t[s]=0,n[s]=-1,e[s]=-1,r&=~i}}function Cf(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-gr(r),s=1<<n;s&t|e[n]&t&&(e[n]|=t),r&=~s}}var ge=0;function Zy(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var ex,Nf,tx,rx,nx,Hd=!1,Ka=[],Ln=null,Mn=null,$n=null,Ho=new Map,qo=new Map,jn=[],Oj="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 wm(e,t){switch(e){case"focusin":case"focusout":Ln=null;break;case"dragenter":case"dragleave":Mn=null;break;case"mouseover":case"mouseout":$n=null;break;case"pointerover":case"pointerout":Ho.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":qo.delete(t.pointerId)}}function fo(e,t,r,n,s,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:i,targetContainers:[s]},t!==null&&(t=Ca(t),t!==null&&Nf(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function Ij(e,t,r,n,s){switch(t){case"focusin":return Ln=fo(Ln,e,t,r,n,s),!0;case"dragenter":return Mn=fo(Mn,e,t,r,n,s),!0;case"mouseover":return $n=fo($n,e,t,r,n,s),!0;case"pointerover":var i=s.pointerId;return Ho.set(i,fo(Ho.get(i)||null,e,t,r,n,s)),!0;case"gotpointercapture":return i=s.pointerId,qo.set(i,fo(qo.get(i)||null,e,t,r,n,s)),!0}return!1}function sx(e){var t=hs(e.target);if(t!==null){var r=$s(t);if(r!==null){if(t=r.tag,t===13){if(t=qy(r),t!==null){e.blockedOn=t,nx(e.priority,function(){tx(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Sl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=qd(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);Ud=n,r.target.dispatchEvent(n),Ud=null}else return t=Ca(r),t!==null&&Nf(t),e.blockedOn=r,!1;t.shift()}return!0}function bm(e,t,r){Sl(e)&&r.delete(t)}function Dj(){Hd=!1,Ln!==null&&Sl(Ln)&&(Ln=null),Mn!==null&&Sl(Mn)&&(Mn=null),$n!==null&&Sl($n)&&($n=null),Ho.forEac
vendor: 11,521 bytes, line 37
37h(bm),qo.forEach(bm)}function po(e,t){e.blockedOn===t&&(e.blockedOn=null,Hd||(Hd=!0,Dt.unstable_scheduleCallback(Dt.unstable_NormalPriority,Dj)))}function Ko(e){function t(s){return po(s,e)}if(0<Ka.length){po(Ka[0],e);for(var r=1;r<Ka.length;r++){var n=Ka[r];n.blockedOn===e&&(n.blockedOn=null)}}for(Ln!==null&&po(Ln,e),Mn!==null&&po(Mn,e),$n!==null&&po($n,e),Ho.forEach(t),qo.forEach(t),r=0;r<jn.length;r++)n=jn[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<jn.length&&(r=jn[0],r.blockedOn===null);)sx(r),r.blockedOn===null&&jn.shift()}var yi=hn.ReactCurrentBatchConfig,Kl=!0;function Lj(e,t,r,n){var s=ge,i=yi.transition;yi.transition=null;try{ge=1,kf(e,t,r,n)}finally{ge=s,yi.transition=i}}function Mj(e,t,r,n){var s=ge,i=yi.transition;yi.transition=null;try{ge=4,kf(e,t,r,n)}finally{ge=s,yi.transition=i}}function kf(e,t,r,n){if(Kl){var s=qd(e,t,r,n);if(s===null)qu(e,t,n,Gl,r),wm(e,n);else if(Ij(s,e,t,r,n))n.stopPropagation();else if(wm(e,n),t&4&&-1<Oj.indexOf(e)){for(;s!==null;){var i=Ca(s);if(i!==null&&ex(i),i=qd(e,t,r,n),i===null&&qu(e,t,n,Gl,r),i===s)break;s=i}s!==null&&n.stopPropagation()}else qu(e,t,n,null,r)}}var Gl=null;function qd(e,t,r,n){if(Gl=null,e=jf(n),e=hs(e),e!==null)if(t=$s(e),t===null)e=null;else if(r=t.tag,r===13){if(e=qy(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Gl=e,null}function ix(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(jj()){case Ef:return 1;case Yy:return 4;case Hl:case Ej:return 16;case Qy:return 536870912;default:return 16}default:return 16}}var On=null,Tf=null,jl=null;function ox(){if(jl)return jl;var e,t=Tf,r=t.length,n,s="value"in On?On.value:On.textContent,i=s.length;for(e=0;e<r&&t[e]===s[e];e++);var o=r-e;for(n=1;n<=o&&t[r-n]===s[i-n];n++);return jl=s.slice(e,1<n?1-n:void 0)}function El(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 Ga(){return!0}function _m(){return!1}function Ut(e){function t(r,n,s,i,o){this._reactName=r,this._targetInst=s,this.type=n,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(r=e[l],this[l]=r?r(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Ga:_m,this.isPropagationStopped=_m,this}return Te(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Ga)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Ga)},persist:function(){},isPersistent:Ga}),t}var Xi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Rf=Ut(Xi),Ea=Te({},Xi,{view:0,detail:0}),$j=Ut(Ea),Mu,$u,mo,Uc=Te({},Ea,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Pf,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==mo&&(mo&&e.type==="mousemove"?(Mu=e.screenX-mo.screenX,$u=e.screenY-mo.screenY):$u=Mu=0,mo=e),Mu)},movementY:function(e){return"movementY"in e?e.movementY:$u}}),Sm=Ut(Uc),Fj=Te({},Uc,{dataTransfer:0}),Uj=Ut(Fj),zj=Te({},Ea,{relatedTarget:0}),Fu=Ut(zj),Bj=Te({},Xi,{animationName:0,elapsedTime:0,pseudoElement:0}),Vj=Ut(Bj),Wj=Te({},Xi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Hj=Ut(Wj),qj=Te({},Xi,{data:0}),jm=Ut(qj),Kj={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Gj={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"},Jj={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Yj(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Jj[e])?!!t[e]:!1}function Pf(){return Yj}var Qj=Te({},Ea,{key:function(e){if(e.key){var t=Kj[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=El(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Gj[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Pf,charCode:function(e){return e.type==="keypress"?El(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?El(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Xj=Ut(Qj),Zj=Te({},Uc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Em=Ut(Zj),eE=Te({},Ea,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Pf}),tE=Ut(eE),rE=Te({},Xi,{propertyName:0,elapsedTime:0,pseudoElement:0}),nE=Ut(rE),sE=Te({},Uc,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),iE=Ut(sE),oE=[9,13,27,32],Af=tn&&"CompositionEvent"in window,Oo=null;tn&&"documentMode"in document&&(Oo=document.documentMode);var aE=tn&&"TextEvent"in window&&!Oo,ax=tn&&(!Af||Oo&&8<Oo&&11>=Oo),Cm=" ",Nm=!1;function lx(e,t){switch(e){case"keyup":return oE.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function cx(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ii=!1;function lE(e,t){switch(e){case"compositionend":return cx(t);case"keypress":return t.which!==32?null:(Nm=!0,Cm);case"textInput":return e=t.data,e===Cm&&Nm?null:e;default:return null}}function cE(e,t){if(ii)return e==="compositionend"||!Af&&lx(e,t)?(e=ox(),jl=Tf=On=null,ii=!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 ax&&t.locale!=="ko"?null:t.data;default:return null}}var uE={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 km(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!uE[e.type]:t==="textarea"}function ux(e,t,r,n){zy(n),t=Jl(t,"onChange"),0<t.length&&(r=new Rf("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var Io=null,Go=null;function dE(e){bx(e,0)}function zc(e){var t=li(e);if(Iy(t))return e}function hE(e,t){if(e==="change")return t}var dx=!1;if(tn){var Uu;if(tn){var zu="oninput"in document;if(!zu){var Tm=document.createElement("div");Tm.setAttribute("oninput","return;"),zu=typeof Tm.oninput=="function"}Uu=zu}else Uu=!1;dx=Uu&&(!document.documentMode||9<document.documentMode)}function Rm(){Io&&(Io.detachEvent("onpropertychange",hx),Go=Io=null)}function hx(e){if(e.propertyName==="value"&&zc(Go)){var t=[];ux(t,Go,e,jf(e)),Hy(dE,t)}}function fE(e,t,r){e==="focusin"?(Rm(),Io=t,Go=r,Io.attachEvent("onpropertychange",hx)):e==="focusout"&&Rm()}function pE(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return zc(Go)}function mE(e,t){if(e==="click")return zc(t)}function gE(e,t){if(e==="input"||e==="change")return zc(t)}function vE(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var yr=typeof Object.is=="function"?Object.is:vE;function Jo(e,t){if(yr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var s=r[n];if(!kd.call(t,s)||!yr(e[s],t[s]))return!1}return!0}function Pm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Am(e,t){var r=Pm(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Pm(r)}}function fx(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?fx(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function px(){for(var e=window,t=Bl();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Bl(e.document)}return t}function Of(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 yE(e){var t=px(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&fx(r.ownerDocument.documentElement,r)){if(n!==null&&Of(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=r.textContent.length,i=Math.min(n.start,s);n=n.end===void 0?i:Math.min(n.end,s),!e.extend&&i>n&&(s=n,n=i,i=s),s=Am(r,i);var o=Am(r,n);s&&o&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var xE=tn&&"documentMode"in document&&11>=document.documentMode,oi=null,Kd=null,Do=null,Gd=!1;
vendor: 4,120 bytes, line 37
37function Om(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Gd||oi==null||oi!==Bl(n)||(n=oi,"selectionStart"in n&&Of(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Do&&Jo(Do,n)||(Do=n,n=Jl(Kd,"onSelect"),0<n.length&&(t=new Rf("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=oi)))}function Ja(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var ai={animationend:Ja("Animation","AnimationEnd"),animationiteration:Ja("Animation","AnimationIteration"),animationstart:Ja("Animation","AnimationStart"),transitionend:Ja("Transition","TransitionEnd")},Bu={},mx={};tn&&(mx=document.createElement("div").style,"AnimationEvent"in window||(delete ai.animationend.animation,delete ai.animationiteration.animation,delete ai.animationstart.animation),"TransitionEvent"in window||delete ai.transitionend.transition);function Bc(e){if(Bu[e])return Bu[e];if(!ai[e])return e;var t=ai[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in mx)return Bu[e]=t[r];return e}var gx=Bc("animationend"),vx=Bc("animationiteration"),yx=Bc("animationstart"),xx=Bc("transitionend"),wx=new Map,Im="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 Qn(e,t){wx.set(e,t),Ms(t,[e])}for(var Vu=0;Vu<Im.length;Vu++){var Wu=Im[Vu],wE=Wu.toLowerCase(),bE=Wu[0].toUpperCase()+Wu.slice(1);Qn(wE,"on"+bE)}Qn(gx,"onAnimationEnd");Qn(vx,"onAnimationIteration");Qn(yx,"onAnimationStart");Qn("dblclick","onDoubleClick");Qn("focusin","onFocus");Qn("focusout","onBlur");Qn(xx,"onTransitionEnd");Mi("onMouseEnter",["mouseout","mouseover"]);Mi("onMouseLeave",["mouseout","mouseover"]);Mi("onPointerEnter",["pointerout","pointerover"]);Mi("onPointerLeave",["pointerout","pointerover"]);Ms("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ms("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ms("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ms("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ms("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ms("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Co="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(" "),_E=new Set("cancel close invalid load scroll toggle".split(" ").concat(Co));function Dm(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,wj(n,t,void 0,e),e.currentTarget=null}function bx(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],s=n.event;n=n.listeners;e:{var i=void 0;if(t)for(var o=n.length-1;0<=o;o--){var l=n[o],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==i&&s.isPropagationStopped())break e;Dm(s,l,u),i=c}else for(o=0;o<n.length;o++){if(l=n[o],c=l.instance,u=l.currentTarget,l=l.listener,c!==i&&s.isPropagationStopped())break e;Dm(s,l,u),i=c}}}if(Wl)throw e=Vd,Wl=!1,Vd=null,e}function Se(e,t){var r=t[Zd];r===void 0&&(r=t[Zd]=new Set);var n=e+"__bubble";r.has(n)||(_x(t,e,2,!1),r.add(n))}function Hu(e,t,r){var n=0;t&&(n|=4),_x(r,e,n,t)}var Ya="_reactListening"+Math.random().toString(36).slice(2);
vendor: 3,228 bytes, line 37
37function Yo(e){if(!e[Ya]){e[Ya]=!0,Ty.forEach(function(r){r!=="selectionchange"&&(_E.has(r)||Hu(r,!1,e),Hu(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ya]||(t[Ya]=!0,Hu("selectionchange",!1,t))}}function _x(e,t,r,n){switch(ix(t)){case 1:var s=Lj;break;case 4:s=Mj;break;default:s=kf}r=s.bind(null,t,r,e),s=void 0,!Bd||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),n?s!==void 0?e.addEventListener(t,r,{capture:!0,passive:s}):e.addEventListener(t,r,!0):s!==void 0?e.addEventListener(t,r,{passive:s}):e.addEventListener(t,r,!1)}function qu(e,t,r,n,s){var i=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var o=n.tag;if(o===3||o===4){var l=n.stateNode.containerInfo;if(l===s||l.nodeType===8&&l.parentNode===s)break;if(o===4)for(o=n.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===s||c.nodeType===8&&c.parentNode===s))return;o=o.return}for(;l!==null;){if(o=hs(l),o===null)return;if(c=o.tag,c===5||c===6){n=i=o;continue e}l=l.parentNode}}n=n.return}Hy(function(){var u=i,d=jf(r),h=[];e:{var m=wx.get(e);if(m!==void 0){var p=Rf,w=e;switch(e){case"keypress":if(El(r)===0)break e;case"keydown":case"keyup":p=Xj;break;case"focusin":w="focus",p=Fu;break;case"focusout":w="blur",p=Fu;break;case"beforeblur":case"afterblur":p=Fu;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=Sm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=Uj;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=tE;break;case gx:case vx:case yx:p=Vj;break;case xx:p=nE;break;case"scroll":p=$j;break;case"wheel":p=iE;break;case"copy":case"cut":case"paste":p=Hj;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=Em}var g=(t&4)!==0,v=!g&&e==="scroll",x=g?m!==null?m+"Capture":null:m;g=[];for(var y=u,b;y!==null;){b=y;var S=b.stateNode;if(b.tag===5&&S!==null&&(b=S,x!==null&&(S=Wo(y,x),S!=null&&g.push(Qo(y,S,b)))),v)break;y=y.return}0<g.length&&(m=new p(m,w,null,r,d),h.push({event:m,listeners:g}))}}if(!(t&7)){e:{if(m=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",m&&r!==Ud&&(w=r.relatedTarget||r.fromElement)&&(hs(w)||w[rn]))break e;if((p||m)&&(m=d.window===d?d:(m=d.ownerDocument)?m.defaultView||m.parentWindow:window,p?(w=r.relatedTarget||r.toElement,p=u,w=w?hs(w):null,w!==null&&(v=$s(w),w!==v||w.tag!==5&&w.tag!==6)&&(w=null)):(p=null,w=u),p!==w)){if(g=Sm,S="onMouseLeave",x="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(g=Em,S="onPointerLeave",x="onPointerEnter",y="pointer"),v=p==null?m:li(p),b=w==null?m:li(w),m=new g(S,y+"leave",p,r,d),m.target=v,m.relatedTarget=b,S=null,hs(d)===u&&(g=new g(x,y+"enter",w,r,d),g.target=b,g.relatedTarget=v,S=g),v=S,p&&w)t:{for(g=p,x=w,y=0,b=g;b;b=qs(b))y++;for(b=0,S=x;S;S=qs(S))b++;for(;0<y-b;)g=qs(g),y--;for(;0<b-y;)x=qs(x),b--;for(;y--;){if(g===x||x!==null&&g===x.alternate)break t;g=qs(g),x=qs(x)}g=null}else g=null;p!==null&&Lm(h,m,p,g,!1),w!==null&&v!==null&&Lm(h,v,w,g,!0)}}
vendor: 5,681 bytes, lines 37-38
37e:{if(m=u?li(u):window,p=m.nodeName&&m.nodeName.toLowerCase(),p==="select"||p==="input"&&m.type==="file")var _=hE;else if(km(m))if(dx)_=gE;else{_=pE;var j=fE}else(p=m.nodeName)&&p.toLowerCase()==="input"&&(m.type==="checkbox"||m.type==="radio")&&(_=mE);if(_&&(_=_(e,u))){ux(h,_,r,d);break e}j&&j(e,m,u),e==="focusout"&&(j=m._wrapperState)&&j.controlled&&m.type==="number"&&Dd(m,"number",m.value)}switch(j=u?li(u):window,e){case"focusin":(km(j)||j.contentEditable==="true")&&(oi=j,Kd=u,Do=null);break;case"focusout":Do=Kd=oi=null;break;case"mousedown":Gd=!0;break;case"contextmenu":case"mouseup":case"dragend":Gd=!1,Om(h,r,d);break;case"selectionchange":if(xE)break;case"keydown":case"keyup":Om(h,r,d)}var E;if(Af)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 ii?lx(e,r)&&(C="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(C="onCompositionStart");C&&(ax&&r.locale!=="ko"&&(ii||C!=="onCompositionStart"?C==="onCompositionEnd"&&ii&&(E=ox()):(On=d,Tf="value"in On?On.value:On.textContent,ii=!0)),j=Jl(u,C),0<j.length&&(C=new jm(C,e,null,r,d),h.push({event:C,listeners:j}),E?C.data=E:(E=cx(r),E!==null&&(C.data=E)))),(E=aE?lE(e,r):cE(e,r))&&(u=Jl(u,"onBeforeInput"),0<u.length&&(d=new jm("onBeforeInput","beforeinput",null,r,d),h.push({event:d,listeners:u}),d.data=E))}bx(h,t)})}function Qo(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Jl(e,t){for(var r=t+"Capture",n=[];e!==null;){var s=e,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=Wo(e,r),i!=null&&n.unshift(Qo(e,i,s)),i=Wo(e,t),i!=null&&n.push(Qo(e,i,s))),e=e.return}return n}function qs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Lm(e,t,r,n,s){for(var i=t._reactName,o=[];r!==null&&r!==n;){var l=r,c=l.alternate,u=l.stateNode;if(c!==null&&c===n)break;l.tag===5&&u!==null&&(l=u,s?(c=Wo(r,i),c!=null&&o.unshift(Qo(r,c,l))):s||(c=Wo(r,i),c!=null&&o.push(Qo(r,c,l)))),r=r.return}o.length!==0&&e.push({event:t,listeners:o})}var SE=/\r\n?/g,jE=/\u0000|\uFFFD/g;function Mm(e){return(typeof e=="string"?e:""+e).replace(SE,` 38`).replace(jE,"")}function Qa(e,t,r){if(t=Mm(t),Mm(e)!==t&&r)throw Error(A(425))}function Yl(){}var Jd=null,Yd=null;function Qd(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 Xd=typeof setTimeout=="function"?setTimeout:void 0,EE=typeof clearTimeout=="function"?clearTimeout:void 0,$m=typeof Promise=="function"?Promise:void 0,CE=typeof queueMicrotask=="function"?queueMicrotask:typeof $m<"u"?function(e){return $m.resolve(null).then(e).catch(NE)}:Xd;function NE(e){setTimeout(function(){throw e})}function Ku(e,t){var r=t,n=0;do{var s=r.nextSibling;if(e.removeChild(r),s&&s.nodeType===8)if(r=s.data,r==="/$"){if(n===0){e.removeChild(s),Ko(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=s}while(r);Ko(t)}function Fn(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 Fm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var Zi=Math.random().toString(36).slice(2),Tr="__reactFiber$"+Zi,Xo="__reactProps$"+Zi,rn="__reactContainer$"+Zi,Zd="__reactEvents$"+Zi,kE="__reactListeners$"+Zi,TE="__reactHandles$"+Zi;function hs(e){var t=e[Tr];if(t)return t;for(var r=e.parentNode;r;){if(t=r[rn]||r[Tr]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Fm(e);e!==null;){if(r=e[Tr])return r;e=Fm(e)}return t}e=r,r=e.parentNode}return null}function Ca(e){return e=e[Tr]||e[rn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function li(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(A(33))}function Vc(e){return e[Xo]||null}var eh=[],ci=-1;function Xn(e){return{current:e}}function je(e){0>ci||(e.current=eh[ci],eh[ci]=null,ci--)}function we(e,t){ci++,eh[ci]=e.current,e.current=t}var qn={},ut=Xn(qn),St=Xn(!1),ks=qn;function $i(e,t){var r=e.type.contextTypes;if(!r)return qn;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in r)s[i]=t[i];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function jt(e){return e=e.childContextTypes,e!=null}function Ql(){je(St),je(ut)}function Um(e,t,r){if(ut.current!==qn)throw Error(A(168));we(ut,t),we(St,r)}function Sx(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var s in n)if(!(s in t))throw Error(A(108,fj(e)||"Unknown",s));return Te({},r,n)}function Xl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||qn,ks=ut.current,we(ut,e),we(St,St.current),!0}function zm(e,t,r){var n=e.stateNode;if(!n)throw Error(A(169));r?(e=Sx(e,t,ks),n.__reactInternalMemoizedMergedChildContext=e,je(St),je(ut),we(ut,e)):je(St),we(St,r)}var Jr=null,Wc=!1,Gu=!1;function jx(e){Jr===null?Jr=[e]:Jr.push(e)}function RE(e){Wc=!0,jx(e)}function Zn(){if(!Gu&&Jr!==null){Gu=!0;var e=0,t=ge;try{var r=Jr;for(ge=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}Jr=null,Wc=!1}catch(s){throw Jr!==null&&(Jr=Jr.slice(e+1)),Jy(Ef,Zn),s}finally{ge=t,Gu=!1}}return null}var ui=[],di=0,Zl=null,ec=0,qt=[],Kt=0,Ts=null,Xr=1,Zr="";function ls(e,t){ui[di++]=ec,ui[di++]=Zl,Zl=e,ec=t}
vendor: 14,409 bytes, line 38
38function Ex(e,t,r){qt[Kt++]=Xr,qt[Kt++]=Zr,qt[Kt++]=Ts,Ts=e;var n=Xr;e=Zr;var s=32-gr(n)-1;n&=~(1<<s),r+=1;var i=32-gr(t)+s;if(30<i){var o=s-s%5;i=(n&(1<<o)-1).toString(32),n>>=o,s-=o,Xr=1<<32-gr(t)+s|r<<s|n,Zr=i+e}else Xr=1<<i|r<<s|n,Zr=e}function If(e){e.return!==null&&(ls(e,1),Ex(e,1,0))}function Df(e){for(;e===Zl;)Zl=ui[--di],ui[di]=null,ec=ui[--di],ui[di]=null;for(;e===Ts;)Ts=qt[--Kt],qt[Kt]=null,Zr=qt[--Kt],qt[Kt]=null,Xr=qt[--Kt],qt[Kt]=null}var Ot=null,At=null,Ce=!1,pr=null;function Cx(e,t){var r=Gt(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function Bm(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Ot=e,At=Fn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Ot=e,At=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Ts!==null?{id:Xr,overflow:Zr}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=Gt(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Ot=e,At=null,!0):!1;default:return!1}}function th(e){return(e.mode&1)!==0&&(e.flags&128)===0}function rh(e){if(Ce){var t=At;if(t){var r=t;if(!Bm(e,t)){if(th(e))throw Error(A(418));t=Fn(r.nextSibling);var n=Ot;t&&Bm(e,t)?Cx(n,r):(e.flags=e.flags&-4097|2,Ce=!1,Ot=e)}}else{if(th(e))throw Error(A(418));e.flags=e.flags&-4097|2,Ce=!1,Ot=e}}}function Vm(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ot=e}function Xa(e){if(e!==Ot)return!1;if(!Ce)return Vm(e),Ce=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Qd(e.type,e.memoizedProps)),t&&(t=At)){if(th(e))throw Nx(),Error(A(418));for(;t;)Cx(e,t),t=Fn(t.nextSibling)}if(Vm(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(A(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){At=Fn(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}At=null}}else At=Ot?Fn(e.stateNode.nextSibling):null;return!0}function Nx(){for(var e=At;e;)e=Fn(e.nextSibling)}function Fi(){At=Ot=null,Ce=!1}function Lf(e){pr===null?pr=[e]:pr.push(e)}var PE=hn.ReactCurrentBatchConfig;function go(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(A(309));var n=r.stateNode}if(!n)throw Error(A(147,e));var s=n,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(o){var l=s.refs;o===null?delete l[i]:l[i]=o},t._stringRef=i,t)}if(typeof e!="string")throw Error(A(284));if(!r._owner)throw Error(A(290,e))}return e}function Za(e,t){throw e=Object.prototype.toString.call(t),Error(A(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Wm(e){var t=e._init;return t(e._payload)}function kx(e){function t(x,y){if(e){var b=x.deletions;b===null?(x.deletions=[y],x.flags|=16):b.push(y)}}function r(x,y){if(!e)return null;for(;y!==null;)t(x,y),y=y.sibling;return null}function n(x,y){for(x=new Map;y!==null;)y.key!==null?x.set(y.key,y):x.set(y.index,y),y=y.sibling;return x}function s(x,y){return x=Vn(x,y),x.index=0,x.sibling=null,x}function i(x,y,b){return x.index=b,e?(b=x.alternate,b!==null?(b=b.index,b<y?(x.flags|=2,y):b):(x.flags|=2,y)):(x.flags|=1048576,y)}function o(x){return e&&x.alternate===null&&(x.flags|=2),x}function l(x,y,b,S){return y===null||y.tag!==6?(y=td(b,x.mode,S),y.return=x,y):(y=s(y,b),y.return=x,y)}function c(x,y,b,S){var _=b.type;return _===si?d(x,y,b.props.children,S,b.key):y!==null&&(y.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===_n&&Wm(_)===y.type)?(S=s(y,b.props),S.ref=go(x,y,b),S.return=x,S):(S=Al(b.type,b.key,b.props,null,x.mode,S),S.ref=go(x,y,b),S.return=x,S)}function u(x,y,b,S){return y===null||y.tag!==4||y.stateNode.containerInfo!==b.containerInfo||y.stateNode.implementation!==b.implementation?(y=rd(b,x.mode,S),y.return=x,y):(y=s(y,b.children||[]),y.return=x,y)}function d(x,y,b,S,_){return y===null||y.tag!==7?(y=Cs(b,x.mode,S,_),y.return=x,y):(y=s(y,b),y.return=x,y)}function h(x,y,b){if(typeof y=="string"&&y!==""||typeof y=="number")return y=td(""+y,x.mode,b),y.return=x,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Ba:return b=Al(y.type,y.key,y.props,null,x.mode,b),b.ref=go(x,null,y),b.return=x,b;case ni:return y=rd(y,x.mode,b),y.return=x,y;case _n:var S=y._init;return h(x,S(y._payload),b)}if(jo(y)||uo(y))return y=Cs(y,x.mode,b,null),y.return=x,y;Za(x,y)}return null}function m(x,y,b,S){var _=y!==null?y.key:null;if(typeof b=="string"&&b!==""||typeof b=="number")return _!==null?null:l(x,y,""+b,S);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Ba:return b.key===_?c(x,y,b,S):null;case ni:return b.key===_?u(x,y,b,S):null;case _n:return _=b._init,m(x,y,_(b._payload),S)}if(jo(b)||uo(b))return _!==null?null:d(x,y,b,S,null);Za(x,b)}return null}function p(x,y,b,S,_){if(typeof S=="string"&&S!==""||typeof S=="number")return x=x.get(b)||null,l(y,x,""+S,_);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Ba:return x=x.get(S.key===null?b:S.key)||null,c(y,x,S,_);case ni:return x=x.get(S.key===null?b:S.key)||null,u(y,x,S,_);case _n:var j=S._init;return p(x,y,b,j(S._payload),_)}if(jo(S)||uo(S))return x=x.get(b)||null,d(y,x,S,_,null);Za(y,S)}return null}function w(x,y,b,S){for(var _=null,j=null,E=y,C=y=0,N=null;E!==null&&C<b.length;C++){E.index>C?(N=E,E=null):N=E.sibling;var R=m(x,E,b[C],S);if(R===null){E===null&&(E=N);break}e&&E&&R.alternate===null&&t(x,E),y=i(R,y,C),j===null?_=R:j.sibling=R,j=R,E=N}if(C===b.length)return r(x,E),Ce&&ls(x,C),_;if(E===null){for(;C<b.length;C++)E=h(x,b[C],S),E!==null&&(y=i(E,y,C),j===null?_=E:j.sibling=E,j=E);return Ce&&ls(x,C),_}for(E=n(x,E);C<b.length;C++)N=p(E,x,C,b[C],S),N!==null&&(e&&N.alternate!==null&&E.delete(N.key===null?C:N.key),y=i(N,y,C),j===null?_=N:j.sibling=N,j=N);return e&&E.forEach(function(F){return t(x,F)}),Ce&&ls(x,C),_}function g(x,y,b,S){var _=uo(b);if(typeof _!="function")throw Error(A(150));if(b=_.call(b),b==null)throw Error(A(151));for(var j=_=null,E=y,C=y=0,N=null,R=b.next();E!==null&&!R.done;C++,R=b.next()){E.index>C?(N=E,E=null):N=E.sibling;var F=m(x,E,R.value,S);if(F===null){E===null&&(E=N);break}e&&E&&F.alternate===null&&t(x,E),y=i(F,y,C),j===null?_=F:j.sibling=F,j=F,E=N}if(R.done)return r(x,E),Ce&&ls(x,C),_;if(E===null){for(;!R.done;C++,R=b.next())R=h(x,R.value,S),R!==null&&(y=i(R,y,C),j===null?_=R:j.sibling=R,j=R);return Ce&&ls(x,C),_}for(E=n(x,E);!R.done;C++,R=b.next())R=p(E,x,C,R.value,S),R!==null&&(e&&R.alternate!==null&&E.delete(R.key===null?C:R.key),y=i(R,y,C),j===null?_=R:j.sibling=R,j=R);return e&&E.forEach(function(I){return t(x,I)}),Ce&&ls(x,C),_}function v(x,y,b,S){if(typeof b=="object"&&b!==null&&b.type===si&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case Ba:e:{for(var _=b.key,j=y;j!==null;){if(j.key===_){if(_=b.type,_===si){if(j.tag===7){r(x,j.sibling),y=s(j,b.props.children),y.return=x,x=y;break e}}else if(j.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===_n&&Wm(_)===j.type){r(x,j.sibling),y=s(j,b.props),y.ref=go(x,j,b),y.return=x,x=y;break e}r(x,j);break}else t(x,j);j=j.sibling}b.type===si?(y=Cs(b.props.children,x.mode,S,b.key),y.return=x,x=y):(S=Al(b.type,b.key,b.props,null,x.mode,S),S.ref=go(x,y,b),S.return=x,x=S)}return o(x);case ni:e:{for(j=b.key;y!==null;){if(y.key===j)if(y.tag===4&&y.stateNode.containerInfo===b.containerInfo&&y.stateNode.implementation===b.implementation){r(x,y.sibling),y=s(y,b.children||[]),y.return=x,x=y;break e}else{r(x,y);break}else t(x,y);y=y.sibling}y=rd(b,x.mode,S),y.return=x,x=y}return o(x);case _n:return j=b._init,v(x,y,j(b._payload),S)}if(jo(b))return w(x,y,b,S);if(uo(b))return g(x,y,b,S);Za(x,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,y!==null&&y.tag===6?(r(x,y.sibling),y=s(y,b),y.return=x,x=y):(r(x,y),y=td(b,x.mode,S),y.return=x,x=y),o(x)):r(x,y)}return v}var Ui=kx(!0),Tx=kx(!1),tc=Xn(null),rc=null,hi=null,Mf=null;function $f(){Mf=hi=rc=null}function Ff(e){var t=tc.current;je(tc),e._currentValue=t}function nh(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function xi(e,t){rc=e,Mf=hi=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(_t=!0),e.firstContext=null)}function Yt(e){var t=e._currentValue;if(Mf!==e)if(e={context:e,memoizedValue:t,next:null},hi===null){if(rc===null)throw Error(A(308));hi=e,rc.dependencies={lanes:0,firstContext:e}}else hi=hi.next=e;return t}var fs=null;function Uf(e){fs===null?fs=[e]:fs.push(e)}function Rx(e,t,r,n){var s=t.interleaved;return s===null?(r.next=r,Uf(t)):(r.next=s.next,s.next=r),t.interleaved=r,nn(e,n)}function nn(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Sn=!1;function zf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Px(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 en(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Un(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,de&2){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,nn(e,r)}return s=n.interleaved,s===null?(t.next=t,Uf(n)):(t.next=s.next,s.next=t),n.interleaved=t,nn(e,r)}function Cl(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Cf(e,r)}}function Hm(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var s=null,i=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};i===null?s=i=o:i=i.next=o,r=r.next}while(r!==null);i===null?s=i=t:i=i.next=t}else s=i=t;r={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function nc(e,t,r,n){var s=e.updateQueue;Sn=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?i=u:o.next=u,o=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(i!==null){var h=s.baseState;o=0,d=u=c=null,l=i;do{var m=l.lane,p=l.eventTime;if((n&m)===m){d!==null&&(d=d.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var w=e,g=l;switch(m=t,p=r,g.tag){case 1:if(w=g.payload,typeof w=="function"){h=w.call(p,h,m);break e}h=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=g.payload,m=typeof w=="function"?w.call(p,h,m):w,m==null)break e;h=Te({},h,m);break e;case 2:Sn=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,m=s.effects,m===null?s.effects=[l]:m.push(l))}else p={eventTime:p,lane:m,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=p,c=h):d=d.next=p,o|=m;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;m=l,l=m.next,m.next=null,s.lastBaseUpdate=m,s.shared.pending=null}}while(!0);if(d===null&&(c=h),s.baseState=c,s.firstBaseUpdate=u,s.lastBaseUpdate=d,t=s.shared.interleaved,t!==null){s=t;do o|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);Ps|=o,e.lanes=o,e.memoizedState=h}}function qm(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],s=n.callback;if(s!==null){if(n.callback=null,n=r,typeof s!="function")throw Error(A(191,s));s.call(n)}}}var Na={},Ar=Xn(Na),Zo=Xn(Na),ea=Xn(Na);function ps(e){if(e===Na)throw Error(A(174));return e}function Bf(e,t){switch(we(ea,t),we(Zo,e),we(Ar,Na),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Md(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Md(t,e)}je(Ar),we(Ar,t)}function zi(){je(Ar),je(Zo),je(ea)}function Ax(e){ps(ea.current);var t=ps(Ar.current),r=Md(t,e.type);t!==r&&(we(Zo,e),we(Ar,r))}function Vf(e){Zo.current===e&&(je(Ar),je(Zo))}var Ne=Xn(0);function sc(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ju=[];function Wf(){for(var e=0;e<Ju.length;e++)Ju[e]._workInProgressVersionPrimary=null;Ju.length=0}var Nl=hn.ReactCurrentDispatcher,Yu=hn.ReactCurrentBatchConfig,Rs=0,ke=null,Ve=null,Ke=null,ic=!1,Lo=!1,ta=0,AE=0;function it(){throw Error(A(321))}function Hf(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!yr(e[r],t[r]))return!1;return!0}function qf(e,t,r,n,s,i){if(Rs=i,ke=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Nl.current=e===null||e.memoizedState===null?LE:ME,e=r(n,s),Lo){i=0;do{if(Lo=!1,ta=0,25<=i)throw Error(A(301));i+=1,Ke=Ve=null,t.updateQueue=null,Nl.current=$E,e=r(n,s)}while(Lo)}if(Nl.current=oc,t=Ve!==null&&Ve.next!==null,Rs=0,Ke=Ve=ke=null,ic=!1,t)throw Error(A(300));return e}function Kf(){var e=ta!==0;return ta=0,e}function Sr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ke===null?ke.memoizedState=Ke=e:Ke=Ke.next=e,Ke}function Qt(){if(Ve===null){var e=ke.alternate;e=e!==null?e.memoizedState:null}else e=Ve.next;var t=Ke===null?ke.memoizedState:Ke.next;if(t!==null)Ke=t,Ve=e;else{if(e===null)throw Error(A(310));Ve=e,e={memoizedState:Ve.memoizedState,baseState:Ve.baseState,baseQueue:Ve.baseQueue,queue:Ve.queue,next:null},Ke===null?ke.memoizedState=Ke=e:Ke=Ke.next=e}return Ke}function ra(e,t){return typeof t=="function"?t(e):t}function Qu(e){var t=Qt(),r=t.queue;if(r===null)throw Error(A(311));r.lastRenderedReducer=e;
vendor: 5,688 bytes, line 38
38var n=Ve,s=n.baseQueue,i=r.pending;if(i!==null){if(s!==null){var o=s.next;s.next=i.next,i.next=o}n.baseQueue=s=i,r.pending=null}if(s!==null){i=s.next,n=n.baseState;var l=o=null,c=null,u=i;do{var d=u.lane;if((Rs&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),n=u.hasEagerState?u.eagerState:e(n,u.action);else{var h={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=h,o=n):c=c.next=h,ke.lanes|=d,Ps|=d}u=u.next}while(u!==null&&u!==i);c===null?o=n:c.next=l,yr(n,t.memoizedState)||(_t=!0),t.memoizedState=n,t.baseState=o,t.baseQueue=c,r.lastRenderedState=n}if(e=r.interleaved,e!==null){s=e;do i=s.lane,ke.lanes|=i,Ps|=i,s=s.next;while(s!==e)}else s===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Xu(e){var t=Qt(),r=t.queue;if(r===null)throw Error(A(311));r.lastRenderedReducer=e;var n=r.dispatch,s=r.pending,i=t.memoizedState;if(s!==null){r.pending=null;var o=s=s.next;do i=e(i,o.action),o=o.next;while(o!==s);yr(i,t.memoizedState)||(_t=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),r.lastRenderedState=i}return[i,n]}function Ox(){}function Ix(e,t){var r=ke,n=Qt(),s=t(),i=!yr(n.memoizedState,s);if(i&&(n.memoizedState=s,_t=!0),n=n.queue,Gf(Mx.bind(null,r,n,e),[e]),n.getSnapshot!==t||i||Ke!==null&&Ke.memoizedState.tag&1){if(r.flags|=2048,na(9,Lx.bind(null,r,n,s,t),void 0,null),Ge===null)throw Error(A(349));Rs&30||Dx(r,t,s)}return s}function Dx(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=ke.updateQueue,t===null?(t={lastEffect:null,stores:null},ke.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function Lx(e,t,r,n){t.value=r,t.getSnapshot=n,$x(t)&&Fx(e)}function Mx(e,t,r){return r(function(){$x(t)&&Fx(e)})}function $x(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!yr(e,r)}catch{return!0}}function Fx(e){var t=nn(e,1);t!==null&&vr(t,e,1,-1)}function Km(e){var t=Sr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ra,lastRenderedState:e},t.queue=e,e=e.dispatch=DE.bind(null,ke,e),[t.memoizedState,e]}function na(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=ke.updateQueue,t===null?(t={lastEffect:null,stores:null},ke.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function Ux(){return Qt().memoizedState}function kl(e,t,r,n){var s=Sr();ke.flags|=e,s.memoizedState=na(1|t,r,void 0,n===void 0?null:n)}function Hc(e,t,r,n){var s=Qt();n=n===void 0?null:n;var i=void 0;if(Ve!==null){var o=Ve.memoizedState;if(i=o.destroy,n!==null&&Hf(n,o.deps)){s.memoizedState=na(t,r,i,n);return}}ke.flags|=e,s.memoizedState=na(1|t,r,i,n)}function Gm(e,t){return kl(8390656,8,e,t)}function Gf(e,t){return Hc(2048,8,e,t)}function zx(e,t){return Hc(4,2,e,t)}function Bx(e,t){return Hc(4,4,e,t)}function Vx(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 Wx(e,t,r){return r=r!=null?r.concat([e]):null,Hc(4,4,Vx.bind(null,t,e),r)}function Jf(){}function Hx(e,t){var r=Qt();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Hf(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function qx(e,t){var r=Qt();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Hf(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function Kx(e,t,r){return Rs&21?(yr(r,t)||(r=Xy(),ke.lanes|=r,Ps|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,_t=!0),e.memoizedState=r)}function OE(e,t){var r=ge;ge=r!==0&&4>r?r:4,e(!0);var n=Yu.transition;Yu.transition={};try{e(!1),t()}finally{ge=r,Yu.transition=n}}function Gx(){return Qt().memoizedState}function IE(e,t,r){var n=Bn(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},Jx(e))Yx(t,r);else if(r=Rx(e,t,r,n),r!==null){var s=mt();vr(r,e,n,s),Qx(r,t,n)}}function DE(e,t,r){var n=Bn(e),s={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(Jx(e))Yx(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,l=i(o,r);if(s.hasEagerState=!0,s.eagerState=l,yr(l,o)){var c=t.interleaved;c===null?(s.next=s,Uf(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}r=Rx(e,t,s,n),r!==null&&(s=mt(),vr(r,e,n,s),Qx(r,t,n))}}function Jx(e){var t=e.alternate;return e===ke||t!==null&&t===ke}function Yx(e,t){Lo=ic=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Qx(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Cf(e,r)}}var oc={readContext:Yt,useCallback:it,useContext:it,useEffect:it,useImperativeHandle:it,useInsertionEffect:it,useLayoutEffect:it,useMemo:it,useReducer:it,useRef:it,useState:it,useDebugValue:it,useDeferredValue:it,useTransition:it,useMutableSource:it,useSyncExternalStore:it,useId:it,unstable_isNewReconciler:!1},LE={readContext:Yt,useCallback:function(e,t){return Sr().memoizedState=[e,t===void 0?null:t],e},useContext:Yt,useEffect:Gm,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,kl(4194308,4,Vx.bind(null,t,e),r)},useLayoutEffect:function(e,t){return kl(4194308,4,e,t)},useInsertionEffect:function(e,t){return kl(4,2,e,t)},useMemo:function(e,t){var r=Sr();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Sr();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=IE.bind(null,ke,e),[n.memoizedState,e]}
vendor: 7,431 bytes, lines 38-40
38,useRef:function(e){var t=Sr();return e={current:e},t.memoizedState=e},useState:Km,useDebugValue:Jf,useDeferredValue:function(e){return Sr().memoizedState=e},useTransition:function(){var e=Km(!1),t=e[0];return e=OE.bind(null,e[1]),Sr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=ke,s=Sr();if(Ce){if(r===void 0)throw Error(A(407));r=r()}else{if(r=t(),Ge===null)throw Error(A(349));Rs&30||Dx(n,t,r)}s.memoizedState=r;var i={value:r,getSnapshot:t};return s.queue=i,Gm(Mx.bind(null,n,i,e),[e]),n.flags|=2048,na(9,Lx.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=Sr(),t=Ge.identifierPrefix;if(Ce){var r=Zr,n=Xr;r=(n&~(1<<32-gr(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=ta++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=AE++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},ME={readContext:Yt,useCallback:Hx,useContext:Yt,useEffect:Gf,useImperativeHandle:Wx,useInsertionEffect:zx,useLayoutEffect:Bx,useMemo:qx,useReducer:Qu,useRef:Ux,useState:function(){return Qu(ra)},useDebugValue:Jf,useDeferredValue:function(e){var t=Qt();return Kx(t,Ve.memoizedState,e)},useTransition:function(){var e=Qu(ra)[0],t=Qt().memoizedState;return[e,t]},useMutableSource:Ox,useSyncExternalStore:Ix,useId:Gx,unstable_isNewReconciler:!1},$E={readContext:Yt,useCallback:Hx,useContext:Yt,useEffect:Gf,useImperativeHandle:Wx,useInsertionEffect:zx,useLayoutEffect:Bx,useMemo:qx,useReducer:Xu,useRef:Ux,useState:function(){return Xu(ra)},useDebugValue:Jf,useDeferredValue:function(e){var t=Qt();return Ve===null?t.memoizedState=e:Kx(t,Ve.memoizedState,e)},useTransition:function(){var e=Xu(ra)[0],t=Qt().memoizedState;return[e,t]},useMutableSource:Ox,useSyncExternalStore:Ix,useId:Gx,unstable_isNewReconciler:!1};function lr(e,t){if(e&&e.defaultProps){t=Te({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function sh(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:Te({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var qc={isMounted:function(e){return(e=e._reactInternals)?$s(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=mt(),s=Bn(e),i=en(n,s);i.payload=t,r!=null&&(i.callback=r),t=Un(e,i,s),t!==null&&(vr(t,e,s,n),Cl(t,e,s))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=mt(),s=Bn(e),i=en(n,s);i.tag=1,i.payload=t,r!=null&&(i.callback=r),t=Un(e,i,s),t!==null&&(vr(t,e,s,n),Cl(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=mt(),n=Bn(e),s=en(r,n);s.tag=2,t!=null&&(s.callback=t),t=Un(e,s,n),t!==null&&(vr(t,e,n,r),Cl(t,e,n))}};function Jm(e,t,r,n,s,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,i,o):t.prototype&&t.prototype.isPureReactComponent?!Jo(r,n)||!Jo(s,i):!0}function Xx(e,t,r){var n=!1,s=qn,i=t.contextType;return typeof i=="object"&&i!==null?i=Yt(i):(s=jt(t)?ks:ut.current,n=t.contextTypes,i=(n=n!=null)?$i(e,s):qn),t=new t(r,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=qc,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=i),t}function Ym(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&qc.enqueueReplaceState(t,t.state,null)}function ih(e,t,r,n){var s=e.stateNode;s.props=r,s.state=e.memoizedState,s.refs={},zf(e);var i=t.contextType;typeof i=="object"&&i!==null?s.context=Yt(i):(i=jt(t)?ks:ut.current,s.context=$i(e,i)),s.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(sh(e,t,i,r),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&qc.enqueueReplaceState(s,s.state,null),nc(e,r,s,n),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function Bi(e,t){try{var r="",n=t;do r+=hj(n),n=n.return;while(n);var s=r}catch(i){s=` 39Error generating stack: `+i.message+` 40`+i.stack}return{value:e,source:t,stack:s,digest:null}}function Zu(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function oh(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var FE=typeof WeakMap=="function"?WeakMap:Map;function Zx(e,t,r){r=en(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){lc||(lc=!0,gh=n),oh(e,t)},r}function e0(e,t,r){r=en(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var s=t.value;r.payload=function(){return n(s)},r.callback=function(){oh(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(r.callback=function(){oh(e,t),typeof n!="function"&&(zn===null?zn=new Set([this]):zn.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),r}function Qm(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new FE;var s=new Set;n.set(t,s)}else s=n.get(t),s===void 0&&(s=new Set,n.set(t,s));s.has(r)||(s.add(r),e=ZE.bind(null,e,t,r),t.then(e,e))}function Xm(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 Zm(e,t,r,n,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=en(-1,1),t.tag=2,Un(r,t,1))),r.lanes|=1),e)}var UE=hn.ReactCurrentOwner,_t=!1;function ft(e,t,r,n){t.child=e===null?Tx(t,null,r,n):Ui(t,e.child,r,n)}function eg(e,t,r,n,s){r=r.render;var i=t.ref;return xi(t,s),n=qf(e,t,r,n,i,s),r=Kf(),e!==null&&!_t?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,sn(e,t,s)):(Ce&&r&&If(t),t.flags|=1,ft(e,t,n,s),t.child)}function tg(e,t,r,n,s){if(e===null){var i=r.type;return typeof i=="function"&&!np(i)&&i.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=i,t0(e,t,i,n,s)):(e=Al(r.type,null,n,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&s)){var o=i.memoizedProps;if(r=r.compare,r=r!==null?r:Jo,r(o,n)&&e.ref===t.ref)return sn(e,t,s)}return t.flags|=1,e=Vn(i,n),e.ref=t.ref,e.return=t,t.child=e}function t0(e,t,r,n,s){if(e!==null){var i=e.memoizedProps;if(Jo(i,n)&&e.ref===t.ref)if(_t=!1,t.pendingProps=n=i,(e.lanes&s)!==0)e.flags&131072&&(_t=!0);else return t.lanes=e.lanes,sn(e,t,s)}return ah(e,t,r,n,s)}function r0(e,t,r){var n=t.pendingProps,s=n.children,i=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},we(pi,Tt),Tt|=r;else{if(!(r&1073741824))return e=i!==null?i.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,we(pi,Tt),Tt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=i!==null?i.baseLanes:r,we(pi,Tt),Tt|=n}else i!==null?(n=i.baseLanes|r,t.memoizedState=null):n=r,we(pi,Tt),Tt|=n;return ft(e,t,s,r),t.child}function n0(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}
vendor: 4,711 bytes, line 40
40function ah(e,t,r,n,s){var i=jt(r)?ks:ut.current;return i=$i(t,i),xi(t,s),r=qf(e,t,r,n,i,s),n=Kf(),e!==null&&!_t?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,sn(e,t,s)):(Ce&&n&&If(t),t.flags|=1,ft(e,t,r,s),t.child)}function rg(e,t,r,n,s){if(jt(r)){var i=!0;Xl(t)}else i=!1;if(xi(t,s),t.stateNode===null)Tl(e,t),Xx(t,r,n),ih(t,r,n,s),n=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var c=o.context,u=r.contextType;typeof u=="object"&&u!==null?u=Yt(u):(u=jt(r)?ks:ut.current,u=$i(t,u));var d=r.getDerivedStateFromProps,h=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";h||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==n||c!==u)&&Ym(t,o,n,u),Sn=!1;var m=t.memoizedState;o.state=m,nc(t,n,o,s),c=t.memoizedState,l!==n||m!==c||St.current||Sn?(typeof d=="function"&&(sh(t,r,d,n),c=t.memoizedState),(l=Sn||Jm(t,r,l,n,m,c,u))?(h||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=n,t.memoizedState=c),o.props=n,o.state=c,o.context=u,n=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{o=t.stateNode,Px(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:lr(t.type,l),o.props=u,h=t.pendingProps,m=o.context,c=r.contextType,typeof c=="object"&&c!==null?c=Yt(c):(c=jt(r)?ks:ut.current,c=$i(t,c));var p=r.getDerivedStateFromProps;(d=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==h||m!==c)&&Ym(t,o,n,c),Sn=!1,m=t.memoizedState,o.state=m,nc(t,n,o,s);var w=t.memoizedState;l!==h||m!==w||St.current||Sn?(typeof p=="function"&&(sh(t,r,p,n),w=t.memoizedState),(u=Sn||Jm(t,r,u,n,m,w,c)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,w,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,w,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=w),o.props=n,o.state=w,o.context=c,n=u):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),n=!1)}return lh(e,t,r,n,i,s)}function lh(e,t,r,n,s,i){n0(e,t);var o=(t.flags&128)!==0;if(!n&&!o)return s&&zm(t,r,!1),sn(e,t,i);n=t.stateNode,UE.current=t;var l=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&o?(t.child=Ui(t,e.child,null,i),t.child=Ui(t,null,l,i)):ft(e,t,l,i),t.memoizedState=n.state,s&&zm(t,r,!0),t.child}function s0(e){var t=e.stateNode;t.pendingContext?Um(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Um(e,t.context,!1),Bf(e,t.containerInfo)}function ng(e,t,r,n,s){return Fi(),Lf(s),t.flags|=256,ft(e,t,r,n),t.child}var ch={dehydrated:null,treeContext:null,retryLane:0};function uh(e){return{baseLanes:e,cachePool:null,transitions:null}}function i0(e,t,r){var n=t.pendingProps,s=Ne.current,i=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(s&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),we(Ne,s&1),e===null)return rh(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=n.children,e=n.fallback,i?(n=t.mode,i=t.child,o={mode:"hidden",children:o},!(n&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=Jc(o,n,0,null),e=Cs(e,n,r,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=uh(r),t.memoizedState=ch,e):Yf(t,o));if(s=e.memoizedState,s!==null&&(l=s.dehydrated,l!==null))return zE(e,t,o,n,l,s,r);if(i){i=n.fallback,o=t.mode,s=e.child,l=s.sibling;var c={mode:"hidden",children:n.children};return!(o&1)&&t.child!==s?(n=t.child,n.childLanes=0,n.pendingProps=c,t.deletions=null):(n=Vn(s,c),n.subtreeFlags=s.subtreeFlags&14680064),l!==null?i=Vn(l,i):(i=Cs(i,o,r,null),i.flags|=2),i.return=t,n.return=t,n.sibling=i,t.child=n,n=i,i=t.child,o=e.child.memoizedState,o=o===null?uh(r):{base
vendor: 4,933 bytes, line 40
40Lanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~r,t.memoizedState=ch,n}return i=e.child,e=i.sibling,n=Vn(i,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function Yf(e,t){return t=Jc({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function el(e,t,r,n){return n!==null&&Lf(n),Ui(t,e.child,null,r),e=Yf(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function zE(e,t,r,n,s,i,o){if(r)return t.flags&256?(t.flags&=-257,n=Zu(Error(A(422))),el(e,t,o,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=n.fallback,s=t.mode,n=Jc({mode:"visible",children:n.children},s,0,null),i=Cs(i,s,o,null),i.flags|=2,n.return=t,i.return=t,n.sibling=i,t.child=n,t.mode&1&&Ui(t,e.child,null,o),t.child.memoizedState=uh(o),t.memoizedState=ch,i);if(!(t.mode&1))return el(e,t,o,null);if(s.data==="$!"){if(n=s.nextSibling&&s.nextSibling.dataset,n)var l=n.dgst;return n=l,i=Error(A(419)),n=Zu(i,n,void 0),el(e,t,o,n)}if(l=(o&e.childLanes)!==0,_t||l){if(n=Ge,n!==null){switch(o&-o){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(n.suspendedLanes|o)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,nn(e,s),vr(n,e,s,-1))}return rp(),n=Zu(Error(A(421))),el(e,t,o,n)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=eC.bind(null,e),s._reactRetry=t,null):(e=i.treeContext,At=Fn(s.nextSibling),Ot=t,Ce=!0,pr=null,e!==null&&(qt[Kt++]=Xr,qt[Kt++]=Zr,qt[Kt++]=Ts,Xr=e.id,Zr=e.overflow,Ts=t),t=Yf(t,n.children),t.flags|=4096,t)}function sg(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),nh(e.return,t,r)}function ed(e,t,r,n,s){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:s}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=n,i.tail=r,i.tailMode=s)}function o0(e,t,r){var n=t.pendingProps,s=n.revealOrder,i=n.tail;if(ft(e,t,n.children,r),n=Ne.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&sg(e,r,t);else if(e.tag===19)sg(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(we(Ne,n),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(r=t.child,s=null;r!==null;)e=r.alternate,e!==null&&sc(e)===null&&(s=r),r=r.sibling;r=s,r===null?(s=t.child,t.child=null):(s=r.sibling,r.sibling=null),ed(t,!1,s,r,i);break;case"backwards":for(r=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&sc(e)===null){t.child=s;break}e=s.sibling,s.sibling=r,r=s,s=e}ed(t,!0,r,null,i);break;case"together":ed(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Tl(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function sn(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Ps|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(A(153));if(t.child!==null){for(e=t.child,r=Vn(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Vn(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function BE(e,t,r){switch(t.tag){case 3:s0(t),Fi();break;case 5:Ax(t);break;case 1:jt(t.type)&&Xl(t);break;case 4:Bf(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,s=t.memoizedProps.value;we(tc,n._currentValue),n._currentValue=s;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(we(Ne,Ne.current&1),t.flags|=128,null):r&t.child.childLanes?i0(e,t,r):(we(Ne,Ne.current&1),e=sn(e,t,r),e!==null?e.sibling:null);we(Ne,Ne.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return o0(e,t,r);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),we(Ne,Ne.current),n)break;return null;case 22:case 23:return t.lanes=0,r0(e,t,r)}return sn(e,t,r)}var a0,dh,l0,c0;a0=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};dh=function(){};l0=function(e,t,r,n){var s=e.memoizedProps;if(s!==n){e=t.stateNode,ps(Ar.current);var i=null;switch(r){case"input":s=Od(e,s),n=Od(e,n),i=[];break;case"select":s=Te({},s,{value:void 0}),n=Te({},n,{value:void 0}),i=[];break;
vendor: 4,763 bytes, line 40
40case"textarea":s=Ld(e,s),n=Ld(e,n),i=[];break;default:typeof s.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=Yl)}$d(r,n);var o;r=null;for(u in s)if(!n.hasOwnProperty(u)&&s.hasOwnProperty(u)&&s[u]!=null)if(u==="style"){var l=s[u];for(o in l)l.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Bo.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in n){var c=n[u];if(l=s!=null?s[u]:void 0,n.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(r||(r={}),r[o]=c[o])}else r||(i||(i=[]),i.push(u,r)),r=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(i=i||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Bo.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&Se("scroll",e),i||l===c||(i=[])):(i=i||[]).push(u,c))}r&&(i=i||[]).push("style",r);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};c0=function(e,t,r,n){r!==n&&(t.flags|=4)};function vo(e,t){if(!Ce)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function ot(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags&14680064,n|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags,n|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function VE(e,t,r){var n=t.pendingProps;switch(Df(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ot(t),null;case 1:return jt(t.type)&&Ql(),ot(t),null;case 3:return n=t.stateNode,zi(),je(St),je(ut),Wf(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Xa(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,pr!==null&&(xh(pr),pr=null))),dh(e,t),ot(t),null;case 5:Vf(t);var s=ps(ea.current);if(r=t.type,e!==null&&t.stateNode!=null)l0(e,t,r,n,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(A(166));return ot(t),null}if(e=ps(Ar.current),Xa(t)){n=t.stateNode,r=t.type;var i=t.memoizedProps;switch(n[Tr]=t,n[Xo]=i,e=(t.mode&1)!==0,r){case"dialog":Se("cancel",n),Se("close",n);break;case"iframe":case"object":case"embed":Se("load",n);break;case"video":case"audio":for(s=0;s<Co.length;s++)Se(Co[s],n);break;case"source":Se("error",n);break;case"img":case"image":case"link":Se("error",n),Se("load",n);break;case"details":Se("toggle",n);break;case"input":fm(n,i),Se("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!i.multiple},Se("invalid",n);break;case"textarea":mm(n,i),Se("invalid",n)}$d(r,i),s=null;for(var o in i)if(i.hasOwnProperty(o)){var l=i[o];o==="children"?typeof l=="string"?n.textContent!==l&&(i.suppressHydrationWarning!==!0&&Qa(n.textContent,l,e),s=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&Qa(n.textContent,l,e),s=["children",""+l]):Bo.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&Se("scroll",n)}switch(r){case"input":Va(n),pm(n,i,!0);break;case"textarea":Va(n),gm(n);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(n.onclick=Yl)}n=s,t.updateQueue=n,n!==null&&(t.flags|=4)}else{o=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=My(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[Tr]=t,e[Xo]=n,a0(e,t,!1,!1),t.stateNode=e;e:{switch(o=Fd(r,n),r){case"dialog":Se("cancel",e),Se("close",e),s=n;break;case"iframe":case"object":case"embed":Se("load",e),s=n;break;case"video":case"audio":for(s=0;s<Co.length;s++)Se(Co[s],e);s=n;break;case"source":Se("error",e),s=n;break;case"img":case"image":case"link":Se("error",e),Se("load",e),s=n;break;case"details":Se("toggle",e),s=n;break;case"input":fm(e,n),s=Od(e,n),Se("invalid",e);break;case"option":s=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},s=Te({},n,{value:void 0}),Se("invalid",e);break;
vendor: 28,887 bytes, line 40
40case"textarea":mm(e,n),s=Ld(e,n),Se("invalid",e);break;default:s=n}$d(r,s),l=s;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];i==="style"?Uy(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&$y(e,c)):i==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&Vo(e,c):typeof c=="number"&&Vo(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Bo.hasOwnProperty(i)?c!=null&&i==="onScroll"&&Se("scroll",e):c!=null&&wf(e,i,c,o))}switch(r){case"input":Va(e),pm(e,n,!1);break;case"textarea":Va(e),gm(e);break;case"option":n.value!=null&&e.setAttribute("value",""+Hn(n.value));break;case"select":e.multiple=!!n.multiple,i=n.value,i!=null?mi(e,!!n.multiple,i,!1):n.defaultValue!=null&&mi(e,!!n.multiple,n.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=Yl)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return ot(t),null;case 6:if(e&&t.stateNode!=null)c0(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(A(166));if(r=ps(ea.current),ps(Ar.current),Xa(t)){if(n=t.stateNode,r=t.memoizedProps,n[Tr]=t,(i=n.nodeValue!==r)&&(e=Ot,e!==null))switch(e.tag){case 3:Qa(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Qa(n.nodeValue,r,(e.mode&1)!==0)}i&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[Tr]=t,t.stateNode=n}return ot(t),null;case 13:if(je(Ne),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ce&&At!==null&&t.mode&1&&!(t.flags&128))Nx(),Fi(),t.flags|=98560,i=!1;else if(i=Xa(t),n!==null&&n.dehydrated!==null){if(e===null){if(!i)throw Error(A(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(A(317));i[Tr]=t}else Fi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ot(t),i=!1}else pr!==null&&(xh(pr),pr=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||Ne.current&1?We===0&&(We=3):rp())),t.updateQueue!==null&&(t.flags|=4),ot(t),null);case 4:return zi(),dh(e,t),e===null&&Yo(t.stateNode.containerInfo),ot(t),null;case 10:return Ff(t.type._context),ot(t),null;case 17:return jt(t.type)&&Ql(),ot(t),null;case 19:if(je(Ne),i=t.memoizedState,i===null)return ot(t),null;if(n=(t.flags&128)!==0,o=i.rendering,o===null)if(n)vo(i,!1);else{if(We!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=sc(e),o!==null){for(t.flags|=128,vo(i,!1),n=o.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)i=r,e=n,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,e=o.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return we(Ne,Ne.current&1|2),t.child}e=e.sibling}i.tail!==null&&Le()>Vi&&(t.flags|=128,n=!0,vo(i,!1),t.lanes=4194304)}else{if(!n)if(e=sc(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),vo(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Ce)return ot(t),null}else 2*Le()-i.renderingStartTime>Vi&&r!==1073741824&&(t.flags|=128,n=!0,vo(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(r=i.last,r!==null?r.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Le(),t.sibling=null,r=Ne.current,we(Ne,n?r&1|2:r&1),t):(ot(t),null);case 22:case 23:return tp(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Tt&1073741824&&(ot(t),t.subtreeFlags&6&&(t.flags|=8192)):ot(t),null;case 24:return null;case 25:return null}throw Error(A(156,t.tag))}function WE(e,t){switch(Df(t),t.tag){case 1:return jt(t.type)&&Ql(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return zi(),je(St),je(ut),Wf(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Vf(t),null;case 13:if(je(Ne),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(A(340));Fi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return je(Ne),null;case 4:return zi(),null;case 10:return Ff(t.type._context),null;case 22:case 23:return tp(),null;case 24:return null;default:return null}}var tl=!1,ct=!1,HE=typeof WeakSet=="function"?WeakSet:Set,q=null;function fi(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Ie(e,t,n)}else r.current=null}function hh(e,t,r){try{r()}catch(n){Ie(e,t,n)}}var ig=!1;function qE(e,t){if(Jd=Kl,e=px(),Of(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var s=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var o=0,l=-1,c=-1,u=0,d=0,h=e,m=null;t:for(;;){for(var p;h!==r||s!==0&&h.nodeType!==3||(l=o+s),h!==i||n!==0&&h.nodeType!==3||(c=o+n),h.nodeType===3&&(o+=h.nodeValue.length),(p=h.firstChild)!==null;)m=h,h=p;for(;;){if(h===e)break t;if(m===r&&++u===s&&(l=o),m===i&&++d===n&&(c=o),(p=h.nextSibling)!==null)break;h=m,m=h.parentNode}h=p}r=l===-1||c===-1?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(Yd={focusedElem:e,selectionRange:r},Kl=!1,q=t;q!==null;)if(t=q,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,q=e;else for(;q!==null;){t=q;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var g=w.memoizedProps,v=w.memoizedState,x=t.stateNode,y=x.getSnapshotBeforeUpdate(t.elementType===t.type?g:lr(t.type,g),v);x.__reactInternalSnapshotBeforeUpdate=y}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(A(163))}}catch(S){Ie(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,q=e;break}q=t.return}return w=ig,ig=!1,w}function Mo(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&hh(t,r,i)}s=s.next}while(s!==n)}}function Kc(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function fh(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function u0(e){var t=e.alternate;t!==null&&(e.alternate=null,u0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Tr],delete t[Xo],delete t[Zd],delete t[kE],delete t[TE])),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 d0(e){return e.tag===5||e.tag===3||e.tag===4}function og(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||d0(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 ph(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Yl));else if(n!==4&&(e=e.child,e!==null))for(ph(e,t,r),e=e.sibling;e!==null;)ph(e,t,r),e=e.sibling}function mh(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(mh(e,t,r),e=e.sibling;e!==null;)mh(e,t,r),e=e.sibling}var Xe=null,fr=!1;function vn(e,t,r){for(r=r.child;r!==null;)h0(e,t,r),r=r.sibling}function h0(e,t,r){if(Pr&&typeof Pr.onCommitFiberUnmount=="function")try{Pr.onCommitFiberUnmount(Fc,r)}catch{}switch(r.tag){case 5:ct||fi(r,t);case 6:var n=Xe,s=fr;Xe=null,vn(e,t,r),Xe=n,fr=s,Xe!==null&&(fr?(e=Xe,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Xe.removeChild(r.stateNode));break;case 18:Xe!==null&&(fr?(e=Xe,r=r.stateNode,e.nodeType===8?Ku(e.parentNode,r):e.nodeType===1&&Ku(e,r),Ko(e)):Ku(Xe,r.stateNode));break;case 4:n=Xe,s=fr,Xe=r.stateNode.containerInfo,fr=!0,vn(e,t,r),Xe=n,fr=s;break;case 0:case 11:case 14:case 15:if(!ct&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){s=n=n.next;do{var i=s,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&hh(r,t,o),s=s.next}while(s!==n)}vn(e,t,r);break;case 1:if(!ct&&(fi(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){Ie(r,t,l)}vn(e,t,r);break;case 21:vn(e,t,r);break;case 22:r.mode&1?(ct=(n=ct)||r.memoizedState!==null,vn(e,t,r),ct=n):vn(e,t,r);break;default:vn(e,t,r)}}function ag(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new HE),t.forEach(function(n){var s=tC.bind(null,e,n);r.has(n)||(r.add(n),n.then(s,s))})}}function sr(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var s=r[n];try{var i=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:Xe=l.stateNode,fr=!1;break e;case 3:Xe=l.stateNode.containerInfo,fr=!0;break e;case 4:Xe=l.stateNode.containerInfo,fr=!0;break e}l=l.return}if(Xe===null)throw Error(A(160));h0(i,o,s),Xe=null,fr=!1;var c=s.alternate;c!==null&&(c.return=null),s.return=null}catch(u){Ie(s,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)f0(t,e),t=t.sibling}function f0(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(sr(t,e),_r(e),n&4){try{Mo(3,e,e.return),Kc(3,e)}catch(g){Ie(e,e.return,g)}try{Mo(5,e,e.return)}catch(g){Ie(e,e.return,g)}}break;case 1:sr(t,e),_r(e),n&512&&r!==null&&fi(r,r.return);break;case 5:if(sr(t,e),_r(e),n&512&&r!==null&&fi(r,r.return),e.flags&32){var s=e.stateNode;try{Vo(s,"")}catch(g){Ie(e,e.return,g)}}if(n&4&&(s=e.stateNode,s!=null)){var i=e.memoizedProps,o=r!==null?r.memoizedProps:i,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&Dy(s,i),Fd(l,o);var u=Fd(l,i);for(o=0;o<c.length;o+=2){var d=c[o],h=c[o+1];d==="style"?Uy(s,h):d==="dangerouslySetInnerHTML"?$y(s,h):d==="children"?Vo(s,h):wf(s,d,h,u)}switch(l){case"input":Id(s,i);break;case"textarea":Ly(s,i);break;case"select":var m=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?mi(s,!!i.multiple,p,!1):m!==!!i.multiple&&(i.defaultValue!=null?mi(s,!!i.multiple,i.defaultValue,!0):mi(s,!!i.multiple,i.multiple?[]:"",!1))}s[Xo]=i}catch(g){Ie(e,e.return,g)}}break;case 6:if(sr(t,e),_r(e),n&4){if(e.stateNode===null)throw Error(A(162));s=e.stateNode,i=e.memoizedProps;try{s.nodeValue=i}catch(g){Ie(e,e.return,g)}}break;case 3:if(sr(t,e),_r(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{Ko(t.containerInfo)}catch(g){Ie(e,e.return,g)}break;case 4:sr(t,e),_r(e);break;case 13:sr(t,e),_r(e),s=e.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(Zf=Le())),n&4&&ag(e);break;case 22:if(d=r!==null&&r.memoizedState!==null,e.mode&1?(ct=(u=ct)||d,sr(t,e),ct=u):sr(t,e),_r(e),n&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(q=e,d=e.child;d!==null;){for(h=q=d;q!==null;){switch(m=q,p=m.child,m.tag){case 0:case 11:case 14:case 15:Mo(4,m,m.return);break;case 1:fi(m,m.return);var w=m.stateNode;if(typeof w.componentWillUnmount=="function"){n=m,r=m.return;try{t=n,w.props=t.memoizedProps,w.state=t.memoizedState,w.componentWillUnmount()}catch(g){Ie(n,r,g)}}break;case 5:fi(m,m.return);break;case 22:if(m.memoizedState!==null){cg(h);continue}}p!==null?(p.return=m,q=p):cg(h)}d=d.sibling}e:for(d=null,h=e;;){if(h.tag===5){if(d===null){d=h;try{s=h.stateNode,u?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=h.stateNode,c=h.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=Fy("display",o))}catch(g){Ie(e,e.return,g)}}}else if(h.tag===6){if(d===null)try{h.stateNode.nodeValue=u?"":h.memoizedProps}catch(g){Ie(e,e.return,g)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===e)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;h.sibling===null;){if(h.return===null||h.return===e)break e;d===h&&(d=null),h=h.return}d===h&&(d=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:sr(t,e),_r(e),n&4&&ag(e);break;case 21:break;default:sr(t,e),_r(e)}}function _r(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(d0(r)){var n=r;break e}r=r.return}throw Error(A(160))}switch(n.tag){case 5:var s=n.stateNode;n.flags&32&&(Vo(s,""),n.flags&=-33);var i=og(e);mh(e,i,s);break;case 3:case 4:var o=n.stateNode.containerInfo,l=og(e);ph(e,l,o);break;default:throw Error(A(161))}}catch(c){Ie(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function KE(e,t,r){q=e,p0(e)}function p0(e,t,r){for(var n=(e.mode&1)!==0;q!==null;){var s=q,i=s.child;if(s.tag===22&&n){var o=s.memoizedState!==null||tl;if(!o){var l=s.alternate,c=l!==null&&l.memoizedState!==null||ct;l=tl;var u=ct;if(tl=o,(ct=c)&&!u)for(q=s;q!==null;)o=q,c=o.child,o.tag===22&&o.memoizedState!==null?ug(s):c!==null?(c.return=o,q=c):ug(s);for(;i!==null;)q=i,p0(i),i=i.sibling;q=s,tl=l,ct=u}lg(e)}else s.subtreeFlags&8772&&i!==null?(i.return=s,q=i):lg(e)}}function lg(e){for(;q!==null;){var t=q;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:ct||Kc(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!ct)if(r===null)n.componentDidMount();else{var s=t.elementType===t.type?r.memoizedProps:lr(t.type,r.memoizedProps);n.componentDidUpdate(s,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&qm(t,i,n);break;case 3:var o=t.updateQueue;if(o!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}qm(t,o,r)}break;case 5:var l=t.stateNode;if(r===null&&t.flags&4){r=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.src=c.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 h=d.dehydrated;h!==null&&Ko(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(A(163))}ct||t.flags&512&&fh(t)}catch(m){Ie(t,t.return,m)}}if(t===e){q=null;break}if(r=t.sibling,r!==null){r.return=t.return,q=r;break}q=t.return}}function cg(e){for(;q!==null;){var t=q;if(t===e){q=null;break}var r=t.sibling;if(r!==null){r.return=t.return,q=r;break}q=t.return}}function ug(e){for(;q!==null;){var t=q;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Kc(4,t)}catch(c){Ie(t,r,c)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var s=t.return;try{n.componentDidMount()}catch(c){Ie(t,s,c)}}var i=t.return;try{fh(t)}catch(c){Ie(t,i,c)}break;case 5:var o=t.return;try{fh(t)}catch(c){Ie(t,o,c)}}}catch(c){Ie(t,t.return,c)}if(t===e){q=null;break}var l=t.sibling;if(l!==null){l.return=t.return,q=l;break}q=t.return}}var GE=Math.ceil,ac=hn.ReactCurrentDispatcher,Qf=hn.ReactCurrentOwner,Jt=hn.ReactCurrentBatchConfig,de=0,Ge=null,Fe=null,et=0,Tt=0,pi=Xn(0),We=0,sa=null,Ps=0,Gc=0,Xf=0,$o=null,wt=null,Zf=0,Vi=1/0,Wr=null,lc=!1,gh=null,zn=null,rl=!1,In=null,cc=0,Fo=0,vh=null,Rl=-1,Pl=0;function mt(){return de&6?Le():Rl!==-1?Rl:Rl=Le()}function Bn(e){return e.mode&1?de&2&&et!==0?et&-et:PE.transition!==null?(Pl===0&&(Pl=Xy()),Pl):(e=ge,e!==0||(e=window.event,e=e===void 0?16:ix(e.type)),e):1}function vr(e,t,r,n){if(50<Fo)throw Fo=0,vh=null,Error(A(185));ja(e,r,n),(!(de&2)||e!==Ge)&&(e===Ge&&(!(de&2)&&(Gc|=r),We===4&&En(e,et)),Et(e,n),r===1&&de===0&&!(t.mode&1)&&(Vi=Le()+500,Wc&&Zn()))}function Et(e,t){var r=e.callbackNode;Pj(e,t);var n=ql(e,e===Ge?et:0);if(n===0)r!==null&&xm(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&xm(r),t===1)e.tag===0?RE(dg.bind(null,e)):jx(dg.bind(null,e)),CE(function(){!(de&6)&&Zn()}),r=null;else{switch(Zy(n)){case 1:r=Ef;break;case 4:r=Yy;break;case 16:r=Hl;break;case 536870912:r=Qy;break;default:r=Hl}r=_0(r,m0.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function m0(e,t){if(Rl=-1,Pl=0,de&6)throw Error(A(327));var r=e.callbackNode;if(wi()&&e.callbackNode!==r)return null;var n=ql(e,e===Ge?et:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=uc(e,n);else{t=n;var s=de;de|=2;var i=v0();(Ge!==e||et!==t)&&(Wr=null,Vi=Le()+500,Es(e,t));do try{QE();break}catch(l){g0(e,l)}while(!0);$f(),ac.current=i,de=s,Fe!==null?t=0:(Ge=null,et=0,t=We)}if(t!==0){if(t===2&&(s=Wd(e),s!==0&&(n=s,t=yh(e,s))),t===1)throw r=sa,Es(e,0),En(e,n),Et(e,Le()),r;if(t===6)En(e,n);else{if(s=e.current.alternate,!(n&30)&&!JE(s)&&(t=uc(e,n),t===2&&(i=Wd(e),i!==0&&(n=i,t=yh(e,i))),t===1))throw r=sa,Es(e,0),En(e,n),Et(e,Le()),r;switch(e.finishedWork=s,e.finishedLanes=n,t){case 0:case 1:throw Error(A(345));case 2:cs(e,wt,Wr);break;case 3:if(En(e,n),(n&130023424)===n&&(t=Zf+500-Le(),10<t)){if(ql(e,0)!==0)break;if(s=e.suspendedLanes,(s&n)!==n){mt(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Xd(cs.bind(null,e,wt,Wr),t);break}cs(e,wt,Wr);break;case 4:if(En(e,n),(n&4194240)===n)break;for(t=e.eventTimes,s=-1;0<n;){var o=31-gr(n);i=1<<o,o=t[o],o>s&&(s=o),n&=~i}if(n=s,n=Le()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*GE(n/1960))-n,10<n){e.timeoutHandle=Xd(cs.bind(null,e,wt,Wr),n);break}cs(e,wt,Wr);break;case 5:cs(e,wt,Wr);break;default:throw Error(A(329))}}}return Et(e,Le()),e.callbackNode===r?m0.bind(null,e):null}function yh(e,t){var r=$o;return e.current.memoizedState.isDehydrated&&(Es(e,t).flags|=256),e=uc(e,t),e!==2&&(t=wt,wt=r,t!==null&&xh(t)),e}function xh(e){wt===null?wt=e:wt.push.apply(wt,e)}function JE(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var s=r[n],i=s.getSnapshot;s=s.value;try{if(!yr(i(),s))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function En(e,t){for(t&=~Xf,t&=~Gc,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-gr(t),n=1<<r;e[r]=-1,t&=~n}}function dg(e){if(de&6)throw Error(A(327));wi();var t=ql(e,0);if(!(t&1))return Et(e,Le()),null;var r=uc(e,t);if(e.tag!==0&&r===2){var n=Wd(e);n!==0&&(t=n,r=yh(e,n))}if(r===1)throw r=sa,Es(e,0),En(e,t),Et(e,Le()),r;if(r===6)throw Error(A(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,cs(e,wt,Wr),Et(e,Le()),null}function ep(e,t){var r=de;de|=1;try{return e(t)}finally{de=r,de===0&&(Vi=Le()+500,Wc&&Zn())}}function As(e){In!==null&&In.tag===0&&!(de&6)&&wi();var t=de;de|=1;var r=Jt.transition,n=ge;try{if(Jt.transition=null,ge=1,e)return e()}finally{ge=n,Jt.transition=r,de=t,!(de&6)&&Zn()}}function tp(){Tt=pi.current,je(pi)}function Es(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,EE(r)),Fe!==null)for(r=Fe.return;r!==null;){var n=r;switch(Df(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&Ql();break;case 3:zi(),je(St),je(ut),Wf();break;case 5:Vf(n);break;case 4:zi();break;case 13:je(Ne);break;case 19:je(Ne);break;case 10:Ff(n.type._context);break;case 22:case 23:tp()}r=r.return}if(Ge=e,Fe=e=Vn(e.current,null),et=Tt=t,We=0,sa=null,Xf=Gc=Ps=0,wt=$o=null,fs!==null){for(t=0;t<fs.length;t++)if(r=fs[t],n=r.interleaved,n!==null){r.interleaved=null;var s=n.next,i=r.pending;if(i!==null){var o=i.next;i.next=s,n.next=o}r.pending=n}fs=null}return e}function g0(e,t){do{var r=Fe;try{if($f(),Nl.current=oc,ic){for(var n=ke.memoizedState;n!==null;){var s=n.queue;s!==null&&(s.pending=null),n=n.next}ic=!1}if(Rs=0,Ke=Ve=ke=null,Lo=!1,ta=0,Qf.current=null,r===null||r.return===null){We=1,sa=t,Fe=null;break}e:{var i=e,o=r.return,l=r,c=t;if(t=et,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=l,h=d.tag;if(!(d.mode&1)&&(h===0||h===11||h===15)){var m=d.alternate;m?(d.updateQueue=m.updateQueue,d.memoizedState=m.memoizedState,d.lanes=m.lanes):(d.updateQueue=null,d.memoizedState=null)}var p=Xm(o);if(p!==null){p.flags&=-257,Zm(p,o,l,i,t),p.mode&1&&Qm(i,u,t),t=p,c=u;var w=t.updateQueue;if(w===null){var g=new Set;g.add(c),t.updateQueue=g}else w.add(c);break e}else{if(!(t&1)){Qm(i,u,t),rp();break e}c=Error(A(426))}}else if(Ce&&l.mode&1){var v=Xm(o);if(v!==null){!(v.flags&65536)&&(v.flags|=256),Zm(v,o,l,i,t),Lf(Bi(c,l));break e}}i=c=Bi(c,l),We!==4&&(We=2),$o===null?$o=[i]:$o.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var x=Zx(i,c,t);Hm(i,x);break e;case 1:l=c;var y=i.type,b=i.stateNode;if(!(i.flags&128)&&(typeof y.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(zn===null||!zn.has(b)))){i.flags|=65536,t&=-t,i.lanes|=t;var S=e0(i,l,t);Hm(i,S);break e}}i=i.return}while(i!==null)}x0(r)}catch(_){t=_,Fe===r&&r!==null&&(Fe=r=r.return);continue}break}while(!0)}function v0(){var e=ac.current;return ac.current=oc,e===null?oc:e}function rp(){(We===0||We===3||We===2)&&(We=4),Ge===null||!(Ps&268435455)&&!(Gc&268435455)||En(Ge,et)}function uc(e,t){var r=de;de|=2;var n=v0();(Ge!==e||et!==t)&&(Wr=null,Es(e,t));do try{YE();break}catch(s){g0(e,s)}while(!0);if($f(),de=r,ac.current=n,Fe!==null)throw Error(A(261));return Ge=null,et=0,We}function YE(){for(;Fe!==null;)y0(Fe)}function QE(){for(;Fe!==null&&!_j();)y0(Fe)}function y0(e){var t=b0(e.alternate,e,Tt);e.memoizedProps=e.pendingProps,t===null?x0(e):Fe=t,Qf.current=null}function x0(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=WE(r,t),r!==null){r.flags&=32767,Fe=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{We=6,Fe=null;return}}else if(r=VE(r,t,Tt),r!==null){Fe=r;return}if(t=t.sibling,t!==null){Fe=t;return}Fe=t=e}while(t!==null);We===0&&(We=5)}function cs(e,t,r){var n=ge,s=Jt.transition;try{Jt.transition=null,ge=1,XE(e,t,r,n)}finally{Jt.transition=s,ge=n}return null}function XE(e,t,r,n){do wi();while(In!==null);if(de&6)throw Error(A(327));r=e.finishedWork;var s=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(A(177));e.callbackNode=null,e.callbackPriority=0;var i=r.lanes|r.childLanes;if(Aj(e,i),e===Ge&&(Fe=Ge=null,et=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||rl||(rl=!0,_0(Hl,function(){return wi(),null})),i=(r.flags&15990)!==0,r.subtreeFlags&15990||i){i=Jt.transition,Jt.transition=null;var o=ge;ge=1;var l=de;de|=4,Qf.current=null,qE(e,r),f0(r,e),yE(Yd),Kl=!!Jd,Yd=Jd=null,e.current=r,KE(r),Sj(),de=l,ge=o,Jt.transition=i}else e.current=r;if(rl&&(rl=!1,In=e,cc=s),i=e.pendingLanes,i===0&&(zn=null),Cj(r.stateNode),Et(e,Le()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)s=t[r],n(s.value,{componentStack:s.stack,digest:s.digest});if(lc)throw lc=!1,e=gh,gh=null,e;return cc&1&&e.tag!==0&&wi(),i=e.pendingLanes,i&1?e===vh?Fo++:(Fo=0,vh=e):Fo=0,Zn(),null}function wi(){if(In!==null){var e=Zy(cc),t=Jt.transition,r=ge;try{if(Jt.transition=null,ge=16>e?16:e,In===null)var n=!1;else{if(e=In,In=null,cc=0,de&6)throw Error(A(331));var s=de;for(de|=4,q=e.current;q!==null;){var i=q,o=i.child;if(q.flags&16){var l=i.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(q=u;q!==null;){var d=q;switch(d.tag){case 0:case 11:case 15:Mo(8,d,i)}var h=d.child;if(h!==null)h.return=d,q=h;else for(;q!==null;){d=q;var m=d.sibling,p=d.return;if(u0(d),d===u){q=null;break}if(m!==null){m.return=p,q=m;break}q=p}}}var w=i.alternate;if(w!==null){var g=w.child;if(g!==null){w.child=null;do{var v=g.sibling;g.sibling=null,g=v}while(g!==null)}}q=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,q=o;else e:for(;q!==null;){if(i=q,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Mo(9,i,i.return)}var x=i.sibling;if(x!==null){x.return=i.return,q=x;break e}q=i.return}}var y=e.current;for(q=y;q!==null;){o=q;var b=o.child;if(o.subtreeFlags&2064&&b!==null)b.return=o,q=b;else e:for(o=y;q!==null;){if(l=q,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Kc(9,l)}}catch(_){Ie(l,l.return,_)}if(l===o){q=null;break e}var S=l.sibling;if(S!==null){S.return=l.return,q=S;break e}q=l.return}}if(de=s,Zn(),Pr&&typeof Pr.onPostCommitFiberRoot=="function")try{Pr.onPostCommitFiberRoot(Fc,e)}catch{}n=!0}return n}finally{ge=r,Jt.transition=t}}return!1}function hg(e,t,r){t=Bi(r,t),t=Zx(e,t,1),e=Un(e,t,1),t=mt(),e!==null&&(ja(e,1,t),Et(e,t))}function Ie(e,t,r){if(e.tag===3)hg(e,e,r);else for(;t!==null;){if(t.tag===3){hg(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(zn===null||!zn.has(n))){e=Bi(r,e),e=e0(t,e,1),t=Un(t,e,1),e=mt(),t!==null&&(ja(t,1,e),Et(t,e));break}}t=t.return}}function ZE(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=mt(),e.pingedLanes|=e.suspendedLanes&r,Ge===e&&(et&r)===r&&(We===4||We===3&&(et&130023424)===et&&500>Le()-Zf?Es(e,0):Xf|=r),Et(e,t)}function w0(e,t){t===0&&(e.mode&1?(t=qa,qa<<=1,!(qa&130023424)&&(qa=4194304)):t=1);var r=mt();e=nn(e,t),e!==null&&(ja(e,t,r),Et(e,r))}function eC(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),w0(e,r)}function tC(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,s=e.memoizedState;s!==null&&(r=s.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(A(314))}n!==null&&n.delete(t),w0(e,r)}var b0;b0=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||St.current)_t=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return _t=!1,BE(e,t,r);_t=!!(e.flags&131072)}else _t=!1,Ce&&t.flags&1048576&&Ex(t,ec,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Tl(e,t),e=t.pendingProps;var s=$i(t,ut.current);xi(t,r),s=qf(null,t,n,e,s,r);var i=Kf();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,jt(n)?(i=!0,Xl(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,zf(t),s.updater=qc,t.stateNode=s,s._reactInternals=t,ih(t,n,e,r),t=lh(null,t,n,!0,i,r)):(t.tag=0,Ce&&i&&If(t),ft(null,t,s,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Tl(e,t),e=t.pendingProps,s=n._init,n=s(n._payload),t.type=n,s=t.tag=nC(n),e=lr(n,e),s){case 0:t=ah(null,t,n,e,r);break e;case 1:t=rg(null,t,n,e,r);break e;case 11:t=eg(null,t,n,e,r);break e;case 14:t=tg(null,t,n,lr(n.type,e),r);break e}throw Error(A(306,n,""))}return t;case 0:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:lr(n,s),ah(e,t,n,s,r);case 1:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:lr(n,s),rg(e,t,n,s,r);case 3:e:{if(s0(t),e===null)throw Error(A(387));n=t.pendingProps,i=t.memoizedState,s=i.element,Px(e,t),nc(t,n,null,r);var o=t.memoizedState;if(n=o.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=Bi(Error(A(423)),t),t=ng(e,t,n,r,s);break e}else if(n!==s){s=Bi(Error(A(424)),t),t=ng(e,t,n,r,s);break e}else for(At=Fn(t.stateNode.containerInfo.firstChild),Ot=t,Ce=!0,pr=null,r=Tx(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Fi(),n===s){t=sn(e,t,r);break e}ft(e,t,n,r)}t=t.child}return t;case 5:return Ax(t),e===null&&rh(t),n=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,o=s.children,Qd(n,s)?o=null:i!==null&&Qd(n,i)&&(t.flags|=32),n0(e,t),ft(e,t,o,r),t.child;case 6:return e===null&&rh(t),null;case 13:return i0(e,t,r);case 4:return Bf(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Ui(t,null,n,r):ft(e,t,n,r),t.child;case 11:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:lr(n,s),eg(e,t,n,s,r);case 7:return ft(e,t,t.pendingProps,r),t.child;case 8:return ft(e,t,t.pendingProps.children,r),t.child;case 12:return ft(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,s=t.pendingProps,i=t.memoizedProps,o=s.value,we(tc,n._currentValue),n._currentValue=o,i!==null)if(yr(i.value,o)){if(i.children===s.children&&!St.current){t=sn(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);
vendor: 4,300 bytes, line 40
40i!==null;){var l=i.dependencies;if(l!==null){o=i.child;for(var c=l.firstContext;c!==null;){if(c.context===n){if(i.tag===1){c=en(-1,r&-r),c.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}i.lanes|=r,c=i.alternate,c!==null&&(c.lanes|=r),nh(i.return,r,t),l.lanes|=r;break}c=c.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(A(341));o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),nh(o,r,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}ft(e,t,s.children,r),t=t.child}return t;case 9:return s=t.type,n=t.pendingProps.children,xi(t,r),s=Yt(s),n=n(s),t.flags|=1,ft(e,t,n,r),t.child;case 14:return n=t.type,s=lr(n,t.pendingProps),s=lr(n.type,s),tg(e,t,n,s,r);case 15:return t0(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:lr(n,s),Tl(e,t),t.tag=1,jt(n)?(e=!0,Xl(t)):e=!1,xi(t,r),Xx(t,n,s),ih(t,n,s,r),lh(null,t,n,!0,e,r);case 19:return o0(e,t,r);case 22:return r0(e,t,r)}throw Error(A(156,t.tag))};function _0(e,t){return Jy(e,t)}function rC(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Gt(e,t,r,n){return new rC(e,t,r,n)}function np(e){return e=e.prototype,!(!e||!e.isReactComponent)}function nC(e){if(typeof e=="function")return np(e)?1:0;if(e!=null){if(e=e.$$typeof,e===_f)return 11;if(e===Sf)return 14}return 2}function Vn(e,t){var r=e.alternate;return r===null?(r=Gt(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Al(e,t,r,n,s,i){var o=2;if(n=e,typeof e=="function")np(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case si:return Cs(r.children,s,i,t);case bf:o=8,s|=8;break;case Td:return e=Gt(12,r,t,s|2),e.elementType=Td,e.lanes=i,e;case Rd:return e=Gt(13,r,t,s),e.elementType=Rd,e.lanes=i,e;case Pd:return e=Gt(19,r,t,s),e.elementType=Pd,e.lanes=i,e;case Ay:return Jc(r,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ry:o=10;break e;case Py:o=9;break e;case _f:o=11;break e;case Sf:o=14;break e;case _n:o=16,n=null;break e}throw Error(A(130,e==null?e:typeof e,""))}return t=Gt(o,r,t,s),t.elementType=e,t.type=n,t.lanes=i,t}function Cs(e,t,r,n){return e=Gt(7,e,n,t),e.lanes=r,e}function Jc(e,t,r,n){return e=Gt(22,e,n,t),e.elementType=Ay,e.lanes=r,e.stateNode={isHidden:!1},e}function td(e,t,r){return e=Gt(6,e,null,t),e.lanes=r,e}function rd(e,t,r){return t=Gt(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function sC(e,t,r,n,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Lu(0),this.expirationTimes=Lu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Lu(0),this.identifierPrefix=n,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function sp(e,t,r,n,s,i,o,l,c){return e=new sC(e,t,r,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Gt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},zf(i),e}function iC(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;
vendor: 4,591 bytes, line 40
40return{$$typeof:ni,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function S0(e){if(!e)return qn;e=e._reactInternals;e:{if($s(e)!==e||e.tag!==1)throw Error(A(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(jt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(A(171))}if(e.tag===1){var r=e.type;if(jt(r))return Sx(e,r,t)}return t}function j0(e,t,r,n,s,i,o,l,c){return e=sp(r,n,!0,e,s,i,o,l,c),e.context=S0(null),r=e.current,n=mt(),s=Bn(r),i=en(n,s),i.callback=t??null,Un(r,i,s),e.current.lanes=s,ja(e,s,n),Et(e,n),e}function Yc(e,t,r,n){var s=t.current,i=mt(),o=Bn(s);return r=S0(r),t.context===null?t.context=r:t.pendingContext=r,t=en(i,o),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=Un(s,t,o),e!==null&&(vr(e,s,o,i),Cl(e,s,o)),o}function dc(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 fg(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function ip(e,t){fg(e,t),(e=e.alternate)&&fg(e,t)}function oC(){return null}var E0=typeof reportError=="function"?reportError:function(e){console.error(e)};function op(e){this._internalRoot=e}Qc.prototype.render=op.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(A(409));Yc(e,t,null,null)};Qc.prototype.unmount=op.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;As(function(){Yc(null,e,null,null)}),t[rn]=null}};function Qc(e){this._internalRoot=e}Qc.prototype.unstable_scheduleHydration=function(e){if(e){var t=rx();e={blockedOn:null,target:e,priority:t};for(var r=0;r<jn.length&&t!==0&&t<jn[r].priority;r++);jn.splice(r,0,e),r===0&&sx(e)}};function ap(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Xc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function pg(){}function aC(e,t,r,n,s){if(s){if(typeof n=="function"){var i=n;n=function(){var u=dc(o);i.call(u)}}var o=j0(t,n,e,0,null,!1,!1,"",pg);return e._reactRootContainer=o,e[rn]=o.current,Yo(e.nodeType===8?e.parentNode:e),As(),o}for(;s=e.lastChild;)e.removeChild(s);if(typeof n=="function"){var l=n;n=function(){var u=dc(c);l.call(u)}}var c=sp(e,0,!1,null,null,!1,!1,"",pg);return e._reactRootContainer=c,e[rn]=c.current,Yo(e.nodeType===8?e.parentNode:e),As(function(){Yc(t,c,r,n)}),c}function Zc(e,t,r,n,s){var i=r._reactRootContainer;if(i){var o=i;if(typeof s=="function"){var l=s;s=function(){var c=dc(o);l.call(c)}}Yc(t,o,e,s)}else o=aC(r,t,e,s,n);return dc(o)}ex=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Eo(t.pendingLanes);r!==0&&(Cf(t,r|1),Et(t,Le()),!(de&6)&&(Vi=Le()+500,Zn()))}break;case 13:As(function(){var n=nn(e,1);if(n!==null){var s=mt();vr(n,e,1,s)}}),ip(e,1)}};Nf=function(e){if(e.tag===13){var t=nn(e,134217728);if(t!==null){var r=mt();vr(t,e,134217728,r)}ip(e,134217728)}};tx=function(e){if(e.tag===13){var t=Bn(e),r=nn(e,t);if(r!==null){var n=mt();vr(r,e,t,n)}ip(e,t)}};rx=function(){return ge};nx=function(e,t){var r=ge;try{return ge=e,t()}finally{ge=r}};zd=function(e,t,r){switch(t){case"input":if(Id(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var s=Vc(n);if(!s)throw Error(A(90));Iy(n),Id(n,s)}}}break;case"textarea":Ly(e,r);break;case"select":t=r.value,t!=null&&mi(e,!!r.multiple,t,!1)}};Vy=ep;Wy=As;var lC={usingClientEntryPoint:!1,Events:[Ca,li,Vc,zy,By,ep]},yo={findFiberByHostInstance:hs,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},cC={bundleType:yo.bundleType,version:yo.version,rendererPackageName:yo.rendererPackageName,rendererConfig:yo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:hn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Ky(e),e===null?null:e.stateNode},findFiberByHostInstance:yo.findFiberByHostInstance||oC,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};
40if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var nl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!nl.isDisabled&&nl.supportsFiber)try{Fc=nl.inject(cC),Pr=nl}catch{}}Ft.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=lC;Ft.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ap(t))throw Error(A(200));return iC(e,t,null,r)};Ft.createRoot=function(e,t){if(!ap(e))throw Error(A(299));var r=!1,n="",s=E0;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=sp(e,1,!1,null,null,r,!1,n,s),e[rn]=t.current,Yo(e.nodeType===8?e.parentNode:e),new op(t)};Ft.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(A(188)):(e=Object.keys(e).join(","),Error(A(268,e)));return e=Ky(t),e=e===null?null:e.stateNode,e};Ft.flushSync=function(e){return As(e)};Ft.hydrate=function(e,t,r){if(!Xc(t))throw Error(A(200));return Zc(null,e,t,!0,r)};Ft.hydrateRoot=function(e,t,r){if(!ap(e))throw Error(A(405));var n=r!=null&&r.hydratedSources||null,s=!1,i="",o=E0;if(r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(i=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),t=j0(t,null,e,1,r??null,s,!1,i,o),e[rn]=t.current,Yo(e),n)for(e=0;e<n.length;e++)r=n[e],s=r._getVersion,s=s(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,s]:t.mutableSourceEagerHydrationData.push(r,s);return new Qc(t)};Ft.render=function(e,t,r){if(!Xc(t))throw Error(A(200));return Zc(null,e,t,!1,r)};Ft.unmountComponentAtNode=function(e){if(!Xc(e))throw Error(A(40));return e._reactRootContainer?(As(function(){Zc(null,null,e,!1,function(){e._reactRootContainer=null,e[rn]=null})}),!0):!1};Ft.unstable_batchedUpdates=ep;Ft.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!Xc(r))throw Error(A(200));if(e==null||e._reactInternals===void 0)throw Error(A(38));return Zc(e,t,r,!1,n)};Ft.version="18.3.1-next-f1338f8080-20240426";function C0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(C0)}catch(e){console.error(e)}}C0(),Cy.exports=Ft;var Fs=Cy.exports;const lp=py(Fs);var N0,mg=Fs;N0=mg.createRoot,mg.hydrateRoot;var hc=["light","dark"],cp="(prefers-color-scheme: dark)",uC=typeof window>"u",up=f.createContext(void 0),dC={setTheme:e=>{},themes:[]},k0=()=>{var e;return(e=f.useContext(up))!=null?e:dC},hC=e=>f.useContext(up)?e.children:f.createElement(pC,{...e}),fC=["light","dark"],pC=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:r=!0,enableColorScheme:n=!0,storageKey:s="theme",themes:i=fC,defaultTheme:o=r?"system":"light",attribute:l="data-theme",value:c,children:u,nonce:d})=>{let[h,m]=f.useState(()=>gg(s,o)),[p,w]=f.useState(()=>gg(s)),g=c?Object.values(c):i,v=f.useCallback(S=>{let _=S;if(!_)return;S==="system"&&r&&(_=vg());let j=c?c[_]:_,E=t?gC():null,C=document.documentElement;if(l==="class"?(C.classList.remove(...g),j&&C.classList.add(j)):j?C.setAttribute(l,j):C.removeAttribute(l),n){let N=hc.includes(o)?o:null,R=hc.includes(_)?_:N;C.style.colorScheme=R}E==null||E()},[]),x=f.useCallback(S=>{let _=typeof S=="function"?S(S):S;m(_);try{localStorage.setItem(s,_)}catch{}},[e]),y=f.useCallback(S=>{let _=vg(S);w(_),h==="system"&&r&&!e&&v("system")},[h,e]);f.useEffect(()=>{let S=window.matchMedia(cp);return S.addListener(y),y(S),()=>S.removeListener(y)},[y]),f.useEffect(()=>{let S=_=>{if(_.key!==s)return;let j=_.newValue||o;x(j)};return window.addEventListener("storage",S),()=>window.removeEventListener("storage",S)},[x]),f.useEffect(()=>{v(e??h)},[e,h]);let b=f.useMemo(()=>({theme:h,setTheme:x,forcedTheme:e,resolvedTheme:h==="system"?p:h,themes:r?[...i,"system"]:i,systemTheme:r?p:void 0}),[h,x,e,p,r,i]);return f.createElement(up.Provider,{value:b},f.createElement(mC,{forcedTheme:e,disableTransitionOnChange:t,enableSystem:r,enableColorScheme:n,storageKey:s,themes:i,defaultTheme:o,attribute:l,value:c,children:u,attrs:g,nonce:d}),u)},mC=f.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:n,enableColorScheme:s,defaultTheme:i,value:o,attrs:l,nonce:c})=>{let u=i==="system",d=r==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${l.map(w=>`'${w}'`).join(",")})`};`:`var d=document.documentElement,n='${r}',s='setAttribute';`,h=s?hc.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",m=(w,g=!1,v=!0)=>{let x=o?o[w]:w,y=g?w+"|| ''":`'${x}'`,b="";return s&&v&&!g&&hc.includes(w)&&(b+=`d.style.colorScheme = '${w}';`),r==="class"?g||x?b+=`c.add(${y})`:b+="null":x&&(b+=`d[s](n,${y})`),b},p=e?`!function(){${d}${m(e)}}()`:n?`!function(){try{${d}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${u})){var t='${cp}',m=window.matchMedia(t);if(m.media!==t||m.matches){${m("dark")}}else{${m("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${m(o?"x[e]":"e",!0)}}${u?"":"else{"+m(i,!1,!1)+"}"}${h}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${m(o?"x[e]":"e",!0)}}else{${m(i,!1,!1)};}${h}}catch(t){}}();`;return f.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:p}})}),gg=(e,t)=>{if(uC)return;let r;try{r=localStorage.getItem(e)||void 0}catch{}return r||t},gC=()=>{let e=document.createElement("style");return e.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(e),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(e)},1)}},vg=e=>
40(e||(e=window.matchMedia(cp)),e.matches?"dark":"light");const vC=1,yC=1e6;let nd=0;function xC(){return nd=(nd+1)%Number.MAX_SAFE_INTEGER,nd.toString()}const sd=new Map,yg=e=>{if(sd.has(e))return;const t=setTimeout(()=>{sd.delete(e),Uo({type:"REMOVE_TOAST",toastId:e})},yC);sd.set(e,t)},wC=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,vC)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?yg(r):e.toasts.forEach(n=>{yg(n.id)}),{...e,toasts:e.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)}}},Ol=[];let Il={toasts:[]};function Uo(e){Il=wC(Il,e),Ol.forEach(t=>{t(Il)})}function bC({...e}){const t=xC(),r=s=>Uo({type:"UPDATE_TOAST",toast:{...s,id:t}}),n=()=>Uo({type:"DISMISS_TOAST",toastId:t});return Uo({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||n()}}}),{id:t,dismiss:n,update:r}}function Xt(){const[e,t]=f.useState(Il);return f.useEffect(()=>(Ol.push(t),()=>{const r=Ol.indexOf(t);r>-1&&Ol.splice(r,1)}),[e]),{...e,toast:bC,dismiss:r=>Uo({type:"DISMISS_TOAST",toastId:r})}}function $(e,t,{checkForDefaultPrevented:r=!0}={}){return function(s){if(e==null||e(s),r===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function xg(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function dp(...e){return t=>{let r=!1;const n=e.map(s=>{const i=xg(s,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let s=0;s<n.length;s++){const i=n[s];typeof i=="function"?i():xg(e[s],null)}}}}function oe(...e){return f.useCallback(dp(...e),e)}function _C(e,t){const r=f.createContext(t),n=i=>{const{children:o,...l}=i,c=f.useMemo(()=>l,Object.values(l));return a.jsx(r.Provider,{value:c,children:o})};n.displayName=e+"Provider";function s(i){const o=f.useContext(r);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[n,s]}function zt(e,t=[]){let r=[];function n(i,o){const l=f.createContext(o),c=r.length;r=[...r,o];const u=h=>{var x;const{scope:m,children:p,...w}=h,g=((x=m==null?void 0:m[e])==null?void 0:x[c])||l,v=f.useMemo(()=>w,Object.values(w));return a.jsx(g.Provider,{value:v,children:p})};u.displayName=i+"Provider";function d(h,m){var g;const p=((g=m==null?void 0:m[e])==null?void 0:g[c])||l,w=f.useContext(p);if(w)return w;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${i}\``)}return[u,d]}const s=()=>{const i=r.map(o=>f.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return f.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[n,SC(s,...t)]}function SC(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=n.reduce((l,{useScope:c,scopeName:u})=>{const h=c(i)[`__scope${u}`];return{...l,...h}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}function Wi(e){const t=EC(e),r=f.forwardRef((n,s)=>{const{children:i,...o}=n,l=f.Children.toArray(i),c=l.find(NC);if(c){const u=c.props.children,d=l.map(h=>h===c?f.Children.count(u)>1?f.Children.only(null):f.isValidElement(u)?u.props.children:null:h);return a.jsx(t,{...o,ref:s,children:f.isValidElement(u)?f.cloneElement(u,void 0,d):null})}return a.jsx(t,{...o,ref:s,children:i})});return r.displayName=`${e}.Slot`,r}var jC=Wi("Slot");function EC(e){const t=f.forwardRef((r,n)=>{const{children:s,...i}=r;if(f.isValidElement(s)){const o=TC(s),l=kC(i,s.props);return s.type!==f.Fragment&&(l.ref=n?dp(n,o):o),f.cloneElement(s,l)}return f.Children.count(s)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var T0=Symbol("radix.slottable");function CC(e){const t=({children:r})=>a.jsx(a.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=T0,t}function NC(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===T0}function kC(e,t){const r={...t};for(const n in t){const s=e[n],i=t[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...l)=>{const c=i(...l);return s(...l),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}
vendor: 8,742 bytes, line 40
40:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}function TC(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function ka(e){const t=e+"CollectionProvider",[r,n]=zt(t),[s,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),o=g=>{const{scope:v,children:x}=g,y=O.useRef(null),b=O.useRef(new Map).current;return a.jsx(s,{scope:v,itemMap:b,collectionRef:y,children:x})};o.displayName=t;const l=e+"CollectionSlot",c=Wi(l),u=O.forwardRef((g,v)=>{const{scope:x,children:y}=g,b=i(l,x),S=oe(v,b.collectionRef);return a.jsx(c,{ref:S,children:y})});u.displayName=l;const d=e+"CollectionItemSlot",h="data-radix-collection-item",m=Wi(d),p=O.forwardRef((g,v)=>{const{scope:x,children:y,...b}=g,S=O.useRef(null),_=oe(v,S),j=i(d,x);return O.useEffect(()=>(j.itemMap.set(S,{ref:S,...b}),()=>void j.itemMap.delete(S))),a.jsx(m,{[h]:"",ref:_,children:y})});p.displayName=d;function w(g){const v=i(e+"CollectionConsumer",g);return O.useCallback(()=>{const y=v.collectionRef.current;if(!y)return[];const b=Array.from(y.querySelectorAll(`[${h}]`));return Array.from(v.itemMap.values()).sort((j,E)=>b.indexOf(j.ref.current)-b.indexOf(E.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:o,Slot:u,ItemSlot:p},w,n]}var RC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],K=RC.reduce((e,t)=>{const r=Wi(`Primitive.${t}`),n=f.forwardRef((s,i)=>{const{asChild:o,...l}=s,c=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function fc(e,t){e&&Fs.flushSync(()=>e.dispatchEvent(t))}function xe(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function PC(e,t=globalThis==null?void 0:globalThis.document){const r=xe(e);f.useEffect(()=>{const n=s=>{s.key==="Escape"&&r(s)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var AC="DismissableLayer",wh="dismissableLayer.update",OC="dismissableLayer.pointerDownOutside",IC="dismissableLayer.focusOutside",wg,R0=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),eo=f.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:o,onDismiss:l,...c}=e,u=f.useContext(R0),[d,h]=f.useState(null),m=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=f.useState({}),w=oe(t,E=>h(E)),g=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=g.indexOf(v),y=d?g.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,S=y>=x,_=LC(E=>{const C=E.target,N=[...u.branches].some(R=>R.contains(C));!S||N||(s==null||s(E),o==null||o(E),E.defaultPrevented||l==null||l())},m),j=MC(E=>{const C=E.target;[...u.branches].some(R=>R.contains(C))||(i==null||i(E),o==null||o(E),E.defaultPrevented||l==null||l())},m);return PC(E=>{y===u.layers.size-1&&(n==null||n(E),!E.defaultPrevented&&l&&(E.preventDefault(),l()))},m),f.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(wg=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),bg(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=wg)}},[d,m,r,u]),f.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),bg())},[d,u]),f.useEffect(()=>{const E=()=>p({});return document.addEventListener(wh,E),()=>document.removeEventListener(wh,E)},[]),a.jsx(K.div,{...c,ref:w,style:{pointerEvents:b?S?"auto":"none":void 0,...e.style},onFocusCapture:$(e.onFocusCapture,j.onFocusCapture),onBlurCapture:$(e.onBlurCapture,j.onBlurCapture),onPointerDownCapture:$(e.onPointerDownCapture,_.onPointerDownCapture)})});eo.displayName=AC;var DC="DismissableLayerBranch",P0=f.forwardRef((e,t)=>{const r=f.useContext(R0),n=f.useRef(null),s=oe(t,n);return f.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),a.jsx(K.div,{...e,ref:s})});P0.displayName=DC;function LC(e,t=globalThis==null?void 0:globalThis.document){const r=xe(e),n=f.useRef(!1),s=f.useRef(()=>{});return f.useEffect(()=>{const i=l=>{if(l.target&&!n.current){let c=function(){A0(OC,r,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);n.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",s.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function MC(e,t=globalThis==null?void 0:globalThis.document){const r=xe(e),n=f.useRef(!1);return f.useEffect(()=>{const s=i=>{i.target&&!n.current&&A0(IC,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function bg(){const e=new CustomEvent(wh);document.dispatchEvent(e)}function A0(e,t,r,{discrete:n}){const s=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?fc(s,i):s.dispatchEvent(i)}var $C=eo,FC=P0,Me=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{},UC="Portal",eu=f.forwardRef((e,t)=>{var l;const{container:r,...n}=e,[s,i]=f.useState(!1);Me(()=>i(!0),[]);const o=r||s&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?lp.createPortal(a.jsx(K.div,{...n,ref:t}),o):null});eu.displayName=UC;function zC(e,t){return f.useReducer((r,n)=>t[r][n]??r,e)}var dt=e=>{const{present:t,children:r}=e,n=BC(t),s=typeof r=="function"?r({present:n.isPresent}):f.Children.only(r),i=oe(n.ref,VC(s));return typeof r=="function"||n.isPresent?f.cloneElement(s,{ref:i}):null};dt.displayName="Presence";function BC(e){const[t,r]=f.useState(),n=f.useRef(null),s=f.useRef(e),i=f.useRef("none"),o=e?"mounted":"unmounted",[l,c]=zC(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const u=sl(n.current);i.current=l==="mounted"?u:"none"},[l]),Me(()=>{const u=n.current,d=s.current;if(d!==e){const m=i.current,p=sl(u);e?c("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&m!==p?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),Me(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,h=p=>{const g=sl(n.current).includes(p.animationName);if(p.target===t&&g&&(c("ANIMATION_END"),!s.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},m=p=>{p.target===t&&(i.current=sl(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:f.useCallback(u=>{n.current=u?getComputedStyle(u):null,r(u)},[])}}function sl(e){return(e==null?void 0:e.animationName)||"none"}function VC(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var WC=vf[" useInsertionEffect ".trim().toString()]||Me;function Ir({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[s,i,o]=HC({defaultProp:t,onChange:r}),l=e!==void 0,c=l?e:s;{const d=f.useRef(e!==void 0);f.useEffect(()=>{const h=d.current;h!==l&&console.warn(`${n} is changing from ${h?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=l},[l,n])}const u=f.useCallback(d=>{var h;if(l){const m=qC(d)?d(e):d;
40m!==e&&((h=o.current)==null||h.call(o,m))}else i(d)},[l,e,i,o]);return[c,u]}function HC({defaultProp:e,onChange:t}){const[r,n]=f.useState(e),s=f.useRef(r),i=f.useRef(t);return WC(()=>{i.current=t},[t]),f.useEffect(()=>{var o;s.current!==r&&((o=i.current)==null||o.call(i,r),s.current=r)},[r,s]),[r,n,i]}function qC(e){return typeof e=="function"}var O0=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),KC="VisuallyHidden",tu=f.forwardRef((e,t)=>a.jsx(K.span,{...e,ref:t,style:{...O0,...e.style}}));tu.displayName=KC;var I0=tu,hp="ToastProvider",[fp,GC,JC]=ka("Toast"),[D0,FL]=zt("Toast",[JC]),[YC,ru]=D0(hp),L0=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:o}=e,[l,c]=f.useState(null),[u,d]=f.useState(0),h=f.useRef(!1),m=f.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${hp}\`. Expected non-empty \`string\`.`),a.jsx(fp.Provider,{scope:t,children:a.jsx(YC,{scope:t,label:r,duration:n,swipeDirection:s,swipeThreshold:i,toastCount:u,viewport:l,onViewportChange:c,onToastAdd:f.useCallback(()=>d(p=>p+1),[]),onToastRemove:f.useCallback(()=>d(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:h,isClosePausedRef:m,children:o})})};L0.displayName=hp;var M0="ToastViewport",QC=["F8"],bh="toast.viewportPause",_h="toast.viewportResume",$0=f.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=QC,label:s="Notifications ({hotkey})",...i}=e,o=ru(M0,r),l=GC(r),c=f.useRef(null),u=f.useRef(null),d=f.useRef(null),h=f.useRef(null),m=oe(t,h,o.onViewportChange),p=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),w=o.toastCount>0;f.useEffect(()=>{const v=x=>{var b;n.length!==0&&n.every(S=>x[S]||x.code===S)&&((b=h.current)==null||b.focus())};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[n]),f.useEffect(()=>{const v=c.current,x=h.current;if(w&&v&&x){const y=()=>{if(!o.isClosePausedRef.current){const j=new CustomEvent(bh);x.dispatchEvent(j),o.isClosePausedRef.current=!0}},b=()=>{if(o.isClosePausedRef.current){const j=new CustomEvent(_h);x.dispatchEvent(j),o.isClosePausedRef.current=!1}},S=j=>{!v.contains(j.relatedTarget)&&b()},_=()=>{v.contains(document.activeElement)||b()};return v.addEventListener("focusin",y),v.addEventListener("focusout",S),v.addEventListener("pointermove",y),v.addEventListener("pointerleave",_),window.addEventListener("blur",y),window.addEventListener("focus",b),()=>{v.removeEventListener("focusin",y),v.removeEventListener("focusout",S),v.removeEventListener("pointermove",y),v.removeEventListener("pointerleave",_),window.removeEventListener("blur",y),window.removeEventListener("focus",b)}}},[w,o.isClosePausedRef]);const g=f.useCallback(({tabbingDirection:v})=>{const y=l().map(b=>{const S=b.ref.current,_=[S,...uN(S)];return v==="forwards"?_:_.reverse()});return(v==="forwards"?y.reverse():y).flat()},[l]);return f.useEffect(()=>{const v=h.current;if(v){const x=y=>{var _,j,E;const b=y.altKey||y.ctrlKey||y.metaKey;if(y.key==="Tab"&&!b){const C=document.activeElement,N=y.shiftKey;if(y.target===v&&N){(_=u.current)==null||_.focus();return}const I=g({tabbingDirection:N?"backwards":"forwards"}),J=I.findIndex(D=>D===C);id(I.slice(J+1))?y.preventDefault():N?(j=u.current)==null||j.focus():(E=d.current)==null||E.focus()}};return v.addEventListener("keydown",x),()=>v.removeEventListener("keydown",x)}},[l,g]),a.jsxs(FC,{ref:c,role:"region","aria-label":s.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:w?void 0:"none"},children:[w&&a.jsx(Sh,{ref:u,onFocusFromOutsideViewport:()=>{const v=g({tabbingDirection:"forwards"});id(v)}}),a.jsx(fp.Slot,{scope:r,children:a.jsx(K.ol,{tabIndex:-1,...i,ref:m})}),w&&a.jsx(Sh,{ref:d,onFocusFromOutsideViewport:()=>{const v=g({tabbingDirection:"backwards"});id(v)}})]})});$0.displayName=M0;var F0="ToastFocusProxy",Sh=f.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...s}=e,i=ru(F0,r);return a.jsx(tu,{"aria-hidden":!0,tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:o=>{var u;const l=o.relatedTarget;!((u=i.viewport)!=null&&u.contains(l))&&n()}})});Sh.displayName=F0;var Ta="Toast",XC="toast.swipeStart",ZC="toast.swipeMove",eN="toast.swipeCancel",tN="toast.swipeEnd",U0=f.forwardRef((e,t)=>
40{const{forceMount:r,open:n,defaultOpen:s,onOpenChange:i,...o}=e,[l,c]=Ir({prop:n,defaultProp:s??!0,onChange:i,caller:Ta});return a.jsx(dt,{present:r||l,children:a.jsx(sN,{open:l,...o,ref:t,onClose:()=>c(!1),onPause:xe(e.onPause),onResume:xe(e.onResume),onSwipeStart:$(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:$(e.onSwipeMove,u=>{const{x:d,y:h}=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",`${h}px`)}),onSwipeCancel:$(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:$(e.onSwipeEnd,u=>{const{x:d,y:h}=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",`${h}px`),c(!1)})})})});U0.displayName=Ta;var[rN,nN]=D0(Ta,{onClose(){}}),sN=f.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:s,open:i,onClose:o,onEscapeKeyDown:l,onPause:c,onResume:u,onSwipeStart:d,onSwipeMove:h,onSwipeCancel:m,onSwipeEnd:p,...w}=e,g=ru(Ta,r),[v,x]=f.useState(null),y=oe(t,D=>x(D)),b=f.useRef(null),S=f.useRef(null),_=s||g.duration,j=f.useRef(0),E=f.useRef(_),C=f.useRef(0),{onToastAdd:N,onToastRemove:R}=g,F=xe(()=>{var Z;(v==null?void 0:v.contains(document.activeElement))&&((Z=g.viewport)==null||Z.focus()),o()}),I=f.useCallback(D=>{!D||D===1/0||(window.clearTimeout(C.current),j.current=new Date().getTime(),C.current=window.setTimeout(F,D))},[F]);f.useEffect(()=>{const D=g.viewport;if(D){const Z=()=>{I(E.current),u==null||u()},H=()=>{const X=new Date().getTime()-j.current;E.current=E.current-X,window.clearTimeout(C.current),c==null||c()};return D.addEventListener(bh,H),D.addEventListener(_h,Z),()=>{D.removeEventListener(bh,H),D.removeEventListener(_h,Z)}}},[g.viewport,_,c,u,I]),f.useEffect(()=>{i&&!g.isClosePausedRef.current&&I(_)},[i,_,g.isClosePausedRef,I]),f.useEffect(()=>(N(),()=>R()),[N,R]);const J=f.useMemo(()=>v?K0(v):null,[v]);return g.viewport?a.jsxs(a.Fragment,{children:[J&&a.jsx(iN,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:J}),a.jsx(rN,{scope:r,onClose:F,children:Fs.createPortal(a.jsx(fp.ItemSlot,{scope:r,children:a.jsx($C,{asChild:!0,onEscapeKeyDown:$(l,()=>{g.isFocusedToastEscapeKeyDownRef.current||F(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:a.jsx(K.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":g.swipeDirection,...w,ref:y,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:$(e.onKeyDown,D=>{D.key==="Escape"&&(l==null||l(D.nativeEvent),D.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,F()))}),onPointerDown:$(e.onPointerDown,D=>{D.button===0&&(b.current={x:D.clientX,y:D.clientY})}),onPointerMove:$(e.onPointerMove,D=>{if(!b.current)return;const Z=D.clientX-b.current.x,H=D.clientY-b.current.y,X=!!S.current,k=["left","right"].includes(g.swipeDirection),P=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,U=k?P(0,Z):0,ee=k?0:P(0,H),G=D.pointerType==="touch"?10:2,ae={x:U,y:ee},re={originalEvent:D,delta:ae};X?(S.current=ae,il(ZC,h,re,{discrete:!1})):_g(ae,g.swipeDirection,G)?(S.current=ae,il(XC,d,re,{discrete:!1}),D.target.setPointerCapture(D.pointerId)):(Math.abs(Z)>G||Math.abs(H)>G)&&(b.current=null)}),onPointerUp:$(e.onPointerUp,D=>{const Z=S.current,H=D.target;if(H.hasPointerCapture(D.pointerId)&&H.releasePointerCapture(D.pointerId),S.current=null,b.current=null,Z){const X=D.currentTarget,k={originalEvent:D,delta:Z};_g(Z,g.swipeDirection,g.swipeThreshold)?il(tN,p,k,{discrete:!0}):il(eN,m,k,{discrete:!0}),X.addEventListener("click",P=>P.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),iN=e=>{const{__scopeToast:t,children:r,...n}=e,s=ru(Ta,t),[i,o]=f.useState(!1),[l,c]=f.useState(!1);return lN(()=>o(!0)),f.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),l?null:a.jsx(eu,{asChild:!0,children:a.jsx(tu,{...n,children:i&&a.jsxs(a.Fragment,{children:[s.label," ",r]})})})},oN="ToastTitle",z0=f.forwardRef((e,t)=>
vendor: 10,726 bytes, lines 40-149
40{const{__scopeToast:r,...n}=e;return a.jsx(K.div,{...n,ref:t})});z0.displayName=oN;var aN="ToastDescription",B0=f.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return a.jsx(K.div,{...n,ref:t})});B0.displayName=aN;var V0="ToastAction",W0=f.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?a.jsx(q0,{altText:r,asChild:!0,children:a.jsx(pp,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${V0}\`. Expected non-empty \`string\`.`),null)});W0.displayName=V0;var H0="ToastClose",pp=f.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,s=nN(H0,r);return a.jsx(q0,{asChild:!0,children:a.jsx(K.button,{type:"button",...n,ref:t,onClick:$(e.onClick,s.onClose)})})});pp.displayName=H0;var q0=f.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...s}=e;return a.jsx(K.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...s,ref:t})});function K0(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),cN(n)){const s=n.ariaHidden||n.hidden||n.style.display==="none",i=n.dataset.radixToastAnnounceExclude==="";if(!s)if(i){const o=n.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...K0(n))}}),t}function il(e,t,r,{discrete:n}){const s=r.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?fc(s,i):s.dispatchEvent(i)}var _g=(e,t,r=0)=>{const n=Math.abs(e.x),s=Math.abs(e.y),i=n>s;return t==="left"||t==="right"?i&&n>r:!i&&s>r};function lN(e=()=>{}){const t=xe(e);Me(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function cN(e){return e.nodeType===e.ELEMENT_NODE}function uN(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function id(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var dN=L0,G0=$0,J0=U0,Y0=z0,Q0=B0,X0=W0,Z0=pp;function ew(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=ew(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function tw(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=ew(e))&&(n&&(n+=" "),n+=t);return n}const Sg=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,jg=tw,Ra=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return jg(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:i}=t,o=Object.keys(s).map(u=>{const d=r==null?void 0:r[u],h=i==null?void 0:i[u];if(d===null)return null;const m=Sg(d)||Sg(h);return s[u][m]}),l=r&&Object.entries(r).reduce((u,d)=>{let[h,m]=d;return m===void 0||(u[h]=m),u},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,d)=>{let{class:h,className:m,...p}=d;return Object.entries(p).every(w=>{let[g,v]=w;return Array.isArray(v)?v.includes({...i,...l}[g]):{...i,...l}[g]===v})?[...u,h,m]:u},[]);return jg(e,o,c,r==null?void 0:r.class,r==null?void 0:r.className)};/** 41 * @license lucide-react v0.462.0 - ISC 42 * 43 * This source code is licensed under the ISC license. 44 * See the LICENSE file in the root directory of this source tree. 45 */const hN=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),rw=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/** 46 * @license lucide-react v0.462.0 - ISC 47 * 48 * This source code is licensed under the ISC license. 49 * See the LICENSE file in the root directory of this source tree. 50 */var fN={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** 51 * @license lucide-react v0.462.0 - ISC 52 * 53 * This source code is licensed under the ISC license. 54 * See the LICENSE file in the root directory of this source tree. 55 */const pN=f.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:i,iconNode:o,...l},c)=>f.createElement("svg",{ref:c,...fN,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:rw("lucide",s),...l},[...o.map(([u,d])=>f.createElement(u,d)),...Array.isArray(i)?i:[i]]));/** 56 * @license lucide-react v0.462.0 - ISC 57 * 58 * This source code is licensed under the ISC license. 59 * See the LICENSE file in the root directory of this source tree. 60 */const ie=(e,t)=>{const r=f.forwardRef(({className:n,...s},i)=>f.createElement(pN,{ref:i,iconNode:t,className:rw(`lucide-${hN(e)}`,n),...s}));return r.displayName=`${e}`,r};/** 61 * @license lucide-react v0.462.0 - ISC 62 * 63 * This source code is licensed under the ISC license. 64 * See the LICENSE file in the root directory of this source tree. 65 */const Eg=ie("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** 66 * @license lucide-react v0.462.0 - ISC 67 * 68 * This source code is licensed under the ISC license. 69 * See the LICENSE file in the root directory of this source tree. 70 */const mN=ie("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** 71 * @license lucide-react v0.462.0 - ISC 72 * 73 * This source code is licensed under the ISC license. 74 * See the LICENSE file in the root directory of this source tree. 75 */const gN=ie("BatteryCharging",[["path",{d:"M15 7h1a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2h-2",key:"1sdynx"}],["path",{d:"M6 7H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h1",key:"1gkd3k"}],["path",{d:"m11 7-3 5h4l-3 5",key:"b4a64w"}],["line",{x1:"22",x2:"22",y1:"11",y2:"13",key:"4dh1rd"}]]);/** 76 * @license lucide-react v0.462.0 - ISC 77 * 78 * This source code is licensed under the ISC license. 79 * See the LICENSE file in the root directory of this source tree. 80 */const nw=ie("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"}]]);/** 81 * @license lucide-react v0.462.0 - ISC 82 * 83 * This source code is licensed under the ISC license. 84 * See the LICENSE file in the root directory of this source tree. 85 */const vN=ie("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** 86 * @license lucide-react v0.462.0 - ISC 87 * 88 * This source code is licensed under the ISC license. 89 * See the LICENSE file in the root directory of this source tree. 90 */const Pa=ie("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** 91 * @license lucide-react v0.462.0 - ISC 92 * 93 * This source code is licensed under the ISC license. 94 * See the LICENSE file in the root directory of this source tree. 95 */const mp=ie("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** 96 * @license lucide-react v0.462.0 - ISC 97 * 98 * This source code is licensed under the ISC license. 99 * See the LICENSE file in the root directory of this source tree. 100 */const ia=ie("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** 101 * @license lucide-react v0.462.0 - ISC 102 * 103 * This source code is licensed under the ISC license. 104 * See the LICENSE file in the root directory of this source tree. 105 */const yN=ie("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** 106 * @license lucide-react v0.462.0 - ISC 107 * 108 * This source code is licensed under the ISC license. 109 * See the LICENSE file in the root directory of this source tree. 110 */const xN=ie("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** 111 * @license lucide-react v0.462.0 - ISC 112 * 113 * This source code is licensed under the ISC license. 114 * See the LICENSE file in the root directory of this source tree. 115 */const jh=ie("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** 116 * @license lucide-react v0.462.0 - ISC 117 * 118 * This source code is licensed under the ISC license. 119 * See the LICENSE file in the root directory of this source tree. 120 */const wN=ie("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** 121 * @license lucide-react v0.462.0 - ISC 122 * 123 * This source code is licensed under the ISC license. 124 * See the LICENSE file in the root directory of this source tree. 125 */const bN=ie("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"}]]);/** 126 * @license lucide-react v0.462.0 - ISC 127 * 128 * This source code is licensed under the ISC license. 129 * See the LICENSE file in the root directory of this source tree. 130 */const _N=ie("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"}]]);/** 131 * @license lucide-react v0.462.0 - ISC 132 * 133 * This source code is licensed under the ISC license. 134 * See the LICENSE file in the root directory of this source tree. 135 */const Eh=ie("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"}]]);/** 136 * @license lucide-react v0.462.0 - ISC 137 * 138 * This source code is licensed under the ISC license. 139 * See the LICENSE file in the root directory of this source tree. 140 */const SN=ie("Leaf",[["path",{d:"M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z",key:"nnexq3"}],["path",{d:"M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12",key:"mt58a7"}]]);/** 141 * @license lucide-react v0.462.0 - ISC 142 * 143 * This source code is licensed under the ISC license. 144 * See the LICENSE file in the root directory of this source tree. 145 */const De=ie("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** 146 * @license lucide-react v0.462.0 - ISC 147 * 148 * This source code is licensed under the ISC license. 149 * See the LICENSE file in the root directory of this source tree.
150 */const jN=ie("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"}]]);/** 151 * @license lucide-react v0.462.0 - ISC 152 * 153 * This source code is licensed under the ISC license. 154 * See the LICENSE file in the root directory of this source tree. 155 */const EN=ie("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"}]]);/** 156 * @license lucide-react v0.462.0 - ISC 157 * 158 * This source code is licensed under the ISC license. 159 * See the LICENSE file in the root directory of this source tree. 160 */const sw=ie("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"}]]);/** 161 * @license lucide-react v0.462.0 - ISC 162 * 163 * This source code is licensed under the ISC license. 164 * See the LICENSE file in the root directory of this source tree. 165 */const Cg=ie("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/** 166 * @license lucide-react v0.462.0 - ISC 167 * 168 * This source code is licensed under the ISC license. 169 * See the LICENSE file in the root directory of this source tree. 170 */const CN=ie("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"}]]);/** 171 * @license lucide-react v0.462.0 - ISC 172 * 173 * This source code is licensed under the ISC license. 174 * See the LICENSE file in the root directory of this source tree. 175 */const NN=ie("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** 176 * @license lucide-react v0.462.0 - ISC 177 * 178 * This source code is licensed under the ISC license. 179 * See the LICENSE file in the root directory of this source tree. 180 */const kN=ie("Navigation",[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]]);/** 181 * @license lucide-react v0.462.0 - ISC 182 * 183 * This source code is licensed under the ISC license. 184 * See the LICENSE file in the root directory of this source tree. 185 */const oa=ie("Newspaper",[["path",{d:"M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-2 2Zm0 0a2 2 0 0 1-2-2v-9c0-1.1.9-2 2-2h2",key:"7pis2x"}],["path",{d:"M18 14h-8",key:"sponae"}],["path",{d:"M15 18h-5",key:"95g1m2"}],["path",{d:"M10 6h8v4h-8V6Z",key:"smlsk5"}]]);/** 186 * @license lucide-react v0.462.0 - ISC 187 * 188 * This source code is licensed under the ISC license. 189 * See the LICENSE file in the root directory of this source tree. 190 */const TN=ie("Pencil",[["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"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** 191 * @license lucide-react v0.462.0 - ISC 192 * 193 * This source code is licensed under the ISC license. 194 * See the LICENSE file in the root directory of this source tree. 195 */const iw=ie("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** 196 * @license lucide-react v0.462.0 - ISC 197 * 198 * This source code is licensed under the ISC license. 199 * See the LICENSE file in the root directory of this source tree. 200 */const on=ie("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** 201 * @license lucide-react v0.462.0 - ISC 202 * 203 * This source code is licensed under the ISC license. 204 * See the LICENSE file in the root directory of this source tree. 205 */const RN=ie("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/** 206 * @license lucide-react v0.462.0 - ISC 207 * 208 * This source code is licensed under the ISC license. 209 * See the LICENSE file in the root directory of this source tree. 210 */const PN=ie("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"}]]);/** 211 * @license lucide-react v0.462.0 - ISC 212 * 213 * This source code is licensed under the ISC license. 214 * See the LICENSE file in the root directory of this source tree. 215 */const AN=ie("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/** 216 * @license lucide-react v0.462.0 - ISC 217 * 218 * This source code is licensed under the ISC license. 219 * See the LICENSE file in the root directory of this source tree. 220 */const an=ie("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/** 221 * @license lucide-react v0.462.0 - ISC 222 * 223 * This source code is licensed under the ISC license. 224 * See the LICENSE file in the root directory of this source tree. 225 */const ON=ie("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/** 226 * @license lucide-react v0.462.0 - ISC 227 * 228 * This source code is licensed under the ISC license. 229 * See the LICENSE file in the root directory of this source tree. 230 */const IN=ie("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/** 231 * @license lucide-react v0.462.0 - ISC 232 * 233 * This source code is licensed under the ISC license. 234 * See the LICENSE file in the root directory of this source tree. 235 */const Dr=ie("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}
vendor: 8,957 bytes, lines 235-275
235],["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"}]]);/** 236 * @license lucide-react v0.462.0 - ISC 237 * 238 * This source code is licensed under the ISC license. 239 * See the LICENSE file in the root directory of this source tree. 240 */const DN=ie("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** 241 * @license lucide-react v0.462.0 - ISC 242 * 243 * This source code is licensed under the ISC license. 244 * See the LICENSE file in the root directory of this source tree. 245 */const Ng=ie("UserPlus",[["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"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/** 246 * @license lucide-react v0.462.0 - ISC 247 * 248 * This source code is licensed under the ISC license. 249 * See the LICENSE file in the root directory of this source tree. 250 */const LN=ie("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);/** 251 * @license lucide-react v0.462.0 - ISC 252 * 253 * This source code is licensed under the ISC license. 254 * See the LICENSE file in the root directory of this source tree. 255 */const kg=ie("Video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/** 256 * @license lucide-react v0.462.0 - ISC 257 * 258 * This source code is licensed under the ISC license. 259 * See the LICENSE file in the root directory of this source tree. 260 */const gp=ie("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** 261 * @license lucide-react v0.462.0 - ISC 262 * 263 * This source code is licensed under the ISC license. 264 * See the LICENSE file in the root directory of this source tree. 265 */const Tg=ie("Youtube",[["path",{d:"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17",key:"1q2vi4"}],["path",{d:"m10 15 5-3-5-3z",key:"1jp15x"}]]);/** 266 * @license lucide-react v0.462.0 - ISC 267 * 268 * This source code is licensed under the ISC license. 269 * See the LICENSE file in the root directory of this source tree. 270 */const MN=ie("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);/** 271 * @license lucide-react v0.462.0 - ISC 272 * 273 * This source code is licensed under the ISC license. 274 * See the LICENSE file in the root directory of this source tree. 275 */const $N=ie("ZoomIn",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),vp="-",FN=e=>{const t=zN(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:o=>{const l=o.split(vp);return l[0]===""&&l.length!==1&&l.shift(),ow(l,t)||UN(o)},getConflictingClassGroupIds:(o,l)=>{const c=r[o]||[];return l&&n[o]?[...c,...n[o]]:c}}},ow=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),s=n?ow(e.slice(1),n):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(vp);return(o=t.validators.find(({validator:l})=>l(i)))==null?void 0:o.classGroupId},Rg=/^\[(.+)\]$/,UN=e=>{if(Rg.test(e)){const t=Rg.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},zN=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return VN(Object.entries(e.classGroups),r).forEach(([i,o])=>{Ch(o,n,i,t)}),n},Ch=(e,t,r,n)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:Pg(t,s);i.classGroupId=r;return}if(typeof s=="function"){if(BN(s)){Ch(s(n),t,r,n);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([i,o])=>{Ch(o,Pg(t,i),r,n)})})},Pg=(e,t)=>{let r=e;return t.split(vp).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},BN=e=>e.isThemeGetter,VN=(e,t)=>t?e.map(([r,n])=>{const s=n.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,l])=>[t+o,l])):i);return[r,s]}):e,WN=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const s=(i,o)=>{r.set(i,o),t++,t>e&&(t=0,n=r,r=new Map)};return{get(i){let o=r.get(i);if(o!==void 0)return o;if((o=n.get(i))!==void 0)return s(i,o),o},set(i,o){r.has(i)?r.set(i,o):s(i,o)}}},aw="!",HN=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,s=t[0],i=t.length,o=l=>{const c=[];let u=0,d=0,h;for(let v=0;v<l.length;v++){let x=l[v];if(u===0){if(x===s&&(n||l.slice(v,v+i)===t)){c.push(l.slice(d,v)),d=v+i;continue}if(x==="/"){h=v;continue}}x==="["?u++:x==="]"&&u--}const m=c.length===0?l:l.substring(d),p=m.startsWith(aw),w=p?m.substring(1):m,g=h&&h>d?h-d:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:w,maybePostfixModifierPosition:g}};return r?l=>r({className:l,parseClassName:o}):o},qN=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},KN=e=>({cache:WN(e.cacheSize),parseClassName:HN(e),...FN(e)}),GN=/\s+/,JN=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=t,i=[],o=e.trim().split(GN);let l="";for(let c=o.length-1;c>=0;c-=1){const u=o[c],{modifiers:d,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:p}=r(u);let w=!!p,g=n(w?m.substring(0,p):m);if(!g){if(!w){l=u+(l.length>0?" "+l:l);continue}if(g=n(m),!g){l=u+(l.length>0?" "+l:l);continue}w=!1}const v=qN(d).join(":"),x=h?v+aw:v,y=x+g;if(i.includes(y))continue;i.push(y);const b=s(g,w);for(let S=0;S<b.length;++S){const _=b[S];i.push(x+_)}l=u+(l.length>0?" "+l:l)}return l};function YN(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=lw(t))&&(n&&(n+=" "),n+=r);return n}const lw=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=lw(e[n]))&&(r&&(r+=" "),r+=t);return r};function QN(e,...t){let r,n,s,i=o;function o(c){const u=t.reduce((d,h)=>h(d),e());return r=KN(u),n=r.cache.get,s=r.cache.set,i=l,l(c)}function l(c){const u=n(c);if(u)return u;const d=JN(c,r);return s(c,d),d}return function(){return i(YN.apply(null,arguments))}}const _e=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},cw=/^\[(?:([a-z-]+):)?(.+)\]$/i,XN=/^\d+\/\d+$/,ZN=new Set(["px","full","screen"]),ek=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,tk=/\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$/,rk=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,nk=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,sk=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ur=e=>bi(e)||ZN.has(e)||XN.test(e),yn=e=>to(e,"length",hk),bi=e=>!!e&&!Number.isNaN(Number(e)),od=e=>to(e,"number",bi),xo=e=>!!e&&Number.isInteger(Number(e)),ik=e=>e.endsWith("%")&&bi(e.slice(0,-1)),le=e=>cw.test(e),xn=e=>ek.test(e),ok=new Set(["length","size","percentage"]),ak=e=>to(e,ok,uw),lk=e=>to(e,"position",uw),ck=new Set(["image","url"]),uk=e=>to(e,ck,pk),dk=e=>to(e,"",fk),wo=()=>!0,to=(e,t,r)=>{const n=cw.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},hk=e=>tk.test(e)&&!rk.test(e),uw=()=>!1,fk=e=>nk.test(e),pk=e=>sk.test(e),mk=()=>{const e=_e("colors"),t=_e("spacing"),r=_e("blur"),n=_e("brightness"),s=_e("borderColor"),i=_e("borderRadius"),o=_e("borderSpacing"),l=_e("borderWidth"),c=_e("contrast"),u=_e("grayscale"),d=_e("hueRotate"),h=_e("invert"),m=_e("gap"),p=_e("gradientColorStops"),w=_e("gradientColorStopPositions"),g=_e("inset"),v=_e("margin"),x=_e("opacity"),y=_e("padding"),b=_e("saturate"),S=_e("scale"),_=_e("sepia"),j=_e("skew"),E=_e("space"),C=_e("translate"),N=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto",le,t],I=()=>[le,t],J=()=>["",Ur,yn],D=()=>["auto",bi,le],Z=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],H=()=>["solid","dashed","dotted","double","none"],X=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],k=()=>["start","end","center","between","around","evenly","stretch"],P=()=>["","0",le],U=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ee=()=>[bi,le];return{cacheSize:500,separator:":",theme:{colors:[wo],spacing:[Ur,yn],blur:["none","",xn,le],brightness:ee(),borderColor:[e],borderRadius:["n
275one","","full",xn,le],borderSpacing:I(),borderWidth:J(),contrast:ee(),grayscale:P(),hueRotate:ee(),invert:P(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[ik,yn],inset:F(),margin:F(),opacity:ee(),padding:I(),saturate:ee(),scale:ee(),sepia:P(),skew:ee(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",le]}],container:["container"],columns:[{columns:[xn]}],"break-after":[{"break-after":U()}],"break-before":[{"break-before":U()}],"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:[...Z(),le]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",xo,le]}],basis:[{basis:F()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",le]}],grow:[{grow:P()}],shrink:[{shrink:P()}],order:[{order:["first","last","none",xo,le]}],"grid-cols":[{"grid-cols":[wo]}],"col-start-end":[{col:["auto",{span:["full",xo,le]},le]}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":[wo]}],"row-start-end":[{row:["auto",{span:[xo,le]},le]}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",le]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",le]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...k()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...k(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...k(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",le,t]}],"min-w":[{"min-w":[le,t,"min","max","fit"]}],"max-w":[{"max-w":[le,t,"none","full","min","max","fit","prose",{screen:[xn]},xn]}],h:[{h:[le,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[le,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[le,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[le,t,"auto","min","max","fit"]}],"font-size":[{text:["base",xn,yn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",od]}],"font-family":[{font:[wo]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",le]}],"line-clamp":[{"line-clamp":["none",bi,od]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ur,le]}],"list-image":[{"list-image":["none",le]}],"list-style-type":[{list:["none","disc","decimal",le]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...H(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ur,yn]}],"underline-offset":[{"underline-offset":["auto",Ur,le]}],"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",le]}],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",le]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Z(),lk]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",ak]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},uk]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[w]}
vendor: 5,182 bytes, line 275
275],"gradient-via-pos":[{via:[w]}],"gradient-to-pos":[{to:[w]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[...H(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[x]}],"divide-style":[{divide:H()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...H()]}],"outline-offset":[{"outline-offset":[Ur,le]}],"outline-w":[{outline:[Ur,yn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[Ur,yn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",xn,dk]}],"shadow-color":[{shadow:[wo]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...X(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":X()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",xn,le]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[h]}],saturate:[{saturate:[b]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"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",le]}],duration:[{duration:ee()}],ease:[{ease:["linear","in","out","in-out",le]}],delay:[{delay:ee()}],animate:[{animate:["none","spin","ping","pulse","bounce",le]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[xo,le]}],"translate-x":[{"translate-x":[C]}],"translate-y":[{"translate-y":[C]}],"skew-x":[{"skew-x":[j]}],"skew-y":[{"skew-y":[j]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",le]}],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",le]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}
vendor: 4,647 bytes, line 275
275],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",le]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ur,yn,od]}],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"]}}},gk=QN(mk);function te(...e){return gk(tw(e))}const vk=dN,dw=f.forwardRef(({className:e,...t},r)=>a.jsx(G0,{ref:r,className:te("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));dw.displayName=G0.displayName;const yk=Ra("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),hw=f.forwardRef(({className:e,variant:t,...r},n)=>a.jsx(J0,{ref:n,className:te(yk({variant:t}),e),...r}));hw.displayName=J0.displayName;const xk=f.forwardRef(({className:e,...t},r)=>a.jsx(X0,{ref:r,className:te("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",e),...t}));xk.displayName=X0.displayName;const fw=f.forwardRef(({className:e,...t},r)=>a.jsx(Z0,{ref:r,className:te("absolute right-2 top-2 rounded-md p-1 text-foreground
275/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:a.jsx(gp,{className:"h-4 w-4"})}));fw.displayName=Z0.displayName;const pw=f.forwardRef(({className:e,...t},r)=>a.jsx(Y0,{ref:r,className:te("text-sm font-semibold",e),...t}));pw.displayName=Y0.displayName;const mw=f.forwardRef(({className:e,...t},r)=>a.jsx(Q0,{ref:r,className:te("text-sm opacity-90",e),...t}));mw.displayName=Q0.displayName;function wk(){const{toasts:e}=Xt();return a.jsxs(vk,{children:[e.map(function({id:t,title:r,description:n,action:s,...i}){return a.jsxs(hw,{...i,children:[a.jsxs("div",{className:"grid gap-1",children:[r&&a.jsx(pw,{children:r}),n&&a.jsx(mw,{children:n})]}),s,a.jsx(fw,{})]},t)}),a.jsx(dw,{})]})}var bk=e=>{switch(e){case"success":return jk;case"info":return Ck;case"warning":return Ek;case"error":return Nk;default:return null}},_k=Array(12).fill(0),Sk=({visible:e,className:t})=>O.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},O.createElement("div",{className:"sonner-spinner"},_k.map((r,n)=>O.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),jk=O.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},O.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Ek=O.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},O.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Ck=O.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},O.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Nk=O.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},O.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),kk=O.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},O.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),O.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Tk=()=>{let[e,t]=O.useState(document.hidden);return O.useEffect(()=>{let r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e},Nh=1,Rk=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:r,...n}=e,s=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Nh++,i=this.toasts.find(l=>l.id===s),o=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),i?this.toasts=this.toasts.map(l=>l.id===s?(this.publish({...l,...e,id:s,title:r}),{...l,...e,id:s,dismissible:o,title:r}):l):this.addToast({title:r,...n,dismissible:o,id:s}),s},this.dismiss=e=>
275(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(r=>r({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let n=e instanceof Promise?e:e(),s=r!==void 0,i,o=n.then(async c=>{if(i=["resolve",c],O.isValidElement(c))s=!1,this.create({id:r,type:"default",message:c});else if(Ak(c)&&!c.ok){s=!1;let u=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,d=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:r,type:"error",message:u,description:d})}else if(t.success!==void 0){s=!1;let u=typeof t.success=="function"?await t.success(c):t.success,d=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"success",message:u,description:d})}}).catch(async c=>{if(i=["reject",c],t.error!==void 0){s=!1;let u=typeof t.error=="function"?await t.error(c):t.error,d=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"error",message:u,description:d})}}).finally(()=>{var c;s&&(this.dismiss(r),r=void 0),(c=t.finally)==null||c.call(t)}),l=()=>new Promise((c,u)=>o.then(()=>i[0]==="reject"?u(i[1]):c(i[1])).catch(u));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(e,t)=>{let r=(t==null?void 0:t.id)||Nh++;return this.create({jsx:e(r),id:r,...t}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},xt=new Rk,Pk=(e,t)=>{let r=(t==null?void 0:t.id)||Nh++;return xt.addToast({title:e,...t,id:r}),r},Ak=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Ok=Pk,Ik=()=>xt.toasts,Dk=()=>xt.getActiveToasts(),Ks=Object.assign(Ok,{success:xt.success,info:xt.info,warning:xt.warning,error:xt.error,custom:xt.custom,message:xt.message,promise:xt.promise,dismiss:xt.dismiss,loading:xt.loading},{getHistory:Ik,getToasts:Dk});function Lk(e,{insertAt:t}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}Lk(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;
275left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}
275:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);
275--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)} 276`);function ol(e){return e.label!==void 0}var Mk=3,$k="32px",Fk="16px",Ag=4e3,Uk=356,zk=14,Bk=20,Vk=200;function ir(...e){return e.filter(Boolean).join(" ")}function Wk(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}var Hk=e=>{var t,r,n,s,i,o,l,c,u,d,h;let{invert:m,toast:p,unstyled:w,interacting:g,setHeights:v,visibleToasts:x,heights:y,index:b,toasts:S,expanded:_,removeToast:j,defaultRichColors:E,closeButton:C,style:N,cancelButtonStyle:R,actionButtonStyle:F,className:I="",descriptionClassName:J="",duration:D,position:Z,gap:H,loadingIcon:X,expandByDefault:k,classNames:P,icons:U,closeButtonAriaLabel:ee="Close toast",pauseWhenPageIsHidden:G}=e,[ae,re]=O.useState(null),[be,Re]=O.useState(null),[z,me]=O.useState(!1),[Pe,pe]=O.useState(!1),[ue,he]=O.useState(!1),[nt,Bt]=O.useState(!1),[ns,fn]=O.useState(!1),[ss,lo]=O.useState(0),[Bs,em]=O.useState(0),co=O.useRef(p.duration||D||Ag),tm=O.useRef(null),is=O.useRef(null),TS=b===0,RS=b+1<=x,Vt=p.type,Vs=p.dism
276issible!==!1,PS=p.className||"",AS=p.descriptionClassName||"",Fa=O.useMemo(()=>y.findIndex(ne=>ne.toastId===p.id)||0,[y,p.id]),OS=O.useMemo(()=>{var ne;return(ne=p.closeButton)!=null?ne:C},[p.closeButton,C]),rm=O.useMemo(()=>p.duration||D||Ag,[p.duration,D]),ku=O.useRef(0),Ws=O.useRef(0),nm=O.useRef(0),Hs=O.useRef(null),[IS,DS]=Z.split("-"),sm=O.useMemo(()=>y.reduce((ne,ve,Ee)=>Ee>=Fa?ne:ne+ve.height,0),[y,Fa]),im=Tk(),LS=p.invert||m,Tu=Vt==="loading";Ws.current=O.useMemo(()=>Fa*H+sm,[Fa,sm]),O.useEffect(()=>{co.current=rm},[rm]),O.useEffect(()=>{me(!0)},[]),O.useEffect(()=>{let ne=is.current;if(ne){let ve=ne.getBoundingClientRect().height;return em(ve),v(Ee=>[{toastId:p.id,height:ve,position:p.position},...Ee]),()=>v(Ee=>Ee.filter(tr=>tr.toastId!==p.id))}},[v,p.id]),O.useLayoutEffect(()=>{if(!z)return;let ne=is.current,ve=ne.style.height;ne.style.height="auto";let Ee=ne.getBoundingClientRect().height;ne.style.height=ve,em(Ee),v(tr=>tr.find(rr=>rr.toastId===p.id)?tr.map(rr=>rr.toastId===p.id?{...rr,height:Ee}:rr):[{toastId:p.id,height:Ee,position:p.position},...tr])},[z,p.title,p.description,v,p.id]);let pn=O.useCallback(()=>{pe(!0),lo(Ws.current),v(ne=>ne.filter(ve=>ve.toastId!==p.id)),setTimeout(()=>{j(p)},Vk)},[p,j,v,Ws]);O.useEffect(()=>{if(p.promise&&Vt==="loading"||p.duration===1/0||p.type==="loading")return;let ne;return _||g||G&&im?(()=>{if(nm.current<ku.current){let ve=new Date().getTime()-ku.current;co.current=co.current-ve}nm.current=new Date().getTime()})():co.current!==1/0&&(ku.current=new Date().getTime(),ne=setTimeout(()=>{var ve;(ve=p.onAutoClose)==null||ve.call(p,p),pn()},co.current)),()=>clearTimeout(ne)},[_,g,p,Vt,G,im,pn]),O.useEffect(()=>{p.delete&&pn()},[pn,p.delete]);function MS(){var ne,ve,Ee;return U!=null&&U.loading?O.createElement("div",{className:ir(P==null?void 0:P.loader,(ne=p==null?void 0:p.classNames)==null?void 0:ne.loader,"sonner-loader"),"data-visible":Vt==="loading"},U.loading):X?O.createElement("div",{className:ir(P==null?void 0:P.loader,(ve=p==null?void 0:p.classNames)==null?void 0:ve.loader,"sonner-loader"),"data-visible":Vt==="loading"},X):O.createElement(Sk,{className:ir(P==null?void 0:P.loader,(Ee=p==null?void 0:p.classNames)==null?void 0:Ee.loader),visible:Vt==="loading"})}return O.createElement("li",{tabIndex:0,ref:is,className:ir(I,PS,P==null?void 0:P.toast,(t=p==null?void 0:p.classNames)==null?void 0:t.toast,P==null?void 0:P.default,P==null?void 0:P[Vt],(r=p==null?void 0:p.classNames)==null?void 0:r[Vt]),"data-sonner-toast":"","data-rich-colors":(n=p.richColors)!=null?n:E,"data-styled":!(p.jsx||p.unstyled||w),"data-mounted":z,"data-promise":!!p.promise,"data-swiped":ns,"data-removed":Pe,"data-visible":RS,"data-y-position":IS,"data-x-position":DS,"data-index":b,"data-front":TS,"data-swiping":ue,"data-dismissible":Vs,"data-type":Vt,"data-invert":LS,"data-swipe-out":nt,"data-swipe-direction":be,"data-expanded":!!(_||k&&z),style:{"--index":b,"--toasts-before":b,"--z-index":S.length-b,"--offset":`${Pe?ss:Ws.current}px`,"--initial-height":k?"auto":`${Bs}px`,...N,...p.style},onDragEnd:()=>{he(!1),re(null),Hs.current=null},onPointerDown:ne=>{Tu||!Vs||(tm.current=new Date,lo(Ws.current),ne.target.setPointerCapture(ne.pointerId),ne.target.tagName!=="BUTTON"&&(he(!0),Hs.current={x:ne.clientX,y:ne.clientY}))},onPointerUp:()=>{var ne,ve,Ee,tr;if(nt||!Vs)return;Hs.current=null;let rr=Number(((ne=is.current)==null?void 0:ne.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),mn=Number(((ve=is.current)==null?void 0:ve.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),os=new Date().getTime()-((Ee=tm.current)==null?void 0:Ee.getTime()),nr=ae==="x"?rr:mn,gn=Math.abs(nr)/os;if(Math.abs(nr)>=Bk||gn>.11){lo(Ws.current),(tr=p.onDismiss)==null||tr.call(p,p),Re(ae==="x"?rr>0?"right":"left":mn>0?"down":"up"),pn(),Bt(!0),fn(!1);return}he(!1),re(null)},onPointerMove:ne=>{var ve,Ee,tr,rr;if(!Hs.current||!Vs||((ve=window.getSelection())==null?void 0:ve.toString().length)>0)return;let mn=ne.clientY-Hs.current.y,os=ne.clientX-Hs.current.x,nr=(Ee=e.swipeDirections)!=null?Ee:Wk(Z);!ae&&(Math.abs(os)>1||Math.abs(mn)>1)&&re(Math.abs(os)>Math.abs(mn)?"x":"y");let gn={x:0,y:0};ae==="y"?(nr.includes("top")||nr.includes("bottom"))&&(nr.includes("top")&&mn<0||nr.includes("bottom")&&mn>0)&&(gn.y=mn):ae==="x"&&(nr.includes("left")||nr.includes("right"))&&(nr.includes("left")&&os<0||nr.includes("right")&&os>0)&&(gn.x=os),(Math.abs(gn.x)>0||Math.abs(gn.y)>0)&&fn(!0),(tr=is.current)==null||tr.style.setProperty("--swipe-amount-x",`${gn.x}
276px`),(rr=is.current)==null||rr.style.setProperty("--swipe-amount-y",`${gn.y}px`)}},OS&&!p.jsx?O.createElement("button",{"aria-label":ee,"data-disabled":Tu,"data-close-button":!0,onClick:Tu||!Vs?()=>{}:()=>{var ne;pn(),(ne=p.onDismiss)==null||ne.call(p,p)},className:ir(P==null?void 0:P.closeButton,(s=p==null?void 0:p.classNames)==null?void 0:s.closeButton)},(i=U==null?void 0:U.close)!=null?i:kk):null,p.jsx||f.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:O.createElement(O.Fragment,null,Vt||p.icon||p.promise?O.createElement("div",{"data-icon":"",className:ir(P==null?void 0:P.icon,(o=p==null?void 0:p.classNames)==null?void 0:o.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||MS():null,p.type!=="loading"?p.icon||(U==null?void 0:U[Vt])||bk(Vt):null):null,O.createElement("div",{"data-content":"",className:ir(P==null?void 0:P.content,(l=p==null?void 0:p.classNames)==null?void 0:l.content)},O.createElement("div",{"data-title":"",className:ir(P==null?void 0:P.title,(c=p==null?void 0:p.classNames)==null?void 0:c.title)},typeof p.title=="function"?p.title():p.title),p.description?O.createElement("div",{"data-description":"",className:ir(J,AS,P==null?void 0:P.description,(u=p==null?void 0:p.classNames)==null?void 0:u.description)},typeof p.description=="function"?p.description():p.description):null),f.isValidElement(p.cancel)?p.cancel:p.cancel&&ol(p.cancel)?O.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||R,onClick:ne=>{var ve,Ee;ol(p.cancel)&&Vs&&((Ee=(ve=p.cancel).onClick)==null||Ee.call(ve,ne),pn())},className:ir(P==null?void 0:P.cancelButton,(d=p==null?void 0:p.classNames)==null?void 0:d.cancelButton)},p.cancel.label):null,f.isValidElement(p.action)?p.action:p.action&&ol(p.action)?O.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||F,onClick:ne=>{var ve,Ee;ol(p.action)&&((Ee=(ve=p.action).onClick)==null||Ee.call(ve,ne),!ne.defaultPrevented&&pn())},className:ir(P==null?void 0:P.actionButton,(h=p==null?void 0:p.classNames)==null?void 0:h.actionButton)},p.action.label):null))};function Og(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function qk(e,t){let r={};return[e,t].forEach((n,s)=>{let i=s===1,o=i?"--mobile-offset":"--offset",l=i?Fk:$k;function c(u){["top","right","bottom","left"].forEach(d=>{r[`${o}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof n=="number"||typeof n=="string"?c(n):typeof n=="object"?["top","right","bottom","left"].forEach(u=>{n[u]===void 0?r[`${o}-${u}`]=l:r[`${o}-${u}`]=typeof n[u]=="number"?`${n[u]}px`:n[u]}):c(l)}),r}var Kk=f.forwardRef(function(e,t){let{invert:r,position:n="bottom-right",hotkey:s=["altKey","KeyT"],expand:i,closeButton:o,className:l,offset:c,mobileOffset:u,theme:d="light",richColors:h,duration:m,style:p,visibleToasts:w=Mk,toastOptions:g,dir:v=Og(),gap:x=zk,loadingIcon:y,icons:b,containerAriaLabel:S="Notifications",pauseWhenPageIsHidden:_}=e,[j,E]=O.useState([]),C=O.useMemo(()=>Array.from(new Set([n].concat(j.filter(G=>G.position).map(G=>G.position)))),[j,n]),[N,R]=O.useState([]),[F,I]=O.useState(!1),[J,D]=O.useState(!1),[Z,H]=O.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),X=O.useRef(null),k=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),P=O.useRef(null),U=O.useRef(!1),ee=O.useCallback(G=>{E(ae=>{var re;return(re=ae.find(be=>be.id===G.id))!=null&&re.delete||xt.dismiss(G.id),ae.filter(({id:be})=>be!==G.id)})},[]);return O.useEffect(()=>xt.subscribe(G=>{if(G.dismiss){E(ae=>ae.map(re=>re.id===G.id?{...re,delete:!0}:re));return}setTimeout(()=>{lp.flushSync(()=>{E(ae=>{let re=ae.findIndex(be=>be.id===G.id);return re!==-1?[...ae.slice(0,re),{...ae[re],...G},...ae.slice(re+1)]:[G,...ae]})})})}),[]),O.useEffect(()=>{if(d!=="system"){H(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?H("dark"):H("light")),typeof window>"u")return;let G=window.matchMedia("(prefers-color-scheme: dark)");try{G.addEventListener("change",({matches:ae})=>{H(ae?"dark":"light")})}catch{G.addListener(({matches:re})=>{try{H(re?"dark":"light")}catch(be){console.error(be)}})}},[d]),O.useEffect(()=>{j.length<=1&&I(!1)},[j]),O.useEffect(()=>{let G=ae=>{var re,be;s.every(Re=>
vendor: 5,057 bytes, line 276
276ae[Re]||ae.code===Re)&&(I(!0),(re=X.current)==null||re.focus()),ae.code==="Escape"&&(document.activeElement===X.current||(be=X.current)!=null&&be.contains(document.activeElement))&&I(!1)};return document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G)},[s]),O.useEffect(()=>{if(X.current)return()=>{P.current&&(P.current.focus({preventScroll:!0}),P.current=null,U.current=!1)}},[X.current]),O.createElement("section",{ref:t,"aria-label":`${S} ${k}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},C.map((G,ae)=>{var re;let[be,Re]=G.split("-");return j.length?O.createElement("ol",{key:G,dir:v==="auto"?Og():v,tabIndex:-1,ref:X,className:l,"data-sonner-toaster":!0,"data-theme":Z,"data-y-position":be,"data-lifted":F&&j.length>1&&!i,"data-x-position":Re,style:{"--front-toast-height":`${((re=N[0])==null?void 0:re.height)||0}px`,"--width":`${Uk}px`,"--gap":`${x}px`,...p,...qk(c,u)},onBlur:z=>{U.current&&!z.currentTarget.contains(z.relatedTarget)&&(U.current=!1,P.current&&(P.current.focus({preventScroll:!0}),P.current=null))},onFocus:z=>{z.target instanceof HTMLElement&&z.target.dataset.dismissible==="false"||U.current||(U.current=!0,P.current=z.relatedTarget)},onMouseEnter:()=>I(!0),onMouseMove:()=>I(!0),onMouseLeave:()=>{J||I(!1)},onDragEnd:()=>I(!1),onPointerDown:z=>{z.target instanceof HTMLElement&&z.target.dataset.dismissible==="false"||D(!0)},onPointerUp:()=>D(!1)},j.filter(z=>!z.position&&ae===0||z.position===G).map((z,me)=>{var Pe,pe;return O.createElement(Hk,{key:z.id,icons:b,index:me,toast:z,defaultRichColors:h,duration:(Pe=g==null?void 0:g.duration)!=null?Pe:m,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:r,visibleToasts:w,closeButton:(pe=g==null?void 0:g.closeButton)!=null?pe:o,interacting:J,position:G,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:ee,toasts:j.filter(ue=>ue.position==z.position),heights:N.filter(ue=>ue.position==z.position),setHeights:R,expandByDefault:i,gap:x,loadingIcon:y,expanded:F,pauseWhenPageIsHidden:_,swipeDirections:e.swipeDirections})})):null}))});const Gk=({...e})=>{const{theme:t="system"}=k0();return a.jsx(Kk,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})};var Jk=vf[" useId ".trim().toString()]||(()=>{}),Yk=0;function Or(e){const[t,r]=f.useState(Jk());return Me(()=>{e||r(n=>n??String(Yk++))},[e]),e||(t?`radix-${t}`:"")}const Qk=["top","right","bottom","left"],Kn=Math.min,Rt=Math.max,pc=Math.round,al=Math.floor,Gn=e=>({x:e,y:e}),Xk={left:"right",right:"left",bottom:"top",top:"bottom"},Zk={start:"end",end:"start"};function kh(e,t,r){return Rt(e,Kn(t,r))}function ln(e,t){return typeof e=="function"?e(t):e}function cn(e){return e.split("-")[0]}function ro(e){return e.split("-")[1]}function yp(e){return e==="x"?"y":"x"}function xp(e){return e==="y"?"height":"width"}function Jn(e){return["top","bottom"].includes(cn(e))?"y":"x"}function wp(e){return yp(Jn(e))}function e2(e,t,r){r===void 0&&(r=!1);const n=ro(e),s=wp(e),i=xp(s);let o=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=mc(o)),[o,mc(o)]}function t2(e){const t=mc(e);return[Th(e),t,Th(t)]}function Th(e){return e.replace(/start|end/g,t=>Zk[t])}function r2(e,t,r){const n=["left","right"],s=["right","left"],i=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return r?t?s:n:t?n:s;case"left":case"right":return t?i:o;default:return[]}}function n2(e,t,r,n){const s=ro(e);let i=r2(cn(e),r==="start",n);return s&&(i=i.map(o=>o+"-"+s),t&&(i=i.concat(i.map(Th)))),i}function mc(e){return e.replace(/left|right|bottom|top/g,t=>Xk[t])}function s2(e){return{top:0,right:0,bottom:0,left:0,...e}}function gw(e){return typeof e!="number"?s2(e):{top:e,right:e,bottom:e,left:e}}function gc(e){const{x:t,y:r,width:n,height:s}=e;return{width:n,height:s,top:r,left:t,right:t+n,bottom:r+s,x:t,y:r}}function Ig(e,t,r){let{reference:n,floating:s}=e;const i=Jn(t),o=wp(t),l=xp(o),c=cn(t),u=i==="y",d=n.x+n.width/2-s.width/2,h=n.y+n.height/2-s.height/2,m=n[l]/2-s[l]/2;let p;switch(c){case"top":p={x:d,y:n.y-s.height};break;case"bottom":p={x:d,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:h};break;case"left":p={x:n.x-s.width,y:h};break;default:p={x:n.x,y:n.y}}switch(ro(t)){case"start":p[o]-=m*(r&&u?-1:1);break;case"end":p[o]+=m*(r&&u?-1:1);break}return p}const i2=async(e,t,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:i=[],platform:o}
vendor: 9,685 bytes, line 276
276=r,l=i.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:s}),{x:d,y:h}=Ig(u,n,c),m=n,p={},w=0;for(let g=0;g<l.length;g++){const{name:v,fn:x}=l[g],{x:y,y:b,data:S,reset:_}=await x({x:d,y:h,initialPlacement:n,placement:m,strategy:s,middlewareData:p,rects:u,platform:o,elements:{reference:e,floating:t}});d=y??d,h=b??h,p={...p,[v]:{...p[v],...S}},_&&w<=50&&(w++,typeof _=="object"&&(_.placement&&(m=_.placement),_.rects&&(u=_.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:s}):_.rects),{x:d,y:h}=Ig(u,m,c)),g=-1)}return{x:d,y:h,placement:m,strategy:s,middlewareData:p}};async function aa(e,t){var r;t===void 0&&(t={});const{x:n,y:s,platform:i,rects:o,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:m=!1,padding:p=0}=ln(t,e),w=gw(p),v=l[m?h==="floating"?"reference":"floating":h],x=gc(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(v)))==null||r?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),y=h==="floating"?{x:n,y:s,width:o.floating.width,height:o.floating.height}:o.reference,b=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),S=await(i.isElement==null?void 0:i.isElement(b))?await(i.getScale==null?void 0:i.getScale(b))||{x:1,y:1}:{x:1,y:1},_=gc(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:b,strategy:c}):y);return{top:(x.top-_.top+w.top)/S.y,bottom:(_.bottom-x.bottom+w.bottom)/S.y,left:(x.left-_.left+w.left)/S.x,right:(_.right-x.right+w.right)/S.x}}const o2=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:s,rects:i,platform:o,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=ln(e,t)||{};if(u==null)return{};const h=gw(d),m={x:r,y:n},p=wp(s),w=xp(p),g=await o.getDimensions(u),v=p==="y",x=v?"top":"left",y=v?"bottom":"right",b=v?"clientHeight":"clientWidth",S=i.reference[w]+i.reference[p]-m[p]-i.floating[w],_=m[p]-i.reference[p],j=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let E=j?j[b]:0;(!E||!await(o.isElement==null?void 0:o.isElement(j)))&&(E=l.floating[b]||i.floating[w]);const C=S/2-_/2,N=E/2-g[w]/2-1,R=Kn(h[x],N),F=Kn(h[y],N),I=R,J=E-g[w]-F,D=E/2-g[w]/2+C,Z=kh(I,D,J),H=!c.arrow&&ro(s)!=null&&D!==Z&&i.reference[w]/2-(D<I?R:F)-g[w]/2<0,X=H?D<I?D-I:D-J:0;return{[p]:m[p]+X,data:{[p]:Z,centerOffset:D-Z-X,...H&&{alignmentOffset:X}},reset:H}}}),a2=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:s,middlewareData:i,rects:o,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:g=!0,...v}=ln(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const x=cn(s),y=Jn(l),b=cn(l)===l,S=await(c.isRTL==null?void 0:c.isRTL(u.floating)),_=m||(b||!g?[mc(l)]:t2(l)),j=w!=="none";!m&&j&&_.push(...n2(l,g,w,S));const E=[l,..._],C=await aa(t,v),N=[];let R=((n=i.flip)==null?void 0:n.overflows)||[];if(d&&N.push(C[x]),h){const D=e2(s,o,S);N.push(C[D[0]],C[D[1]])}if(R=[...R,{placement:s,overflows:N}],!N.every(D=>D<=0)){var F,I;const D=(((F=i.flip)==null?void 0:F.index)||0)+1,Z=E[D];if(Z)return{data:{index:D,overflows:R},reset:{placement:Z}};let H=(I=R.filter(X=>X.overflows[0]<=0).sort((X,k)=>X.overflows[1]-k.overflows[1])[0])==null?void 0:I.placement;if(!H)switch(p){case"bestFit":{var J;const X=(J=R.filter(k=>{if(j){const P=Jn(k.placement);return P===y||P==="y"}return!0}).map(k=>[k.placement,k.overflows.filter(P=>P>0).reduce((P,U)=>P+U,0)]).sort((k,P)=>k[1]-P[1])[0])==null?void 0:J[0];X&&(H=X);break}case"initialPlacement":H=l;break}if(s!==H)return{reset:{placement:H}}}return{}}}};function Dg(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Lg(e){return Qk.some(t=>e[t]>=0)}const l2=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...s}=ln(e,t);switch(n){case"referenceHidden":{const i=await aa(t,{...s,elementContext:"reference"}),o=Dg(i,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Lg(o)}}}case"escaped":{const i=await aa(t,{...s,altBoundary:!0}),o=Dg(i,r.floating);return{data:{escapedOffsets:o,escaped:Lg(o)}}}default:return{}}}}};async function c2(e,t){const{placement:r,platform:n,elements:s}=e,i=await(n.isRTL==null?void 0:n.isRTL(s.floating)),o=cn(r),l=ro(r),c=Jn(r)==="y",u=["left","top"].includes(o)?-1:1,d=i&&c?-1:1,h=ln(t,e);let{mainAxis:m,crossAxis:p,alignmentAxis:w}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&typeof w=="number"&&(p=l==="end"?w*-1:w),c?{x:p*d,y:m*u}:{x:m*u,y:p*d}}const u2=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:s,y:i,placement:o,middlewareData:l}=t,c=await c2(t,e);return o===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:s+c.x,y:i+c.y,data:{...c,placement:o}}}}},d2=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:s}=t,{mainAxis:i=!0,crossAxis:o=!1,limiter:l={fn:v=>{let{x,y}=v;return{x,y}}},...c}=ln(e,t),u={x:r,y:n},d=await aa(t,c),h=Jn(cn(s)),m=yp(h);let p=u[m],w=u[h];if(i){const v=m==="y"?"top":"left",x=m==="y"?"bottom":"right",y=p+d[v],b=p-d[x];p=kh(y,p,b)}if(o){const v=h==="y"?"top":"left",x=h==="y"?"bottom":"right",y=w+d[v],b=w-d[x];w=kh(y,w,b)}const g=l.fn({...t,[m]:p,[h]:w});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[m]:i,[h]:o}}}}}},h2=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:s,rects:i,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=ln(e,t),d={x:r,y:n},h=Jn(s),m=yp(h);let p=d[m],w=d[h];const g=ln(l,t),v=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const b=m==="y"?"height":"width",S=i.reference[m]-i.floating[b]+v.mainAxis,_=i.reference[m]+i.reference[b]-v.mainAxis;p<S?p=S:p>_&&(p=_)}if(u){var x,y;const b=m==="y"?"width":"height",S=["top","left"].includes(cn(s)),_=i.reference[h]-i.floating[b]+(S&&((x=o.offset)==null?void 0:x[h])||0)+(S?0:v.crossAxis),j=i.reference[h]+i.reference[b]+(S?0:((y=o.offset)==null?void 0:y[h])||0)-(S?v.crossAxis:0);w<_?w=_:w>j&&(w=j)}return{[m]:p,[h]:w}}}},f2=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:s,rects:i,platform:o,elements:l}=t,{apply:c=()=>{},...u}=ln(e,t),d=await aa(t,u),h=cn(s),m=ro(s),p=Jn(s)==="y",{width:w,height:g}=i.floating;let v,x;h==="top"||h==="bottom"?(v=h,x=m===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(x=h,v=m==="end"?"top":"bottom");const y=g-d.top-d.bottom,b=w-d.left-d.right,S=Kn(g-d[v],y),_=Kn(w-d[x],b),j=!t.middlewareData.shift;let E=S,C=_;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(C=b),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(E=y),j&&!m){const R=Rt(d.left,0),F=Rt(d.right,0),I=Rt(d.top,0),J=Rt(d.bottom,0);p?C=w-2*(R!==0||F!==0?R+F:Rt(d.left,d.right)):E=g-2*(I!==0||J!==0?I+J:Rt(d.top,d.bottom))}await c({...t,availableWidth:C,availableHeight:E});const N=await o.getDimensions(l.floating);return w!==N.width||g!==N.height?{reset:{rects:!0}}:{}}}};function nu(){return typeof window<"u"}function no(e){return vw(e)?(e.nodeName||"").toLowerCase():"#document"}function It(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Mr(e){var t;return(t=(vw(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function vw(e){return nu()?e instanceof Node||e instanceof It(e).Node:!1}function xr(e){return nu()?e instanceof Element||e instanceof It(e).Element:!1}function Lr(e){return nu()?e instanceof HTMLElement||e instanceof It(e).HTMLElement:!1}function Mg(e){return!nu()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof It(e).ShadowRoot}function Aa(e){const{overflow:t,overflowX:r,overflowY:n,display:s}=wr(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(s)}function p2(e){return["table","td","th"].includes(no(e))}function su(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function bp(e){const t=_p(),r=xr(e)?wr(e):e;return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function m2(e){let t=Yn(e);for(;Lr(t)&&!Hi(t);){if(bp(t))return t;if(su(t))return null;t=Yn(t)}return null}function _p(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Hi(e){return["html","body","#document"].includes(no(e))}function wr(e){return It(e).getComputedStyle(e)}function iu(e){return xr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Yn(e){if(no(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Mg(e)&&e.host||Mr(e);return Mg(t)?t.host:t}function yw(e){const t=Yn(e);return Hi(t)?e.ownerDocument?e.ownerDocument.body:e.body:Lr(t)&&Aa(t)?t:yw(t)}function la(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=yw(e),i=s===((n=e.ownerDocument)==null?void 0:n.body),o=It(s);if(i){const l=Rh(o);
vendor: 4,595 bytes, line 276
276return t.concat(o,o.visualViewport||[],Aa(s)?s:[],l&&r?la(l):[])}return t.concat(s,la(s,[],r))}function Rh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function xw(e){const t=wr(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=Lr(e),i=s?e.offsetWidth:r,o=s?e.offsetHeight:n,l=pc(r)!==i||pc(n)!==o;return l&&(r=i,n=o),{width:r,height:n,$:l}}function Sp(e){return xr(e)?e:e.contextElement}function _i(e){const t=Sp(e);if(!Lr(t))return Gn(1);const r=t.getBoundingClientRect(),{width:n,height:s,$:i}=xw(t);let o=(i?pc(r.width):r.width)/n,l=(i?pc(r.height):r.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const g2=Gn(0);function ww(e){const t=It(e);return!_p()||!t.visualViewport?g2:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function v2(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==It(e)?!1:t}function Os(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),i=Sp(e);let o=Gn(1);t&&(n?xr(n)&&(o=_i(n)):o=_i(e));const l=v2(i,r,n)?ww(i):Gn(0);let c=(s.left+l.x)/o.x,u=(s.top+l.y)/o.y,d=s.width/o.x,h=s.height/o.y;if(i){const m=It(i),p=n&&xr(n)?It(n):n;let w=m,g=Rh(w);for(;g&&n&&p!==w;){const v=_i(g),x=g.getBoundingClientRect(),y=wr(g),b=x.left+(g.clientLeft+parseFloat(y.paddingLeft))*v.x,S=x.top+(g.clientTop+parseFloat(y.paddingTop))*v.y;c*=v.x,u*=v.y,d*=v.x,h*=v.y,c+=b,u+=S,w=It(g),g=Rh(w)}}return gc({width:d,height:h,x:c,y:u})}function y2(e){let{elements:t,rect:r,offsetParent:n,strategy:s}=e;const i=s==="fixed",o=Mr(n),l=t?su(t.floating):!1;if(n===o||l&&i)return r;let c={scrollLeft:0,scrollTop:0},u=Gn(1);const d=Gn(0),h=Lr(n);if((h||!h&&!i)&&((no(n)!=="body"||Aa(o))&&(c=iu(n)),Lr(n))){const m=Os(n);u=_i(n),d.x=m.x+n.clientLeft,d.y=m.y+n.clientTop}return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-c.scrollLeft*u.x+d.x,y:r.y*u.y-c.scrollTop*u.y+d.y}}function x2(e){return Array.from(e.getClientRects())}function Ph(e,t){const r=iu(e).scrollLeft;return t?t.left+r:Os(Mr(e)).left+r}function w2(e){const t=Mr(e),r=iu(e),n=e.ownerDocument.body,s=Rt(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=Rt(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+Ph(e);const l=-r.scrollTop;return wr(n).direction==="rtl"&&(o+=Rt(t.clientWidth,n.clientWidth)-s),{width:s,height:i,x:o,y:l}}function b2(e,t){const r=It(e),n=Mr(e),s=r.visualViewport;let i=n.clientWidth,o=n.clientHeight,l=0,c=0;if(s){i=s.width,o=s.height;const u=_p();(!u||u&&t==="fixed")&&(l=s.offsetLeft,c=s.offsetTop)}return{width:i,height:o,x:l,y:c}}function _2(e,t){const r=Os(e,!0,t==="fixed"),n=r.top+e.clientTop,s=r.left+e.clientLeft,i=Lr(e)?_i(e):Gn(1),o=e.clientWidth*i.x,l=e.clientHeight*i.y,c=s*i.x,u=n*i.y;return{width:o,height:l,x:c,y:u}}function $g(e,t,r){let n;if(t==="viewport")n=b2(e,r);else if(t==="document")n=w2(Mr(e));else if(xr(t))n=_2(t,r);else{const s=ww(e);n={...t,x:t.x-s.x,y:t.y-s.y}}return gc(n)}function bw(e,t){const r=Yn(e);return r===t||!xr(r)||Hi(r)?!1:wr(r).position==="fixed"||bw(r,t)}function S2(e,t){const r=t.get(e);if(r)return r;let n=la(e,[],!1).filter(l=>xr(l)&&no(l)!=="body"),s=null;const i=wr(e).position==="fixed";let o=i?Yn(e):e;for(;xr(o)&&!Hi(o);){const l=wr(o),c=bp(o);!c&&l.position==="fixed"&&(s=null),(i?!c&&!s:!c&&l.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||Aa(o)&&!c&&bw(e,o))?n=n.filter(d=>d!==o):s=l,o=Yn(o)}return t.set(e,n),n}function j2(e){let{element:t,boundary:r,rootBoundary:n,strategy:s}=e;const o=[...r==="clippingAncestors"?su(t)?[]:S2(t,this._c):[].concat(r),n],l=o[0],c=o.reduce((u,d)=>{const h=$g(t,d,s);return u.top=Rt(h.top,u.top),u.right=Kn(h.right,u.right),u.bottom=Kn(h.bottom,u.bottom),u.left=Rt(h.left,u.left),u},$g(t,l,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function E2(e){const{width:t,height:r}=xw(e);return{width:t,height:r}}function C2(e,t,r){const n=Lr(t),s=Mr(t),i=r==="fixed",o=Os(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=Gn(0);if(n||!n&&!i)if((no(t)!=="body"||Aa(s))&&(l=iu(t)),n){const p=Os(t,!0,i,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else s&&(c.x=Ph(s));let u=0,d=0;if(s&&!n&&!i){const p=s.getBoundingClientRect();d=p.top+l.scrollTop,u=p.left+l.scrollLeft-Ph(s,p)}const h=o.left+l.scrollLeft-c.x-u,m=o.top+l.scrollTop-c.y-d;return{x:h,y:m,width:o.width,height:o.height}}function ad(e){return wr(e).position==="static"}function Fg(e,t){if(!Lr(e)||wr(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Mr(e)===r&&(r=r.ownerDocument.body),r}function _w(e,t){const r=It(e);
vendor: 9,049 bytes, line 276
276if(su(e))return r;if(!Lr(e)){let s=Yn(e);for(;s&&!Hi(s);){if(xr(s)&&!ad(s))return s;s=Yn(s)}return r}let n=Fg(e,t);for(;n&&p2(n)&&ad(n);)n=Fg(n,t);return n&&Hi(n)&&ad(n)&&!bp(n)?r:n||m2(e)||r}const N2=async function(e){const t=this.getOffsetParent||_w,r=this.getDimensions,n=await r(e.floating);return{reference:C2(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function k2(e){return wr(e).direction==="rtl"}const T2={convertOffsetParentRelativeRectToViewportRelativeRect:y2,getDocumentElement:Mr,getClippingRect:j2,getOffsetParent:_w,getElementRects:N2,getClientRects:x2,getDimensions:E2,getScale:_i,isElement:xr,isRTL:k2};function R2(e,t){let r=null,n;const s=Mr(e);function i(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const{left:u,top:d,width:h,height:m}=e.getBoundingClientRect();if(l||t(),!h||!m)return;const p=al(d),w=al(s.clientWidth-(u+h)),g=al(s.clientHeight-(d+m)),v=al(u),y={rootMargin:-p+"px "+-w+"px "+-g+"px "+-v+"px",threshold:Rt(0,Kn(1,c))||1};let b=!0;function S(_){const j=_[0].intersectionRatio;if(j!==c){if(!b)return o();j?o(!1,j):n=setTimeout(()=>{o(!1,1e-7)},1e3)}b=!1}try{r=new IntersectionObserver(S,{...y,root:s.ownerDocument})}catch{r=new IntersectionObserver(S,y)}r.observe(e)}return o(!0),i}function P2(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,u=Sp(e),d=s||i?[...u?la(u):[],...la(t)]:[];d.forEach(x=>{s&&x.addEventListener("scroll",r,{passive:!0}),i&&x.addEventListener("resize",r)});const h=u&&l?R2(u,r):null;let m=-1,p=null;o&&(p=new ResizeObserver(x=>{let[y]=x;y&&y.target===u&&p&&(p.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var b;(b=p)==null||b.observe(t)})),r()}),u&&!c&&p.observe(u),p.observe(t));let w,g=c?Os(e):null;c&&v();function v(){const x=Os(e);g&&(x.x!==g.x||x.y!==g.y||x.width!==g.width||x.height!==g.height)&&r(),g=x,w=requestAnimationFrame(v)}return r(),()=>{var x;d.forEach(y=>{s&&y.removeEventListener("scroll",r),i&&y.removeEventListener("resize",r)}),h==null||h(),(x=p)==null||x.disconnect(),p=null,c&&cancelAnimationFrame(w)}}const A2=u2,O2=d2,I2=a2,D2=f2,L2=l2,Ug=o2,M2=h2,$2=(e,t,r)=>{const n=new Map,s={platform:T2,...r},i={...s.platform,_c:n};return i2(e,t,{...s,platform:i})};var Dl=typeof document<"u"?f.useLayoutEffect:f.useEffect;function vc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!vc(e[n],t[n]))return!1;return!0}if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,s[n]))return!1;for(n=r;n--!==0;){const i=s[n];if(!(i==="_owner"&&e.$$typeof)&&!vc(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Sw(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function zg(e,t){const r=Sw(e);return Math.round(t*r)/r}function ld(e){const t=f.useRef(e);return Dl(()=>{t.current=e}),t}function F2(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:i,floating:o}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,h]=f.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,p]=f.useState(n);vc(m,n)||p(n);const[w,g]=f.useState(null),[v,x]=f.useState(null),y=f.useCallback(k=>{k!==j.current&&(j.current=k,g(k))},[]),b=f.useCallback(k=>{k!==E.current&&(E.current=k,x(k))},[]),S=i||w,_=o||v,j=f.useRef(null),E=f.useRef(null),C=f.useRef(d),N=c!=null,R=ld(c),F=ld(s),I=ld(u),J=f.useCallback(()=>{if(!j.current||!E.current)return;const k={placement:t,strategy:r,middleware:m};F.current&&(k.platform=F.current),$2(j.current,E.current,k).then(P=>{const U={...P,isPositioned:I.current!==!1};D.current&&!vc(C.current,U)&&(C.current=U,Fs.flushSync(()=>{h(U)}))})},[m,t,r,F,I]);Dl(()=>{u===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,h(k=>({...k,isPositioned:!1})))},[u]);const D=f.useRef(!1);Dl(()=>(D.current=!0,()=>{D.current=!1}),[]),Dl(()=>{if(S&&(j.current=S),_&&(E.current=_),S&&_){if(R.current)return R.current(S,_,J);J()}},[S,_,J,R,N]);const Z=f.useMemo(()=>({reference:j,floating:E,setReference:y,setFloating:b}),[y,b]),H=f.useMemo(()=>({reference:S,floating:_}),[S,_]),X=f.useMemo(()=>{const k={position:r,left:0,top:0};if(!H.floating)return k;const P=zg(H.floating,d.x),U=zg(H.floating,d.y);return l?{...k,transform:"translate("+P+"px, "+U+"px)",...Sw(H.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:P,top:U}},[r,l,H.floating,d.x,d.y]);return f.useMemo(()=>({...d,update:J,refs:Z,elements:H,floatingStyles:X}),[d,J,Z,H,X])}const U2=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:s}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Ug({element:n.current,padding:s}).fn(r):{}:n?Ug({element:n,padding:s}).fn(r):{}}}},z2=(e,t)=>({...A2(e),options:[e,t]}),B2=(e,t)=>({...O2(e),options:[e,t]}),V2=(e,t)=>({...M2(e),options:[e,t]}),W2=(e,t)=>({...I2(e),options:[e,t]}),H2=(e,t)=>({...D2(e),options:[e,t]}),q2=(e,t)=>({...L2(e),options:[e,t]}),K2=(e,t)=>({...U2(e),options:[e,t]});var G2="Arrow",jw=f.forwardRef((e,t)=>{const{children:r,width:n=10,height:s=5,...i}=e;return a.jsx(K.svg,{...i,ref:t,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});jw.displayName=G2;var J2=jw;function jp(e){const[t,r]=f.useState(void 0);return Me(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let o,l;if("borderBoxSize"in i){const c=i.borderBoxSize,u=Array.isArray(c)?c[0]:c;o=u.inlineSize,l=u.blockSize}else o=e.offsetWidth,l=e.offsetHeight;r({width:o,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Ep="Popper",[Ew,ou]=zt(Ep),[Y2,Cw]=Ew(Ep),Nw=e=>{const{__scopePopper:t,children:r}=e,[n,s]=f.useState(null);return a.jsx(Y2,{scope:t,anchor:n,onAnchorChange:s,children:r})};Nw.displayName=Ep;var kw="PopperAnchor",Tw=f.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...s}=e,i=Cw(kw,r),o=f.useRef(null),l=oe(t,o);return f.useEffect(()=>{i.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:a.jsx(K.div,{...s,ref:l})});Tw.displayName=kw;var Cp="PopperContent",[Q2,X2]=Ew(Cp),Rw=f.forwardRef((e,t)=>{var z,me,Pe,pe,ue,he;const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:i="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:h="partial",hideWhenDetached:m=!1,updatePositionStrategy:p="optimized",onPlaced:w,...g}=e,v=Cw(Cp,r),[x,y]=f.useState(null),b=oe(t,nt=>y(nt)),[S,_]=f.useState(null),j=jp(S),E=(j==null?void 0:j.width)??0,C=(j==null?void 0:j.height)??0,N=n+(i!=="center"?"-"+i:""),R=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},F=Array.isArray(u)?u:[u],I=F.length>0,J={padding:R,boundary:F.filter(eT),altBoundary:I},{refs:D,floatingStyles:Z,placement:H,isPositioned:X,middlewareData:k}=F2({strategy:"fixed",placement:N,whileElementsMounted:(...nt)=>P2(...nt,{animationFrame:p==="always"}),elements:{reference:v.anchor},middleware:[z2({mainAxis:s+C,alignmentAxis:o}),c&&B2({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?V2():void 0,...J}),c&&W2({...J}),H2({...J,apply:({elements:nt,rects:Bt,availableWidth:ns,availableHeight:fn})=>{const{width:ss,height:lo}=Bt.reference,Bs=nt.floating.style;Bs.setProperty("--radix-popper-available-width",`${ns}px`),Bs.setProperty("--radix-popper-available-height",`${fn}px`),Bs.setProperty("--radix-popper-anchor-width",`${ss}px`),Bs.setProperty("--radix-popper-anchor-height",`${lo}px`)}}),S&&K2({element:S,padding:l}),tT({arrowWidth:E,arrowHeight:C}),m&&q2({strategy:"referenceHidden",...J})]}),[P,U]=Ow(H),ee=xe(w);Me(()=>{X&&(ee==null||ee())},[X,ee]);const G=(z=k.arrow)==null?void 0:z.x,ae=(me=k.arrow)==null?void 0:me.y,re=((Pe=k.arrow)==null?void 0:Pe.centerOffset)!==0,[be,Re]=f.useState();return Me(()=>{x&&Re(window.getComputedStyle(x).zIndex)},[x]),a.jsx("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...Z,transform:X?Z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:be,"--radix-popper-transform-origin":[(pe=k.transformOrigin)==null?void 0:pe.x,(ue=k.transformOrigin)==null?void 0:ue.y].join(" "),...((he=k.hide)==null?void 0:he.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(Q2,{scope:r,placedSide:P,onArrowChange:_,arrowX:G,arrowY:ae,shouldHideArrow:re,children:a.jsx(K.div,{"data-side":P,"data-align":U,...g,ref:b,style:{...g.style,animation:X?void 0:"none"}})})})});Rw.displayName=Cp;var Pw="PopperArrow",Z2={top:"bottom",right:"left",bottom:"top",left:"r
276ight"},Aw=f.forwardRef(function(t,r){const{__scopePopper:n,...s}=t,i=X2(Pw,n),o=Z2[i.placedSide];return a.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:a.jsx(J2,{...s,ref:r,style:{...s.style,display:"block"}})})});Aw.displayName=Pw;function eT(e){return e!==null}var tT=e=>({name:"transformOrigin",options:e,fn(t){var v,x,y;const{placement:r,rects:n,middlewareData:s}=t,o=((v=s.arrow)==null?void 0:v.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[u,d]=Ow(r),h={start:"0%",center:"50%",end:"100%"}[d],m=(((x=s.arrow)==null?void 0:x.x)??0)+l/2,p=(((y=s.arrow)==null?void 0:y.y)??0)+c/2;let w="",g="";return u==="bottom"?(w=o?h:`${m}px`,g=`${-c}px`):u==="top"?(w=o?h:`${m}px`,g=`${n.floating.height+c}px`):u==="right"?(w=`${-c}px`,g=o?h:`${p}px`):u==="left"&&(w=`${n.floating.width+c}px`,g=o?h:`${p}px`),{data:{x:w,y:g}}}});function Ow(e){const[t,r="center"]=e.split("-");return[t,r]}var rT=Nw,Iw=Tw,Dw=Rw,Lw=Aw,[au,UL]=zt("Tooltip",[ou]),Np=ou(),Mw="TooltipProvider",nT=700,Bg="tooltip.open",[sT,$w]=au(Mw),Fw=e=>{const{__scopeTooltip:t,delayDuration:r=nT,skipDelayDuration:n=300,disableHoverableContent:s=!1,children:i}=e,o=f.useRef(!0),l=f.useRef(!1),c=f.useRef(0);return f.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),a.jsx(sT,{scope:t,isOpenDelayedRef:o,delayDuration:r,onOpen:f.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:f.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,n)},[n]),isPointerInTransitRef:l,onPointerInTransitChange:f.useCallback(u=>{l.current=u},[]),disableHoverableContent:s,children:i})};Fw.displayName=Mw;var Uw="Tooltip",[zL,lu]=au(Uw),Ah="TooltipTrigger",iT=f.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=lu(Ah,r),i=$w(Ah,r),o=Np(r),l=f.useRef(null),c=oe(t,l,s.onTriggerChange),u=f.useRef(!1),d=f.useRef(!1),h=f.useCallback(()=>u.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),a.jsx(Iw,{asChild:!0,...o,children:a.jsx(K.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:c,onPointerMove:$(e.onPointerMove,m=>{m.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),d.current=!0)}),onPointerLeave:$(e.onPointerLeave,()=>{s.onTriggerLeave(),d.current=!1}),onPointerDown:$(e.onPointerDown,()=>{s.open&&s.onClose(),u.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:$(e.onFocus,()=>{u.current||s.onOpen()}),onBlur:$(e.onBlur,s.onClose),onClick:$(e.onClick,s.onClose)})})});iT.displayName=Ah;var oT="TooltipPortal",[BL,aT]=au(oT,{forceMount:void 0}),qi="TooltipContent",zw=f.forwardRef((e,t)=>{const r=aT(qi,e.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...i}=e,o=lu(qi,e.__scopeTooltip);return a.jsx(dt,{present:n||o.open,children:o.disableHoverableContent?a.jsx(Bw,{side:s,...i,ref:t}):a.jsx(lT,{side:s,...i,ref:t})})}),lT=f.forwardRef((e,t)=>{const r=lu(qi,e.__scopeTooltip),n=$w(qi,e.__scopeTooltip),s=f.useRef(null),i=oe(t,s),[o,l]=f.useState(null),{trigger:c,onClose:u}=r,d=s.current,{onPointerInTransitChange:h}=n,m=f.useCallback(()=>{l(null),h(!1)},[h]),p=f.useCallback((w,g)=>{const v=w.currentTarget,x={x:w.clientX,y:w.clientY},y=fT(x,v.getBoundingClientRect()),b=pT(x,y),S=mT(g.getBoundingClientRect()),_=vT([...b,...S]);l(_),h(!0)},[h]);return f.useEffect(()=>()=>m(),[m]),f.useEffect(()=>{if(c&&d){const w=v=>p(v,d),g=v=>p(v,c);return c.addEventListener("pointerleave",w),d.addEventListener("pointerleave",g),()=>{c.removeEventListener("pointerleave",w),d.removeEventListener("pointerleave",g)}}},[c,d,p,m]),f.useEffect(()=>{if(o){const w=g=>{const v=g.target,x={x:g.clientX,y:g.clientY},y=(c==null?void 0:c.contains(v))||(d==null?void 0:d.contains(v)),b=!gT(x,o);y?m():b&&(m(),u())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[c,d,o,u,m]),a.jsx(Bw,{...e,ref:i})}),[cT,uT]=au(Uw,{isInside:!1}),dT=CC("TooltipContent"),Bw=f.forwardRef((e,t)=>
vendor: 4,516 bytes, line 276
276{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:o,...l}=e,c=lu(qi,r),u=Np(r),{onClose:d}=c;return f.useEffect(()=>(document.addEventListener(Bg,d),()=>document.removeEventListener(Bg,d)),[d]),f.useEffect(()=>{if(c.trigger){const h=m=>{const p=m.target;p!=null&&p.contains(c.trigger)&&d()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[c.trigger,d]),a.jsx(eo,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:h=>h.preventDefault(),onDismiss:d,children:a.jsxs(Dw,{"data-state":c.stateAttribute,...u,...l,ref:t,style:{...l.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:[a.jsx(dT,{children:n}),a.jsx(cT,{scope:r,isInside:!0,children:a.jsx(I0,{id:c.contentId,role:"tooltip",children:s||n})})]})})});zw.displayName=qi;var Vw="TooltipArrow",hT=f.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=Np(r);return uT(Vw,r).isInside?null:a.jsx(Lw,{...s,...n,ref:t})});hT.displayName=Vw;function fT(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(r,n,s,i)){case i:return"left";case s:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function pT(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function mT(e){const{top:t,right:r,bottom:n,left:s}=e;return[{x:s,y:t},{x:r,y:t},{x:r,y:n},{x:s,y:n}]}function gT(e,t){const{x:r,y:n}=e;let s=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const l=t[i],c=t[o],u=l.x,d=l.y,h=c.x,m=c.y;d>n!=m>n&&r<(h-u)*(n-d)/(m-d)+u&&(s=!s)}return s}function vT(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),yT(t)}function yT(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const s=e[n];for(;t.length>=2;){const i=t[t.length-1],o=t[t.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))t.pop();else break}t.push(s)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const s=e[n];for(;r.length>=2;){const i=r[r.length-1],o=r[r.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))r.pop();else break}r.push(s)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var xT=Fw,Ww=zw;const wT=xT,bT=f.forwardRef(({className:e,sideOffset:t=4,...r},n)=>a.jsx(Ww,{ref:n,sideOffset:t,className:te("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));bT.displayName=Ww.displayName;var cu=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(){}},uu=typeof window>"u"||"Deno"in globalThis;function cr(){}function _T(e,t){return typeof e=="function"?e(t):e}function ST(e){return typeof e=="number"&&e>=0&&e!==1/0}function jT(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Oh(e,t){return typeof e=="function"?e(t):e}function ET(e,t){return typeof e=="function"?e(t):e}function Vg(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:i,queryKey:o,stale:l}=e;if(o){if(n){if(t.queryHash!==kp(o,t.options))return!1}else if(!ua(t.queryKey,o))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||s&&s!==t.state.fetchStatus||i&&!i(t))}function Wg(e,t){const{exact:r,status:n,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(r){if(ca(t.options.mutationKey)!==ca(i))return!1}
vendor: 22,264 bytes, line 276
276else if(!ua(t.options.mutationKey,i))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function kp(e,t){return((t==null?void 0:t.queryKeyHashFn)||ca)(e)}function ca(e){return JSON.stringify(e,(t,r)=>Ih(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function ua(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>ua(e[r],t[r])):!1}function Hw(e,t){if(e===t)return e;const r=Hg(e)&&Hg(t);if(r||Ih(e)&&Ih(t)){const n=r?e:Object.keys(e),s=n.length,i=r?t:Object.keys(t),o=i.length,l=r?[]:{},c=new Set(n);let u=0;for(let d=0;d<o;d++){const h=r?d:i[d];(!r&&c.has(h)||r)&&e[h]===void 0&&t[h]===void 0?(l[h]=void 0,u++):(l[h]=Hw(e[h],t[h]),l[h]===e[h]&&e[h]!==void 0&&u++)}return s===o&&u===s?e:l}return t}function Hg(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ih(e){if(!qg(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!qg(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function qg(e){return Object.prototype.toString.call(e)==="[object Object]"}function CT(e){return new Promise(t=>{setTimeout(t,e)})}function NT(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?Hw(e,t):t}function kT(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function TT(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Tp=Symbol();function qw(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Tp?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var xs,kn,Ti,oy,RT=(oy=class extends cu{constructor(){super();fe(this,xs);fe(this,kn);fe(this,Ti);se(this,Ti,t=>{if(!uu&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){T(this,kn)||this.setEventListener(T(this,Ti))}onUnsubscribe(){var t;this.hasListeners()||((t=T(this,kn))==null||t.call(this),se(this,kn,void 0))}setEventListener(t){var r;se(this,Ti,t),(r=T(this,kn))==null||r.call(this),se(this,kn,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){T(this,xs)!==t&&(se(this,xs,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof T(this,xs)=="boolean"?T(this,xs):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},xs=new WeakMap,kn=new WeakMap,Ti=new WeakMap,oy),Kw=new RT,Ri,Tn,Pi,ay,PT=(ay=class extends cu{constructor(){super();fe(this,Ri,!0);fe(this,Tn);fe(this,Pi);se(this,Pi,t=>{if(!uu&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){T(this,Tn)||this.setEventListener(T(this,Pi))}onUnsubscribe(){var t;this.hasListeners()||((t=T(this,Tn))==null||t.call(this),se(this,Tn,void 0))}setEventListener(t){var r;se(this,Pi,t),(r=T(this,Tn))==null||r.call(this),se(this,Tn,t(this.setOnline.bind(this)))}setOnline(t){T(this,Ri)!==t&&(se(this,Ri,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return T(this,Ri)}},Ri=new WeakMap,Tn=new WeakMap,Pi=new WeakMap,ay),yc=new PT;function AT(){let e,t;const r=new Promise((s,i)=>{e=s,t=i});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}function OT(e){return Math.min(1e3*2**e,3e4)}function Gw(e){return(e??"online")==="online"?yc.isOnline():!0}var Jw=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function cd(e){return e instanceof Jw}function Yw(e){let t=!1,r=0,n=!1,s;const i=AT(),o=g=>{var v;n||(m(new Jw(g)),(v=e.abort)==null||v.call(e))},l=()=>{t=!0},c=()=>{t=!1},u=()=>Kw.isFocused()&&(e.networkMode==="always"||yc.isOnline())&&e.canRun(),d=()=>Gw(e.networkMode)&&e.canRun(),h=g=>{var v;n||(n=!0,(v=e.onSuccess)==null||v.call(e,g),s==null||s(),i.resolve(g))},m=g=>{var v;n||(n=!0,(v=e.onError)==null||v.call(e,g),s==null||s(),i.reject(g))},p=()=>new Promise(g=>{var v;s=x=>{(n||u())&&g(x)},(v=e.onPause)==null||v.call(e)}).then(()=>{var g;s=void 0,n||(g=e.onContinue)==null||g.call(e)}),w=()=>{if(n)return;let g;const v=r===0?e.initialPromise:void 0;try{g=v??e.fn()}catch(x){g=Promise.reject(x)}Promise.resolve(g).then(h).catch(x=>{var j;if(n)return;const y=e.retry??(uu?0:3),b=e.retryDelay??OT,S=typeof b=="function"?b(r,x):b,_=y===!0||typeof y=="number"&&r<y||typeof y=="function"&&y(r,x);if(t||!_){m(x);return}r++,(j=e.onFail)==null||j.call(e,r,x),CT(S).then(()=>u()?void 0:p()).then(()=>{t?m(x):w()})})};return{promise:i,cancel:o,continue:()=>(s==null||s(),i),cancelRetry:l,continueRetry:c,canStart:d,start:()=>(d()?w():p().then(w),i)}}var IT=e=>setTimeout(e,0);function DT(){let e=[],t=0,r=l=>{l()},n=l=>{l()},s=IT;const i=l=>{t?e.push(l):s(()=>{r(l)})},o=()=>{const l=e;e=[],l.length&&s(()=>{n(()=>{l.forEach(c=>{r(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||o()}return c},batchCalls:l=>(...c)=>{i(()=>{l(...c)})},schedule:i,setNotifyFunction:l=>{r=l},setBatchNotifyFunction:l=>{n=l},setScheduler:l=>{s=l}}}var pt=DT(),ws,ly,Qw=(ly=class{constructor(){fe(this,ws)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ST(this.gcTime)&&se(this,ws,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(uu?1/0:5*60*1e3))}clearGcTimeout(){T(this,ws)&&(clearTimeout(T(this,ws)),se(this,ws,void 0))}},ws=new WeakMap,ly),Ai,bs,Ht,_s,at,ba,Ss,dr,Br,cy,LT=(cy=class extends Qw{constructor(t){super();fe(this,dr);fe(this,Ai);fe(this,bs);fe(this,Ht);fe(this,_s);fe(this,at);fe(this,ba);fe(this,Ss);se(this,Ss,!1),se(this,ba,t.defaultOptions),this.setOptions(t.options),this.observers=[],se(this,_s,t.client),se(this,Ht,T(this,_s).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,se(this,Ai,$T(this.options)),this.state=t.state??T(this,Ai),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=T(this,at))==null?void 0:t.promise}setOptions(t){this.options={...T(this,ba),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&T(this,Ht).remove(this)}setData(t,r){const n=NT(this.state.data,t,this.options);return st(this,dr,Br).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){st(this,dr,Br).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,s;const r=(n=T(this,at))==null?void 0:n.promise;return(s=T(this,at))==null||s.cancel(t),r?r.then(cr).catch(cr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(T(this,Ai))}isActive(){return this.observers.some(t=>ET(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Tp||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Oh(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:!jT(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=T(this,at))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=T(this,at))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),T(this,Ht).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(T(this,at)&&(T(this,Ss)?T(this,at).cancel({revert:!0}):T(this,at).cancelRetry()),this.scheduleGc()),T(this,Ht).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||st(this,dr,Br).call(this,{type:"invalidate"})}fetch(t,r){var u,d,h;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(T(this,at))return T(this,at).continueRetry(),T(this,at).promise}if(t&&this.setOptions(t),!this.options.queryFn){const m=this.observers.find(p=>p.options.queryFn);m&&this.setOptions(m.options)}const n=new AbortController,s=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(se(this,Ss,!0),n.signal)})},i=()=>{const m=qw(this.options,r),w=(()=>{const g={client:T(this,_s),queryKey:this.queryKey,meta:this.meta};return s(g),g})();return se(this,Ss,!1),this.options.persister?this.options.persister(m,w,this):m(w)},l=(()=>{const m={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:T(this,_s),state:this.state,fetchFn:i};return s(m),m})();(u=this.options.behavior)==null||u.onFetch(l,this),se(this,bs,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=l.fetchOptions)==null?void 0:d.meta))&&st(this,dr,Br).call(this,{type:"fetch",meta:(h=l.fetchOptions)==null?void 0:h.meta});const c=m=>{var p,w,g,v;cd(m)&&m.silent||st(this,dr,Br).call(this,{type:"error",error:m}),cd(m)||((w=(p=T(this,Ht).config).onError)==null||w.call(p,m,this),(v=(g=T(this,Ht).config).onSettled)==null||v.call(g,this.state.data,m,this)),this.scheduleGc()};return se(this,at,Yw({initialPromise:r==null?void 0:r.initialPromise,fn:l.fetchFn,abort:n.abort.bind(n),onSuccess:m=>{var p,w,g,v;if(m===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(m)}catch(x){c(x);return}(w=(p=T(this,Ht).config).onSuccess)==null||w.call(p,m,this),(v=(g=T(this,Ht).config).onSettled)==null||v.call(g,m,this.state.error,this),this.scheduleGc()},onError:c,onFail:(m,p)=>{st(this,dr,Br).call(this,{type:"failed",failureCount:m,error:p})},onPause:()=>{st(this,dr,Br).call(this,{type:"pause"})},onContinue:()=>{st(this,dr,Br).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0})),T(this,at).start()}},Ai=new WeakMap,bs=new WeakMap,Ht=new WeakMap,_s=new WeakMap,at=new WeakMap,ba=new WeakMap,Ss=new WeakMap,dr=new WeakSet,Br=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...MT(n.data,this.options),fetchMeta:t.meta??null};case"success":return se(this,bs,void 0),{...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=t.error;return cd(s)&&s.revert&&T(this,bs)?{...T(this,bs),fetchStatus:"idle"}:{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),pt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),T(this,Ht).notify({query:this,type:"updated",action:t})})},cy);function MT(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Gw(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function $T(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Er,uy,FT=(uy=class extends cu{constructor(t={}){super();fe(this,Er);this.config=t,se(this,Er,new Map)}build(t,r,n){const s=r.queryKey,i=r.queryHash??kp(s,r);let o=this.get(i);return o||(o=new LT({client:t,queryKey:s,queryHash:i,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){T(this,Er).has(t.queryHash)||(T(this,Er).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=T(this,Er).get(t.queryHash);r&&(t.destroy(),r===t&&T(this,Er).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){pt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return T(this,Er).get(t)}getAll(){return[...T(this,Er).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Vg(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>Vg(t,n)):r}notify(t){pt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){pt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){pt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Er=new WeakMap,uy),Cr,ht,js,Nr,wn,dy,UT=(dy=class extends Qw{constructor(t){super();fe(this,Nr);fe(this,Cr);fe(this,ht);fe(this,js);this.mutationId=t.mutationId,se(this,ht,t.mutationCache),se(this,Cr,[]),this.state=t.state||zT(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){T(this,Cr).includes(t)||(T(this,Cr).push(t),this.clearGcTimeout(),T(this,ht).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){se(this,Cr,T(this,Cr).filter(r=>r!==t)),this.scheduleGc(),T(this,ht).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){T(this,Cr).length||(this.state.status==="pending"?this.scheduleGc():T(this,ht).remove(this))}continue(){var t;return((t=T(this,js))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,l,c,u,d,h,m,p,w,g,v,x,y,b,S,_,j,E,C;const r=()=>{st(this,Nr,wn).call(this,{type:"continue"})};se(this,js,Yw({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(N,R)=>{st(this,Nr,wn).call(this,{type:"failed",failureCount:N,error:R})},onPause:()=>{st(this,Nr,wn).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>T(this,ht).canRun(this)}));const n=this.state.status==="pending",s=!T(this,js).canStart();try{if(n)r();else{st(this,Nr,wn).call(this,{type:"pending",variables:t,isPaused:s}),await((o=(i=T(this,ht).config).onMutate)==null?void 0:o.call(i,t,this));const R=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t));R!==this.state.context&&st(this,Nr,wn).call(this,{type:"pending",context:R,variables:t,isPaused:s})}const N=await T(this,js).start();return await((d=(u=T(this,ht).config).onSuccess)==null?void 0:d.call(u,N,t,this.state.context,this)),await((m=(h=this.options).onSuccess)==null?void 0:m.call(h,N,t,this.state.context)),await((w=(p=T(this,ht).config).onSettled)==null?void 0:w.call(p,N,null,this.state.variables,this.state.context,this)),await((v=(g=this.options).onSettled)==null?void 0:v.call(g,N,null,t,this.state.context)),st(this,Nr,wn).call(this,{type:"success",data:N}),N}catch(N){try{throw await((y=(x=T(this,ht).config).onError)==null?void 0:y.call(x,N,t,this.state.context,this)),await((S=(b=this.options).onError)==null?void 0:S.call(b,N,t,this.state.context)),await((j=(_=T(this,ht).config).onSettled)==null?void 0:j.call(_,void 0,N,this.state.variables,this.state.context,this)),await((C=(E=this.options).onSettled)==null?void 0:C.call(E,void 0,N,t,this.state.context)),N}finally{st(this,Nr,wn).call(this,{type:"error",error:N})}}finally{T(this,ht).runNext(this)}}},Cr=new WeakMap,ht=new WeakMap,js=new WeakMap,Nr=new WeakSet,wn=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),pt.batch(()=>{T(this,Cr).forEach(n=>{n.onMutationUpdate(t)}),T(this,ht).notify({mutation:this,type:"updated",action:t})})},dy);function zT(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Yr,hr,_a,hy,BT=(hy=class extends cu{constructor(t={}){super();fe(this,Yr);fe(this,hr);fe(this,_a);this.config=t,se(this,Yr,new Set),se(this,hr,new Map),se(this,_a,0)}build(t,r,n){const s=new UT({mutationCache:this,mutationId:++Ua(this,_a)._,options:t.defaultMutationOptions(r),state:n});return this.add(s),s}add(t){T(this,Yr).add(t);const r=ll(t);if(typeof r=="string"){const n=T(this,hr).get(r);n?n.push(t):T(this,hr).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(T(this,Yr).delete(t)){const r=ll(t);if(typeof r=="string"){const n=T(this,hr).get(r);if(n)if(n.length>1){const s=n.indexOf(t);s!==-1&&n.splice(s,1)}else n[0]===t&&T(this,hr).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=ll(t);if(typeof r=="string"){const n=T(this,hr).get(r),s=n==null?void 0:n.find(i=>i.state.status==="pending");return!s||s===t}else return!0}runNext(t){var n;const r=ll(t);if(typeof r=="string"){const s=(n=T(this,hr).get(r))==null?void 0:n.find(i=>i!==t&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){pt.batch(()=>{T(this,Yr).forEach(t=>{this.notify({type:"removed",mutation:t})}),T(this,Yr).clear(),T(this,hr).clear()})}getAll(){return Array.from(T(this,Yr))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Wg(r,n))}findAll(t={}){return this.getAll().filter(r=>Wg(t,r))}notify(t){pt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return pt.batch(()=>Promise.all(t.map(r=>r.continue().catch(cr))))}},Yr=new WeakMap,hr=new WeakMap,_a=new WeakMap,hy);function ll(e){var t;return(t=e.options.scope)==null?void 0:t.id}function Kg(e){return{onFetch:(t,r)=>{var d,h,m,p,w;const n=t.options,s=(m=(h=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:h.fetchMore)==null?void 0:m.direction,i=((p=t.state.data)==null?void 0:p.pages)||[],o=((w=t.state.data)==null?void 0:w.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let g=!1;const v=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},x=qw(t.options,t.fetchOptions),y=async(b,S,_)=>{if(g)return Promise.reject();if(S==null&&b.pages.length)return Promise.resolve(b);const E=(()=>{const F={client:t.client,queryKey:t.queryKey,pageParam:S,direction:_?"backward":"forward",meta:t.options.meta};return v(F),F})(),C=await x(E),{maxPages:N}=t.options,R=_?TT:kT;return{pages:R(b.pages,C,N),pageParams:R(b.pageParams,S,N)}};if(s&&i.length){const b=s==="backward",S=b?VT:Gg,_={pages:i,pageParams:o},j=S(n,_);l=await y(_,j,b)}else{const b=e??i.length;do{const S=c===0?o[0]??n.initialPageParam:Gg(n,l);if(c>0&&S==null)break;l=await y(l,S),c++}while(c<b)}return l};t.options.persister?t.fetchFn=()=>{var g,v;return(v=(g=t.options).persister)==null?void 0:v.call(g,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=u}}}function Gg(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function VT(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var Ae,Rn,Pn,Oi,Ii,An,Di,Li,fy,WT=(fy=class{constructor(e={}){fe(this,Ae);fe(this,Rn);fe(this,Pn);fe(this,Oi);fe(this,Ii);fe(this,An);fe(this,Di);fe(this,Li);se(this,Ae,e.queryCache||new FT),se(this,Rn,e.mutationCache||new BT),se(this,Pn,e.defaultOptions||{}),se(this,Oi,new Map),se(this,Ii,new Map),se(this,An,0)}mount(){Ua(this,An)._++,T(this,An)===1&&(se(this,Di,Kw.subscribe(async e=>{e&&(await this.resumePausedMutations(),T(this,Ae).onFocus())})),se(this,Li,yc.subscribe(async e=>{e&&(await this.resumePausedMutations(),T(this,Ae).onOnline())})))}unmount(){var e,t;Ua(this,An)._--,T(this,An)===0&&((e=T(this,Di))==null||e.call(this),se(this,Di,void 0),(t=T(this,Li))==null||t.call(this),se(this,Li,void 0))}isFetching(e){return T(this,Ae).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return T(this,Rn).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=T(this,Ae).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=T(this,Ae).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Oh(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return T(this,Ae).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),s=T(this,Ae).get(n.queryHash),i=s==null?void 0:s.state.data,o=_T(t,i);if(o!==void 0)return T(this,Ae).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return pt.batch(()=>T(this,Ae).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=T(this,Ae).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=T(this,Ae);pt.batch(()=>
276{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=T(this,Ae);return pt.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=pt.batch(()=>T(this,Ae).findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(cr).catch(cr)}invalidateQueries(e,t={}){return pt.batch(()=>(T(this,Ae).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=pt.batch(()=>T(this,Ae).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,r);return r.throwOnError||(i=i.catch(cr)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(n).then(cr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=T(this,Ae).build(this,t);return r.isStaleByTime(Oh(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(cr).catch(cr)}fetchInfiniteQuery(e){return e.behavior=Kg(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(cr).catch(cr)}ensureInfiniteQueryData(e){return e.behavior=Kg(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return yc.isOnline()?T(this,Rn).resumePausedMutations():Promise.resolve()}getQueryCache(){return T(this,Ae)}getMutationCache(){return T(this,Rn)}getDefaultOptions(){return T(this,Pn)}setDefaultOptions(e){se(this,Pn,e)}setQueryDefaults(e,t){T(this,Oi).set(ca(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...T(this,Oi).values()],r={};return t.forEach(n=>{ua(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){T(this,Ii).set(ca(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...T(this,Ii).values()],r={};return t.forEach(n=>{ua(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...T(this,Pn).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=kp(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===Tp&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...T(this,Pn).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){T(this,Ae).clear(),T(this,Rn).clear()}},Ae=new WeakMap,Rn=new WeakMap,Pn=new WeakMap,Oi=new WeakMap,Ii=new WeakMap,An=new WeakMap,Di=new WeakMap,Li=new WeakMap,fy),HT=f.createContext(void 0),qT=({client:e,children:t})=>(f.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),a.jsx(HT.Provider,{value:e,children:t}));/** 277 * @remix-run/router v1.23.0 278 * 279 * Copyright (c) Remix Software Inc. 280 * 281 * This source code is licensed under the MIT license found in the 282 * LICENSE.md file in the root directory of this source tree. 283 * 284 * @license MIT 285 */function da(){return da=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},da.apply(this,arguments)}var Dn;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Dn||(Dn={}));const Jg="popstate";function KT(e){e===void 0&&(e={});function t(n,s){let{pathname:i,search:o,hash:l}=n.location;return Dh("",{pathname:i,search:o,hash:l},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function r(n,s){return typeof s=="string"?s:xc(s)}return JT(t,r,null,e)}function Ue(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Xw(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function GT(){return Math.random().toString(36).substr(2,8)}function Yg(e,t){return{usr:e.state,key:e.key,idx:t}}function Dh(e,t,r,n){return r===void 0&&(r=null),da({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?so(t):t,{state:r,key:t&&t.key||n||GT()})}function xc(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function so(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function JT(e,t,r,n){n===void 0&&(n={});let{window:s=document.defaultView,v5Compat:i=!1}=n,o=s.history,l=Dn.Pop,c=null,u=d();u==null&&(u=0,o.replaceState(da({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function h(){l=Dn.Pop;let v=d(),x=v==null?null:v-u;u=v,c&&c({action:l,location:g.location,delta:x})}function m(v,x){l=Dn.Push;let y=Dh(g.location,v,x);u=d()+1;let b=Yg(y,u),S=g.createHref(y);try{o.pushState(b,"",S)}catch(_){if(_ instanceof DOMException&&_.name==="DataCloneError")throw _;s.location.assign(S)}i&&c&&c({action:l,location:g.location,delta:1})}function p(v,x){l=Dn.Replace;let y=Dh(g.location,v,x);u=d();let b=Yg(y,u),S=g.createHref(y);o.replaceState(b,"",S),i&&c&&c({action:l,location:g.location,delta:0})}function w(v){let x=s.location.origin!=="null"?s.location.origin:s.location.href,y=typeof v=="string"?v:xc(v);return y=y.replace(/ $/,"%20"),Ue(x,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,x)}let g={get action(){return l},get location(){return e(s,o)},listen(v){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(Jg,h),c=v,()=>{s.removeEventListener(Jg,h),c=null}},createHref(v){return t(s,v)},createURL:w,encodeLocation(v){let x=w(v);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:m,replace:p,go(v){return o.go(v)}};return g}var Qg;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Qg||(Qg={}));function YT(e,t,r){return r===void 0&&(r="/"),QT(e,t,r,!1)}function QT(e,t,r,n){let s=typeof t=="string"?so(t):t,i=Rp(s.pathname||"/",r);if(i==null)return null;let o=Zw(e);XT(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let u=cR(i);l=aR(o[c],u,n)}return l}function Zw(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let s=(i,o,l)=>{let c={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};c.relativePath.startsWith("/")&&(Ue(c.relativePath.startsWith(n),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+n+'" is not val
285id. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(n.length));let u=Wn([n,c.relativePath]),d=r.concat(c);i.children&&i.children.length>0&&(Ue(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Zw(i.children,t,d,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:iR(u,i.index),routesMeta:d})};return e.forEach((i,o)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))s(i,o);else for(let c of eb(i.path))s(i,o,c)}),t}function eb(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,s=r.endsWith("?"),i=r.replace(/\?$/,"");if(n.length===0)return s?[i,""]:[i];let o=eb(n.join("/")),l=[];return l.push(...o.map(c=>c===""?i:[i,c].join("/"))),s&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function XT(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:oR(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const ZT=/^:[\w-]+$/,eR=3,tR=2,rR=1,nR=10,sR=-2,Xg=e=>e==="*";function iR(e,t){let r=e.split("/"),n=r.length;return r.some(Xg)&&(n+=sR),t&&(n+=tR),r.filter(s=>!Xg(s)).reduce((s,i)=>s+(ZT.test(i)?eR:i===""?rR:nR),n)}function oR(e,t){return e.length===t.length&&e.slice(0,-1).every((n,s)=>n===t[s])?e[e.length-1]-t[t.length-1]:0}function aR(e,t,r){let{routesMeta:n}=e,s={},i="/",o=[];for(let l=0;l<n.length;++l){let c=n[l],u=l===n.length-1,d=i==="/"?t:t.slice(i.length)||"/",h=Zg({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),m=c.route;if(!h&&u&&r&&!n[n.length-1].route.index&&(h=Zg({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},d)),!h)return null;
vendor: 10,320 bytes, lines 285-294
285Object.assign(s,h.params),o.push({params:s,pathname:Wn([i,h.pathname]),pathnameBase:fR(Wn([i,h.pathnameBase])),route:m}),h.pathnameBase!=="/"&&(i=Wn([i,h.pathnameBase]))}return o}function Zg(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=lR(e.path,e.caseSensitive,e.end),s=t.match(r);if(!s)return null;let i=s[0],o=i.replace(/(.)\/+$/,"$1"),l=s.slice(1);return{params:n.reduce((u,d,h)=>{let{paramName:m,isOptional:p}=d;if(m==="*"){let g=l[h]||"";o=i.slice(0,i.length-g.length).replace(/(.)\/+$/,"$1")}const w=l[h];return p&&!w?u[m]=void 0:u[m]=(w||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:o,pattern:e}}function lR(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),Xw(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(n.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),n]}function cR(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Xw(!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 Rp(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function uR(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:s=""}=typeof e=="string"?so(e):e;return{pathname:r?r.startsWith("/")?r:dR(r,t):t,search:pR(n),hash:mR(s)}}function dR(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?r.length>1&&r.pop():s!=="."&&r.push(s)}),r.length>1?r.join("/"):"/"}function ud(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function hR(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function tb(e,t){let r=hR(e);return t?r.map((n,s)=>s===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function rb(e,t,r,n){n===void 0&&(n=!1);let s;typeof e=="string"?s=so(e):(s=da({},e),Ue(!s.pathname||!s.pathname.includes("?"),ud("?","pathname","search",s)),Ue(!s.pathname||!s.pathname.includes("#"),ud("#","pathname","hash",s)),Ue(!s.search||!s.search.includes("#"),ud("#","search","hash",s)));let i=e===""||s.pathname==="",o=i?"/":s.pathname,l;if(o==null)l=r;else{let h=t.length-1;if(!n&&o.startsWith("..")){let m=o.split("/");for(;m[0]==="..";)m.shift(),h-=1;s.pathname=m.join("/")}l=h>=0?t[h]:"/"}let c=uR(s,l),u=o&&o!=="/"&&o.endsWith("/"),d=(i||o===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const Wn=e=>e.join("/").replace(/\/\/+/g,"/"),fR=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),pR=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,mR=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function gR(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const nb=["post","put","patch","delete"];new Set(nb);const vR=["get",...nb];new Set(vR);/** 286 * React Router v6.30.1 287 * 288 * Copyright (c) Remix Software Inc. 289 * 290 * This source code is licensed under the MIT license found in the 291 * LICENSE.md file in the root directory of this source tree. 292 * 293 * @license MIT 294 */function ha(){return ha=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ha.apply(this,arguments)}const Pp=f.createContext(null),yR=f.createContext(null),Us=f.createContext(null),du=f.createContext(null),es=f.createContext({outlet:null,matches:[],isDataRoute:!1}),sb=f.createContext(null);function xR(e,t){let{relative:r}=t===void 0?{}:t;Oa()||Ue(!1);let{basename:n,navigator:s}=f.useContext(Us),{hash:i,pathname:o,search:l}=ob(e,{relative:r}),c=o;return n!=="/"&&(c=o==="/"?n:Wn([n,o])),s.createHref({pathname:c,search:l,hash:i})}function Oa(){return f.useContext(du)!=null}function Ia(){return Oa()||Ue(!1),f.useContext(du).location}function ib(e){f.useContext(Us).static||f.useLayoutEffect(e)}function Ap(){let{isDataRoute:e}=f.useContext(es);return e?OR():wR()}function wR(){Oa()||Ue(!1);let e=f.useContext(Pp),{basename:t,future:r,navigator:n}=f.useContext(Us),{matches:s}=f.useContext(es),{pathname:i}=Ia(),o=JSON.stringify(tb(s,r.v7_relativeSplatPath)),l=f.useRef(!1);return ib(()=>{l.current=!0}),f.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){n.go(u);return}let h=rb(u,JSON.parse(o),i,d.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:Wn([t,h.pathname])),(d.replace?n.replace:n.push)(h,d.state,d)},[t,n,o,i,e])}function bR(){let{matches:e}=f.useContext(es),t=e[e.length-1];return t?t.params:{}}function ob(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=f.useContext(Us),{matches:s}=f.useContext(es),{pathname:i}=Ia(),o=JSON.stringify(tb(s,n.v7_relativeSplatPath));return f.useMemo(()=>rb(e,JSON.parse(o),i,r==="path"),[e,o,i,r])}function _R(e,t){return SR(e,t)}function SR(e,t,r,n){Oa()||Ue(!1);let{navigator:s}=f.useContext(Us),{matches:i}=f.useContext(es),o=i[i.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=Ia(),d;if(t){var h;let v=typeof t=="string"?so(t):t;c==="/"||(h=v.pathname)!=null&&h.startsWith(c)||Ue(!1),d=v}else d=u;let m=d.pathname||"/",p=m;if(c!=="/"){let v=c.replace(/^\//,"").split("/");p="/"+m.replace(/^\//,"").split("/").slice(v.length).join("/")}let w=YT(e,{pathname:p}),g=kR(w&&w.map(v=>Object.assign({},v,{params:Object.assign({},l,v.params),pathname:Wn([c,s.encodeLocation?s.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?c:Wn([c,s.encodeLocation?s.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),i,r,n);return t&&g?f.createElement(du.Provider,{value:{location:ha({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Dn.Pop}},g):g}function jR(){let e=AR(),t=gR(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},t),r?f.createElement("pre",{style:s},r):null,null)}const ER=f.createElement(jR,null);class CR extends f.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?f.createElement(es.Provider,{value:this.props.routeContext},f.createElement(sb.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function NR(e){let{routeContext:t,match:r,children:n}=e,s=f.useContext(Pp);return s&&s.static&&s.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=r.route.id),f.createElement(es.Provider,{value:t},n)}function kR(e,t,r,n){var s;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var i;if(!r)return null;if(r.errors)e=r.matches;else if((i=n)!=null&&i.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,l=(s=r)==null?void 0:s.errors;if(l!=null){let d=o.findIndex(h=>h.route.id&&(l==null?void 0:l[h.route.id])!==void 0);d>=0||Ue(!1),o=o.slice(0,Math.min(o.length,d+1))}let c=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let d=0;d<o.length;d++){let h=o[d];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(u=d),h.route.id){let{loaderData:m,errors:p}=r,w=h.route.loader&&m[h.route.id]===void 0&&(!p||p[h.route.id]===void 0);if(h.route.lazy||w){c=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,h,m)=>{let p,w=!1,g=null,v=null;r&&(p=l&&h.route.id?l[h.route.id]:void 0,g=h.route.errorElement||ER,c&&(u<0&&m===0?(w=!0,v=null):u===m&&(w=!0,v=h.route.hydrateFallbackElement||null)));let x=t.concat(o.slice(0,m+1)),y=()=>{let b;return p?b=g:w?b=v:h.route.Component?b=f.createElement(h.route.Component,null):h.route.element?b=h.route.element:b=d,f.createElement(NR,{match:h,routeContext:{outlet:d,matches:x,isDataRoute:r!=null},children:b})};return r&&(h.route.ErrorBoundary||h.route.errorElement||m===0)?f.createElement(CR,{location:r.location,revalidation:r.revalidation,component:g,error:p,children:y(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):y()},null)}var ab=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(ab||{}),wc=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}(wc||{});function TR(e){let t=f.useContext(Pp);return t||Ue(!1),t}function RR(e){let t=f.useContext(yR);return t||Ue(!1),t}function PR(e){let t=f.useContext(es);return t||Ue(!1),t}function lb(e){let t=PR(),r=t.matches[t.matches.length-1];return r.route.id||Ue(!1),r.route.id}function AR(){var e;
294let t=f.useContext(sb),r=RR(wc.UseRouteError),n=lb(wc.UseRouteError);return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function OR(){let{router:e}=TR(ab.UseNavigateStable),t=lb(wc.UseNavigateStable),r=f.useRef(!1);return ib(()=>{r.current=!0}),f.useCallback(function(s,i){i===void 0&&(i={}),r.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,ha({fromRouteId:t},i)))},[e,t])}function IR(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Vr(e){Ue(!1)}function DR(e){let{basename:t="/",children:r=null,location:n,navigationType:s=Dn.Pop,navigator:i,static:o=!1,future:l}=e;Oa()&&Ue(!1);let c=t.replace(/^\/*/,"/"),u=f.useMemo(()=>({basename:c,navigator:i,static:o,future:ha({v7_relativeSplatPath:!1},l)}),[c,l,i,o]);typeof n=="string"&&(n=so(n));let{pathname:d="/",search:h="",hash:m="",state:p=null,key:w="default"}=n,g=f.useMemo(()=>{let v=Rp(d,c);return v==null?null:{location:{pathname:v,search:h,hash:m,state:p,key:w},navigationType:s}},[c,d,h,m,p,w,s]);return g==null?null:f.createElement(Us.Provider,{value:u},f.createElement(du.Provider,{children:r,value:g}))}function LR(e){let{children:t,location:r}=e;return _R(Lh(t),r)}new Promise(()=>{});function Lh(e,t){t===void 0&&(t=[]);let r=[];return f.Children.forEach(e,(n,s)=>{if(!f.isValidElement(n))return;let i=[...t,s];if(n.type===f.Fragment){r.push.apply(r,Lh(n.props.children,i));return}n.type!==Vr&&Ue(!1),!n.props.index||!n.props.children||Ue(!1);let o={id:n.props.id||i.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=Lh(n.props.children,i)),r.push(o)}),r}/** 295 * React Router DOM v6.30.1 296 * 297 * Copyright (c) Remix Software Inc. 298 * 299 * This source code is licensed under the MIT license found in the 300 * LICENSE.md file in the root directory of this source tree. 301 * 302 * @license MIT 303 */function Mh(){return Mh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Mh.apply(this,arguments)}function MR(e,t){if(e==null)return{};var r={},n=Object.keys(e),s,i;for(i=0;i<n.length;i++)s=n[i],!(t.indexOf(s)>=0)&&(r[s]=e[s]);return r}function $R(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function FR(e,t){return e.button===0&&(!t||t==="_self")&&!$R(e)}const UR=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],zR="6";try{window.__reactRouterVersion=zR}catch{}const BR="startTransition",ev=vf[BR];function VR(e){let{basename:t,children:r,future:n,window:s}=e,i=f.useRef();i.current==null&&(i.current=KT({window:s,v5Compat:!0}));let o=i.current,[l,c]=f.useState({action:o.action,location:o.location}),{v7_startTransition:u}=n||{},d=f.useCallback(h=>{u&&ev?ev(()=>c(h)):c(h)},[c,u]);return f.useLayoutEffect(()=>o.listen(d),[o,d]),f.useEffect(()=>IR(n),[n]),f.createElement(DR,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:o,future:n})}const WR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",HR=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ns=f.forwardRef(function(t,r){let{onClick:n,relative:s,reloadDocument:i,replace:o,state:l,target:c,to:u,preventScrollReset:d,viewTransition:h}=t,m=MR(t,UR),{basename:p}=f.useContext(Us),w,g=!1;if(typeof u=="string"&&HR.test(u)&&(w=u,WR))try{let b=new URL(window.location.href),S=u.startsWith("//")?new URL(b.protocol+u):new URL(u),_=Rp(S.pathname,p);S.origin===b.origin&&_!=null?u=_+S.search+S.hash:g=!0}catch{}let v=xR(u,{relative:s}),x=qR(u,{replace:o,state:l,target:c,preventScrollReset:d,relative:s,viewTransition:h});function y(b){n&&n(b),b.defaultPrevented||x(b)}return f.createElement("a",Mh({},m,{href:w||v,onClick:g||i?n:y,ref:r,target:c}))});var tv;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(tv||(tv={}));var rv;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(rv||(rv={}));function qR(e,t){let{target:r,replace:n,state:s,preventScrollReset:i,relative:o,viewTransition:l}=t===void 0?{}:t,c=Ap(),u=Ia(),d=ob(e,{relative:o});return f.useCallback(h=>{if(FR(h,r)){h.preventDefault();let m=n!==void 0?n:xc(u)===xc(d);c(e,{replace:m,state:s,preventScrollReset:i,relative:o,viewTransition:l})}},[u,c,d,n,s,r,e,i,o,l])}const KR=Ra("inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background transition-smooth focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90 rounded-xl shadow-elegant",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90 rounded-xl",outline:"border-2 border-primary bg-transparent text-primary hover:bg-primary hover:text-primary-foreground rounded-xl",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 rounded-xl shadow-elegant",ghost:"hover:bg-accent hover:text-accent-foreground rounded-xl",link:"text-primary underline-offset-4 hover:underline",hero:"bg-gradient-primary text-primary-foreground hover:shadow-glow hover:scale-105 rounded-xl font-semibold",energy:"bg-energy text-energy-foreground hover:bg-energy/90 rounded-xl shadow-elegant font-semibold"},size:{default:"h-12 px-6 py-3",sm:"h-9 px-4",lg:"h-14 px-10 text-lg",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),B=f.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...s},i)=>{const o=n?jC:"button";return a.jsx(o,{className:te(KR({variant:t,size:r,className:e})),ref:i,...s})});B.displayName="Button";var GR=f.createContext(void 0);function io(e){const t=f.useContext(GR);return e||t||"ltr"}function hu(e){const t=f.useRef({value:e,previous:e});return f.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var zs="NavigationMenu",[Op,cb,JR]=ka(zs),[$h,YR,QR]=ka(zs),[Ip,VL]=zt(zs,[JR,QR]),[XR,Zt]=Ip(zs),[ZR,eP]=Ip(zs),ub=f.forwardRef((e,t)=>
vendor: 5,096 bytes, line 303
303{const{__scopeNavigationMenu:r,value:n,onValueChange:s,defaultValue:i,delayDuration:o=200,skipDelayDuration:l=300,orientation:c="horizontal",dir:u,...d}=e,[h,m]=f.useState(null),p=oe(t,N=>m(N)),w=io(u),g=f.useRef(0),v=f.useRef(0),x=f.useRef(0),[y,b]=f.useState(!0),[S,_]=Ir({prop:n,onChange:N=>{const R=N!=="",F=l>0;R?(window.clearTimeout(x.current),F&&b(!1)):(window.clearTimeout(x.current),x.current=window.setTimeout(()=>b(!0),l)),s==null||s(N)},defaultProp:i??"",caller:zs}),j=f.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>_(""),150)},[_]),E=f.useCallback(N=>{window.clearTimeout(v.current),_(N)},[_]),C=f.useCallback(N=>{S===N?window.clearTimeout(v.current):g.current=window.setTimeout(()=>{window.clearTimeout(v.current),_(N)},o)},[S,_,o]);return f.useEffect(()=>()=>{window.clearTimeout(g.current),window.clearTimeout(v.current),window.clearTimeout(x.current)},[]),a.jsx(db,{scope:r,isRootMenu:!0,value:S,dir:w,orientation:c,rootNavigationMenu:h,onTriggerEnter:N=>{window.clearTimeout(g.current),y?C(N):E(N)},onTriggerLeave:()=>{window.clearTimeout(g.current),j()},onContentEnter:()=>window.clearTimeout(v.current),onContentLeave:j,onItemSelect:N=>{_(R=>R===N?"":N)},onItemDismiss:()=>_(""),children:a.jsx(K.nav,{"aria-label":"Main","data-orientation":c,dir:w,...d,ref:p})})});ub.displayName=zs;var Fh="NavigationMenuSub",tP=f.forwardRef((e,t)=>{const{__scopeNavigationMenu:r,value:n,onValueChange:s,defaultValue:i,orientation:o="horizontal",...l}=e,c=Zt(Fh,r),[u,d]=Ir({prop:n,onChange:s,defaultProp:i??"",caller:Fh});return a.jsx(db,{scope:r,isRootMenu:!1,value:u,dir:c.dir,orientation:o,rootNavigationMenu:c.rootNavigationMenu,onTriggerEnter:h=>d(h),onItemSelect:h=>d(h),onItemDismiss:()=>d(""),children:a.jsx(K.div,{"data-orientation":o,...l,ref:t})})});tP.displayName=Fh;var db=e=>{const{scope:t,isRootMenu:r,rootNavigationMenu:n,dir:s,orientation:i,children:o,value:l,onItemSelect:c,onItemDismiss:u,onTriggerEnter:d,onTriggerLeave:h,onContentEnter:m,onContentLeave:p}=e,[w,g]=f.useState(null),[v,x]=f.useState(new Map),[y,b]=f.useState(null);return a.jsx(XR,{scope:t,isRootMenu:r,rootNavigationMenu:n,value:l,previousValue:hu(l),baseId:Or(),dir:s,orientation:i,viewport:w,onViewportChange:g,indicatorTrack:y,onIndicatorTrackChange:b,onTriggerEnter:xe(d),onTriggerLeave:xe(h),onContentEnter:xe(m),onContentLeave:xe(p),onItemSelect:xe(c),onItemDismiss:xe(u),onViewportContentChange:f.useCallback((S,_)=>{x(j=>(j.set(S,_),new Map(j)))},[]),onViewportContentRemove:f.useCallback(S=>{x(_=>_.has(S)?(_.delete(S),new Map(_)):_)},[]),children:a.jsx(Op.Provider,{scope:t,children:a.jsx(ZR,{scope:t,items:v,children:o})})})},hb="NavigationMenuList",fb=f.forwardRef((e,t)=>{const{__scopeNavigationMenu:r,...n}=e,s=Zt(hb,r),i=a.jsx(K.ul,{"data-orientation":s.orientation,...n,ref:t});return a.jsx(K.div,{style:{position:"relative"},ref:s.onIndicatorTrackChange,children:a.jsx(Op.Slot,{scope:r,children:s.isRootMenu?a.jsx(Sb,{asChild:!0,children:i}):i})})});fb.displayName=hb;var pb="NavigationMenuItem",[rP,mb]=Ip(pb),gb=f.forwardRef((e,t)=>{const{__scopeNavigationMenu:r,value:n,...s}=e,i=Or(),o=n||i||"LEGACY_REACT_AUTO_VALUE",l=f.useRef(null),c=f.useRef(null),u=f.useRef(null),d=f.useRef(()=>{}),h=f.useRef(!1),m=f.useCallback((w="start")=>{if(l.current){d.current();const g=zh(l.current);g.length&&Mp(w==="start"?g:g.reverse())}},[]),p=f.useCallback(()=>{if(l.current){const w=zh(l.current);w.length&&(d.current=cP(w))}},[]);return a.jsx(rP,{scope:r,value:o,triggerRef:c,contentRef:l,focusProxyRef:u,wasEscapeCloseRef:h,onEntryKeyDown:m,onFocusProxyEnter:m,onRootContentClose:p,onContentFocusOutside:p,children:a.jsx(K.li,{...s,ref:t})})});gb.displayName=pb;var Uh="NavigationMenuTrigger",vb=f.forwardRef((e,t)=>{const{__scopeNavigationMenu:r,disabled:n,...s}=e,i=Zt(Uh,e.__scopeNavigationMenu),o=mb(Uh,e.__scopeNavigationMenu),l=f.useRef(null),c=oe(l,o.triggerRef,t),u=Eb(i.baseId,o.value),d=Cb(i.baseId,o.value),h=f.useRef(!1),m=f.useRef(!1),p=o.value===i.value;return a.jsxs(a.Fragment,{children:[a.jsx(Op.ItemSlot,{scope:r,value:o.value,children:a.jsx(jb,{asChild:!0,children:a.jsx(K.button,{id:u,disabled:n,"data-disabled":n?"":void 0,"data-state":$p(p),"aria-expanded":p,"aria-controls":d,...s,ref:c,onPointerEnter:$(e.onPointerEnter,()=>{m.current=!1,o.wasEscapeCloseRef.current=!1}),onPointerMove:$(e.onPointerMove,bc(()=>{n||m.current||o.wasEscapeCloseRef.current||h.current||(i.onTriggerEnter(o.value),h.current=!0)})),onPointerLeave:$(e.onPointerLeave,bc(()=>{n||(i.onTriggerLeave(),h.current=!1)})),onClick:$(e.onClick,()=>{i.onItemSelect(o.value),m.current=p}),onKeyDown:$(e.onKeyDown,w=>{const v={horizontal:"ArrowDown",vertical:i.dir==="rtl"?"ArrowLeft":"ArrowRight"}[i.orientation];p&&w.key===v&&(o.onEntryKeyDown(),w.preventDefault())})})})}),p&&a.jsxs(a.Fragment,{children:[a.jsx(I0,{"aria-hidden":!0,tabIndex:0,ref:o.focusProxyRef,onFocus:w=>{const g=o.contentRef.current,v=w.relatedTarget,x=v===l.current,y=g==null?void 0:g.contains(v);(x||!y)&&o.onFocusProxyEnter(x?"start":"end")}}),i.viewport&&a.jsx("span",{"aria-owns":d})]})]})});
303vb.displayName=Uh;var nP="NavigationMenuLink",nv="navigationMenu.linkSelect",yb=f.forwardRef((e,t)=>{const{__scopeNavigationMenu:r,active:n,onSelect:s,...i}=e;return a.jsx(jb,{asChild:!0,children:a.jsx(K.a,{"data-active":n?"":void 0,"aria-current":n?"page":void 0,...i,ref:t,onClick:$(e.onClick,o=>{const l=o.target,c=new CustomEvent(nv,{bubbles:!0,cancelable:!0});if(l.addEventListener(nv,u=>s==null?void 0:s(u),{once:!0}),fc(l,c),!c.defaultPrevented&&!o.metaKey){const u=new CustomEvent(Ll,{bubbles:!0,cancelable:!0});fc(l,u)}},{checkForDefaultPrevented:!1})})})});yb.displayName=nP;var Dp="NavigationMenuIndicator",xb=f.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=Zt(Dp,e.__scopeNavigationMenu),i=!!s.value;return s.indicatorTrack?lp.createPortal(a.jsx(dt,{present:r||i,children:a.jsx(sP,{...n,ref:t})}),s.indicatorTrack):null});xb.displayName=Dp;var sP=f.forwardRef((e,t)=>{const{__scopeNavigationMenu:r,...n}=e,s=Zt(Dp,r),i=cb(r),[o,l]=f.useState(null),[c,u]=f.useState(null),d=s.orientation==="horizontal",h=!!s.value;f.useEffect(()=>{var g;const w=(g=i().find(v=>v.value===s.value))==null?void 0:g.ref.current;w&&l(w)},[i,s.value]);const m=()=>{o&&u({size:d?o.offsetWidth:o.offsetHeight,offset:d?o.offsetLeft:o.offsetTop})};return Bh(o,m),Bh(s.indicatorTrack,m),c?a.jsx(K.div,{"aria-hidden":!0,"data-state":h?"visible":"hidden","data-orientation":s.orientation,...n,ref:t,style:{position:"absolute",...d?{left:0,width:c.size+"px",transform:`translateX(${c.offset}px)`}:{top:0,height:c.size+"px",transform:`translateY(${c.offset}px)`},...n.style}}):null}),Ki="NavigationMenuContent",wb=f.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=Zt(Ki,e.__scopeNavigationMenu),i=mb(Ki,e.__scopeNavigationMenu),o=oe(i.contentRef,t),l=i.value===s.value,c={value:i.value,triggerRef:i.triggerRef,focusProxyRef:i.focusProxyRef,wasEscapeCloseRef:i.wasEscapeCloseRef,onContentFocusOutside:i.onContentFocusOutside,onRootContentClose:i.onRootContentClose,...n};return s.viewport?a.jsx(iP,{forceMount:r,...c,ref:o}):a.jsx(dt,{present:r||l,children:a.jsx(bb,{"data-state":$p(l),...c,ref:o,onPointerEnter:$(e.onPointerEnter,s.onContentEnter),onPointerLeave:$(e.onPointerLeave,bc(s.onContentLeave)),style:{pointerEvents:!l&&s.isRootMenu?"none":void 0,...c.style}})})});wb.displayName=Ki;var iP=f.forwardRef((e,t)=>{const r=Zt(Ki,e.__scopeNavigationMenu),{onViewportContentChange:n,onViewportContentRemove:s}=r;return Me(()=>{n(e.value,{ref:t,...e})},[e,t,n]),Me(()=>()=>s(e.value),[e.value,s]),null}),Ll="navigationMenu.rootContentDismiss",bb=f.forwardRef((e,t)=>{const{__scopeNavigationMenu:r,value:n,triggerRef:s,focusProxyRef:i,wasEscapeCloseRef:o,onRootContentClose:l,onContentFocusOutside:c,...u}=e,d=Zt(Ki,r),h=f.useRef(null),m=oe(h,t),p=Eb(d.baseId,n),w=Cb(d.baseId,n),g=cb(r),v=f.useRef(null),{onItemDismiss:x}=d;f.useEffect(()=>{const b=h.current;if(d.isRootMenu&&b){const S=()=>{var _;x(),l(),b.contains(document.activeElement)&&((_=s.current)==null||_.focus())};return b.addEventListener(Ll,S),()=>b.removeEventListener(Ll,S)}},[d.isRootMenu,e.value,s,x,l]);const y=f.useMemo(()=>{const S=g().map(R=>R.value);d.dir==="rtl"&&S.reverse();const _=S.indexOf(d.value),j=S.indexOf(d.previousValue),E=n===d.value,C=j===S.indexOf(n);if(!E&&!C)return v.current;const N=(()=>{if(_!==j){if(E&&j!==-1)return _>j?"from-end":"from-start";if(C&&_!==-1)return _>j?"to-start":"to-end"}return null})();return v.current=N,N},[d.previousValue,d.value,d.dir,g,n]);return a.jsx(Sb,{asChild:!0,children:a.jsx(eo,{id:w,"aria-labelledby":p,"data-motion":y,"data-orientation":d.orientation,...u,ref:m,disableOutsidePointerEvents:!1,onDismiss:()=>{var S;const b=new Event(Ll,{bubbles:!0,cancelable:!0});(S=h.current)==null||S.dispatchEvent(b)},onFocusOutside:$(e.onFocusOutside,b=>{var _;c();const S=b.target;(_=d.rootNavigationMenu)!=null&&_.contains(S)&&b.preventDefault()}),onPointerDownOutside:$(e.onPointerDownOutside,b=>{var E;const S=b.target,_=g().some(C=>{var N;return(N=C.ref.current)==null?void 0:N.contains(S)}),j=d.isRootMenu&&((E=d.viewport)==null?void 0:E.contains(S));(_||j||!d.isRootMenu)&&b.preventDefault()}),onKeyDown:$(e.onKeyDown,b=>{var j;const S=b.altKey||b.ctrlKey||b.metaKey;if(b.key==="Tab"&&!S){const E=zh(b.currentTarget),C=document.activeElement,N=E.findIndex(I=>I===C),F=b.shiftKey?E.slice(0,N).reverse():E.slice(N+1,E.length);Mp(F)?b.preventDefault():(j=i.current)==null||j.focus()}}),onEscapeKeyDown:$(e.onEscapeKeyDown,b=>{o.current=!0})})})}),Lp="NavigationMenuViewport",_b=f.forwardRef((e,t)=>
303{const{forceMount:r,...n}=e,i=!!Zt(Lp,e.__scopeNavigationMenu).value;return a.jsx(dt,{present:r||i,children:a.jsx(oP,{...n,ref:t})})});_b.displayName=Lp;var oP=f.forwardRef((e,t)=>{const{__scopeNavigationMenu:r,children:n,...s}=e,i=Zt(Lp,r),o=oe(t,i.onViewportChange),l=eP(Ki,e.__scopeNavigationMenu),[c,u]=f.useState(null),[d,h]=f.useState(null),m=c?(c==null?void 0:c.width)+"px":void 0,p=c?(c==null?void 0:c.height)+"px":void 0,w=!!i.value,g=w?i.value:i.previousValue;return Bh(d,()=>{d&&u({width:d.offsetWidth,height:d.offsetHeight})}),a.jsx(K.div,{"data-state":$p(w),"data-orientation":i.orientation,...s,ref:o,style:{pointerEvents:!w&&i.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":m,"--radix-navigation-menu-viewport-height":p,...s.style},onPointerEnter:$(e.onPointerEnter,i.onContentEnter),onPointerLeave:$(e.onPointerLeave,bc(i.onContentLeave)),children:Array.from(l.items).map(([x,{ref:y,forceMount:b,...S}])=>{const _=g===x;return a.jsx(dt,{present:b||_,children:a.jsx(bb,{...S,ref:dp(y,j=>{_&&j&&h(j)})})},x)})})}),aP="FocusGroup",Sb=f.forwardRef((e,t)=>{const{__scopeNavigationMenu:r,...n}=e,s=Zt(aP,r);return a.jsx($h.Provider,{scope:r,children:a.jsx($h.Slot,{scope:r,children:a.jsx(K.div,{dir:s.dir,...n,ref:t})})})}),sv=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],lP="FocusGroupItem",jb=f.forwardRef((e,t)=>{const{__scopeNavigationMenu:r,...n}=e,s=YR(r),i=Zt(lP,r);return a.jsx($h.ItemSlot,{scope:r,children:a.jsx(K.button,{...n,ref:t,onKeyDown:$(e.onKeyDown,o=>{if(["Home","End",...sv].includes(o.key)){let c=s().map(h=>h.ref.current);if([i.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(o.key)&&c.reverse(),sv.includes(o.key)){const h=c.indexOf(o.currentTarget);c=c.slice(h+1)}setTimeout(()=>Mp(c)),o.preventDefault()}})})})});function zh(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Mp(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}function cP(e){return e.forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")}),()=>{e.forEach(t=>{const r=t.dataset.tabindex;t.setAttribute("tabindex",r)})}}function Bh(e,t){const r=xe(t);Me(()=>{let n=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return s.observe(e),()=>{window.cancelAnimationFrame(n),s.unobserve(e)}}},[e,r])}function $p(e){return e?"open":"closed"}function Eb(e,t){return`${e}-trigger-${t}`}function Cb(e,t){return`${e}-content-${t}`}function bc(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Nb=ub,kb=fb,uP=gb,Tb=vb,dP=yb,Rb=xb,Pb=wb,Ab=_b;const Ob=f.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(Nb,{ref:n,className:te("relative z-10 flex max-w-max flex-1 items-center justify-center",e),...r,children:[t,a.jsx(Mb,{})]}));Ob.displayName=Nb.displayName;const Ib=f.forwardRef(({className:e,...t},r)=>a.jsx(kb,{ref:r,className:te("group flex flex-1 list-none items-center justify-center space-x-1",e),...t}));Ib.displayName=kb.displayName;const dd=uP,hP=Ra("group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50"),Db=f.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(Tb,{ref:n,className:te(hP(),"group",e),...r,children:[t," ",a.jsx(Pa,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]}));Db.displayName=Tb.displayName;const Lb=f.forwardRef(({className:e,...t},r)=>a.jsx(Pb,{ref:r,className:te("left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto",e),...t}));Lb.displayName=Pb.displayName;const hd=dP,Mb=f.forwardRef(({className:e,...t},r)=>a.jsx("div",{className:te("absolute left-0 top-full flex justify-center"),children:a.jsx(Ab,{className:te("origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",e),ref:r,...t})}));Mb.displayName=Ab.displayName;const fP=f.forwardRef(({className:e,...t},r)=>a.jsx(Rb,{ref:r,className:te("top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",e),...t,children:a.jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}));fP.displayName=Rb.displayName;const iv=()=>{const{theme:e,setTheme:t}=k0();return a.jsxs(B,{variant:"ghost",size:"icon",onClick:()=>t(e==="dark"?"light":"dark"),"aria-label":"Toggle theme",className:"transition-smooth",children:[a.jsx(IN,{className:"h-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),a.jsx(NN,{className:"absolute h-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"})]})},pP=Symbol.for("@supabase/supabase-js.traceContextExtractor");function mP(){return globalThis[pP]}function gP(e,t,r,n){function s(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function l(d){try{u(n.next(d))}catch(h){o(h)}}function c(d){try{u(n.throw(d))}catch(h){o(h)}}function u(d){d.done?i(d.value):s(d.value).then(l,c)}u((n=n.apply(e,t||[])).next())})}const vP=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);
303class Fp extends Error{constructor(t,r="FunctionsError",n){super(t),this.name=r,this.context=n}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class yP extends Fp{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class ov extends Fp{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class av extends Fp{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var Vh;(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"})(Vh||(Vh={}));class xP{constructor(t,{headers:r={},customFetch:n,region:s=Vh.Any}={}){this.url=t,this.headers=r,this.region=s,this.fetch=vP(n)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return gP(this,arguments,void 0,function*(r,n={}){var s,i;let o,l,c;try{const{headers:u,method:d,body:h,signal:m,timeout:p}=n;let w={},{region:g}=n;g||(g=this.region);const v=new URL(`${this.url}/${r}`);g&&g!=="any"&&(w["x-region"]=g,v.searchParams.set("forceFunctionRegion",g));let x;const y=!!u&&Object.keys(u).some(C=>C.toLowerCase()==="content-type");h&&!y?typeof Blob<"u"&&h instanceof Blob||h instanceof ArrayBuffer?(w["Content-Type"]="application/octet-stream",x=h):typeof h=="string"?(w["Content-Type"]="text/plain",x=h):typeof FormData<"u"&&h instanceof FormData?x=h:(w["Content-Type"]="application/json",x=JSON.stringify(h)):h&&typeof h!="string"&&!(typeof Blob<"u"&&h instanceof Blob)&&!(h instanceof ArrayBuffer)&&!(typeof FormData<"u"&&h instanceof FormData)?x=JSON.stringify(h):x=h;let b=m;p&&(l=new AbortController,o=setTimeout(()=>l.abort(),p),m?(b=l.signal,c=()=>l.abort(),m.addEventListener("abort",c)):b=l.signal);const S=yield this.fetch(v.toString(),{method:d||"POST",headers:Object.assign(Object.assign(Object.assign({},w),this.headers),u),body:x,signal:b}).catch(C=>{throw new yP(C)}),_=S.headers.get("x-relay-error");if(_&&_==="true")throw new ov(S);if(!S.ok)throw new av(S);let j=((s=S.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim().toLowerCase(),E;return j==="application/json"?E=yield S.json():j==="application/octet-stream"||j==="application/pdf"?E=yield S.blob():j==="text/event-stream"?E=S:j==="multipart/form-data"?E=yield S.formData():E=yield S.text(),{data:E,error:null,response:S}}catch(u){return{data:null,error:u,response:u instanceof av||u instanceof ov?u.context:void 0}}finally{o&&clearTimeout(o),c&&((i=n.signal)===null||i===void 0||i.removeEventListener("abort",c))}})}}var Si=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.co
303de=e.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};const $b=3,lv=e=>Math.min(1e3*2**e,3e4),wP=[520,503],Fb=["GET","HEAD","OPTIONS"];function fa(e){"@babel/helpers - typeof";return fa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fa(e)}function bP(e,t){if(fa(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(fa(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _P(e){var t=bP(e,"string");return fa(t)=="symbol"?t:t+""}function SP(e,t,r){return(t=_P(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function ms(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?cv(Object(r),!0).forEach(function(n){SP(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cv(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function uv(e,t){return new Promise(r=>{if(t!=null&&t.aborted){r();return}const n=setTimeout(()=>{t==null||t.removeEventListener("abort",s),r()},e);function s(){clearTimeout(n),r()}t==null||t.addEventListener("abort",s)})}function jP(e,t,r,n){return!(!n||r>=$b||!Fb.includes(e)||!wP.includes(t))}async function Ub(e,t,r,n){let s=0;for(;;){const l=ms({},r.headers);s>0&&(l["X-Retry-Count"]=String(s));let c;try{c=await e(t,{method:r.method,headers:l,body:r.body,signal:r.signal})}catch(u){if((u==null?void 0:u.name)==="AbortError"||(u==null?void 0:u.code)==="ABORT_ERR"||!Fb.includes(r.method))throw u;if(n&&s<$b){const d=lv(s);s++,await uv(d,r.signal);continue}throw u}if(jP(r.method,c.status,s,n)){var i,o;const u=(i=(o=c.headers)===null||o===void 0?void 0:o.get("Retry-After"))!==null&&i!==void 0?i:null,d=u!==null?Math.max(0,parseInt(u,10)||0)*1e3:lv(s);await c.text(),s++,await uv(d,r.signal);continue}return c}}var EP=class{constructor(e){var t,r,n,s,i;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=(t=e.shouldThrowOnError)!==null&&t!==void 0?t:!1,this.signal=e.signal,this.isMaybeSingle=(r=e.isMaybeSingle)!==null&&r!==void 0?r:!1,this.shouldStripNulls=(n=e.shouldStripNulls)!==null&&n!==void 0?n:!1,this.urlLengthLimit=(s=e.urlLengthLimit)!==null&&s!==void 0?s:8e3,this.retryEnabled=(i=e.retry)!==null&&i!==void 0?i:!0,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw new Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}retry(e){return this.retryEnabled=e,this}then(e,t){var r=this;if(this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json"),this.shouldStripNulls){const o=this.headers.get("Accept");o==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!o||o==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const n=this.fetch;let i=(async()=>{const o={};r.headers.forEach((c,u)=>{o[u]=c});const l=await Ub(n,r.url.toString(),{method:r.method,headers:o,body:JSON.stringify(r.body,(c,u)=>typeof u=="bigint"?u.toString():u),signal:r.signal},r.retryEnabled);return await r.processResponse(l)})();return this.shouldThrowOnError||(i=i.catch(o=>{var l;let c="",u="",d="";const h=o==null?void 0:o.cause;if(h){var m,p,w,g;const y=(m=h==null?void 0:h.message)!==null&&m!==void 0?m:"",b=(p=h==null?void 0:h.code)!==null&&p!==void 0?p:"";c=`${(w=o==null?void 0:o.name)!==null&&w!==void 0?w:"FetchError"}: ${o==null?void 0:o.message}`,c+=` 304 305Caused by: ${(g=h==null?void 0:h.name)!==null&&g!==void 0?g:"Error"}: ${y}`,b&&(c+=` (${b})`),h!=null&&h.stack&&(c+=` 306${h.stack}`)}else{var v;c=(v=o==null?void 0:o.stack)!==null&&v!==void 0?v:""}const x=this.url.toString().length;return(o==null?void 0:o.name)==="AbortError"||(o==null?void 0:o.code)==="ABORT_ERR"?(d="",u="Request was aborted (timeout or manual cancellation)",x>this.urlLengthLimit&&(u+=`. Note: Your request URL is ${x} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((h==null?void 0:h.name)==="HeadersOverflowError"||(h==null?void 0:h.code)==="UND_ERR_HEADERS_OVERFLOW")&&(d="",u="HTTP headers exceeded server limits (typically 16KB)",x>this.urlLengthLimit&&(u+=`. Your request URL is ${x} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${(l=o==null?void 0:o.name)!==null&&l!==void 0?l:"FetchError"}: ${o==null?void 0:o.message}`,details:c,hint:u,code:d},data:null,count:null,status:0,statusText:""}}
306)),i.then(e,t)}async processResponse(e){var t=this;let r=null,n=null,s=null,i=e.status,o=e.statusText;if(e.ok){var l,c;if(t.method!=="HEAD"){var u;const p=await e.text();if(p!=="")if(t.headers.get("Accept")==="text/csv")n=p;else if(t.headers.get("Accept")&&(!((u=t.headers.get("Accept"))===null||u===void 0)&&u.includes("application/vnd.pgrst.plan+text")))n=p;else try{n=JSON.parse(p)}catch{if(r={message:p},n=null,t.shouldThrowOnError)throw new Si({message:p,details:"",hint:"",code:""})}}const h=(l=t.headers.get("Prefer"))===null||l===void 0?void 0:l.match(/count=(exact|planned|estimated)/),m=(c=e.headers.get("content-range"))===null||c===void 0?void 0:c.split("/");if(h&&m&&m.length>1&&(s=parseInt(m[1])),t.isMaybeSingle&&Array.isArray(n))if(n.length>1){if(r={code:"PGRST116",details:`Results contain ${n.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},n=null,s=null,i=406,o="Not Acceptable",t.shouldThrowOnError){var d;throw new Si(ms(ms({},r),{},{hint:(d=r.hint)!==null&&d!==void 0?d:""}))}}else n.length===1?n=n[0]:n=null}else{const h=await e.text();try{r=JSON.parse(h),Array.isArray(r)&&e.status===404&&(n=[],r=null,i=200,o="OK")}catch{e.status===404&&h===""?(i=204,o="No Content"):r={message:h}}if(r&&t.shouldThrowOnError)throw new Si(r)}return{success:r===null,error:r,data:n,count:s,status:i,statusText:o}}returns(){return this}overrideTypes(){return this}},CP=class extends EP{throwOnError(){return super.throwOnError()}select(e){let t=!1;const r=(e??"*").split("").map(n=>/\s/.test(n)&&!t?"":(n==='"'&&(t=!t),n)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:r,foreignTable:n,referencedTable:s=n}={}){const i=s?`${s}.order`:"order",o=this.url.searchParams.get(i);return this.url.searchParams.set(i,`${o?`${o},`:""}${e}.${t?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:r=t}={}){const n=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(n,`${e}`),this}range(e,t,{foreignTable:r,referencedTable:n=r}={}){const s=typeof n>"u"?"offset":`${n}.offset`,i=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(s,`${e}`),this.url.searchParams.set(i,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:e=!1,verbose:t=!1,settings:r=!1,buffers:n=!1,wal:s=!1,format:i="text"}={}){var o;const l=[e?"analyze":null,t?"verbose":null,r?"settings":null,n?"buffers":null,s?"wal":null].filter(Boolean).join("|"),c=(o=this.headers.get("Accept"))!==null&&o!==void 0?o:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${i}; for="${c}"; options=${l};`),i==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};const dv=new RegExp("[,()]");var ti=class extends CP{throwOnError(){return super.throwOnError()}eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){const r=Array.from(new Set(t)).map(n=>typeof n=="string"&&dv.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(e,`in.(${r})`),this}notIn(e,t){const r=Array.from(new Set(t)).map(n=>typeof n=="string"&&dv.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(e,`not.in.(${r})`),this}contains(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t=="string"?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:r,type:n}={}){let s="";n==="plain"?s="pl":n==="phrase"?s="ph":n==="websearch"&&(s="w");const i=r===void 0?"":`(${r})`;return this.url.searchParams.append(e,`${s}fts${i}.${t}`),this}match(e){return Object.entries(e).filter(([t,r])=>
306r!==void 0).forEach(([t,r])=>{this.url.searchParams.append(t,`eq.${r}`)}),this}not(e,t,r){return this.url.searchParams.append(e,`not.${t}.${r}`),this}or(e,{foreignTable:t,referencedTable:r=t}={}){const n=r?`${r}.or`:"or";return this.url.searchParams.append(n,`(${e})`),this}filter(e,t,r){return this.url.searchParams.append(e,`${t}.${r}`),this}},NP=class{constructor(e,{headers:t={},schema:r,fetch:n,urlLengthLimit:s=8e3,retry:i}){this.url=e,this.headers=new Headers(t),this.schema=r,this.fetch=n,this.urlLengthLimit=s,this.retry=i}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){const{head:r=!1,count:n}=t??{},s=r?"HEAD":"GET";let i=!1;const o=(e??"*").split("").map(u=>/\s/.test(u)&&!i?"":(u==='"'&&(i=!i),u)).join(""),{url:l,headers:c}=this.cloneRequestState();return l.searchParams.set("select",o),n&&c.append("Prefer",`count=${n}`),new ti({method:s,url:l,headers:c,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(e,{count:t,defaultToNull:r=!0}={}){var n;const s="POST",{url:i,headers:o}=this.cloneRequestState();if(t&&o.append("Prefer",`count=${t}`),r||o.append("Prefer","missing=default"),Array.isArray(e)){const l=e.reduce((c,u)=>c.concat(Object.keys(u)),[]);if(l.length>0){const c=[...new Set(l)].map(u=>`"${u}"`);i.searchParams.set("columns",c.join(","))}}return new ti({method:s,url:i,headers:o,schema:this.schema,body:e,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(e,{onConflict:t,ignoreDuplicates:r=!1,count:n,defaultToNull:s=!0}={}){var i;const o="POST",{url:l,headers:c}=this.cloneRequestState();if(c.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),t!==void 0&&l.searchParams.set("on_conflict",t),n&&c.append("Prefer",`count=${n}`),s||c.append("Prefer","missing=default"),Array.isArray(e)){const u=e.reduce((d,h)=>d.concat(Object.keys(h)),[]);if(u.length>0){const d=[...new Set(u)].map(h=>`"${h}"`);l.searchParams.set("columns",d.join(","))}}return new ti({method:o,url:l,headers:c,schema:this.schema,body:e,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(e,{count:t}={}){var r;const n="PATCH",{url:s,headers:i}=this.cloneRequestState();return t&&i.append("Prefer",`count=${t}`),new ti({method:n,url:s,headers:i,schema:this.schema,body:e,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:e}={}){var t;const r="DELETE",{url:n,headers:s}=this.cloneRequestState();return e&&s.append("Prefer",`count=${e}`),new ti({method:r,url:n,headers:s,schema:this.schema,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function kP(e,t){try{const o=JSON.parse(e);if(o&&typeof o=="object"&&!Array.isArray(o)){var r,n,s,i;return new Si({message:String((r=o.message)!==null&&r!==void 0?r:e),details:(n=o.details)!==null&&n!==void 0?n:"",hint:(s=o.hint)!==null&&s!==void 0?s:"",code:(i=o.code)!==null&&i!==void 0?i:""})}}catch{}return new Si({message:e||t,details:"",hint:"",code:""})}function hv(e,t,r){var n;const s=e;return{success:!1,error:new Si({message:`${(n=s==null?void 0:s.name)!==null&&n!==void 0?n:"FetchError"}: ${s==null?void 0:s.message}`,details:"",hint:"",code:""}),data:null,count:null,status:t,statusText:r}}var TP=class zb{constructor(t,{headers:r={},schema:n,fetch:s,timeout:i,urlLengthLimit:o=8e3,retry:l}={}){this.url=t,this.headers=new Headers(r),this.schemaName=n,this.urlLengthLimit=o;const c=s??globalThis.fetch;i!==void 0&&i>0?this.fetch=(u,d)=>{const h=new AbortController,m=setTimeout(()=>h.abort(),i),p=d==null?void 0:d.signal;if(p){if(p.aborted)return clearTimeout(m),c(u,d);const w=()=>{clearTimeout(m),h.abort()};return p.addEventListener("abort",w,{once:!0}),c(u,ms(ms({},d),{},{signal:h.signal})).finally(()=>{clearTimeout(m),p.removeEventListener("abort",w)})}return c(u,ms(ms({},d),{},{signal:h.signal})).finally(()=>clearTimeout(m))}:this.fetch=c,this.retry=l}from(t){if(!t||typeof t!="string"||t.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new NP(new URL(`${this.url}/${t}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(t){return new zb(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}async getOpenApiSpec(){var t=this,r;const n=new Headers(t.headers);n.set("Accept","application/openapi+json"),t.schemaName&&n.set("Accept-Profile",t.schemaName);const s={};
306n.forEach((u,d)=>{s[d]=u});const i=(r=t.fetch)!==null&&r!==void 0?r:globalThis.fetch;let o;try{var l;o=await Ub(i,`${t.url}/`,{method:"GET",headers:s},(l=t.retry)!==null&&l!==void 0?l:!0)}catch(u){return hv(u,0,"")}let c;try{c=await o.text()}catch(u){return hv(u,o.status,o.statusText)}if(o.ok)try{return{success:!0,error:null,data:JSON.parse(c),count:null,status:o.status,statusText:o.statusText}}catch{}return{success:!1,error:kP(c,o.statusText),data:null,count:null,status:o.status,statusText:o.statusText}}rpc(t,r={},{head:n=!1,get:s=!1,count:i}={}){var o;let l;const c=new URL(`${this.url}/rpc/${t}`);let u;const d=p=>p!==null&&typeof p=="object"&&(!Array.isArray(p)||p.some(d)),h=n&&Object.values(r).some(d);h?(l="POST",u=r):n||s?(l=n?"HEAD":"GET",Object.entries(r).filter(([p,w])=>w!==void 0).map(([p,w])=>[p,Array.isArray(w)?`{${w.join(",")}}`:`${w}`]).forEach(([p,w])=>{c.searchParams.append(p,w)})):(l="POST",u=r);const m=new Headers(this.headers);return h?m.set("Prefer",i?`count=${i},return=minimal`:"return=minimal"):i&&m.set("Prefer",`count=${i}`),new ti({method:l,url:c,headers:m,schema:this.schemaName,body:u,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class RP{constructor(){}static detectEnvironment(){var t;if(typeof WebSocket<"u")return{type:"native",wsConstructor:WebSocket};const r=globalThis;if(typeof globalThis<"u"&&typeof r.WebSocket<"u")return{type:"native",wsConstructor:r.WebSocket};const n=typeof global<"u"?global:void 0;if(n&&typeof n.WebSocket<"u")return{type:"native",wsConstructor:n.WebSocket};if(typeof globalThis<"u"&&typeof r.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&r.EdgeRuntime||typeof navigator<"u"&&(!((t=navigator.userAgent)===null||t===void 0)&&t.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const s=globalThis.process;if(s){const i=s.versions;if(i&&i.node)return{type:"unsupported",error:"Node.js detected but native WebSocket not found.",workaround:"Ensure you are running Node.js 22+ or provide a WebSocket implementation via the transport option."}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const t=this.detectEnvironment();if(t.wsConstructor)return t.wsConstructor;let r=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(r+=` 307 308Suggested solution: ${t.workaround}`),new Error(r)}static isWebSocketSupported(){try{return this.detectEnvironment().type==="native"}catch{return!1}}}const PP="2.117.2",AP=`realtime-js/${PP}`,OP="1.0.0",Bb="2.0.0",IP=Bb,DP=1e4,LP=15e3,MP=1e4,$P=100,Cn={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},Vb={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave",access_token:"access_token"},Wh={connecting:"connecting",open:"open",closing:"closing",closed:"closed"};class FP{constructor(t){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=t??[]}encode(t,r){if(t.event===this.BROADCAST_EVENT&&!(t.payload instanceof ArrayBuffer)&&typeof t.payload.event=="string")return r(this._binaryEncodeUserBroadcastPush(t));let n=[t.join_ref,t.ref,t.topic,t.event,t.payload];return r(JSON.stringify(n))}_binaryEncodeUserBroadcastPush(t){var r;return this._isArrayBuffer((r=t.payload)===null||r===void 0?void 0:r.payload)?this._encodeBinaryUserBroadcastPush(t):this._encodeJsonUserBroadcastPush(t)}_encodeBinaryUserBroadcastPush(t){var r,n;const s=(n=(r=t.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:new ArrayBuffer(0);return this._encodeUserBroadcastPush(t,this.BINARY_ENCODING,s)}_encodeJsonUserBroadcastPush(t){var r,n;const s=(n=(r=t.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:{},o=new TextEncoder().encode(JSON.stringify(s)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,o)}_encodeUserBroadcastPush(t,r,n){var s,i;const o=new TextEncoder,l=o.encode(t.topic),c=o.encode((s=t.ref)!==null&&s!==void 0?s:""),u=o.encode((i=t.join_ref)!==null&&i!==void 0?i:""),d=o.encode(t.payload.event),h=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},m=o.encode(Object.keys(h).length===0?"":JSON.stringify(h));if(u.length>255)throw new Error(`joinRef length ${u.length} exceeds maximum of 255`);if(c.length>255)throw new Error(`ref length ${c.length} exceeds maximum of 255`);if(l.length>255)throw new Error(`topic length ${l.length} exceeds maximum of 255`);if(d.length>255)throw new Error(`userEvent length ${d.length} exceeds maximum of 255`);if(m.length>255)throw new Error(`metadata length ${m.length} exceeds maximum of 255`);const p=this.USER_BROADCAST_PUSH_META_LENGTH+u.length+c.length+l.length+d.length+m.length,w=new ArrayBuffer(this.HEADER_LENGTH+p),g=new DataView(w),v=new Uint8Array(w);let x=0;g.setUint8(x++,this.KINDS.userBroadcastPush),g.setUint8(x++,u.length),g.setUint8(x++,c.length),g.setUint8(x++,l.length),g.setUint8(x++,d.length),g.setUint8(x++,m.length),g.setUint8(x++,r),v.set(u,x),x+=u.length,v.set(c,x),x+=c.length,v.set(l,x),x+=l.length,v.set(d,x),x+=d.length,v.set(m,x),x+=m.length;var y=new Uint8Array(w.byteLength+n.byteLength);return y.set(new Uint8Array(w),0),y.set(new Uint8Array(n),w.byteLength),y.buffer}decode(t,r){if(this._isArrayBuffer(t)){let n=this._binaryDecode(t);return r(n)}if(typeof t=="string"){const n=JSON.parse(t),[s,i,o,l,c]=n;return r({join_ref:s,ref:i,topic:o,event:l,payload:c})}return r({})}_binaryDecode(t){const r=new DataView(t),n=r.getUint8(0),s=new TextDecoder;switch(n){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(t,r,s)}}_decodeUserBroadcast(t,r,n){const s=r.getUint8(1),i=r.getUint8(2),o=r.getUint8(3),l=r.getUint8(4);let c=this.HEADER_LENGTH+4;const u=n.decode(t.slice(c,c+s));c=c+s;const d=n.decode(t.slice(c,c+i));c=c+i;
308const h=n.decode(t.slice(c,c+o));c=c+o;const m=t.slice(c,t.byteLength),p=l===this.JSON_ENCODING?JSON.parse(n.decode(m)):m,w={type:this.BROADCAST_EVENT,event:d,payload:p};return o>0&&(w.meta=JSON.parse(h)),{join_ref:null,ref:null,topic:u,event:this.BROADCAST_EVENT,payload:w}}_isArrayBuffer(t){var r;return t instanceof ArrayBuffer||((r=t==null?void 0:t.constructor)===null||r===void 0?void 0:r.name)==="ArrayBuffer"}_pick(t,r){return!t||typeof t!="object"?{}:Object.fromEntries(Object.entries(t).filter(([n])=>r.includes(n)))}}var ye;(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"})(ye||(ye={}));const fv=(e,t,r={})=>{var n;const s=(n=r.skipTypes)!==null&&n!==void 0?n:[];return t?Object.keys(t).reduce((i,o)=>(i[o]=UP(o,e,t,s),i),{}):{}},UP=(e,t,r,n)=>{const s=t.find(l=>
vendor: 5,530 bytes, line 308
308l.name===e),i=s==null?void 0:s.type,o=r[e];return i&&!n.includes(i)?Wb(i,o):Hh(o)},Wb=(e,t)=>{if(e.charAt(0)==="_"){const r=e.slice(1,e.length);return WP(t,r)}switch(e){case ye.bool:return zP(t);case ye.float4:case ye.float8:case ye.int2:case ye.int4:case ye.int8:case ye.numeric:case ye.oid:return BP(t);case ye.json:case ye.jsonb:return VP(t);case ye.timestamp:return HP(t);case ye.abstime:case ye.date:case ye.daterange:case ye.int4range:case ye.int8range:case ye.money:case ye.reltime:case ye.text:case ye.time:case ye.timestamptz:case ye.timetz:case ye.tsrange:case ye.tstzrange:return Hh(t);default:return Hh(t)}},Hh=e=>e,zP=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},BP=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},VP=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},WP=(e,t)=>{if(typeof e!="string")return e;const r=e.length-1,n=e[r];if(e[0]==="{"&&n==="}"){let i;const o=e.slice(1,r);try{i=JSON.parse("["+o+"]")}catch{i=o?o.split(","):[]}return i.map(l=>Wb(t,l))}return e},HP=e=>typeof e=="string"?e.replace(" ","T"):e,Hb=e=>{const t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),t.pathname===""||t.pathname==="/"?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};var ji=e=>typeof e=="function"?e:function(){return e},qP=typeof self<"u"?self:null,ri=typeof window<"u"?window:null,jr=qP||ri||globalThis,KP="2.0.0",GP=1e4,JP=1e3,YP=100,kr={connecting:0,open:1,closing:2,closed:3},yt={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},Hr={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},qh={longpoll:"longpoll",websocket:"websocket"},QP={complete:4},Kh="base64url.bearer.phx.",cl=class{constructor(e,t,r,n){this.channel=e,this.event=t,this.payload=r||function(){return{}},this.receivedResp=null,this.timeout=n,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(e){this.timeout=e,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:e,response:t,_ref:r}){this.recHooks.filter(n=>n.status===e).forEach(n=>n.callback(t))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},qb=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},XP=class{constructor(e,t,r){this.state=yt.closed,this.topic=e,this.params=ji(t||{}),this.socket=r,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new cl(this,Hr.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new qb(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=yt.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(n=>n.send()),this.pushBuffer=[]}),this.joinPush.receive("error",n=>{this.state=yt.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,n),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=yt.closed,this.socket.remove(this)}),this.onError(n=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,n),this.isJoining()&&this.joinPush.reset(),this.state=yt.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new cl(this,Hr.leave,ji({}),this.timeout).send(),this.state=yt.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(Hr.reply,(n,s)=>{this.trigger(this.replyEventName(s),n)})}join(e=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=e,this.joinedOnce=!0,this.rejoin(),this.joinPush}
vendor: 19,019 bytes, lines 308-309
308teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=yt.closed,this.bindings=[]}onClose(e){this.on(Hr.close,e)}onError(e){return this.on(Hr.error,t=>e(t))}on(e,t){let r=this.bindingRef++;return this.bindings.push({event:e,ref:r,callback:t}),r}off(e,t){this.bindings=this.bindings.filter(r=>!(r.event===e&&(typeof t>"u"||t===r.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,r=this.timeout){if(t=t||{},!this.joinedOnce)throw new Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let n=new cl(this,e,function(){return t},r);return this.canPush()?n.send():(n.startTimeout(),this.pushBuffer.push(n)),n}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=yt.leaving;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(Hr.close,"leave")},r=new cl(this,Hr.leave,ji({}),e);return r.receive("ok",()=>t()).receive("timeout",()=>t()),r.send(),this.canPush()||r.trigger("ok",{}),r}onMessage(e,t,r){return t}filterBindings(e,t,r){return!0}isMember(e,t,r,n){return this.topic!==e?!1:n&&n!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:r,joinRef:n}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=yt.joining,this.joinPush.resend(e))}trigger(e,t,r,n){let s=this.onMessage(e,t,r,n);if(t&&!s)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let i=this.bindings.filter(o=>o.event===e&&this.filterBindings(o,t,r));for(let o=0;o<i.length;o++)i[o].callback(s,r,n||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===yt.closed}isErrored(){return this.state===yt.errored}isJoined(){return this.state===yt.joined}isJoining(){return this.state===yt.joining}isLeaving(){return this.state===yt.leaving}},_c=class{static request(e,t,r,n,s,i,o){if(jr.XDomainRequest){let l=new jr.XDomainRequest;return this.xdomainRequest(l,e,t,n,s,i,o)}else if(jr.XMLHttpRequest){let l=new jr.XMLHttpRequest;return this.xhrRequest(l,e,t,r,n,s,i,o)}else{if(jr.fetch&&jr.AbortController)return this.fetchRequest(e,t,r,n,s,i,o);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(e,t,r,n,s,i,o){let l={method:e,headers:r,body:n},c=null;return s&&(c=new AbortController,setTimeout(()=>c.abort(),s),l.signal=c.signal),jr.fetch(t,l).then(u=>u.text()).then(u=>this.parseJSON(u)).then(u=>o&&o(u)).catch(u=>{u.name==="AbortError"&&i?i():o&&o(null)}),c}static xdomainRequest(e,t,r,n,s,i,o){return e.timeout=s,e.open(t,r),e.onload=()=>{let l=this.parseJSON(e.responseText);o&&o(l)},i&&(e.ontimeout=i),e.onprogress=()=>{},e.send(n),e}static xhrRequest(e,t,r,n,s,i,o,l){e.open(t,r,!0),e.timeout=i;for(let[c,u]of Object.entries(n))e.setRequestHeader(c,u);return e.onerror=()=>l&&l(null),e.onreadystatechange=()=>{if(e.readyState===QP.complete&&l){let c=this.parseJSON(e.responseText);l(c)}},o&&(e.ontimeout=o),e.send(s),e}static parseJSON(e){if(!e||e==="")return null;try{return JSON.parse(e)}catch{return console&&console.log("failed to parse JSON response",e),null}}static serialize(e,t){let r=[];for(var n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;let s=t?`${t}[${n}]`:n,i=e[n];typeof i=="object"?r.push(this.serialize(i,s)):r.push(encodeURIComponent(s)+"="+encodeURIComponent(i))}return r.join("&")}static appendParams(e,t){if(Object.keys(t).length===0)return e;let r=e.match(/\?/)?"&":"?";return`${e}${r}${this.serialize(t)}`}},ZP=e=>{let t="",r=new Uint8Array(e),n=r.byteLength;for(let s=0;s<n;s++)t+=String.fromCharCode(r[s]);return btoa(t)},Gs=class{constructor(e,t){t&&t.length===2&&t[1].startsWith(Kh)&&(this.authToken=atob(t[1].slice(Kh.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=kr.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+qh.websocket),"$1/"+qh.longpoll)}endpointURL(){return _c.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,r){this.close(e,t,r),this.readyState=kr.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===kr.open||this.readyState===kr.connecting}poll(){const e={Accept:"application/json"};this.authToken&&(e["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",e,null,()=>this.ontimeout(),t=>{if(t){var{status:r,token:n,messages:s}=t;if(r===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=n}else r=0;switch(r){case 200:s.forEach(i=>{setTimeout(()=>this.onmessage({data:i}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=kr.open,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${r}`)}})}send(e){typeof e!="string"&&(e=ZP(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(e,t=0){this.awaitingBatchAck=!0;const r=t+YP,n=e.slice(t,r);this.ajax("POST",{"Content-Type":"application/x-ndjson"},n.join(` 309`),()=>this.onerror("timeout"),s=>{!s||s.status!==200?(this.awaitingBatchAck=!1,this.onerror(s&&s.status),this.closeAndRetry(1011,"internal server error",!1)):r<e.length?this.batchSend(e,r):this.batchBuffer.length>0?(this.batchSend(this.batchBuffer),this.batchBuffer=[]):this.awaitingBatchAck=!1})}close(e,t,r){for(let s of this.reqs)s.abort();this.readyState=kr.closed;let n=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:r});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",n)):this.onclose(n)}ajax(e,t,r,n,s){let i,o=()=>{this.reqs.delete(i),n()};i=_c.request(e,this.endpointURL(),t,r,this.timeout,o,l=>{this.reqs.delete(i),this.isActive()&&s(l)}),this.reqs.add(i)}},eA=class No{constructor(t,r={}){let n=r.events||{state:"presence_state",diff:"presence_diff"};this.state=Object.create(null),this.pendingDiffs=[],this.channel=t,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(n.state,s=>{let{onJoin:i,onLeave:o,onSync:l}=this.caller;this.joinRef=this.channel.joinRef(),this.state=No.syncState(this.state,s,i,o),this.pendingDiffs.forEach(c=>{this.state=No.syncDiff(this.state,c,i,o)}),this.pendingDiffs=[],l()}),this.channel.on(n.diff,s=>{let{onJoin:i,onLeave:o,onSync:l}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(s):(this.state=No.syncDiff(this.state,s,i,o),l())})}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}list(t){return No.list(this.state,t)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(t,r,n,s){let i=this.toNullProtoObj(this.clone(t));r=this.toNullProtoObj(r);let o=Object.create(null),l=Object.create(null);return this.map(i,(c,u)=>{r[c]||(l[c]=u)}),this.map(r,(c,u)=>{let d=i[c];if(d){let h=u.metas.map(g=>g.phx_ref),m=d.metas.map(g=>g.phx_ref),p=u.metas.filter(g=>m.indexOf(g.phx_ref)<0),w=d.metas.filter(g=>h.indexOf(g.phx_ref)<0);p.length>0&&(o[c]=u,o[c].metas=p),w.length>0&&(l[c]=this.clone(d),l[c].metas=w)}else o[c]=u}),this.syncDiff(i,{joins:o,leaves:l},n,s)}static syncDiff(t,r,n,s){t=this.toNullProtoObj(t);let{joins:i,leaves:o}=this.clone(r);return n||(n=function(){}),s||(s=function(){}),this.map(i,(l,c)=>{let u=t[l];if(t[l]=this.clone(c),u){let d=t[l].metas.map(m=>m.phx_ref),h=u.metas.filter(m=>d.indexOf(m.phx_ref)<0);t[l].metas.unshift(...h)}n(l,u,c)}),this.map(o,(l,c)=>{let u=t[l];if(!u)return;let d=c.metas.map(h=>h.phx_ref);u.metas=u.metas.filter(h=>d.indexOf(h.phx_ref)<0),s(l,u,c),u.metas.length===0&&delete t[l]}),t}static list(t,r){return r||(r=function(n,s){return s}),this.map(t,(n,s)=>r(n,s))}static map(t,r){return Object.getOwnPropertyNames(t).map(n=>r(n,t[n]))}static toNullProtoObj(t){if(Object.getPrototypeOf(t)===null)return t;let r=Object.create(null);return Object.getOwnPropertyNames(t).forEach(n=>{r[n]=t[n]}),r}static clone(t){return JSON.parse(JSON.stringify(t))}},ul={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let r=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(r))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[r,n,s,i,o]=JSON.parse(e);return t({join_ref:r,ref:n,topic:s,event:i,payload:o})}},binaryEncode(e){let{join_ref:t,ref:r,event:n,topic:s,payload:i}=e,o=new TextEncoder,l=o.encode(t),c=o.encode(r),u=o.encode(s),d=o.encode(n);this.assertFieldSize(l.byteLength,"join_ref"),this.assertFieldSize(c.byteLength,"ref"),this.assertFieldSize(u.byteLength,"topic"),this.assertFieldSize(d.byteLength,"event");let h=this.META_LENGTH+l.byteLength+c.byteLength+u.byteLength+d.byteLength,m=new ArrayBuffer(this.HEADER_LENGTH+h),p=new Uint8Array(m),w=new DataView(m),g=0;w.setUint8(g++,this.KINDS.push),w.setUint8(g++,l.byteLength),w.setUint8(g++,c.byteLength),w.setUint8(g++,u.byteLength),w.setUint8(g++,d.byteLength),p.set(l,g),g+=l.byteLength,p.set(c,g),g+=c.byteLength,p.set(u,g),g+=u.byteLength,p.set(d,g),g+=d.byteLength;var v=new Uint8Array(m.byteLength+i.byteLength);return v.set(p,0),v.set(new Uint8Array(i),m.byteLength),v.buffer},assertFieldSize(e,t){if(e>255)throw new Error(`unable to convert ${t} to binary: must be less than or equal to 255 bytes, but is ${e} bytes`)},binaryDecode(e){let t=new DataView(e),r=t.getUint8(0),n=new TextDecoder;switch(r){case this.KINDS.push:return this.decodePush(e,t,n);case this.KINDS.reply:return this.decodeReply(e,t,n);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,n)}},decodePush(e,t,r){let n=t.getUint8(1),s=t.getUint8(2),i=t.getUint8(3),o=this.HEADER_LENGTH+this.META_LENGTH-1,l=r.decode(e.slice(o,o+n));o=o+n;let c=r.decode(e.slice(o,o+s));o=o+s;let u=r.decode(e.slice(o,o+i));o=o+i;let d=e.slice(o,e.byteLength);return{join_ref:l,ref:null,topic:c,event:u,payload:d}},decodeReply(e,t,r){let n=t.getUint8(1),s=t.getUint8(2),i=t.getUint8(3),o=t.getUint8(4),l=this.HEADER_LENGTH+this.META_LENGTH,c=r.decode(e.slice(l,l+n));l=l+n;let u=r.decode(e.slice(l,l+s));l=l+s;let d=r.decode(e.slice(l,l+i));l=l+i;let h=r.decode(e.slice(l,l+o));l=l+o;let m=e.slice(l,e.byteLength),p={status:h,response:m};return{join_ref:c,ref:u,topic:d,event:Hr.reply,payload:p}},decodeBroadcast(e,t,r){let n=t.getUint8(1),s=t.getUint8(2),i=this.HEADER_LENGTH+2,o=r.decode(e.slice(i,i+n));i=i+n;let l=r.decode(e.slice(i,i+s));i=i+s;let c=e.slice(i,e.byteLength);return{join_ref:null,ref:null,topic:o,event:l,payload:c}}},tA=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||GP,this.transport=t.transport||jr.WebSocket||Gs,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null;let r=null;try{r=jr&&jr.sessionStorage}catch{}this.sessionStore=t.sessionStorage||r,this.establishedConnections=0,this.defaultEncoder=ul.encode.bind(ul),this.defaultDecoder=ul.decode.bind(ul),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==Gs?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let n=null;ri&&ri.addEventListener&&(ri.addEventListener("pagehide",s=>{this.conn&&(this.disconnect(),n=this.connectClock)}),ri.addEventListener("pageshow",s=>{n===this.connectClock&&(n=null,this.connect())}),ri.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=t.autoSendHeartbeat??!0,this.heartbeatCallback=t.heartbeatCallback??(()=>{}),this.rejoinAfterMs=s=>t.rejoinAfterMs?t.rejoinAfterMs(s):[1e3,2e3,5e3][s-1]||1e4,this.reconnectAfterMs=s=>t.reconnectAfterMs?t.reconnectAfterMs(s):[10,50,100,150,200,250,500,1e3,2e3][s-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(s,i,o)=>{console.log(`${s}: ${i}`,o)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=ji(t.params||{}),this.endPoint=`${e}/${qh.websocket}`,this.vsn=t.vsn||KP,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new qb(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{t.beforeReconnect&&await t.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=t.authToken&&ji(t.authToken)}getLongPollTransport(){return Gs}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=_c.appendParams(_c.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return e.charAt(0)!=="/"?e:e.charAt(1)==="/"?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`}disconnect(e,t,r){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,e&&e()},t,r)}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=ji(e)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==Gs?this.connectWithFallback(Gs,this.longPollFallbackMs):this.transportConnect())}log(e,t,r){this.logger&&this.logger(e,t,r)}hasLogger(){return this.logger!==null}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}onHeartbeat(e){this.heartbeatCallback=e}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),r=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let n=this.onMessage(s=>{s.ref===t&&(this.off([n]),e(Date.now()-r))});return!0}transportName(e){switch(e){case Gs:return"LongPoll";default:return e.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let e;this.authToken&&(e=["phoenix",`${Kh}${btoa(this.authToken()).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),e),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=t=>this.onConnError(t),this.conn.onmessage=t=>this.onConnMessage(t),this.conn.onclose=t=>this.onConnClose(t)}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t)}connectWithFallback(e,t=2500){clearTimeout(this.fallbackTimer);let r=!1,n=!0,s,i,o=this.transportName(e),l=c=>{this.log("transport",`falling back to ${o}...`,c),this.off([s,i]),n=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${o}`))return l("memorized");this.fallbackTimer=setTimeout(l,t),i=this.onError(c=>{this.log("transport","error",c),n&&!r&&(clearTimeout(this.fallbackTimer),l(c))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(r=!0,!n){let c=this.transportName(e);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${c}`,"true"),this.log("transport",`established ${c} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(l,t),this.ping(c=>{this.log("transport","connected to primary after",c),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(e){this.log("error","error in heartbeat callback",e)}this.triggerChanError(new Error("heartbeat timeout")),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),JP,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(e,t,r){if(!this.conn)return e&&e();const n=this.conn;this.waitForBufferDone(n,()=>{t?n.close(t,r||""):n.close(),this.waitForSocketClosed(n,()=>{this.conn===n&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e()})})}waitForBufferDone(e,t,r=1){if(r===5||!e.bufferedAmount){t();return}setTimeout(()=>{this.waitForBufferDone(e,t,r+1)},150*r)}waitForSocketClosed(e,t,r=1){if(r===5||e.readyState===kr.closed){t();return}setTimeout(()=>{this.waitForSocketClosed(e,t,r+1)},150*r)}onConnClose(e){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(e),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",e)}onConnError(e){this.hasLogger()&&this.log("transport","error",e);let t=this.transport,r=this.establishedConnections;this.triggerStateCallbacks("error",e,t,r),(t===this.transport||r>0)&&this.triggerChanError(e)}
vendor: 4,209 bytes, line 309
309triggerChanError(e){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(Hr.error,e)})}connectionState(){switch(this.conn&&this.conn.readyState){case kr.connecting:return"connecting";case kr.open:return"open";case kr.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(t=>t!==e)}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([r])=>e.indexOf(r)===-1)}channel(e,t={}){let r=new XP(e,t,this);return this.channels.push(r),r}push(e){if(this.hasLogger()){let{topic:t,event:r,payload:n,ref:s,join_ref:i}=e;this.log("push",`${t} ${r} (${i}, ${s})`,n)}this.isConnected()?this.encode(e,t=>this.conn.send(t)):this.sendBuffer.push(()=>this.encode(e,t=>this.conn.send(t)))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(e){this.log("error","error in heartbeat callback",e)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(e){this.log("error","error in heartbeat callback",e)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,t=>{let{topic:r,event:n,payload:s,ref:i,join_ref:o}=t;if(i&&i===this.pendingHeartbeatRef){const l=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(s.status==="ok"?"ok":"error",l)}catch(c){this.log("error","error in heartbeat callback",c)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${s.status||""} ${r} ${n} ${i&&"("+i+")"||""}`.trim(),s);for(let l=0;l<this.channels.length;l++){const c=this.channels[l];c.isMember(r,n,s,o)&&c.trigger(n,s,i,o)}this.triggerStateCallbacks("message",t)})}triggerStateCallbacks(e,...t){try{this.stateChangeCallbacks[e].forEach(([r,n])=>{try{n(...t)}catch(s){this.log("error",`error in ${e} callback`,s)}})}catch(r){this.log("error",`error triggering ${e} callbacks`,r)}}leaveOpenTopic(e){let t=this.channels.find(r=>r.topic===e&&(r.isJoined()||r.isJoining()));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave())}};class zo{constructor(t,r){const n=nA(r);this.presence=new eA(t.getChannel(),n),this.presence.onJoin((s,i,o)=>{const l=zo.onJoinPayload(s,i,o);t.getChannel().trigger("presence",l)}),this.presence.onLeave((s,i,o)=>{const l=zo.onLeavePayload(s,i,o);t.getChannel().trigger("presence",l)}),this.presence.onSync(()=>{t.getChannel().trigger("presence",{event:"sync"})})}get state(){return zo.transformState(this.presence.state)}static transformState(t){return t=rA(t),Object.getOwnPropertyNames(t).reduce((r,n)=>{const s=t[n];return r[n]=Ml(s),r},{})}static onJoinPayload(t,r,n){const s=pv(r),i=Ml(n);return{event:"join",key:t,currentPresences:s,newPresences:i}}static onLeavePayload(t,r,n){const s=pv(r),i=Ml(n);return{event:"leave",key:t,currentPresences:s,leftPresences:i}}}function Ml(e){return e.metas.map(t=>{const r=Object.getOwnPropertyDescriptors(t),n=Object.defineProperties({},r);return n.presence_ref=n.phx_ref,delete n.phx_ref,delete n.phx_ref_prev,n})}function rA(e){return JSON.parse(JSON.stringify(e))}function nA(e){return(e==null?void 0:e.events)&&{events:e.events}}function pv(e){return e!=null&&e.metas?Ml(e):[]}var mv;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(mv||(mv={}));class sA{get state(){return this.presenceAdapter.state}constructor(t,r){this.channel=t,this.presenceAdapter=new zo(this.channel.channelAdapter,r)}}function iA(e){if(e instanceof Error)return e;if(typeof e=="string")return new Error(e);
309if(e&&typeof e=="object"){const t=e;if(typeof t.code=="number"){const r=typeof t.reason=="string"&&t.reason?` (${t.reason})`:"";return new Error(`socket closed: ${t.code}${r}`,{cause:e})}return new Error("channel error: transport failure",{cause:e})}return new Error("channel error: connection lost")}class oA{constructor(t,r,n){const s=aA(n);this.channel=t.getSocket().channel(r,s),this.socket=t}get state(){return this.channel.state}set state(t){this.channel.state=t}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(t,r){return this.channel.on(t,r)}off(t,r){this.channel.off(t,r)}subscribe(t){return this.channel.join(t)}unsubscribe(t){return this.channel.leave(t)}teardown(){this.channel.teardown()}onClose(t){this.channel.onClose(t)}onError(t){return this.channel.onError(t)}push(t,r,n){let s;try{s=this.channel.push(t,r,n)}catch{throw new Error(`tried to push '${t}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>$P){const i=this.channel.pushBuffer.shift();i.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${i.event}`,i.payload())}return s}updateJoinPayload(t){const r=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},r),t)}canPush(){return this.socket.isConnected()&&this.state===Cn.joined}isJoined(){return this.state===Cn.joined}isJoining(){return this.state===Cn.joining}isClosed(){return this.state===Cn.closed}isLeaving(){return this.state===Cn.leaving}updateFilterBindings(t){this.channel.filterBindings=t}updatePayloadTransform(t){this.channel.onMessage=t}getChannel(){return this.channel}}function aA(e){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},e.config)}}const lA=/[,()"\\]/,cA=e=>lA.test(e)||e!==e.trim(),uA=e=>`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`,gv=e=>{const t=e===null?"null":String(e);return cA(t)?uA(t):t},dA=e=>e===null?"null":String(e),hA=(e,t)=>{if(e==="in"){const r=Array.isArray(t)?t:[t];if(r.length===0)throw new Error("Realtime `in` filter requires at least one value.");return`in.(${Array.from(new Set(r)).map(s=>gv(s)).join(",")})`}return e==="is"?`is.${dA(t)}`:`${e}.${gv(t)}`};class fA{constructor(){this.filters=[]}add(t,r,n,s=!1){const i=s?"not.":"";return this.filters.push(`${t}=${i}${hA(r,n)}`),this}eq(t,r){return this.add(t,"eq",r)}neq(t,r){return this.add(t,"neq",r)}gt(t,r){return this.add(t,"gt",r)}gte(t,r){return this.add(t,"gte",r)}lt(t,r){return this.add(t,"lt",r)}lte(t,r){return this.add(t,"lte",r)}in(t,r){return this.add(t,"in",r)}like(t,r){return this.add(t,"like",r)}ilike(t,r){return this.add(t,"ilike",r)}match(t,r){return this.add(t,"match",r)}imatch(t,r){return this.add(t,"imatch",r)}is(t,r){return this.add(t,"is",r)}isDistinct(t,r){return this.add(t,"isdistinct",r)}not(t,r,n){return this.add(t,r,n,!0)}build(){return this.filters.join(",")}toString(){return this.build()}}var vv;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(vv||(vv={}));var ds;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(ds||(ds={}));var qr;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(qr||(qr={}));class Kr{get state(){return this.channelAdapter.state}set state(t){this.channelAdapter.state=t}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(t,r={config:{}},n){var s,i;if(this.topic=t,this.params=r,this.socket=n,this.bindings={},this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},r.config),this.channelAdapter=new oA(this.socket.socketAdapter,t,this.params),this.presence=new sA(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=Hb(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((i=(s=this.params.config)===null||s===void 0?void 0:s.broadcast)===null||i===void 0)&&i.replay))throw new Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(t,r=this.timeout){var n,s,i,o;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:l,presence:c,private:u,postgres_changes_options:d}}=this.params,h=(s=(n=this.bindings.postgres_changes)===null||n===void 0?void 0:n.map(v=>v.filter))!==null&&s!==void 0?s:[],m=!!this.bindings[ds.PRESENCE]&&this.bindings[ds.PRESENCE].length>0||((i=this.params.config.presence)===null||i===void 0?void 0:i.enabled)===!0,p={},w=Object.assign({broadcast:l,presence:Object.assign(Object.assign({},c),{enabled:m}),postgres_changes:h,private:u},d?{postgres_changes_options:d}:{});this.socket.accessTokenValue&&(p.access_token=this.socket.accessTokenValue),this._onError(v=>{t==null||t(qr.CHANNEL_ERROR,iA(v))}),this._onClose(()=>t==null?void 0:t(qr.CLOSED)),this.updateJoinPayload(Object.assign({config:w},p)),this._updateFilterMessage();const g=d!=null&&d.wait&&h.length>0?Math.max(r,((o=d.timeout)!==null&&o!==void 0?o:LP)+MP):r;this.channelAdapter.subscribe(g).receive("ok",async({postgres_changes:v})=>
309{if(this.socket._isManualToken()||this.socket.setAuth(),v===void 0){t==null||t(qr.SUBSCRIBED);return}this._updatePostgresBindings(v,t)}).receive("error",v=>{this.state=Cn.errored;const x=Object.values(v).join(", ")||"error";t==null||t(qr.CHANNEL_ERROR,new Error(x,{cause:v}))}).receive("timeout",()=>{t==null||t(qr.TIMED_OUT)})}return this}_updatePostgresBindings(t,r){var n;const s=this.bindings.postgres_changes,i=(n=s==null?void 0:s.length)!==null&&n!==void 0?n:0,o=[];for(let l=0;l<i;l++){const c=s[l],{filter:{event:u,schema:d,table:h,filter:m}}=c,p=t&&t[l];if(p&&p.event===u&&Kr.isFilterValueEqual(p.schema,d)&&Kr.isFilterValueEqual(p.table,h)&&Kr.isFilterValueEqual(p.filter,m))o.push(Object.assign(Object.assign({},c),{id:p.id}));else{this.unsubscribe(),this.state=Cn.errored,r==null||r(qr.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=o,this.state!=Cn.errored&&r&&r(qr.SUBSCRIBED)}presenceState(){return this.presence.state}async track(t,r={}){return await this.send({type:"presence",event:"track",payload:t},r)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,r,n){const s=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),i=t===ds.PRESENCE||t===ds.POSTGRES_CHANGES;if(s&&i)throw this.socket.log("channel",`cannot add \`${t}\` callbacks for ${this.topic} after \`subscribe()\`.`),new Error(`cannot add \`${t}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(t,r,n)}async httpSend(t,r,n={}){var s;if(r==null)return Promise.reject(new Error("Payload is required for httpSend()"));const i=r instanceof ArrayBuffer||ArrayBuffer.isView(r),o={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":i?"application/octet-stream":"application/json"};this.socket.accessTokenValue&&(o.Authorization=`Bearer ${this.socket.accessTokenValue}`);const l=new URL(this.broadcastEndpointURL);l.pathname+=`/${encodeURIComponent(this.subTopic)}/events/${encodeURIComponent(t)}`,this.private&&l.searchParams.set("private","true");const c={method:"POST",headers:o,body:i?r:JSON.stringify(r)},u=await this._fetchWithTimeout(l.toString(),c,(s=n.timeout)!==null&&s!==void 0?s:this.timeout);if(u.status===202)return{success:!0};if(u.status===404)return Promise.reject(new Error("httpSend() requires Realtime server v2.97.0 or newer; the endpoint returned 404. Update your Supabase CLI to a recent version, or upgrade the Realtime server in your self-hosted setup. See https://github.com/supabase/supabase-js/blob/master/packages/core/realtime-js/migrations/httpsend-server-version.md"));let d=u.statusText;try{const h=await u.json();d=h.error||h.message||d}catch{}return Promise.reject(new Error(d))}async send(t,r={}){var n,s;if(!this.channelAdapter.canPush()&&t.type==="broadcast"){const i="Realtime send() is automatically falling back to REST API. This behavior will be deprecated
309in the future. Please use httpSend() explicitly for REST delivery.";this.socket.hasLogger()?this.socket.log("channel",i):console.warn(i);const{event:o,payload:l}=t,c={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(c.Authorization=`Bearer ${this.socket.accessTokenValue}`);const u={method:"POST",headers:c,body:JSON.stringify({messages:[{topic:this.subTopic,event:o,payload:l,private:this.private}]})};try{const d=await this._fetchWithTimeout(this.broadcastEndpointURL,u,(n=r.timeout)!==null&&n!==void 0?n:this.timeout);return await((s=d.body)===null||s===void 0?void 0:s.cancel()),d.ok?"ok":"error"}catch(d){return d instanceof Error&&d.name==="AbortError"?"timed out":"error"}}else return new Promise(i=>{var o,l,c;const u=this.channelAdapter.push(t.type,t,r.timeout||this.timeout);t.type==="broadcast"&&!(!((c=(l=(o=this.params)===null||o===void 0?void 0:o.config)===null||l===void 0?void 0:l.broadcast)===null||c===void 0)&&c.ack)&&i("ok"),u.receive("ok",()=>i("ok")),u.receive("error",()=>i("error")),u.receive("timeout",()=>i("timed out"))})}updateJoinPayload(t){this.channelAdapter.updateJoinPayload(t)}async unsubscribe(t=this.timeout){return new Promise(r=>{this.channelAdapter.unsubscribe(t).receive("ok",()=>r("ok")).receive("timeout",()=>r("timed out")).receive("error",()=>r("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(t,r,n){const s=new AbortController,i=setTimeout(()=>s.abort(),n),o=await this.socket.fetch(t,Object.assign(Object.assign({},r),{signal:s.signal}));return clearTimeout(i),o}_on(t,r,n){var s;const i=t.toLocaleLowerCase(),o=r==null?void 0:r.filter;if((o instanceof fA||typeof o=="object"&&o!==null&&typeof o.build=="function")&&(r=Object.assign(Object.assign({},r),{filter:o.build()})),i===ds.POSTGRES_CHANGES&&((s=this.bindings[i])===null||s===void 0?void 0:s.find(d=>Kr.isSamePostgresFilter(d.filter,r))))return this.socket.log("error",`duplicate \`postgres_changes\` binding for ${this.topic} ignored`,r),this;const l=this.channelAdapter.on(t,n),c={type:i,filter:r,callback:n,ref:l};return this.bindings[i]?this.bindings[i].push(c):this.bindings[i]=[c],this._updateFilterMessage(),this}_onClose(t){this.channelAdapter.onClose(t)}_onError(t){this.channelAdapter.onError(t)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((t,r,n)=>{var s,i,o,l,c,u,d;const h=t.event.toLocaleLowerCase();if(this._notThisChannelEvent(h,n))return!1;const m=(s=this.bindings[h])===null||s===void 0?void 0:s.find(p=>p.ref===t.ref);if(!m)return!0;if(["broadcast","presence","postgres_changes"].includes(h))if("id"in m){const p=m.id,w=(i=m.filter)===null||i===void 0?void 0:i.event;return p&&((o=r.ids)===null||o===void 0?void 0:o.includes(p))&&(w==="*"||(w==null?void 0:w.toLocaleLowerCase())===((l=r.data)===null||l===void 0?void 0:l.type.toLocaleLowerCase()))}else{const p=(u=(c=m==null?void 0:m.filter)===null||c===void 0?void 0:c.event)===null||u===void 0?void 0:u.toLocaleLowerCase();return p==="*"||p===((d=r==null?void 0:r.event)===null||d===void 0?void 0:d.toLocaleLowerCase())}else return m.type.toLocaleLowerCase()===h})}_notThisChannelEvent(t,r){const{close:n,error:s,leave:i,join:o}=Vb;return r&&[n,s,i,o].includes(t)&&r!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((t,r,n)=>{if(typeof r=="object"&&"ids"in r){const s=r.data,{schema:i,table:o,commit_timestamp:l,type:c,errors:u}=s;return Object.assign(Object.assign({},{schema:i,table:o,commit_timestamp:l,eventType:c,new:{},old:{},errors:u}),this._getPayloadRecords(s))}return r})}copyBindings(t){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const r in t.bindings)for(const n of t.bindings[r])this._on(n.type,n.filter,n.callback)}static isFilterValueEqual(t,r){return(t??void 0)===(r??void 0)}static isSamePostgresFilter(t,r){var n,s,i,o;const l=(s=(n=t==null?void 0:t.select)===null||n===void 0?void 0:n.join())!==null&&s!==void 0?s:void 0,c=(o=(i=r==null?void 0:r.select)===null||i===void 0?void 0:i.join())!==null&&o!==void 0?o:void 0;return(t==null?void 0:t.event)===(r==null?void 0:r.event)&&Kr.isFilterValueEqual(t==null?void 0:t.schema,r==null?void 0:r.schema)&&Kr.isFilterValueEqual(t==null?void 0:t.table,r==null?void 0:r.table)&&Kr.
309isFilterValueEqual(t==null?void 0:t.filter,r==null?void 0:r.filter)&&l===c}_getPayloadRecords(t){const r={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(r.new=fv(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(r.old=fv(t.columns,t.old_record)),r}}class pA{constructor(t,r){this.socket=new tA(t,r)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(t){this.socket.heartbeatCallback=t}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(t,r,n,s=1e4){return new Promise(i=>{setTimeout(()=>i("timeout"),s),this.socket.disconnect(()=>{t(),i("ok")},r,n)})}push(t){this.socket.push(t)}log(t,r,n){this.socket.log(t,r,n)}hasLogger(){return this.socket.hasLogger()}makeRef(){return this.socket.makeRef()}onOpen(t){this.socket.onOpen(t)}onClose(t){this.socket.onClose(t)}onError(t){this.socket.onError(t)}onMessage(t){this.socket.onMessage(t)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==Wh.connecting}isDisconnecting(){return this.socket.connectionState()==Wh.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const yv={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},mA=[1e3,2e3,5e3,1e4],gA=1e4;function vA(){const e=new Map;return{get length(){return e.size},clear(){e.clear()},getItem(t){return e.has(t)?e.get(t):null},key(t){var r;return(r=Array.from(e.keys())[t])!==null&&r!==void 0?r:null},removeItem(t){e.delete(t)},setItem(t,r){e.set(t,String(r))}}}function yA(){try{if(typeof globalThis<"u"&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return vA()}const xA=` 310 addEventListener("message", (e) => { 311 if (e.data.event === "start") { 312 setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); 313 } 314 });`;class wA{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(t,r){var n;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={},this.ref=0,this.serializer=new FP,this._manuallySetToken=!1,this._authPromise=null,this._authGeneration=0,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._resolveFetch=i=>i?(...o)=>i(...o):(...o)=>fetch(...o),!(!((n=r==null?void 0:r.params)===null||n===void 0)&&n.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=r.params.apikey;const s=this._initializeOptions(r);this.socketAdapter=new pA(t,s),this.httpEndpoint=Hb(t),this.fetch=this._resolveFetch(r==null?void 0:r.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(t){const r=t.message;throw new Error(`WebSocket not available: ${r}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(t,r){return this._cancelPendingDisconnect(),this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},t,r)}getChannels(){return this.channels}async removeChannel(t){const r=await t.unsubscribe();return r==="ok"&&t.teardown(),r}async removeAllChannels(){const t=this.channels.map(async n=>{const s=await n.unsubscribe();return n.teardown(),s}),r=await Promise.all(t);return await this.disconnect(),r}log(t,r,n){this.socketAdapter.log(t,r,n)}hasLogger(){return this.socketAdapter.hasLogger()}connectionState(){return this.socketAdapter.connectionState()||Wh.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(t,r={config:{}}){const n=`realtime:${t}`,s=this.getChannels().find(i=>i.topic===n);if(s)return s;{const i=new Kr(`realtime:${t}`,r,this);return this._cancelPendingDisconnect(),this.channels.push(i),i}}push(t){this.socketAdapter.push(t)}async setAuth(t=null){const r=++this._authGeneration,n=this._performAuth(t,r);r===this._authGeneration&&(this._authPromise=n);try{await n}finally{this._authPromise===n&&(this._authPromise=null)}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(t){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(t)}_makeRef(){return this.socketAdapter.makeRef()}_remove(t){this.channels=this.channels.filter(r=>r.topic!==t.topic),this.channels.length===0&&(this.log("transport","no channels remaining, scheduling disconnect"),this._schedulePendingDisconnect())}_schedulePendingDisconnect(){if(this._cancelPendingDisconnect(),this._disconnectOnEmptyChannelsAfterMs===0){this.log("transport","disconnecting immediately - no channels"),this.disconnect();return}
314this._pendingDisconnectTimer=setTimeout(()=>{this._pendingDisconnectTimer=null,this.channels.length===0&&(this.log("transport","deferred disconnect fired - no channels, disconnecting"),this.disconnect())},this._disconnectOnEmptyChannelsAfterMs),this.log("transport",`deferred disconnect scheduled in ${this._disconnectOnEmptyChannelsAfterMs}ms`)}_cancelPendingDisconnect(){this._pendingDisconnectTimer!==null&&(this.log("transport","pending disconnect cancelled - channel activity detected"),clearTimeout(this._pendingDisconnectTimer),this._pendingDisconnectTimer=null)}async _performAuth(t,r){let n,s=!1;if(t)n=t,s=!0;else if(this.accessToken)try{n=await this.accessToken()}catch(i){this.log("error","Error fetching access token from callback",i),n=this.accessTokenValue}else n=this.accessTokenValue;r===this._authGeneration&&(this.accessToken?this._manuallySetToken=!1:s&&(this._manuallySetToken=!0),this.accessTokenValue!=n&&(this.accessTokenValue=n,this.channels.forEach(i=>{const o={access_token:n,version:AP};i.updateJoinPayload(o),i.joinedOnce&&i.channelAdapter.isJoined()&&i.channelAdapter.push(Vb.access_token,{access_token:n})})))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this._isManualToken()||this.setAuth().catch(r=>{this.log("error",`Error setting auth in ${t}`,r)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(r=>{this.log("error","error waiting for auth on connect",r)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(t=>{t.ref&&t.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(t){return(r,n)=>{r!=="disconnected"&&(r=="sent"&&this._setAuthSafely(),t&&t(r,n))}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=r=>{this.log("worker","worker error",r.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(t){let r;if(t)r=t;else{const n=new Blob([xA],{type:"application/javascript"});r=URL.createObjectURL(n)}return r}_initializeOptions(t){var r,n,s,i,o,l,c,u,d,h,m,p;this.worker=(r=t==null?void 0:t.worker)!==null&&r!==void 0?r:!1,this.accessToken=(n=t==null?void 0:t.accessToken)!==null&&n!==void 0?n:null;const w={};w.timeout=(s=t==null?void 0:t.timeout)!==null&&s!==void 0?s:DP,w.heartbeatIntervalMs=(i=t==null?void 0:t.heartbeatIntervalMs)!==null&&i!==void 0?i:yv.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=(o=t==null?void 0:t.disconnectOnEmptyChannelsAfterMs)!==null&&o!==void 0?o:2*((l=t==null?void 0:t.heartbeatIntervalMs)!==null&&l!==void 0?l:yv.HEARTBEAT_INTERVAL),w.transport=(c=t==null?void 0:t.transport)!==null&&c!==void 0?c:RP.getWebSocketConstructor(),w.params=t==null?void 0:t.params,w.logger=t==null?void 0:t.logger,w.heartbeatCallback=this._wrapHeartbeatCallback(t==null?void 0:t.heartbeatCallback),w.sessionStorage=(u=t==null?void 0:t.sessionStorage)!==null&&u!==void 0?u:yA(),w.reconnectAfterMs=(d=t==null?void 0:t.reconnectAfterMs)!==null&&d!==void 0?d:y=>mA[y-1]||gA;let g,v;const x=(h=t==null?void 0:t.vsn)!==null&&h!==void 0?h:IP;switch(x){case OP:g=(y,b)=>b(JSON.stringify(y)),v=(y,b)=>b(JSON.parse(y));break;case Bb:g=this.serializer.encode.bind(this.serializer),v=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${w.vsn}`)}if(w.vsn=x,w.encode=(m=t==null?void 0:t.encode)!==null&&m!==void 0?m:g,w.decode=(p=t==null?void 0:t.decode)!==null&&p!==void 0?p:v,w.beforeReconnect=this._reconnectAuth.bind(this),(t!=null&&t.logLevel||t!=null&&t.log_level)&&(this.logLevel=t.logLevel||t.log_level,w.params=Object.assign(Object.assign({},w.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t==null?void 0:t.workerUrl,w.autoSendHeartbeat=!this.worker}return w}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}
314var pa=class extends Error{constructor(e,t){var r;super(e),this.name="IcebergError",this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown=t.icebergType==="CommitStateUnknownException"||[500,502,504].includes(t.status)&&((r=t.icebergType)==null?void 0:r.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function bA(e,t,r){const n=new URL(t,e);if(r)for(const[s,i]of Object.entries(r))i!==void 0&&n.searchParams.set(s,i);return n.toString()}async function _A(e){return!e||e.type==="none"?{}:e.type==="bearer"?{Authorization:`Bearer ${e.token}`}:e.type==="header"?{[e.name]:e.value}:e.type==="custom"?await e.getHeaders():{}}function SA(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:r,path:n,query:s,body:i,headers:o}){const l=bA(e.baseUrl,n,s),c=await _A(e.auth),u=await t(l,{method:r,headers:{...i?{"Content-Type":"application/json"}:{},...c,...o},body:i?JSON.stringify(i):void 0}),d=await u.text(),h=(u.headers.get("content-type")||"").includes("application/json"),m=h&&d?JSON.parse(d):d;if(!u.ok){const p=h?m:void 0,w=p==null?void 0:p.error;throw new pa((w==null?void 0:w.message)??`Request failed with status ${u.status}`,{status:u.status,icebergType:w==null?void 0:w.type,icebergCode:w==null?void 0:w.code,details:p})}return{status:u.status,headers:u.headers,data:m}}}}function dl(e){return e.join("�")}var jA=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:dl(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(n=>({namespace:n}))}async createNamespace(e,t){const r={namespace:e.namespace,properties:t==null?void 0:t.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:r})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${dl(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${dl(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${dl(e.namespace)}`}),!0}catch(t){if(t instanceof pa&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(r){if(r instanceof pa&&r.status===409)return;throw r}}};function Js(e){return e.join("�")}var EA=class{constructor(e,t="",r){this.client=e,this.prefix=t,this.accessDelegation=r}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Js(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){const r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Js(e.namespace)}/tables`,body:t,headers:r})).data.metadata}async updateTable(e,t){const r=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Js(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":r.data["metadata-location"],metadata:r.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Js(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String((t==null?void 0:t.purge)??!1)}})}async loadTable(e){const t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Js(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){const t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Js(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(r){if(r instanceof pa&&r.status===404)return!1;throw r}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(r){if(r instanceof pa&&r.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw r}}},CA=class{constructor(e){var n;let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const r=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=SA({baseUrl:r,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=(n=e.accessDelegation)==null?void 0:n.join(","),this.namespaceOps=new jA(this.client,t),this.tableOps=new EA(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}
314async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}};function ma(e){"@babel/helpers - typeof";return ma=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ma(e)}function NA(e,t){if(ma(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ma(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kA(e){var t=NA(e,"string");return ma(t)=="symbol"?t:t+""}function TA(e,t,r){return(t=kA(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Y(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?xv(Object(r),!0).forEach(function(n){TA(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xv(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var fu=class extends Error{constructor(e,t="storage",r,n){super(e),this.__isStorageError=!0,this.namespace=t,this.name=t==="vectors"?"StorageVectorsError":"StorageError",this.status=r,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function pu(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var Gh=class extends fu{constructor(e,t,r,n="storage",s){super(e,n,t,r),this.name=n==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=t,this.statusCode=r,this.co
314de=s}toJSON(){return Y(Y({},super.toJSON()),{},{code:this.code})}},Kb=class extends fu{constructor(e,t,r="storage"){super(e,r),this.name=r==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=t}};function Sc(e,t,r){const n=Y({},e),s=t.toLowerCase();for(const i of Object.keys(n))i.toLowerCase()===s&&delete n[i];return n[s]=r,n}function RA(e){const t={};for(const[r,n]of Object.entries(e))t[r.toLowerCase()]=n;return t}const PA=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),AA=e=>{if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Jh=e=>{if(Array.isArray(e))return e.map(r=>Jh(r));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([r,n])=>{const s=r.replace(/([-_][a-z])/gi,i=>i.toUpperCase().replace(/[-_]/g,""));t[s]=Jh(n)}),t},OA=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e),Yh=e=>e.split("/").map(encodeURIComponent).join("/"),wv=e=>{if(typeof e=="object"&&e!==null){const t=e;if(typeof t.msg=="string")return t.msg;if(typeof t.message=="string")return t.message;if(typeof t.error_description=="string")return t.error_description;if(typeof t.error=="string")return t.error;if(typeof t.error=="object"&&t.error!==null){const r=t.error;if(typeof r.message=="string")return r.message}}return JSON.stringify(e)},IA=async(e,t,r,n)=>{if(e!==null&&typeof e=="object"&&"json"in e&&typeof e.json=="function"){const s=e;let i=parseInt(String(s.status),10);Number.isFinite(i)||(i=500),s.json().then(o=>{const l=(o==null?void 0:o.statusCode)||(o==null?void 0:o.code)||i+"";t(new Gh(wv(o),i,l,n,o==null?void 0:o.code))}).catch(()=>{const o=i+"";t(new Gh(s.statusText||`HTTP ${i} error`,i,o,n))})}else t(new Kb(wv(e),e,n))},DA=(e,t,r,n)=>{const s={method:e,headers:(t==null?void 0:t.headers)||{}};if(e==="GET"||e==="HEAD"||!n)return Y(Y({},s),r);if(AA(n)){var i;const o=(t==null?void 0:t.headers)||{};let l;for(const[c,u]of Object.entries(o))c.toLowerCase()==="content-type"&&(l=u);s.headers=Sc(o,"Content-Type",(i=l)!==null&&i!==void 0?i:"application/json"),s.body=JSON.stringify(n)}else s.body=n;return t!=null&&t.duplex&&(s.duplex=t.duplex),Y(Y({},s),r)};async function bo(e,t,r,n,s,i,o){return new Promise((l,c)=>{e(r,DA(t,n,s,i)).then(u=>{if(!u.ok)throw u;if(n!=null&&n.noResolveJson)return u;if(o==="vectors"){const d=u.headers.get("content-type");if(u.headers.get("content-length")==="0"||u.status===204)return{};if(!d||!d.includes("application/json"))return{}}return u.json()}).then(u=>l(u)).catch(u=>IA(u,c,n,o))})}function Gb(e="storage"){return{get:async(t,r,n,s)=>bo(t,"GET",r,n,s,void 0,e),post:async(t,r,n,s,i)=>bo(t,"POST",r,s,i,n,e),put:async(t,r,n,s,i)=>bo(t,"PUT",r,s,i,n,e),head:async(t,r,n,s)=>bo(t,"HEAD",r,Y(Y({},n),{},{noResolveJson:!0}),s,void 0,e),remove:async(t,r,n,s,i)=>bo(t,"DELETE",r,s,i,n,e)}}const LA=Gb("storage"),{get:Ei,post:ur,put:jc,head:MA,remove:Ci}=LA,Pt=Gb("vectors");var oo=class{constructor(e,t={},r,n="storage"){this.shouldThrowOnError=!1,this.url=e,this.headers=RA(t),this.fetch=PA(r),this.namespace=n}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=Sc(this.headers,e,t),this}async handleOperation(e){var t=this;try{return{data:await e(),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(pu(r))return{data:null,error:r};throw r}}};let Jb;Jb=Symbol.toStringTag;var $A=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[Jb]="StreamDownloadBuilder",this.promise=null}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(pu(t))return{data:null,error:t};throw t}}};let Yb;Yb=Symbol.toStringTag;var FA=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[Yb]="BlobDownloadBuilder",this.promise=null}asStream(){return new $A(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var e=this;try{return{data:await(await e.downloadFn()).blob(),error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(pu(t))return{data:null,error:t};throw t}}};const fd={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},bv={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var UA=class extends oo{constructor(e,t={},r,n){super(e,t,n,"storage"),this.bucketId=r}async uploadOrUpdate(e,t,r,n){var s=this;return s.handleOperation(async()=>{let i;const o=Y(Y({},bv),n);let l=Y(Y({},s.headers),e==="POST"&&{"x-upsert":String(o.upsert)});const c=o.metadata;if(typeof Blob<"u"&&r instanceof Blob?(i=new FormData,i.append("cacheControl",o.cacheControl),c&&i.append("metadata",s.encodeMetadata(c)),i.append("",r)):typeof FormData<"u"&&r instanceof FormData?(i=r,i.has("cacheControl")||i.append("cacheControl",o.cacheControl),c&&!i.has("metadata")&&i.append("metadata",s.encodeMetadata(c))):(i=r,l["cache-control"]=`max-age=${o.cacheControl}`,l["content-type"]=o.contentType,c&&(l["x-metadata"]=s.toBase64(s.encodeMetadata(c))),(typeof ReadableStream<"u"&&i instanceof ReadableStream||i&&typeof i=="object"&&"pipe"in i&&typeof i.pipe=="function")&&!o.duplex&&(o.duplex="half")),n!=null&&n.headers)for(const[m,p]of Object.entries(n.headers))l=Sc(l,m,p);const u=s._removeEmptyFolders(t),d=s._getFinalPath(u),h=await(e=="PUT"?jc:ur)(s.fetch,`${s.url}/object/${d}`,i,Y({headers:l},o!=null&&o.duplex?{duplex:o.duplex}:{}));return{path:u,id:h.Id,fullPath:h.Key}})}async upload(e,t,r){return this.uploadOrUpdate("POST",e,t,r)}async uploadToSignedUrl(e,t,r,n){var s=this;const i=s._removeEmptyFolders(e),o=s._getFinalPath(i),l=new URL(s.url+`/object/upload/sign/${o}`);return l.searchParams.set("token",t),s.handleOperation(async()=>{let c;const u=Y(Y({},bv),n);let d=Y(Y({},s.headers),{"x-upsert":String(u.upsert)});const h=u.metadata;if(typeof Blob<"u"&&r instanceof Blob?(c=new FormData,c.append("cacheControl",u.cacheControl),h&&c.append("metadata",s.encodeMetadata(h)),c.append("",r)):typeof FormData<"u"&&r instanceof FormData?(c=r,c.has("cacheControl")||c.append("cacheControl",u.cacheControl),h&&!c.has("metadata")&&c.append("metadata",s.encodeMetadata(h))):(c=r,d["cache-control"]=`max-age=${u.cacheControl}`,d["content-type"]=u.contentType,h&&(d["x-metadata"]=s.toBase64(s.encodeMetadata(h))),(typeof ReadableStream<"u"&&c instanceof ReadableStream||c&&typeof c=="object"&&"pipe"in c&&typeof c.pipe=="function")&&!u.duplex&&(u.duplex="half")),n!=null&&n.headers)for(const[m,p]of Object.entries(n.headers))d=Sc(d,m,p);return{path:i,fullPath:(await jc(s.fetch,l.toString(),c,Y({headers:d},u!=null&&u.duplex?{duplex:u.duplex}:{}))).Key}})}async createSignedUploadUrl(e,t){var r=this;return r.handleOperation(async()=>{let n=r._getFinalPath(e);const s=Y({},r.headers);t!=null&&t.upsert&&(s["x-upsert"]="true");const i=await ur(r.fetch,`${r.url}/object/upload/sign/${n}`,{},{headers:s}),o=new URL(r.url+i.url),l=o.searchParams.get("token");if(!l)throw new fu("No token returned by API");return{signedUrl:o.toString(),path:e,token:l}})}async update(e,t,r){return this.uploadOrUpdate("PUT",e,t,r)}async move(e,t,r){var n=this;return n.handleOperation(async()=>await ur(n.fetch,`${n.url}/object/move`,{bucketId:n.bucketId,sourceKey:e,destinationKey:t,de
314stinationBucket:r==null?void 0:r.destinationBucket,sourceVersionId:r==null?void 0:r.sourceVersionId},{headers:n.headers}))}async copy(e,t,r){var n=this;return n.handleOperation(async()=>({path:(await ur(n.fetch,`${n.url}/object/copy`,{bucketId:n.bucketId,sourceKey:e,destinationKey:t,destinationBucket:r==null?void 0:r.destinationBucket,sourceVersionId:r==null?void 0:r.sourceVersionId},{headers:n.headers})).Key}))}async createSignedUrl(e,t,r){var n=this;return n.handleOperation(async()=>{let s=n._getFinalPath(e);const i=typeof(r==null?void 0:r.transform)=="object"&&r.transform!==null&&Object.keys(r.transform).length>0;let o=await ur(n.fetch,`${n.url}/object/sign/${s}`,Y(Y({expiresIn:t},i?{transform:r.transform}:{}),(r==null?void 0:r.versionId)!=null?{versionId:r.versionId}:{}),{headers:n.headers});const l=new URLSearchParams;r!=null&&r.download&&l.set("download",r.download===!0?"":r.download),(r==null?void 0:r.cacheNonce)!=null&&l.set("cacheNonce",String(r.cacheNonce));const c=l.toString();return{signedUrl:encodeURI(`${n.url}${o.signedURL}${c?`&${c}`:""}`)}})}async createSignedUrls(e,t,r){var n=this;return n.handleOperation(async()=>{const s=await ur(n.fetch,`${n.url}/object/sign/${n.bucketId}`,{expiresIn:t,paths:e},{headers:n.headers}),i=new URLSearchParams;r!=null&&r.download&&i.set("download",r.download===!0?"":r.download),(r==null?void 0:r.cacheNonce)!=null&&i.set("cacheNonce",String(r.cacheNonce));const o=i.toString();return s.map(l=>Y(Y({},l),{},{signedUrl:l.signedURL?encodeURI(`${n.url}${l.signedURL}${o?`&${o}`:""}`):null}))})}download(e,t,r){const n=typeof(t==null?void 0:t.transform)=="object"&&t.transform!==null&&Object.keys(t.transform).length>0?"render/image/authenticated":"object",s=new URLSearchParams;t!=null&&t.transform&&this.applyTransformOptsToQuery(s,t.transform),(t==null?void 0:t.cacheNonce)!=null&&s.set("cacheNonce",String(t.cacheNonce)),(t==null?void 0:t.versionId)!=null&&s.set("versionId",String(t.versionId));const i=s.toString(),o=this._getFinalPath(e),l=()=>Ei(this.fetch,`${this.url}/${n}/${o}${i?`?${i}`:""}`,{headers:this.headers,noResolveJson:!0},r);return new FA(l,this.shouldThrowOnError)}async info(e,t){var r=this;const n=r._getFinalPath(e),s=new URLSearchParams;(t==null?void 0:t.versionId)!=null&&s.set("versionId",String(t.versionId));const i=s.toString();return r.handleOperation(async()=>Jh(await Ei(r.fetch,`${r.url}/object/info/${n}${i?`?${i}`:""}`,{headers:r.headers})))}async exists(e){var t=this;const r=t._getFinalPath(e);try{return await MA(t.fetch,`${t.url}/object/${r}`,{headers:t.headers}),{data:!0,error:null}}catch(s){if(t.shouldThrowOnError)throw s;if(pu(s)){var n;const i=s instanceof Gh?s.status:s instanceof Kb?(n=s.originalError)===null||n===void 0?void 0:n.status:void 0;if(i!==void 0&&[400,404].includes(i))return{data:!1,error:s}}throw s}}getPublicUrl(e,t){const r=this._getFinalPath(e),n=new URLSearchParams;t!=null&&t.download&&n.set("download",t.download===!0?"":t.download),t!=null&&t.transform&&this.applyTransformOptsToQuery(n,t.transform),(t==null?void 0:t.cacheNonce)!=null&&n.set("cacheNonce",String(t.cacheNonce)),(t==null?void 0:t.versionId)!=null&&n.set("versionId",String(t.versionId));const s=n.toString(),i=typeof(t==null?void 0:t.transform)=="object"&&t.transform!==null&&Object.keys(t.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${i}/public/${r}`)+(s?`?${s}`:"")}}}async remove(e){var t=this;return t.handleOperation(async()=>await Ci(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async purgeCache(e,t,r){var n=this;return n.handleOperation(async()=>{const s=Yh(n._getFinalPath(e)),i=new URLSearchParams;t!=null&&t.transformations&&i.set("transformations","true");const o=i.toString();return await Ci(n.fetch,`${n.url}/cdn/${s}${o?`?${o}`:""}`,{},{headers:n.headers},r)})}async list(e,t,r){var n=this;return n.handleOperation(async()=>{const s=t!=null&&t.sortBy?Y(Y({},fd.sortBy),t.sortBy):fd.sortBy,i=Y(Y(Y({},fd),t),{},{sortBy:s,prefix:e||""});return await ur(n.fetch,`${n.url}/object/list/${n.bucketId}`,i,{headers:n.headers},r)})}async listV2(e,t){var r=this;return r.handleOperation(async()=>{const n=Y({},e);return await ur(r.fetch,`${r.url}/object/list-v2/${r.bucketId}`,n,{headers:r.headers},t)})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(e,t){return t.width&&e.set("width",t.width.toString()),t.height&&e.set("height",t.height.toString()),t.resize&&e.set("resize",t.resize),t.format&&e.set("format",t.format),t.quality&&e.set("qual
314ity",t.quality.toString()),e}};const zA="2.117.2",Da={"X-Client-Info":`storage-js/${zA}`};var BA=class extends oo{constructor(e,t={},r,n){const s=new URL(e);n!=null&&n.useNewHostname&&/supabase\.(co|in|red)$/.test(s.hostname)&&!s.hostname.includes("storage.supabase.")&&(s.hostname=s.hostname.replace("supabase.","storage.supabase."));const i=s.href.replace(/\/$/,""),o=Y(Y({},Da),t);super(i,o,r,"storage")}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const r=t.listBucketOptionsToQueryString(e);return await Ei(t.fetch,`${t.url}/bucket${r}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Ei(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var r=this;return r.handleOperation(async()=>await ur(r.fetch,`${r.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes,versioning_status:t.versioningStatus},{headers:r.headers}))}async updateBucket(e,t){var r=this;return r.handleOperation(async()=>await jc(r.fetch,`${r.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes,versioning_status:t.versioningStatus},{headers:r.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await ur(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Ci(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}async getBucketLifecycle(e){var t=this;return t.handleOperation(async()=>await Ei(t.fetch,t.bucketLifecycleUrl(e),{headers:t.headers}))}async updateBucketLifecycle(e,t){var r=this;return r.handleOperation(async()=>await jc(r.fetch,r.bucketLifecycleUrl(e),t,{headers:r.headers}))}async deleteBucketLifecycle(e){var t=this;return t.handleOperation(async()=>await Ci(t.fetch,t.bucketLifecycleUrl(e),{},{headers:t.headers}))}async purgeBucketCache(e,t,r){var n=this;return n.handleOperation(async()=>{const s=new URLSearchParams;t!=null&&t.transformations&&s.set("transformations","true");const i=s.toString();return await Ci(n.fetch,`${n.url}/cdn/${Yh(e)}${i?`?${i}`:""}`,{},{headers:n.headers},r)})}bucketLifecycleUrl(e){return`${this.url}/bucket/${Yh(e)}/lifecycle`}listBucketOptionsToQueryString(e){const t={};return e&&("limit"in e&&(t.limit=String(e.limit)),"offset"in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?"?"+new URLSearchParams(t).toString():""}},VA=class extends oo{constructor(e,t={},r){const n=e.replace(/\/$/,""),s=Y(Y({},Da),t);super(n,s,r,"storage")}async createBucket(e){var t=this;return t.handleOperation(async()=>await ur(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const r=new URLSearchParams;(e==null?void 0:e.limit)!==void 0&&r.set("limit",e.limit.toString()),(e==null?void 0:e.offset)!==void 0&&r.set("offset",e.offset.toString()),e!=null&&e.sortColumn&&r.set("sortColumn",e.sortColumn),e!=null&&e.sortOrder&&r.set("sortOrder",e.sortOrder),e!=null&&e.search&&r.set("search",e.search);const n=r.toString(),s=n?`${t.url}/bucket?${n}`:`${t.url}/bucket`;return await Ei(t.fetch,s,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Ci(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!OA(e))throw new fu("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const r=new CA({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}),n=this.shouldThrowOnError;return new Proxy(r,{get(s,i){const o=s[i];return typeof o!="function"?o:async(...l)=>{try{return{data:await o.apply(s,l),error:null}}catch(c){if(n)throw c;return{data:null,error:c}}}}})}},WA=class extends oo{constructor(e,t={},r){const n=e.replace(/\/$/,""),s=Y(Y({},Da),{},{"Content-Type":"application/json"},t);super(n,s,r,"vectors")}async createIndex(e){var t=this;return t.handleOperation(async()=>await Pt.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var r=this;return r.handleOperation(async()=>await Pt.post(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await Pt.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var r=this;return r.handleOperation(async()=>await Pt.post(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers})||{})}},HA=class extends oo{constructor(e,t={},r){const n=e.replace(/\/$/,""),s=Y(Y({},Da),{},{"Content-Type":"application/json"},t);super(n,s,r,"vectors")}async putVectors(e){var t=this;if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return t.handleOperation(async()=>await Pt.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await Pt.post(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}))}async listVectors(e){var t=this;if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");
314if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return t.handleOperation(async()=>await Pt.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await Pt.post(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}))}async deleteVectors(e){var t=this;if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return t.handleOperation(async()=>await Pt.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},qA=class extends oo{constructor(e,t={},r){const n=e.replace(/\/$/,""),s=Y(Y({},Da),{},{"Content-Type":"application/json"},t);super(n,s,r,"vectors")}async createBucket(e){var t=this;return t.handleOperation(async()=>await Pt.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Pt.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await Pt.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Pt.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},KA=class extends qA{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new GA(this.url,this.headers,e,this.fetch)}async createBucket(e){var t=()=>super.createBucket,r=this;return t().call(r,e)}async getBucket(e){var t=()=>super.getBucket,r=this;return t().call(r,e)}async listBuckets(e={}){var t=()=>super.listBuckets,r=this;return t().call(r,e)}async deleteBucket(e){var t=()=>super.deleteBucket,r=this;return t().call(r,e)}},GA=class extends WA{constructor(e,t,r,n){super(e,t,n),this.vectorBucketName=r}async createIndex(e){var t=()=>super.createIndex,r=this;return t().call(r,Y(Y({},e),{},{vectorBucketName:r.vectorBucketName}))}async listIndexes(e={}){var t=()=>super.listIndexes,r=this;return t().call(r,Y(Y({},e),{},{vectorBucketName:r.vectorBucketName}))}async getIndex(e){var t=()=>super.getIndex,r=this;return t().call(r,r.vectorBucketName,e)}async deleteIndex(e){var t=()=>super.deleteIndex,r=this;return t().call(r,r.vectorBucketName,e)}index(e){return new JA(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},JA=class extends HA{constructor(e,t,r,n,s){super(e,t,s),this.vectorBucketName=r,this.indexName=n}async putVectors(e){var t=()=>super.putVectors,r=this;return t().call(r,Y(Y({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async getVectors(e){var t=()=>super.getVectors,r=this;return t().call(r,Y(Y({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,r=this;return t().call(r,Y(Y({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,r=this;return t().call(r,Y(Y({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,r=this;return t().call(r,Y(Y({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}},YA=class extends BA{constructor(e,t={},r,n){super(e,t,r,n)}from(e){return new UA(this.url,this.headers,e,this.fetch)}get vectors(){return new KA(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new VA(this.url+"/iceberg",this.headers,this.fetch)}};function mu(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}const Qb="2.117.2",Gr=30*1e3,ko=3,pd=ko*Gr,QA=2*Gr,XA="http://localhost:9999",ZA="supabase.auth.token",eO={"X-Client-Info":`gotrue-js/${Qb}`},Qh="X-Supabase-Api-Version",Xb={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},tO=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,gs="sb_flow_id",rO=5,nO=10*60*1e3;
314class ga extends Error{constructor(t,r,n){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function L(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class sO extends ga{constructor(t,r,n){super(t,r,n),this.name="AuthApiError",this.status=r,this.code=n}}function _v(e){return L(e)&&e.name==="AuthApiError"}class mr extends ga{constructor(t,r){super(t),this.name="AuthUnknownError",this.originalError=r}}class $r extends ga{constructor(t,r,n,s){super(t,n,s),this.name=r,this.status=n}}class qe extends $r{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function hl(e){return L(e)&&e.name==="AuthSessionMissingError"}class Ys extends $r{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class fl extends $r{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class pl extends $r{constructor(t,r=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}function iO(e){return L(e)&&e.name==="AuthImplicitGrantRedirectError"}class Sv extends $r{constructor(t,r=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class oO extends $r{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class $l extends $r{constructor(t,r){super(t,"AuthRetryableFetchError",r,void 0)}}function ml(e){return L(e)&&e.name==="AuthRetryableFetchError"}class jv extends $r{constructor(t="Refresh result discarded: session state changed mid-flight (e.g., concurrent signOut)"){super(t,"AuthRefreshDiscardedError",409,void 0)}}function Ev(e){return L(e)&&e.name==="AuthRefreshDiscardedError"}class Cv extends $r{constructor(t,r,n){super(t,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}class Ec extends $r{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const Cc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),Nv=` 315\r=`.split(""),aO=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<Nv.length;t+=1)e[Nv[t].charCodeAt(0)]=-2;for(let t=0;t<Cc.length;t+=1)e[Cc[t].charCodeAt(0)]=t;return e})();function kv(e,t,r){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){const n=t.queue>>t.queuedBits-6&63;r(Cc[n]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const n=t.queue>>t.queuedBits-6&63;r(Cc[n]),t.queuedBits-=6}}function Zb(e,t,r){const n=aO[e];if(n>-1)for(t.queue=t.queue<<6|n,t.queuedBits+=6;t.queuedBits>=8;)r(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(n===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function Tv(e){const t=[],r=o=>{t.push(String.fromCodePoint(o))},n={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},i=o=>{uO(o,n,r)};for(let o=0;o<e.length;o+=1)Zb(e.charCodeAt(o),s,i);return t.join("")}function lO(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 cO(e,t){for(let r=0;r<e.length;r+=1){let n=e.charCodeAt(r);if(n>55295&&n<=56319){const s=(n-55296)*1024&65535;n=(e.charCodeAt(r+1)-56320&65535|s)+65536,r+=1}lO(n,t)}}function uO(e,t,r){if(t.utf8seq===0){if(e<=127){r(e);return}for(let n=1;n<6;n+=1)if(!(e>>7-n&1)){t.utf8seq=n;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&r(t.codepoint)}}function Ni(e){const t=[],r={queue:0,queuedBits:0},n=s=>{t.push(s)};for(let s=0;s<e.length;
315s+=1)Zb(e.charCodeAt(s),r,n);return new Uint8Array(t)}function dO(e){const t=[];return cO(e,r=>t.push(r)),new Uint8Array(t)}function vs(e){const t=[],r={queue:0,queuedBits:0},n=s=>{t.push(s)};return e.forEach(s=>kv(s,r,n)),kv(null,r,n),t.join("")}function e1(e){return Math.round(Date.now()/1e3)+e}function hO(){return Symbol("auth-callback")}const Qe=()=>typeof window<"u"&&typeof document<"u",as={tested:!1,writable:!1},t1=()=>{if(!Qe())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(as.tested)return as.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),as.tested=!0,as.writable=!0}catch{as.tested=!0,as.writable=!1}return as.writable};function Rv(e){const t={},r=new URL(e);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((s,i)=>{t[i]=s})}catch{}return r.searchParams.forEach((n,s)=>{t[s]=n}),t}const r1=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),fO=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",Qr=async(e,t,r)=>{await e.setItem(t,JSON.stringify(r))},lt=async(e,t)=>{const r=await e.getItem(t);if(!r)return null;try{return JSON.parse(r)}catch{return null}},bt=async(e,t)=>{await e.removeItem(t)};class gu{constructor(){this.promise=new gu.promiseConstructor((t,r)=>{this.resolve=t,this.reject=r})}}gu.promiseConstructor=Promise;function gl(e){const t=e.split(".");if(t.length!==3)throw new Ec("Invalid JWT structure");for(let n=0;n<t.length;n++)if(!tO.test(t[n]))throw new Ec("JWT not in base64url format");return{header:JSON.parse(Tv(t[0])),payload:JSON.parse(Tv(t[1])),signature:Ni(t[2]),raw:{header:t[0],payload:t[1]}}}async function pO(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function mO(e,t){return new Promise((n,s)=>{(async()=>{for(let i=0;i<1/0;i++)try{const o=await e(i);if(!t(i,null,o)){n(o);return}}catch(o){if(!t(i,o)){s(o);return}}})()})}function n1(e){return("0"+e.toString(16)).substr(-2)}function gO(){const t=new Uint32Array(56);if(typeof crypto>"u"){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=r.length;let s="";for(let i=0;i<56;i++)s+=r.charAt(Math.floor(Math.random()*n));return s}return crypto.getRandomValues(t),Array.from(t,n1).join("")}async function vO(e){const r=new TextEncoder().encode(e),n=await crypto.subtle.digest("SHA-256",r),s=new Uint8Array(n);return Array.from(s).map(i=>String.fromCharCode(i)).join("")}async function yO(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;const r=await vO(e);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}const xO=/^[a-zA-Z0-9_-]{8,64}$/;function Fl(e){return typeof e=="string"&&xO.test(e)?e:null}function wO(){if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function"){const t=new Uint8Array(16);return crypto.getRandomValues(t),Array.from(t,n1).join("")}let e="";for(let t=0;t<32;t++)e+=Math.floor(Math.random()*16).toString(16);return e}const Gi=(e,t)=>`${e}-flow-${t}-code-verifier`,va=e=>`${e}-flows-code-verifier`;async function Up(e,t){const r=await lt(e,va(t));return Array.isArray(r)?r.filter(n=>Fl(n)!==null):[]}async function bO(e,t,r,n,s){await Qr(e,Gi(t,r),n);const i=(await Up(e,t)).filter(o=>o!==r);for(i.push(r);i.length>rO;){const o=i.shift();await bt(e,Gi(t,o)),s==null||s(o)}await Qr(e,va(t),i),await Qr(e,`${t}-code-verifier`,n)}async function _O(e,t,r){if(r){const s=await lt(e,Gi(t,r));return{verifier:typeof s=="string"?s:null,flowId:r}}const n=await lt(e,`${t}-code-verifier`);return{verifier:typeof n=="string"?n:null,flowId:null}}async function or(e,t,r){const n=`${t}-code-verifier`;if(!r){await bt(e,n);return}const s=Gi(t,r),i=await lt(e,s);await bt(e,s);const o=await Up(e,t),l=o.filter(c=>c!==r);l.length!==o.length&&(l.length>0?await Qr(e,va(t),l):await bt(e,va(t))),i!=null&&i===await lt(e,n)&&await bt(e,n)}async function SO(e,t){const r=await Up(e,t);for(const n of r)await bt(e,Gi(t,n));await bt(e,va(t)),await bt(e,`${t}-code-verifier`)}function jO(e,t){const r=e.indexOf("#");let n=r===-1?e:e.slice(0,r);const s=r===-1?"":e.slice(r),i=n.indexOf("?");if(i!==-1){const l=n.slice(0,i),c=n.slice(i+1).split("&").filter(u=>u!==""&&u!==gs&&!u.startsWith(`${gs}=`));n=c.length>0?`${l}?${c.join("&")}`:l}const o=n.includes("?")?"&":"?";return`${n}${o}${gs}=${encodeURIComponent(t)}${s}`}async function EO(e,t,r=!1,n){const s=gO();let i=s;r&&(i+="/recovery");const o=wO();await bO(e,t,o,i,n);const l=await yO(s);return[l,s===l?"plain":"s256",o]}const CO=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function NO(e){const t=e.headers.get(Qh);if(!t||!t.match(CO))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function kO(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 TO(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 RO=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function zr(e){if(!RO.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function _o(e){if(!e.recoveryCodes)throw new Error("@supabase/auth-js: the MFA recovery codes API is experimental and disabled by default. Enable it by passing `auth: { experimental: { recoveryCodes: true } }` to createClient (or to the GoTrueClient constructor).")}function md(){const e={};return new Proxy(e,{get:(t,r)=>{if(r==="__isUserNotAvailableProxy")return!0;
315if(typeof r=="symbol"){const n=r.toString();if(n==="Symbol(Symbol.toPrimitive)"||n==="Symbol(Symbol.toStringTag)"||n==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${r}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function PO(e,t){return new Proxy(e,{get:(r,n,s)=>{if(n==="__isInsecureUserWarningProxy")return!0;if(typeof n=="symbol"){const i=n.toString();if(i==="Symbol(Symbol.toPrimitive)"||i==="Symbol(Symbol.toStringTag)"||i==="Symbol(util.inspect.custom)"||i==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(r,n,s)}return!t.value&&typeof n=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),t.value=!0),Reflect.get(r,n,s)}})}function Pv(e){return JSON.parse(JSON.stringify(e))}const us=e=>{if(typeof e=="object"&&e!==null){const t=e;if(typeof t.msg=="string")return t.msg;if(typeof t.message=="string")return t.message;if(typeof t.error_description=="string")return t.error_description;if(typeof t.error=="string")return t.error}return JSON.stringify(e)},Av=[500,501,502,503,504,520,521,522,523,524,525,526,527,528,529,530];async function Ov(e){var t;if(!fO(e))throw new $l(us(e),0);let r;try{r=await e.json()}catch(i){throw Av.includes(e.status)?new $l(e.statusText||`HTTP ${e.status}`,e.status):new mr(us(i),i)}if(Av.includes(e.status))throw new $l(us(r),e.status);let n;const s=NO(e);if(s&&s.getTime()>=Xb["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?n=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(n=r.error_code),n){if(n==="weak_password")throw new Cv(us(r),e.status,((t=r.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(n==="session_not_found")throw new qe}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((i,o)=>i&&typeof o=="string",!0))throw new Cv(us(r),e.status,r.weak_password.reasons);throw new sO(us(r),e.status||500,n)}const AO=(e,t,r,n)=>{const s={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?s:(s.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),s.body=JSON.stringify(n),Object.assign(Object.assign({},s),r))};async function W(e,t,r,n){var s;const i=Object.assign({},n==null?void 0:n.headers);i[Qh]||(i[Qh]=Xb["2024-01-01"].name),n!=null&&n.jwt&&(i.Authorization=`Bearer ${n.jwt}`);const o=(s=n==null?void 0:n.query)!==null&&s!==void 0?s:{};n!=null&&n.redirectTo&&(o.redirect_to=n.redirectTo);const l=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",c=await OO(e,t,r+l,{headers:i,noResolveJson:n==null?void 0:n.noResolveJson},{},n==null?void 0:n.body);return n!=null&&n.xform?n==null?void 0:n.xform(c):{data:Object.assign({},c),error:null}}async function OO(e,t,r,n,s,i){const o=AO(t,n,s,i);let l;try{l=await e(r,Object.assign({},o))}catch(c){throw new $l(us(c),0)}if(l.ok||await Ov(l),n!=null&&n.noResolveJson)return l;try{return await l.json()}catch(c){await Ov(c)}}function Wt(e){var t;let r=null;LO(e)&&(r=Object.assign({},e),e.expires_at||(r.expires_at=e1(e.expires_in)));const n=(t=e.user)!==null&&t!==void 0?t:typeof(e==null?void 0:e.id)=="string"?e:null;return{data:{session:r,user:n},error:null}}function Iv(e){const t=Wt(e);return!t.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((r,n)=>r&&typeof n=="string",!0)&&(t.data.weak_password=e.weak_password),t}function Nn(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function IO(e){return{data:e,error:null}}function DO(e){const{action_link:t,email_otp:r,hashed_token:n,redirect_to:s,verification_type:i}=e,o=mu(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),l={action_link:t,email_otp:r,hashed_token:n,redirect_to:s,verification_type:i},c=Object.assign({},o);return{data:{properties:l,user:c},error:null}}function Dv(e){return e}function LO(e){return!!e.access_token&&!!e.refresh_token&&!!e.expires_in}const gd=["global","local","others"];class MO{constructor({url:t="",headers:r={},fetch:n,experimental:s}){this.url=t,this.headers=r,this.fetch=r1(n),this.experimental=s??{},this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)},this.passkey={listPasskeys:this._adminListPasskeys.bind(this),deletePasskey:this._adminDeletePasskey.bind(this)}}async signOut(t,r=gd[0]){if(gd.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${gd.join(", ")}`);try{return await W(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(n){if(L(n))return{data:null,error:n};throw n}}async inviteUserByEmail(t,r={}){try{return await W(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:Nn})}catch(n){if(L(n))return{data:{user:null},error:n};throw n}}async generateLink(t){try{const{options:r}=t,n=mu(t,["options"]),s=Object.assign(Object.assign({},n),r);return"newEmail"in n&&(s.new_email=n==null?void 0:n.newEmail,delete s.newEmail),await W(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:DO,redirectTo:r==null?void 0:r.redirectTo})}catch(r){if(L(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(t){try{return await W(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:Nn})}catch(r){if(L(r))return{data:{user:null},error:r};throw r}}async listUsers(t){var r,n,s,i,o,l,c;try{const u={nextPage:null,lastPage:0,total:0},d=await W(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=t==null?void 0:t.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(i=(s=t==null?void 0:t.perPage)===null||s===void 0?void 0:s.toString())!==null&&i!==void 0?i:""},xform:Dv});if(d.error)throw d.error;const h=await d.json(),m=(o=d.headers.get("x-total-count"))!==null&&o!==void 0?o:0,p=(c=(l=d.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return p.length>
3150&&(p.forEach(w=>{const g=parseInt(w.split(";")[0].split("=")[1].substring(0,1)),v=JSON.parse(w.split(";")[1].split("=")[1]);u[`${v}Page`]=g}),u.total=parseInt(m)),{data:Object.assign(Object.assign({},h),u),error:null}}catch(u){if(L(u))return{data:{users:[]},error:u};throw u}}async getUserById(t){zr(t);try{return await W(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:Nn})}catch(r){if(L(r))return{data:{user:null},error:r};throw r}}async updateUserById(t,r){zr(t);try{return await W(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:r,headers:this.headers,xform:Nn})}catch(n){if(L(n))return{data:{user:null},error:n};throw n}}async deleteUser(t,r=!1){zr(t);try{return await W(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:r},xform:Nn})}catch(n){if(L(n))return{data:{user:null},error:n};throw n}}async _listFactors(t){zr(t.userId);try{const{data:r,error:n}=await W(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:s=>({data:{factors:s},error:null})});return{data:r,error:n}}catch(r){if(L(r))return{data:null,error:r};throw r}}async _deleteFactor(t){zr(t.userId),zr(t.id);try{return{data:await W(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(r){if(L(r))return{data:null,error:r};throw r}}async _listOAuthClients(t){var r,n,s,i,o,l,c;try{const u={nextPage:null,lastPage:0,total:0},d=await W(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=t==null?void 0:t.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(i=(s=t==null?void 0:t.perPage)===null||s===void 0?void 0:s.toString())!==null&&i!==void 0?i:""},xform:Dv});if(d.error)throw d.error;const h=await d.json(),m=(o=d.headers.get("x-total-count"))!==null&&o!==void 0?o:0,p=(c=(l=d.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return p.length>0&&(p.forEach(w=>{const g=parseInt(w.split(";")[0].split("=")[1].substring(0,1)),v=JSON.parse(w.split(";")[1].split("=")[1]);u[`${v}Page`]=g}),u.total=parseInt(m)),{data:Object.assign(Object.assign({},h),u),error:null}}catch(u){if(L(u))return{data:{clients:[]},error:u};throw u}}async _createOAuthClient(t){try{return await W(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(L(r))return{data:null,error:r};throw r}}async _getOAuthClient(t){try{return await W(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(L(r))return{data:null,error:r};throw r}}async _updateOAuthClient(t,r){try{return await W(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(L(n))return{data:null,error:n};throw n}}async _deleteOAuthClient(t){try{return await W(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(L(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(t){try{return await W(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(L(r))return{data:null,error:r};throw r}}async _listCustomProviders(t){try{const r={};return t!=null&&t.type&&(r.type=t.type),await W(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:r,xform:n=>{var s;return{data:{providers:(s=n==null?void 0:n.providers)!==null&&s!==void 0?s:[]},error:null}}})}catch(r){if(L(r))return{data:{providers:[]},error:r};throw r}}async _createCustomProvider(t){try{return await W(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:t,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(L(r))return{data:null,error:r};throw r}}async _getCustomProvider(t){try{return await W(this.fetch,"GET",`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(L(r))return{data:null,error:r};throw r}}async _updateCustomProvider(t,r){try{return await W(this.fetch,"PUT",`${this.url}/admin/custom-providers/${t}`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(L(n))return{data:null,error:n};throw n}}async _deleteCustomProvider(t){try{return await W(this.fetch,"DELET
315E",`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(L(r))return{data:null,error:r};throw r}}async _adminListPasskeys(t){zr(t.userId);try{return await W(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/passkeys`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(L(r))return{data:null,error:r};throw r}}async _adminDeletePasskey(t){zr(t.userId),zr(t.passkeyId);try{return await W(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/passkeys/${t.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(L(r))return{data:null,error:r};throw r}}}function Lv(e={}){return{getItem:t=>e[t]||null,setItem:(t,r)=>{e[t]=r},removeItem:t=>{delete e[t]}}}globalThis&&t1()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug");class $O extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}function FO(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function s1(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function UO(e){return parseInt(e,16)}function zO(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,n=>n.toString(16).padStart(2,"0")).join("")}function BO(e){var t;const{chainId:r,domain:n,expirationTime:s,issuedAt:i=new Date,nonce:o,notBefore:l,requestId:c,resources:u,scheme:d,uri:h,version:m}=e;{if(!Number.isInteger(r))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!n)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(o&&o.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${o}`);if(!h)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(m!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${m}`);if(!((t=e.statement)===null||t===void 0)&&t.includes(` 316`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const p=s1(e.address),w=d?`${d}://${n}`:n,g=e.statement?`${e.statement} 317`:"",v=`${w} wants you to sign in with your Ethereum account: 318${p} 319 320${g}`;let x=`URI: ${h} 321Version: ${m} 322Chain ID: ${r}${o?` 323Nonce: ${o}`:""} 324Issued At: ${i.toISOString()}`;if(s&&(x+=` 325Expiration Time: ${s.toISOString()}`),l&&(x+=` 326Not Before: ${l.toISOString()}`),c&&(x+=` 327Request ID: ${c}`),u){let y=` 328Resources:`;for(const b of u){if(!b||typeof b!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${b}`);y+=` 329- ${b}`}x+=y}return`${v} 330${x}`}class $e extends Error{constructor({message:t,code:r,cause:n,name:s}){var i;super(t,{cause:n}),this.__isWebAuthnError=!0,this.name=(i=s??(n instanceof Error?n.name:void 0))!==null&&i!==void 0?i:"Unknown Error",this.code=r}toJSON(){return{name:this.name,message:this.message,code:this.code}}}class Nc extends $e{constructor(t,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:t}),this.name="WebAuthnUnknownError",this.originalError=r}}function VO({error:e,options:t}){var r,n,s;const{publicKey:i}=t;if(!i)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new $e({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((r=i.authenticatorSelection)===null||r===void 0?void 0:r.requireResidentKey)===!0)return new $e({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&((n=i.authenticatorSelection)===null||n===void 0?void 0:n.userVerification)==="required")return new $e({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((s=i.authenticatorSelection)===null||s===void 0?void 0:s.userVerification)==="required")return new $e({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if(e.name==="InvalidStateError")return new $e({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new $e({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return i.pubKeyCredParams.filter(l=>l.type==="public-key").length===0?new $e({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new $e({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){const o=window.location.hostname;if(i1(o)){if(i.rp.id!==o)return new $e({message:`The RP ID "${i.rp.id}
330" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new $e({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(i.user.id.byteLength<1||i.user.id.byteLength>64)return new $e({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if(e.name==="UnknownError")return new $e({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new $e({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function WO({error:e,options:t}){const{publicKey:r}=t;if(!r)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new $e({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new $e({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const n=window.location.hostname;if(i1(n)){if(r.rpId!==n)return new $e({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new $e({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new $e({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new $e({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class HO{createNewAbortSignal(){if(this.controller){const r=new Error("Cancelling existing WebAuthn API call for new one");r.name="AbortError",this.controller.abort(r)}const t=new AbortController;return this.controller=t,t.signal}cancelCeremony(){if(this.controller){const t=new Error("Manually cancelling existing WebAuthn API call");t.name="AbortError",this.controller.abort(t),this.controller=void 0}}}const Xh=new HO;function Mv(e){if(!e)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(e);const{challenge:t,user:r,excludeCredentials:n}=e,s=mu(e,["challenge","user","excludeCredentials"]),i=Ni(t).buffer,o=Object.assign(Object.assign({},r),{id:Ni(r.id).buffer}),l=Object.assign(Object.assign({},s),{challenge:i,user:o});if(n&&n.length>0){l.excludeCredentials=new Array(n.length);for(let c=0;c<n.length;c++){const u=n[c];l.excludeCredentials[c]=Object.assign(Object.assign({},u),{id:Ni(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return l}function $v(e){if(!e)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(e);const{challenge:t,allowCredentials:r}=e,n=mu(e,["challenge","allowCredentials"]),s=Ni(t).buffer,i=Object.assign(Object.assign({},n),{challenge:s});if(r&&r.length>0){i.allowCredentials=new Array(r.length);for(let o=0;o<r.length;o++){const l=r[o];i.allowCredentials[o]=Object.assign(Object.assign({},l),{id:Ni(l.id).buffer,type:l.type||"public-key",transports:l.transports})}}return i}function Fv(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const r=e;return{id:e.id,rawId:e.id,response:{attestationObject:vs(new Uint8Array(e.response.attestationObject)),clientDataJSON:vs(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function Uv(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const r=e,n=e.getClientExtensionResults(),s=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:vs(new Uint8Array(s.authenticatorData)),clientDataJSON:vs(new Uint8Array(s.clientDataJSON)),signature:vs(new Uint8Array(s.signature)),userHandle:s.userHandle?vs(new Uint8Array(s.userHandle)):void 0},type:"public-key",clientExtensionResults:n,authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function i1(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function kc(){var e,t;return!!(Qe()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.create)=="function"&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.get)=="function")}async function o1(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Nc("Browser returned unexpected credential type",t)}:{data:null,error:new Nc("Empty credential response",t)}}
330catch(t){return{data:null,error:VO({error:t,options:e})}}}async function a1(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Nc("Browser returned unexpected credential type",t)}:{data:null,error:new Nc("Empty credential response",t)}}catch(t){return{data:null,error:WO({error:t,options:e})}}}const qO={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},KO={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function Tc(...e){const t=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),r=s=>s instanceof ArrayBuffer||ArrayBuffer.isView(s),n={};for(const s of e)if(s)for(const i in s){const o=s[i];if(o!==void 0)if(Array.isArray(o))n[i]=o;else if(r(o))n[i]=o;else if(t(o)){const l=n[i];t(l)?n[i]=Tc(l,o):n[i]=Tc(o)}else n[i]=o}return n}function GO(e,t){return Tc(qO,e,t||{})}function JO(e,t){return Tc(KO,e,t||{})}class YO{constructor(t){this.client=t,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(t){return this.client.mfa.enroll(Object.assign(Object.assign({},t),{factorType:"webauthn"}))}async _challenge({factorId:t,webauthn:r,friendlyName:n,signal:s},i){var o;try{const{data:l,error:c}=await this.client.mfa.challenge({factorId:t,webauthn:r});if(!l)return{data:null,error:c};const u=s??Xh.createNewAbortSignal();if(l.webauthn.type==="create"){const{user:d}=l.webauthn.credential_options.publicKey;if(!d.name){const h=n;if(h)d.name=`${d.id}:${h}`;else{const p=(await this.client.getUser()).data.user,w=((o=p==null?void 0:p.user_metadata)===null||o===void 0?void 0:o.name)||(p==null?void 0:p.email)||(p==null?void 0:p.id)||"User";d.name=`${d.id}:${w}`}}d.displayName||(d.displayName=d.name)}switch(l.webauthn.type){case"create":{const d=GO(l.webauthn.credential_options.publicKey,i==null?void 0:i.create),{data:h,error:m}=await o1({publicKey:d,signal:u});return h?{data:{factorId:t,challengeId:l.id,webauthn:{type:l.webauthn.type,credential_response:h}},error:null}:{data:null,error:m}}case"request":{const d=JO(l.webauthn.credential_options.publicKey,i==null?void 0:i.request),{data:h,error:m}=await a1(Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:d,signal:u}));return h?{data:{factorId:t,challengeId:l.id,webauthn:{type:l.webauthn.type,credential_response:h}},error:null}:{data:null,error:m}}}}catch(l){return L(l)?{data:null,error:l}:{data:null,error:new mr("Unexpected error in challenge",l)}}}async _verify({challengeId:t,factorId:r,webauthn:n}){return this.client.mfa.verify({factorId:r,challengeId:t,webauthn:n})}async _authenticate({factorId:t,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},i){if(!r)return{data:null,error:new ga("rpId is required for WebAuthn authentication")};try{if(!kc())return{data:null,error:new mr("Browser does not support WebAuthn",null)};const{data:o,error:l}=await this.challenge({factorId:t,webauthn:{rpId:r,rpOrigins:n},signal:s},{request:i});if(!o)return{data:null,error:l};const{webauthn:c}=o;return this._verify({factorId:t,challengeId:o.challengeId,webauthn:{type:c.type,rpId:r,rpOrigins:n,credential_response:c.credential_response}})}catch(o){return L(o)?{data:null,error:o}:{data:null,error:new mr("Unexpected error in authenticate",o)}}}async _register({friendlyName:t,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},i){if(!r)return{data:null,error:new ga("rpId is required for WebAuthn registration")};try{if(!kc())return{data:null,error:new mr("Browser does not support WebAuthn",null)};const{data:o,error:l}=await this._enroll({friendlyName:t});if(!o)return await this.client.mfa.listFactors().then(d=>{var h;
330return(h=d.data)===null||h===void 0?void 0:h.all.find(m=>m.factor_type==="webauthn"&&m.friendly_name===t&&m.status==="unverified")}).then(d=>d?this.client.mfa.unenroll({factorId:d==null?void 0:d.id}):void 0),{data:null,error:l};const{data:c,error:u}=await this._challenge({factorId:o.id,friendlyName:o.friendly_name,webauthn:{rpId:r,rpOrigins:n},signal:s},{create:i});return c?this._verify({factorId:o.id,challengeId:c.challengeId,webauthn:{rpId:r,rpOrigins:n,type:c.webauthn.type,credential_response:c.webauthn.credential_response}}):{data:null,error:u}}catch(o){return L(o)?{data:null,error:o}:{data:null,error:new mr("Unexpected error in register",o)}}}}FO();const QO={url:XA,storageKey:ZA,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:eO,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}},Qs={};let zv=!1;class ya{get jwks(){var t,r;return(r=(t=Qs[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(t){Qs[this.storageKey]=Object.assign(Object.assign({},Qs[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,r;return(r=(t=Qs[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){Qs[this.storageKey]=Object.assign(Object.assign({},Qs[this.storageKey]),{cachedAt:t})}constructor(t){var r,n,s;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.lastRefreshFailure=null,this._sessionRemovalEpoch=0,this.initializePromise=null,this._pendingInitNotifications=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lock=null,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const i=Object.assign(Object.assign({},QO),t);if(this.storageKey=i.storageKey,this.instanceID=(r=ya.nextInstanceID[this.storageKey])!==null&&r!==void 0?r:0,ya.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!i.debug,typeof i.debug=="function"&&(this.logger=i.debug),this.instanceID>0&&Qe()){const o=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(o),this.logDebugMessages&&console.trace(o)}if(this.persistSession=i.persistSession,this.autoRefreshToken=i.autoRefreshToken,this.experimental=(n=i.experimental)!==null&&n!==void 0?n:{},this.admin=new MO({url:i.url,headers:i.headers,fetch:i.fetch,experimental:this.experimental}),this.url=i.url,this.headers=i.headers,this.fetch=r1(i.fetch),this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,this.throwOnError=i.throwOnError,this.lockAcquireTimeout=i.lockAcquireTimeout,i.lock!=null&&(this.lock=i.lock,zv||(zv=!0,console.warn(`${this._logPrefix()} The "lock" option is deprecated and will be removed in v3. The client now coordinates session refreshes without a lock, so most apps can drop the option. See https://github.com/supabase/supabase-js/blob/master/packages/core/auth-js/migrations/lockless-coordination.md`))),this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new YO(this),recoveryCodes:{getStatus:this._getRecoveryCodesStatus.bind(this),generate:this._generateRecoveryCodes.bind(this),verify:this._verifyRecoveryCode.bind(this),regenerate:this._regenerateRecoveryCodes.bind(this),unenroll:this._unenrollRecoveryCodes.bind(this)}}
330,this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.passkey={startRegistration:this._startPasskeyRegistration.bind(this),verifyRegistration:this._verifyPasskeyRegistration.bind(this),startAuthentication:this._startPasskeyAuthentication.bind(this),verifyAuthentication:this._verifyPasskeyAuthentication.bind(this),list:this._listPasskeys.bind(this),update:this._updatePasskey.bind(this),delete:this._deletePasskey.bind(this)},this.persistSession?(i.storage?this.storage=i.storage:t1()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=Lv(this.memoryStorage)),i.userStorage&&(this.userStorage=i.userStorage)):(this.memoryStorage={},this.storage=Lv(this.memoryStorage)),Qe()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(o){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",o)}(s=this.broadcastChannel)===null||s===void 0||s.addEventListener("message",async o=>{this._debug("received broadcast notification from other tab or client",o),(o.data.event==="TOKEN_REFRESHED"||o.data.event==="SIGNED_IN")&&(this.lastRefreshFailure=null);try{await this._notifyAllSubscribers(o.data.event,o.data.session,!1)}catch(l){this._debug("#broadcastChannel","error",l)}})}i.skipAutoInitialize||this.initialize().catch(o=>{this._debug("#initialize()","error",o)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(t){if(this.throwOnError&&t&&t.error)throw t.error;return t}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${Qb}) ${new Date().toISOString()}`}_debug(...t){return this.logDebugMessages&&this.logger(this._logPrefix(),...t),this}async initialize(){var t;if(this.initializePromise)return await this.initializePromise;this._pendingInitNotifications=[],this.initializePromise=(async()=>this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()):await this._initialize())();
330const r=await this.initializePromise,n=(t=this._pendingInitNotifications)!==null&&t!==void 0?t:[];this._pendingInitNotifications=null;for(const s of n)await this._notifyAllSubscribers(s.event,s.session,s.broadcast);return r}async _initialize(){var t;try{let r={},n="none";if(Qe()&&(r=Rv(window.location.href),this._isImplicitGrantCallback(r)?n="implicit":await this._isPKCECallback(r)&&(n="pkce")),Qe()&&this.detectSessionInUrl&&n!=="none"){const{data:s,error:i}=await this._getSessionFromURL(r,n);if(i){if(this._debug("#_initialize()","error detecting session from URL",i),iO(i)){const c=(t=i.details)===null||t===void 0?void 0:t.code;if(c==="identity_already_exists"||c==="identity_not_found"||c==="single_identity_not_deletable")return{error:i}}return{error:i}}const{session:o,redirectType:l}=s;return this._debug("#_initialize()","detected session in URL",o,"redirect type",l),await this._saveSession(o),setTimeout(async()=>{l==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",o):await this._notifyAllSubscribers("SIGNED_IN",o)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return L(r)?this._returnResult({error:r}):this._returnResult({error:new mr("Unexpected error during initialization",r)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var r,n,s;try{const i=await W(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(r=t==null?void 0:t.options)===null||r===void 0?void 0:r.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(s=t==null?void 0:t.options)===null||s===void 0?void 0:s.captchaToken}},xform:Wt}),{data:o,error:l}=i;if(l||!o)return this._returnResult({data:{user:null,session:null},error:l});const c=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(i){if(L(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signUp(t){var r,n,s;let i=null;try{let o;if("email"in t){const{email:h,password:m,options:p}=t;let w=null,g=null;this.flowType==="pkce"&&([w,g,i]=await this._getCodeChallengeAndMethod()),o=await W(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:this._maybeAppendFlowIdToRedirect(p==null?void 0:p.emailRedirectTo,i),body:{email:h,password:m,data:(r=p==null?void 0:p.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:p==null?void 0:p.captchaToken},code_challenge:w,code_challenge_method:g},xform:Wt})}else if("phone"in t){const{phone:h,password:m,options:p}=t;o=await W(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:h,password:m,data:(n=p==null?void 0:p.data)!==null&&n!==void 0?n:{},channel:(s=p==null?void 0:p.channel)!==null&&s!==void 0?s:"sms",gotrue_meta_security:{captcha_token:p==null?void 0:p.captchaToken}},xform:Wt})}else throw new fl("You must provide either an email or phone number and a password");const{data:l,error:c}=o;if(c||!l)return await or(this.storage,this.storageKey,i),this._returnResult({data:{user:null,session:null},error:c});const u=l.session,d=l.user;return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",u)),this._returnResult({data:{user:d,session:u},error:null})}catch(o){if(await or(this.storage,this.storageKey,i),L(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async signInWithPassword(t){try{let r;if("email"in t){const{email:i,password:o,options:l}=t;r=await W(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:i,password:o,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:Iv})}else if("phone"in t){const{phone:i,password:o,options:l}=t;r=await W(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:i,password:o,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:Iv})}else throw new fl("You must provide either an email or phone number and a password");const{data:n,error:s}=r;if(s)return this._returnResult({data:{user:null,session:null},error:s});if(!n||!n.session||!n.user){const i=new Ys;return this._returnResult({data:{user:null,session:null},error:i})}return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:s})}catch(r){if(L(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOAuth(t){var r,n,s,i;return await this._handleProviderSignIn(t.provider,{redirectTo:(r=t.options)===null||r===void 0?void 0:r.redirectTo,scopes:(n=t.options)===null||n===void 0?void 0:n.scopes,queryParams:(s=t.options)===null||s===void 0?void 0:s.queryParams,skipBrowserRedirect:(i=t.options)===null||i===void 0?void 0:i.skipBrowserRedirect})}async exchangeCodeForSession(t,r){return await this.initializePromise,this.lock!=null?this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(t,r)):this._exchangeCodeForSession(t,r)}async signInWithWeb3(t){const{chain:r}=t;switch(r){case"ethereum":return await this.signInWithEthereum(t);case"solana":return await this.signInWithSolana(t);default:throw new Error(`@supabase/auth-js: Unsupported chain "${r}"`)}}async signInWithEthereum(t){var r,n,s,i,o,l,c,u,d,h,m;let p,w;if("message"in t)p=t.message,w=t.signature;else{const{chain:g,wallet:v,statement:x,options:y}=t;let b;if(Qe())if(typeof v=="object")b=v;else{const N=window;if("ethereum"in N&&typeof N.ethereum=="object"&&"request"in N.ethereum&&typeof N.ethereum.request=="function")b=N.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof v!="object"||!(y!=null&&y.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");b=v}const S=new URL((r=y==null?void 0:y.url)!==null&&r!==void 0?r:window.location.href),_=await b.request({method:"eth_requestAccounts"}).then(N=>N).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!_||_.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const j=s1(_[0]);let E=(n=y==null?void 0:y.signInWithEthereum)===null||n===void 0?void 0:n.chainId;if(!E){const N=await b.request({method:"eth_chainId"});E=UO(N)}const C={domain:S.host,address:j,statement:x,uri:S.href,version:"1",chainId:E,nonce:(s=y==null?void 0:y.signInWithEthereum)===null||s===void 0?void 0:s.nonce,issuedAt:(o=(i=y==null?void 0:y.signInWithEthereum)===null||i===void 0?void 0:i.issuedAt)!==null&&o!==void 0?o:new Date,expirationTime:(l=y==null?void 0:y.signInWithEthereum)===null||l===void 0?void 0:l.expirationTime,notBefore:(c=y==null?void 0:y.signInWithEthereum)===null||c===void 0?void 0:c.notBefore,requestId:(u=y==null?void 0:y.signInWithEthereum)===null||u===void 0?void 0:u.requestId,resources:(d=y==null?void 0:y.signInWithEthereum)===null||d===void 0?void 0:d.resources};p=BO(C),w=await b.request({method:"personal_sign",params:[zO(p),j]})}try{const{data:g,error:v}=await W(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:p,signature:w}
330,!((h=t.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(m=t.options)===null||m===void 0?void 0:m.captchaToken}}:null),xform:Wt});if(v)throw v;if(!g||!g.session||!g.user){const x=new Ys;return this._returnResult({data:{user:null,session:null},error:x})}return g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("SIGNED_IN",g.session)),this._returnResult({data:Object.assign({},g),error:v})}catch(g){if(L(g))return this._returnResult({data:{user:null,session:null},error:g});throw g}}async signInWithSolana(t){var r,n,s,i,o,l,c,u,d,h,m,p;let w,g;if("message"in t)w=t.message,g=t.signature;else{const{chain:v,wallet:x,statement:y,options:b}=t;let S;if(Qe())if(typeof x=="object")S=x;else{const j=window;if("solana"in j&&typeof j.solana=="object"&&("signIn"in j.solana&&typeof j.solana.signIn=="function"||"signMessage"in j.solana&&typeof j.solana.signMessage=="function"))S=j.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 x!="object"||!(b!=null&&b.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");S=x}const _=new URL((r=b==null?void 0:b.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in S&&S.signIn){const j=await S.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},b==null?void 0:b.signInWithSolana),{version:"1",domain:_.host,uri:_.href}),y?{statement:y}:null));let E;if(Array.isArray(j)&&j[0]&&typeof j[0]=="object")E=j[0];else if(j&&typeof j=="object"&&"signedMessage"in j&&"signature"in j)E=j;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in E&&"signature"in E&&(typeof E.signedMessage=="string"||E.signedMessage instanceof Uint8Array)&&E.signature instanceof Uint8Array)w=typeof E.signedMessage=="string"?E.signedMessage:new TextDecoder().decode(E.signedMessage),g=E.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in S)||typeof S.signMessage!="function"||!("publicKey"in S)||typeof S!="object"||!S.publicKey||!("toBase58"in S.publicKey)||typeof S.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");w=[`${_.host} wants you to sign in with your Solana account:`,S.publicKey.toBase58(),...y?["",y,""]:[""],"Version: 1",`URI: ${_.href}`,`Issued At: ${(s=(n=b==null?void 0:b.signInWithSolana)===null||n===void 0?void 0:n.issuedAt)!==null&&s!==void 0?s:new Date().toISOString()}`,...!((i=b==null?void 0:b.signInWithSolana)===null||i===void 0)&&i.notBefore?[`Not Before: ${b.signInWithSolana.notBefore}`]:[],...!((o=b==null?void 0:b.signInWithSolana)===null||o===void 0)&&o.expirationTime?[`Expiration Time: ${b.signInWithSolana.expirationTime}`]:[],...!((l=b==null?void 0:b.signInWithSolana)===null||l===void 0)&&l.chainId?[`Chain ID: ${b.signInWithSolana.chainId}`]:[],...!((c=b==null?void 0:b.signInWithSolana)===null||c===void 0)&&c.nonce?[`Nonce: ${b.signInWithSolana.nonce}`]:[],...!((u=b==null?void 0:b.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${b.signInWithSolana.requestId}`]:[],...!((h=(d=b==null?void 0:b.signInWithSolana)===null||d===void 0?void 0:d.resources)===null||h===void 0)&&h.length?["Resources",...b.signInWithSolana.resources.map(E=>`- ${E}`)]:[]].join(` 331`);const j=await S.signMessage(new TextEncoder().encode(w),"utf8");if(!j||!(j instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");g=j}}try{const{data:v,error:x}=await W(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:w,signature:vs(g)},!((m=t.options)===null||m===void 0)&&m.captchaToken?{gotrue_meta_security:{captcha_token:(p=t.options)===null||p===void 0?void 0:p.captchaToken}}:null),xform:Wt});if(x)throw x;if(!v||!v.session||!v.user){const y=new Ys;return this._returnResult({data:{user:null,session:null},error:y})}return v.session&&(await this._saveSession(v.session),await this._notifyAllSubscribers("SIGNED_IN",v.session)),this._returnResult({data:Object.assign({},v),error:x})}catch(v){if(L(v))return this._returnResult({data:{user:null,session:null},error:v});throw v}}async _exchangeCodeForSession(t,r){const n=(r==null?void 0:r.flowId)!=null,s=n?Fl(r==null?void 0:r.flowId):Qe()?Fl(Rv(window.location.href)[gs]):null;n&&!s&&this._debug("#_exchangeCodeForSession()","provided flowId is not a valid flow id",r==null?void 0:r.flowId);const{verifier:i,flowId:o}=n&&!s?{verifier:null,flowId:null}:await _O(this.storage,this.storageKey,s),[l,c]=(i??"").split("/");try{if(!l&&this.flowType==="pkce")throw new oO;const{data:u,error:d}=await W(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:l},xform:Wt});if(await or(this.storage,this.storageKey,o),d)throw d;if(!u||!u.session||!u.user){const h=new Ys;return this._returnResult({data:{user:null,session:null,redirectType:null},error:h})}return u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers(c==="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",u.session)),this._returnResult({data:Object.assign(Object.assign({},u),{redirectType:c??null}),error:d})}catch(u){if(await or(this.storage,this.storageKey,o),L(u))return this._returnResult({data:{user:null,session:null,redirectType:null},error:u});throw u}}async signInWithIdToken(t){try{const{options:r,provider:n,token:s,access_token:i,nonce:o}=t,l=await W(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:s,access_token:i,nonce:o,gotrue_meta_security:{captcha_token:r==null?void 0:r.captchaToken}},xform:Wt}),{data:c,error:u}=l;if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!c||!c.session||!c.user){const d=new Ys;return this._returnResult({data:{user:null,session:null},error:d})}return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),this._returnResult({data:c,error:u})}catch(r){if(L(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOtp(t){var r,n,s,i,o;let l=null;try{if("email"in t){const{email:c,options:u}=t;let d=null,h=null;this.flowType==="pkce"&&([d,h,l]=await this._getCodeChallengeAndMethod());const{error:m}=await W(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:c,data:(r=u==null?void 0:u.data)!==null&&r!==void 0?r:{},create_user:(n=u==null?void 0:u.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:u==null?void 0:u.captchaToken},code_challenge:d,code_challenge_method:h},redirectTo:this._maybeAppendFlowIdToRedirect(u==null?void 0:u.emailRedirectTo,l)});return this._returnResult({data:{user:null,session:null},error:m})}if("phone"in t){const{phone:c,options:u}=t,{data:d,error:h}=await W(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:c,data:(s=u==null?void 0:u.data)!==null&&s!==void 0?s:{},create_user:(i=u==null?void 0:u.shouldCreateUser)!==null&&i!==void 0?i:!0,gotrue_meta_security:{captcha_token:u==null?void 0:u.captchaToken},channel:(o=u==null?void 0:u.channel)!==null&&o!==void 0?o:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:d==null?void 0:d.message_id},error:h})}throw new fl("You must provide either an email or phone number.")}catch(c){if(await or(this.storage,this.storageKey,l),L(c))return this._returnResult({data:{user:null,session:null},error:c});throw c}}async verifyOtp(t){var r,n;try{let s,i;"options"in t&&(s=(r=t.options)===null||r===void 0?void 0:r.redirectTo,i=(n=t.options)===null||n===void 0?void 0:n.captchaToken);const{data:o,error:l}=await W(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:i}}),redirectTo:s,xform:Wt});if(l)throw l;if(!o)throw new Error("An error occurred on token verification.");const c=o.session,u=o.user;return c!=null&&c.access_token&&(await this._saveSession(c),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(s){if(L(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithSSO(t){var r,n,s,i;let o=null;try{let l=null,c=null;this.flowType==="pkce"&&([l,c,o]=await this._getCodeChallengeAndMethod());const u=await W(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:this._maybeAppendFlowIdToRedirect((r=t.options)===null||r===void 0?void 0:r.redirectTo,o)}),!((n=t==null?void 0:t.options)===null||n===void 0)&&n.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:l,code_challenge_method:c}),headers:this.headers,xform:IO});return!((s=u.data)===null||s===void 0)&&s.url&&Qe()&&!(!((i=t.options)===null||i===void 0)&&i.skipBrowserRedirect)&&window.location.assign(u.data.url),this._returnResult(u)}catch(l){if(await or(this.storage,this.storageKey,o),L(l))return this._returnResult({data:null,error:l});throw l}}async reauthenticate(){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate()):await this._reauthenticate()}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;if(n)throw n;if(!r)throw new qe;const{error:s}=await W(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return this._returnResult({data:{user:null,session:null},error:s})})}catch(t){if(L(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async resend(t){let r=null;try{const n=`${this.url}/resend`;if("email"in t){const{email:s,type:i,options:o}=t;let l=null,c=null;this.flowType==="pkce"&&([l,c,r]=await this._getCodeChallengeAndMethod());const{error:u}=await W(this.fetch,"POST",n,{headers:this.headers,body:{email:s,type:i,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken},code_challenge:l,code_challenge_method:c},redirectTo:this._maybeAppendFlowIdToRedirect(o==null?void 0:o.emailRedirectTo,r)});return u&&await or(this.storage,this.storageKey,r),this._returnResult({data:{user:null,session:null},error:u})}else if("phone"in t){const{phone:s,type:i,options:o}=t,{data:l,error:c}=await W(this.fetch,"POST",n,{headers:this.headers,body:{phone:s,type:i,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:l==null?void 0:l.message_id},error:c})}throw new fl("You must provide either an email or phone number and a type")}catch(n){if(await or(this.storage,this.storageKey,r),L(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async getSession(){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async t=>t)):await this._useSession(async t=>t)}async _acquireLock(t,r){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),s=(async()=>(await n,await r()))();return this.pendingInLock.push((async()=>{try{await s}catch{}})()),s}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){const s=[...this.pendingInLock];await Promise.all(s),this.pendingInLock.splice(0,s.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(t){this._debug("#_useSession","begin");try{const r=await this.__loadSession();return await t(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lock!=null&&!this.lockAcquired&&this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let t=null;const r=await lt(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?t=r:(this._debug("#getSession()","session from storage is not val
331id"),await this._removeSession())),!t)return{data:{session:null},error:null};const n=t.expires_at?t.expires_at*1e3-Date.now()<pd:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",t.expires_at),!n)return{data:{session:await this._hydrateSessionUser(t)},error:null};const{data:s,error:i}=await this._callRefreshToken(t.refresh_token);if(i){const o=await lt(this.storage,this.storageKey);return o&&this._isValidSession(o)&&o.expires_at&&o.expires_at*1e3>Date.now()?this._returnResult({data:{session:await this._hydrateSessionUser(o)},error:null}):this._returnResult({data:{session:null},error:i})}return this._returnResult({data:{session:s},error:null})}finally{this._debug("#__loadSession()","end")}}async _hydrateSessionUser(t){if(this.userStorage){const r=await lt(this.userStorage,this.storageKey+"-user");t.user=r!=null&&r.user?r.user:md()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){const r={value:this.suppressGetSessionWarning};t.user=PO(t.user,r),r.value&&(this.suppressGetSessionWarning=!0)}return t}async getUser(t){if(t)return await this._getUser(t);await this.initializePromise;let r;return this.lock!=null?r=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser()):r=await this._getUser(),r.data.user&&(this.suppressGetSessionWarning=!0),r}async _getUser(t){try{return t?await W(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:Nn}):await this._useSession(async r=>{var n,s,i;const{data:o,error:l}=r;if(l)throw l;return!(!((n=o.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new qe}:await W(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(i=(s=o.session)===null||s===void 0?void 0:s.access_token)!==null&&i!==void 0?i:void 0,xform:Nn})})}catch(r){if(L(r))return hl(r)&&await this._removeSession(),this._returnResult({data:{user:null},error:r});throw r}}async updateUser(t,r={}){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(t,r)):await this._updateUser(t,r)}async _updateUser(t,r={}){let n=null;try{return await this._useSession(async s=>{const{data:i,error:o}=s;if(o)throw o;if(!i.session)throw new qe;const l=i.session;let c=null,u=null;this.flowType==="pkce"&&t.email!=null&&([c,u,n]=await this._getCodeChallengeAndMethod());const{data:d,error:h}=await W(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:this._maybeAppendFlowIdToRedirect(r==null?void 0:r.emailRedirectTo,n),body:Object.assign(Object.assign({},t),{code_challenge:c,code_challenge_method:u}),jwt:l.access_token,xform:Nn});if(h)throw h;return l.user=d.user,await this._saveSession(l),await this._notifyAllSubscribers("USER_UPDATED",l),this._returnResult({data:{user:l.user},error:null})})}catch(s){if(await or(this.storage,this.storageKey,n),L(s))return this._returnResult({data:{user:null},error:s});throw s}}async setSession(t){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(t)):await this._setSession(t)}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new qe;const r=Date.now()/1e3;let n=r,s=!0,i=null;const{payload:o}=gl(t.access_token);if(o.exp&&(n=o.exp,s=n<=r),s){const{data:l,error:c}=await this._callRefreshToken(t.refresh_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!l)return{data:{user:null,session:null},error:null};i=l}else{const{data:l,error:c}=await this._getUser(t.access_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});i={access_token:t.access_token,refresh_token:t.refresh_token,user:l.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)}return this._returnResult({data:{user:i.user,session:i},error:null})}catch(r){if(L(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}}async refreshSession(t){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(t)):await this._refreshSession(t)}async _refreshSession(t){try{return await this._useSession(async r=>{var n;if(!t){const{data:o,error:l}=r;if(l)throw l;t=(n=o.session)!==null&&n!==void 0?n:void 0}if(!(t!=null&&t.refresh_token))throw new qe;const{data:s,error:i}=await this._callRefreshToken(t.refresh_token);return i?this._returnResult({data:{user:null,session:null},error:i}):s?this._returnResult({data:{user:s.user,session:s},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(r){if(L(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async _getSessionFromURL(t,r){var n;try{if(!Qe())throw new pl("No browser detected.");
331if(t.error||t.error_description||t.error_code)throw new pl(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new Sv("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new pl("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new Sv("No code detected.");const{data:b,error:S}=await this._exchangeCodeForSession(t.code,{flowId:t[gs]});if(S)throw S;const _=new URL(window.location.href);return _.searchParams.delete("code"),_.searchParams.delete(gs),window.history.replaceState(window.history.state,"",_.toString()),{data:{session:b.session,redirectType:(n=b.redirectType)!==null&&n!==void 0?n:null},error:null}}const{provider_token:s,provider_refresh_token:i,access_token:o,refresh_token:l,expires_in:c,expires_at:u,token_type:d}=t;if(!o||!c||!l||!d)throw new pl("No session defined in URL");const h=Math.round(Date.now()/1e3),m=parseInt(c);let p=h+m;u&&(p=parseInt(u));const w=p-h;w*1e3<=Gr&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${w}s, should have been closer to ${m}s`);const g=p-m;h-g>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",g,p,h):h-g<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",g,p,h);const{data:v,error:x}=await this._getUser(o);if(x)throw x;const y={provider_token:s,provider_refresh_token:i,access_token:o,expires_in:m,expires_at:p,refresh_token:l,token_type:d,user:v.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:y,redirectType:t.type},error:null})}catch(s){if(L(s))return this._returnResult({data:{session:null,redirectType:null},error:s});throw s}}_isImplicitGrantCallback(t){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),t):!!(t.access_token||t.error||t.error_description||t.error_code)}async _isPKCECallback(t){if(!t.code)return!1;const r=Fl(t[gs]);return r&&await lt(this.storage,Gi(this.storageKey,r))?!0:!!await lt(this.storage,`${this.storageKey}-code-verifier`)}async signOut(t={scope:"global"}){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(t)):await this._signOut(t)}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async r=>{var n;const s=async()=>{await this._removeSession()},{data:i,error:o}=r;if(o&&!hl(o))return this._returnResult({error:o});const l=(n=i.session)===null||n===void 0?void 0:n.access_token;if(l){const{error:c}=await this.admin.signOut(l,t);if(c&&!(_v(c)&&(c.status===404||c.status===401||c.status===403)||hl(c)))return t!=="others"&&await s(),this._returnResult({error:c})}return t!=="others"&&await s(),this._returnResult({error:null})})}onAuthStateChange(t){const r=hO(),n={id:r,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,n),(async()=>(await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(r)}):await this._emitInitialSession(r)))(),{data:{subscription:n}}}async _emitInitialSession(t){return await this._useSession(async r=>{var n,s;try{const{data:{session:i},error:o}=r;if(o)throw o;await((n=this.stateChangeEmitters.get(t))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",i)),this._debug("INITIAL_SESSION","callback id",t,"session",i)}catch(i){if(await((s=this.stateChangeEmitters.get(t))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",i),Ev(i))return;hl(i)||ml(i)||_v(i)&&(i.code==="refresh_token_not_found"||i.code==="refresh_token_already_used"||i.code==="session_expired")?console.warn(i):console.error(i)}})}async resetPasswordForEmail(t,r={}){let n=null,s=null,i=null;this.flowType==="pkce"&&([n,s,i]=await this._getCodeChallengeAndMethod(!0));try{return await W(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:n,code_challenge_method:s,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:this._maybeAppendFlowIdToRedirect(r.redirectTo,i)})}catch(o){if(await or(this.storage,this.storageKey,i),L(o))return this._returnResult({data:null,error:o});throw o}}async getUserIdentities(){var t;try{const{data:r,error:n}=await this.getUser();if(n)throw n;return this._returnResult({data:{identities:(t=r.user.identities)!==null&&t!==void 0?t:[]},error:null})}catch(r){if(L(r))return this._returnResult({data:null,error:r});throw r}}async linkIdentity(t){return"token"in t?this.linkIdentityIdToken(t):this.linkIdentityOAuth(t)}async linkIdentityOAuth(t){var r;let n=null;try{const{data:s,error:i}=await this._useSession(async o=>{var l,c,u,d,h;const{data:m,error:p}=o;if(p)throw p;const{url:w,flowId:g}=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(l=t.options)===null||l===void 0?void 0:l.redirectTo,scopes:(c=t.options)===null||c===void 0?void 0:c.scopes,queryParams:(u=t.options)===null||u===void 0?void 0:u.queryParams,skipBrowserRedirect:!0});return n=g,await W(this.fetch,"GET",w,{headers:this.headers,jwt:(h=(d=m.session)===null||d===void 0?void 0:d.access_token)!==null&&h!==void 0?h:void 0})});if(i)throw i;return Qe()&&!(!((r=t.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(s==null?void 0:s.url),this._returnResult({data:{provider:t.provider,url:s==null?void 0:s.url,flowId:n},error:null})}catch(s){if(L(s))return this._returnResult({data:{provider:t.provider,url:null,flowId:n},error:s});throw s}}async linkIdentityIdToken(t){return await this._useSession(async r=>{var n;try{const{error:s,data:{session:i}}=r;if(s)throw s;const{options:o,provider:l,token:c,access_token:u,nonce:d}=t,h=await W(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(n=i==null?void 0:i.access_token)!==null&&n!==void 0?n:void 0,body:{provider:l,id_token:c,access_token:u,nonce:d,link_identity:!0,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:Wt}),{data:m,error:p}=h;return p?this._returnResult({data:{user:null,session:null},error:p}):!m||!m.session||!m.user?this._returnResult({data:{user:null,session:null},error:new Ys}):(m.session&&(await this._saveSession(m.session),await this._notifyAllSubscribers("USER_UPDATED",m.session)),this._returnResult({data:m,error:p}))}catch(s){if(await or(this.storage,this.storageKey,null),L(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}})}async unlinkIdentity(t){try{return await this._useSession(async r=>{var n,s;const{data:i,error:o}=r;if(o)throw o;
331return await W(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(s=(n=i.session)===null||n===void 0?void 0:n.access_token)!==null&&s!==void 0?s:void 0})})}catch(r){if(L(r))return this._returnResult({data:null,error:r});throw r}}async _refreshAccessToken(t){const r="#_refreshAccessToken()";this._debug(r,"begin");try{const n=Date.now();return await mO(async s=>(s>0&&await pO(200*Math.pow(2,s-1)),this._debug(r,"refreshing attempt",s),await W(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:Wt})),(s,i)=>{const o=200*Math.pow(2,s);return i&&ml(i)&&Date.now()+o-n<Gr})}catch(n){if(this._debug(r,"error",n),L(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}finally{this._debug(r,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,r){const{url:n,flowId:s}=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",r,"url",n),Qe()&&!r.skipBrowserRedirect&&window.location.assign(n),{data:{provider:t,url:n,flowId:s},error:null}}async _recoverAndRefresh(){var t,r;const n="#_recoverAndRefresh()";this._debug(n,"begin");try{const s=await lt(this.storage,this.storageKey);if(s&&this.userStorage){let o=await lt(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!o&&(o={user:s.user},await Qr(this.userStorage,this.storageKey+"-user",o)),s.user=(t=o==null?void 0:o.user)!==null&&t!==void 0?t:md()}else if(s&&!s.user&&!s.user){const o=await lt(this.storage,this.storageKey+"-user");o&&(o!=null&&o.user)?(s.user=o.user,await bt(this.storage,this.storageKey+"-user"),await Qr(this.storage,this.storageKey,s)):s.user=md()}if(this._debug(n,"session from storage",s),!this._isValidSession(s)){this._debug(n,"session is not valid"),s!==null&&await this._removeSession();return}const i=((r=s.expires_at)!==null&&r!==void 0?r:1/0)*1e3-Date.now()<pd;if(this._debug(n,`session has${i?"":" not"} expired with margin of ${pd}s`),i){if(this.autoRefreshToken&&s.refresh_token){const{error:o}=await this._callRefreshToken(s.refresh_token);o&&(Ev(o)?this._debug(n,"refresh discarded by commit guard",o):this._debug(n,"refresh failed",o))}}else if(s.user&&s.user.__isUserNotAvailableProxy===!0)try{const{data:o,error:l}=await this._getUser(s.access_token);!l&&(o!=null&&o.user)?(s.user=o.user,await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)):this._debug(n,"could not get user data, skipping SIGNED_IN notification")}catch(o){console.error("Error getting user data:",o),this._debug(n,"error getting user data, skipping SIGNED_IN notification",o)}else await this._notifyAllSubscribers("SIGNED_IN",s)}catch(s){this._debug(n,"error",s),ml(s)?console.warn(s):console.error(s);return}finally{this._debug(n,"end")}}async _callRefreshToken(t){var r,n;if(!t)throw new qe;if(this.refreshingDeferred)return this.refreshingDeferred.promise;if(this.lastRefreshFailure&&this.lastRefreshFailure.refreshToken===t&&Date.now()<this.lastRefreshFailure.expiresAt)return this._debug("#_callRefreshToken()","returning cached failure (cooldown active)"),this.lastRefreshFailure.result;const s="#_callRefreshToken()";this._debug(s,"begin");try{this.refreshingDeferred=new gu,this.refreshingDeferred.promise.then(void 0,()=>{});const i=await lt(this.storage,this.storageKey),{data:o,error:l}=await this._refreshAccessToken(t);if(l)throw l;if(!o.session)throw new qe;const c=await lt(this.storage,this.storageKey);if(i!==null&&(c===null||c.refresh_token!==i.refresh_token)){this._debug(s,"commit guard: storage changed since refresh started, discarding rotated tokens",{startedWith:"present",nowHolds:c?"replaced":"cleared"});const m={data:null,error:new jv};return this.refreshingDeferred.resolve(m),m}const d=this._sessionRemovalEpoch;if(await this._saveSession(o.session),this._sessionRemovalEpoch!==d){this._debug(s,"commit guard (post-save): _removeSession ran during _saveSession, und
331oing write"),await bt(this.storage,this.storageKey),this.userStorage&&await bt(this.userStorage,this.storageKey+"-user");const m={data:null,error:new jv};return this.refreshingDeferred.resolve(m),m}await this._notifyAllSubscribers("TOKEN_REFRESHED",o.session);const h={data:o.session,error:null};return this.lastRefreshFailure=null,this.refreshingDeferred.resolve(h),h}catch(i){if(this._debug(s,"error",i),L(i)){const o={data:null,error:i};if(!ml(i)){const l=await lt(this.storage,this.storageKey);!!(l!=null&&l.expires_at&&l.expires_at*1e3>Date.now())?this._debug(s,"proactive refresh failed, access token still valid â preserving session"):await this._removeSession()}return this.lastRefreshFailure={refreshToken:t,result:o,expiresAt:Date.now()+QA},(r=this.refreshingDeferred)===null||r===void 0||r.resolve(o),o}throw(n=this.refreshingDeferred)===null||n===void 0||n.reject(i),i}finally{this.refreshingDeferred=null,this._debug(s,"end")}}async _notifyAllSubscribers(t,r,n=!0){if(this._pendingInitNotifications!==null&&n){this._pendingInitNotifications.push({event:t,session:r,broadcast:n});return}const s=`#_notifyAllSubscribers(${t})`;this._debug(s,"begin",r,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:t,session:r});const i=[],o=Array.from(this.stateChangeEmitters.values()).map(async l=>{try{await l.callback(t,r)}catch(c){i.push(c)}});if(await Promise.all(o),i.length>0){for(let l=0;l<i.length;l+=1)console.error(i[l]);throw i[0]}}finally{this._debug(s,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0;const r=Object.assign({},t),n=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!n&&r.user&&await Qr(this.userStorage,this.storageKey+"-user",{user:r.user});const s=Object.assign({},r);delete s.user;const i=Pv(s);await Qr(this.storage,this.storageKey,i)}else{const s=Pv(r);await Qr(this.storage,this.storageKey,s)}}async _removeSession(){this._sessionRemovalEpoch+=1,this._debug("#_removeSession()"),this.lastRefreshFailure=null,this.suppressGetSessionWarning=!1,await bt(this.storage,this.storageKey),await SO(this.storage,this.storageKey),await bt(this.storage,this.storageKey+"-user"),this.userStorage&&await bt(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&Qe()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",t)}catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),Gr);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t);const r=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=r,r&&typeof r=="object"&&typeof r.unref=="function"?r.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(r)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t);const r=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,r&&clearTimeout(r)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async dispose(){var t;this._removeVisibilityChangedCallback(),await this._stopAutoRefresh(),(t=this.broadcastChannel)===null||t===void 0||t.close(),this.broadcastChannel=null,this.stateChangeEmitters.clear()}async _autoRefreshTokenTick(){if(this._debug("#_autoRefreshTokenTick()","begin"),this.lock!=null){try{await this._acquireLock(0,async()=>{try{const t=Date.now();try{return await this._useSession(async r=>{const{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const s=Math.floor((n.expires_at*1e3-t)/Gr);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${Gr}ms, refresh threshold is ${ko} ticks`),s<=ko&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t instanceof $O)this._debug("auto refresh token tick lock not available");else throw t}return}if(this.refreshingDeferred!==null){this._debug("#_autoRefreshTokenTick()","refresh already in flight, skipping");return}try{const t=Date.now();try{await this._useSession(async r=>{const{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const s=Math.floor((n.expires_at*1e3-t)/Gr);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${Gr}ms, refresh threshold is ${ko} ticks`),s<=ko&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Qe()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(t){this._debug("#visibilityChangedCallback","error",t)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const r=`#_onVisibilityChanged(${t})`;if(this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"){if(this.autoRefreshToken&&this._startAutoRefresh(),!t)if(await this.initializePromise,this.lock!=null)await this._acquireLock(this.lockAcquireTimeout,async()=>
331{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()});else{if(document.visibilityState!=="visible"){this._debug(r,"visibilityState is no longer visible, skipping recovery");return}await this._recoverAndRefresh()}}else document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(t,r,n){let s=n==null?void 0:n.redirectTo,i=null,o=null,l=null;this.flowType==="pkce"&&([i,o,l]=await this._getCodeChallengeAndMethod(),s=this._maybeAppendFlowIdToRedirect(s,l));const c=[`provider=${encodeURIComponent(r)}`];if(s&&c.push(`redirect_to=${encodeURIComponent(s)}`),n!=null&&n.scopes&&c.push(`scopes=${encodeURIComponent(n.scopes)}`),i!=null&&o!=null){const u=new URLSearchParams({code_challenge:`${encodeURIComponent(i)}`,code_challenge_method:`${encodeURIComponent(o)}`});c.push(u.toString())}if(n!=null&&n.queryParams){const u=new URLSearchParams(n.queryParams);c.push(u.toString())}return n!=null&&n.skipBrowserRedirect&&c.push(`skip_http_redirect=${n.skipBrowserRedirect}`),{url:`${t}?${c.join("&")}`,flowId:l}}_maybeAppendFlowIdToRedirect(t,r){return!t||!r||!this.experimental.appendPkceFlowIdToRedirects?t??void 0:jO(t,r)}async _getCodeChallengeAndMethod(t=!1){return EO(this.storage,this.storageKey,t,r=>this._debug("#_getCodeChallengeAndMethod()","evicted oldest pending PKCE verifier slot",r))}async _unenroll(t){try{return await this._useSession(async r=>{var n;const{data:s,error:i}=r;return i?this._returnResult({data:null,error:i}):await W(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if(L(r))return this._returnResult({data:null,error:r});throw r}}async _enroll(t){try{return await this._useSession(async r=>{var n,s;const{data:i,error:o}=r;if(o)return this._returnResult({data:null,error:o});const l=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:t.factorType==="totp"?{issuer:t.issuer}:{}),{data:c,error:u}=await W(this.fetch,"POST",`${this.url}/factors`,{body:l,headers:this.headers,jwt:(n=i==null?void 0:i.session)===null||n===void 0?void 0:n.access_token});return u?this._returnResult({data:null,error:u}):(t.factorType==="totp"&&c.type==="totp"&&(!((s=c==null?void 0:c.totp)===null||s===void 0)&&s.qr_code)&&(c.totp.qr_code=`data:image/svg+xml;utf-8,${c.totp.qr_code}`),this._returnResult({data:c,error:null}))})}catch(r){if(L(r))return this._returnResult({data:null,error:r});throw r}}async _verify(t){const r=async()=>{try{return await this._useSession(async n=>{var s;const{data:i,error:o}=n;if(o)return this._returnResult({data:null,error:o});const l=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?Fv(t.webauthn.credential_response):Uv(t.webauthn.credential_response)})}:{code:t.code}),{data:c,error:u}=await W(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:l,headers:this.headers,jwt:(s=i==null?void 0:i.session)===null||s===void 0?void 0:s.access_token});return u?this._returnResult({data:null,error:u}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+c.expires_in},c)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",c),this._returnResult({data:c,error:u}))})}catch(n){if(L(n))return this._returnResult({data:null,error:n});throw n}};return this.lock!=null?this._acquireLock(this.lockAcquireTimeout,r):r()}async _challenge(t){const r=async()=>{try{return await this._useSession(async n=>{var s;const{data:i,error:o}=n;if(o)return this._returnResult({data:null,error:o});const l=await W(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(s=i==null?void 0:i.session)===null||s===void 0?void 0:s.access_token});if(l.error)return l;const{data:c}=l;if(c.type!=="webauthn")return{data:c,error:null};switch(c.webauthn.type){case"create":return{data:Object.assign(Object.assign({},c),{webauthn:Object.assign(Object.assign({},c.webauthn),{credential_options:Object.assign(Object.assign({},c.webauthn.credential_options),{publicKey:Mv(c.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},c),{webauthn:Object.assign(Object.assign({},c.webauthn),{credential_options:Object.assign(Object.assign({},c.webauthn.credential_options),{publicKey:$v(c.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(n){if(L(n))return this._returnResult({data:null,error:n});throw n}};return this.lock!=null?this._acquireLock(this.lockAcquireTimeout,r):r()}async _challengeAndVerify(t){const{data:r,error:n}=await this._challenge({factorId:t.factorId});return n?this._returnResult({data:null,error:n}):await this._verify({factorId:t.factorId,challengeId:r.id,code:t.code})}async _listFactors(){var t;const{data:{user:r},error:n}=await this.getUser();if(n)return{data:null,error:n};const s={all:[],phone:[],totp:[],webauthn:[],recovery_code:[]};for(const i of(t=r==null?void 0:r.factors)!==null&&t!==void 0?t:[])s.all.push(i),i.status==="verified"&&i.factor_type in s&&Array.isArray(s[i.factor_type])&&s[i.factor_type].push(i);return{data:s,error:null}}async _getAuthenticatorAssuranceLevel(t){var r,n,s,i;if(t)try{const{payload:p}=gl(t);let w=null;p.aal&&(w=p.aal);let g=w;const{data:{user:v},error:x}=await this.getUser(t);if(x)return this._returnResult({data:null,error:x});((n=(r=v==null?void 0:v.factors)===null||r===void 0?void 0:r.filter(S=>S.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(g="aal2");const b=p.amr||[];return{data:{currentLevel:w,nextLevel:g,currentAuthenticationMethods:b},error:null}}catch(p){if(L(p))return this._returnResult({data:null,error:p});throw p}const{data:{session:o},error:l}
331=await this.getSession();if(l)return this._returnResult({data:null,error:l});if(!o)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:c}=gl(o.access_token);let u=null;c.aal&&(u=c.aal);let d=u;((i=(s=o.user.factors)===null||s===void 0?void 0:s.filter(p=>p.status==="verified"))!==null&&i!==void 0?i:[]).length>0&&(d="aal2");const m=c.amr||[];return{data:{currentLevel:u,nextLevel:d,currentAuthenticationMethods:m},error:null}}async _getRecoveryCodesStatus(){_o(this.experimental);try{return await this._useSession(async t=>{var r;const{data:n,error:s}=t;if(s)return this._returnResult({data:null,error:s});const{data:i,error:o}=await W(this.fetch,"GET",`${this.url}/factors/recovery-codes`,{headers:this.headers,jwt:(r=n==null?void 0:n.session)===null||r===void 0?void 0:r.access_token});return o?this._returnResult({data:null,error:o}):this._returnResult({data:i,error:null})})}catch(t){if(L(t))return this._returnResult({data:null,error:t});throw t}}async _generateRecoveryCodes(t){_o(this.experimental);try{return await this._useSession(async r=>{var n;const{data:s,error:i}=r;if(i)return this._returnResult({data:null,error:i});const{data:o,error:l}=await W(this.fetch,"POST",`${this.url}/factors/recovery-codes`,{body:t!=null&&t.friendlyName?{friendly_name:t.friendlyName}:void 0,headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token});return l?this._returnResult({data:null,error:l}):this._returnResult({data:o,error:null})})}catch(r){if(L(r))return this._returnResult({data:null,error:r});throw r}}async _verifyRecoveryCode(t){_o(this.experimental);const r=async()=>{try{return await this._useSession(async n=>{var s;const{data:i,error:o}=n;if(o)return this._returnResult({data:null,error:o});const{data:l,error:c}=await W(this.fetch,"POST",`${this.url}/factors/recovery-codes/verify`,{body:{code:t.code},headers:this.headers,jwt:(s=i==null?void 0:i.session)===null||s===void 0?void 0:s.access_token});if(c)return this._returnResult({data:null,error:c});const u=Object.assign({expires_at:e1(l.expires_in)},l);return await this._saveSession(u),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",u),this._returnResult({data:l,error:null})})}catch(n){if(L(n))return this._returnResult({data:null,error:n});throw n}};return this.lock!=null?this._acquireLock(this.lockAcquireTimeout,r):r()}async _regenerateRecoveryCodes(){_o(this.experimental);try{return await this._useSession(async t=>{var r;const{data:n,error:s}=t;if(s)return this._returnResult({data:null,error:s});const{data:i,error:o}=await W(this.fetch,"POST",`${this.url}/factors/recovery-codes/regenerate`,{headers:this.headers,jwt:(r=n==null?void 0:n.session)===null||r===void 0?void 0:r.access_token});return o?this._returnResult({data:null,error:o}):this._returnResult({data:i,error:null})})}catch(t){if(L(t))return this._returnResult({data:null,error:t});throw t}}async _unenrollRecoveryCodes(){_o(this.experimental);try{return await this._useSession(async t=>{var r;const{data:n,error:s}=t;if(s)return this._returnResult({data:null,error:s});const{data:i,error:o}=await W(this.fetch,"DELETE",`${this.url}/factors/recovery-codes`,{headers:this.headers,jwt:(r=n==null?void 0:n.session)===null||r===void 0?void 0:r.access_token});return o?this._returnResult({data:null,error:o}):this._returnResult({data:i,error:null})})}catch(t){if(L(t))return this._returnResult({data:null,error:t});throw t}}async _getAuthorizationDetails(t){try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;return s?this._returnResult({data:null,error:s}):n?await W(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:n.access_token,xform:i=>({data:i,error:null})}):this._returnResult({data:null,error:new qe})})}catch(r){if(L(r))return this._returnResult({data:null,error:r});throw r}}async _approveAuthorization(t,r){try{return await this._useSession(async n=>{const{data:{session:s},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!s)return this._returnResult({data:null,error:new qe});const o=await W(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"approve"},xform:l=>({data:l,error:null})});return o.data&&o.data.redirect_url&&Qe()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(n){if(L(n))return this._returnResult({data:null,error:n});throw n}}async _denyAuthorization(t,r){try{return await this._useSession(async n=>{const{data:{session:s},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!s)return this._returnResult({data:null,error:new qe});const o=await W(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"deny"},xform:l=>({data:l,error:null})});return o.data&&o.data.redirect_url&&Qe()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(n){if(L(n))return this._returnResult({data:null,error:n});throw n}}async _listOAuthGrants(){try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;return n?this._returnResult({data:null,error:n}):r?await W(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new qe})})}catch(t){if(L(t))return this._returnResult({data:null,error:t});throw t}}async _revokeOAuthGrant(t){try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;return s?this._returnResult({data:null,error:s}
331):n?(await W(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,query:{client_id:t.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new qe})})}catch(r){if(L(r))return this._returnResult({data:null,error:r});throw r}}async fetchJwk(t,r={keys:[]}){let n=r.keys.find(l=>l.kid===t);if(n)return n;const s=Date.now();if(n=this.jwks.keys.find(l=>l.kid===t),n&&this.jwks_cached_at+nO>s)return n;const{data:i,error:o}=await W(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(o)throw o;return!i.keys||i.keys.length===0||(this.jwks=i,this.jwks_cached_at=s,n=i.keys.find(l=>l.kid===t),!n)?null:n}async getClaims(t,r={}){try{let n=t;if(!n){const{data:p,error:w}=await this.getSession();if(w||!p.session)return this._returnResult({data:null,error:w});n=p.session.access_token}const{header:s,payload:i,signature:o,raw:{header:l,payload:c}}=gl(n);if(!(r!=null&&r.allowExpired))try{kO(i.exp)}catch(p){throw new Ec(p instanceof Error?p.message:"JWT validation failed")}const u=!s.alg||s.alg.startsWith("HS")||!s.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(s.kid,r!=null&&r.keys?{keys:r.keys}:r==null?void 0:r.jwks);if(!u){const{error:p}=await this.getUser(n);if(p)throw p;return{data:{claims:i,header:s,signature:o},error:null}}const d=TO(s.alg),h=await crypto.subtle.importKey("jwk",u,d,!0,["verify"]);if(!await crypto.subtle.verify(d,h,o,dO(`${l}.${c}`)))throw new Ec("Invalid JWT signature");return{data:{claims:i,header:s,signature:o},error:null}}catch(n){if(L(n))return this._returnResult({data:null,error:n});throw n}}async signInWithPasskey(t){var r,n,s,i;try{if(!kc())return this._returnResult({data:null,error:new mr("Browser does not support WebAuthn",null)});const{data:o,error:l}=await this._startPasskeyAuthentication({options:{captchaToken:(r=t==null?void 0:t.options)===null||r===void 0?void 0:r.captchaToken}});if(l||!o)return this._returnResult({data:null,error:l});const c=$v(o.options),u=(s=(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.signal)!==null&&s!==void 0?s:Xh.createNewAbortSignal(),{data:d,error:h}=await a1({publicKey:c,signal:u,mediation:(i=t==null?void 0:t.options)===null||i===void 0?void 0:i.mediation});if(h||!d)return this._returnResult({data:null,error:h??new mr("WebAuthn ceremony failed",null)});const m=Uv(d);return this._verifyPasskeyAuthentication({challengeId:o.challenge_id,credential:m})}catch(o){if(L(o))return this._returnResult({data:null,error:o});throw o}}async registerPasskey(t){var r,n;try{if(!kc())return this._returnResult({data:null,error:new mr("Browser does not support WebAuthn",null)});const{data:s,error:i}=await this._startPasskeyRegistration();if(i||!s)return this._returnResult({data:null,error:i});const o=Mv(s.options),l=(n=(r=t==null?void 0:t.options)===null||r===void 0?void 0:r.signal)!==null&&n!==void 0?n:Xh.createNewAbortSignal(),{data:c,error:u}=await o1({publicKey:o,signal:l});if(u||!c)return this._returnResult({data:null,error:u??new mr("WebAuthn ceremony failed",null)});const d=Fv(c);return this._verifyPasskeyRegistration({challengeId:s.challenge_id,credential:d})}catch(s){if(L(s))return this._returnResult({data:null,error:s});throw s}}async _startPasskeyRegistration(){try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new qe});const{data:s,error:i}=await W(this.fetch,"POST",`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:r.access_token,body:{}});return i?this._returnResult({data:null,error:i}):this._returnResult({data:s,error:null})})}catch(t){if(L(t))return this._returnResult({data:null,error:t});throw t}}async _verifyPasskeyRegistration(t){try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!n)return this._returnResult({data:null,error:new qe});const{data:i,error:o}=await W(this.fetch,"POST",`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:n.access_token,body:{challenge_id:t.challengeId,credential:t.credential}});return o?this._returnResult({data:null,error:o}):this._returnResult({data:i,error:null})})}catch(r){if(L(r))return this._returnResult({data:null,error:r});throw r}}async _startPasskeyAuthentication(t){var r;try{const{data:n,error:s}=await W(this.fetch,"POST",`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:(r=t==null?void 0:t.options)===null||r===void 0?void 0:r.captchaToken}}});return s?this._returnResult({data:null,error:s}):this._returnResult({data:n,error:null})}catch(n){if(L(n))return this._returnResult({data:null,error:n});throw n}}async _verifyPasskeyAuthentication(t){try{const{data:r,error:n}=await W(this.fetch,"POST",`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:t.challengeId,credential:t.credential},xform:Wt});return n?this._returnResult({data:null,error:n}):(r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:r,error:null}))}catch(r){if(L(r))return this._returnResult({data:null,error:r});throw r}}async _listPasskeys(){try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new qe});const{data:s,error:i}=await W(this.fetch,"GET",`${this.url}/passkeys`,{headers:this.headers,jwt:r.access_token,xform:o=>({data:o,error:null})});return i?this._returnResult({data:null,error:i}):this._returnResult({data:s,error:null})})}catch(t){if(L(t))return this._returnResult({data:null,error:t});throw t}}async _updatePasskey(t){try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!n)return this._returnResult({data:null,error:new qe});const{data:i,error:o}=await W(this.fetch,"PATCH",`${this.url}/passkeys/${t.passkeyId}`,{headers:this.headers,jwt:n.access_token,body:{friendly_name:t.friendlyName}});return o?this._returnResult({data:null,error:o}):this._returnResult({data:i,error:null})})}catch(r){if(L(r))return this._returnResult({data:null,error:r});throw r}}async _deletePasskey(t){try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!n)return this._returnResult({data:null,error:new qe});const{error:i}
331=await W(this.fetch,"DELETE",`${this.url}/passkeys/${t.passkeyId}`,{headers:this.headers,jwt:n.access_token,noResolveJson:!0});return i?this._returnResult({data:null,error:i}):this._returnResult({data:null,error:null})})}catch(r){if(L(r))return this._returnResult({data:null,error:r});throw r}}}ya.nextInstanceID={};const XO=ya,ZO="2.117.2";let To="",Rc;if(typeof Deno<"u"){var vd;To="deno",Rc=(vd=Deno.version)===null||vd===void 0?void 0:vd.deno}else if(typeof document<"u")To="web";else if(typeof navigator<"u"&&navigator.product==="ReactNative")To="react-native";else{var yd;To="node";const e=globalThis.process;Rc=e==null||(yd=e.version)===null||yd===void 0?void 0:yd.replace(/^v/,"")}const l1=[`runtime=${To}`];Rc&&l1.push(`runtime-version=${Rc}`);const eI={"X-Client-Info":`supabase-js/${ZO}; ${l1.join("; ")}`},tI={headers:eI},rI={schema:"public"},nI={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},sI={},iI={enabled:!1,respectSamplingDecision:!0};function oI(e){if(!e||typeof e!="string")return null;const t=e.split("-");if(t.length!==4)return null;const[r,n,s,i]=t;if(r.length!==2||n.length!==32||s.length!==16||i.length!==2)return null;const o=/^[0-9a-f]+$/i;return!o.test(r)||!o.test(n)||!o.test(s)||!o.test(i)||n==="00000000000000000000000000000000"||s==="0000000000000000"?null:{version:r,traceId:n,parentId:s,traceFlags:i,isSampled:(parseInt(i,16)&1)===1}}function aI(e,t){if(!e||!t||t.length===0)return!1;let r;if(e instanceof URL)r=e;else try{r=new URL(e)}catch{return!1}for(const n of t)try{if(typeof n=="string"){if(lI(r.hostname,n))return!0}else if(n instanceof RegExp){if(n.test(r.hostname))return!0}else if(typeof n=="function"&&n(r))return!0}catch{continue}return!1}function lI(e,t){if(t===e)return!0;if(t.startsWith("*.")){const r=t.slice(2);if(e.endsWith(r)&&(e===r||e.endsWith("."+r)))return!0}return!1}function cI(e){const t=[];try{const r=new URL(e);t.push(r.hostname)}catch{}return t.push("*.supabase.co","*.supabase.in"),t.push("localhost","127.0.0.1","[::1]"),t}function xa(e){"@babel/helpers - typeof";return xa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xa(e)}function uI(e,t){if(xa(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(xa(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dI(e){var t=uI(e,"string");return xa(t)=="symbol"?t:t+""}function hI(e,t,r){return(t=dI(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Bv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Oe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Bv(Object(r),!0).forEach(function(n){hI(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bv(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}const fI=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),pI=()=>Headers,c1=e=>e.startsWith("sb_publishable_")||e.startsWith("sb_secret_"),mI="sb_temp_",Vv=new Set,gI=e=>{var t,r;if(!e.startsWith("sb_")||c1(e)||e.startsWith(mI))return;const n=(t=(r=e.match(/^sb_[a-zA-Z0-9]+_/))===null||r===void 0?void 0:r[0])!==null&&t!==void 0?t:"unknown";Vv.has(n)||(Vv.add(n),console.warn("@supabase/supabase-js: Unrecognized Supabase API key format. The client will proceed and send this key as-is; if you see authentication errors you may need to upgrade @supabase/supabase-js to a version that recognizes this key type."))},Wv=(e,t,r,n,s,i)=>{const o=fI(n),l=pI(),c=(s==null?void 0:s.enabled)===!0,u=(s==null?void 0:s.respectSamplingDecision)!==!1,d=c?cI(t):null,h=!(i!=null&&i.omitApiKeyAsBearer&&c1(e));return async(m,p)=>{const w=await r();let g=new l(p==null?void 0:p.headers);if(g.has("apikey")||g.set("apikey",e),!g.has("Authorization")){const v=w??(h?e:null);v&&g.set("Authorization",`Bearer ${v}`)}if(d){const v=vI(m,d,u);v&&(v.traceparent&&!g.has("traceparent")&&g.set("traceparent",v.traceparent),v.tracestate&&!g.has("tracestate")&&g.set("tracestate",v.tracestate),v.baggage&&!g.has("baggage")&&g.set("baggage",v.baggage))}return o(m,Oe(Oe({},p),{},{headers:g}))}};let Hv=!1,qv=!1;function vI(e,t,r){const n=mP();if(!n)return Hv||(Hv=!0,console.warn("@supabase/supabase-js: tracePropagation is enabled but the tracing runtime is not loaded, so trace headers will not be attached. Add `import '@supabase/supabase-js/tracing'` at your application entry point (requires the OpenTelemetry API package to be installed). The CDN/UMD build does not support trace propagation.")),null;if(!aI(typeof e=="string"||e instanceof URL?e:e.url,t))return null;const s=n();if(!s||!s.traceparent){var i;if(!(s==null||(i=s.carrierKeys)===null||i===void 0)&&i.length&&!qv){qv=!0;const o=s.carrierKeys.includes("sentry-trace")?" Sentry detected: set `propagateTraceparent: true` in Sentry.init() to emit it."
331:" Configure your tracing SDK to emit W3C trace context on outgoing requests.";console.warn(`@supabase/supabase-js: tracePropagation is enabled and a tracing SDK is active, but its propagator wrote [${s.carrierKeys.join(", ")}] and no W3C traceparent header, so trace headers will not be attached.`+o)}return null}if(r){const o=oI(s.traceparent);if(o&&!o.isSampled)return{traceparent:s.traceparent}}return s}function Kv(e){return typeof e=="boolean"?{enabled:e}:e}function yI(e){return e.endsWith("/")?e:e+"/"}let Gv=!1;function xI(e){Gv||typeof e!="object"||e===null||!("schema"in e)||e.schema===void 0||(Gv=!0,console.warn(`@supabase/supabase-js: The "schema" option must be nested under "db", e.g. createClient(url, key, { db: { schema: 'myschema' } }). A top-level "schema" is ignored and queries go to the default schema.`))}function wI(e,t){var r,n,s,i,o,l;const{db:c,auth:u,realtime:d,global:h}=e,{db:m,auth:p,realtime:w,global:g}=t,v=Kv(e.tracePropagation),x=Kv(t.tracePropagation),y={db:Oe(Oe({},m),c),auth:Oe(Oe({},p),u),realtime:Oe(Oe({},w),d),storage:{},global:Oe(Oe(Oe({},g),h),{},{headers:Oe(Oe({},(r=g==null?void 0:g.headers)!==null&&r!==void 0?r:{}),(n=h==null?void 0:h.headers)!==null&&n!==void 0?n:{})}),tracePropagation:{enabled:(s=(i=v==null?void 0:v.enabled)!==null&&i!==void 0?i:x==null?void 0:x.enabled)!==null&&s!==void 0?s:!1,respectSamplingDecision:(o=(l=v==null?void 0:v.respectSamplingDecision)!==null&&l!==void 0?l:x==null?void 0:x.respectSamplingDecision)!==null&&o!==void 0?o:!0},accessToken:async()=>""};return e.accessToken?y.accessToken=e.accessToken:delete y.accessToken,y}function bI(e){const t=e==null?void 0:e.trim();if(!t)throw new Error("supabaseUrl is required.");if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(yI(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var _I=class extends XO{constructor(e){super(e)}},SI=class{constructor(e,t,r){var n,s;this.supabaseUrl=e,this.supabaseKey=t;const i=bI(e);if(!t)throw new Error("supabaseKey is required.");gI(t),xI(r),this.realtimeUrl=new URL("realtime/v1",i),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",i),this.storageUrl=new URL("storage/v1",i),this.functionsUrl=new URL("functions/v1",i);const o=`sb-${i.hostname.split(".")[0]}-auth-token`,l={db:rI,realtime:sI,auth:Oe(Oe({},nI),{},{storageKey:o}),global:tI,tracePropagation:iI},c=wI(r??{},l);if(this.settings=c,this.storageKey=(n=c.auth.storageKey)!==null&&n!==void 0?n:"",this.headers=(s=c.global.headers)!==null&&s!==void 0?s:{},c.accessToken)this.accessToken=c.accessToken,this.auth=new Proxy({},{get:(d,h)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(h)} is not possible`)}});else{var u;this.auth=this._initSupabaseAuthClient((u=c.auth)!==null&&u!==void 0?u:{},this.headers,c.global.fetch)}this.fetch=Wv(t,e,this._getSessionToken.bind(this),c.global.fetch,c.tracePropagation),this.functionsFetch=Wv(t,e,this._getSessionToken.bind(this),c.global.fetch,c.tracePropagation,{omitApiKeyAsBearer:!0}),this.realtime=this._initRealtimeClient(Oe({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},c.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(d=>this.realtime.setAuth(d)).catch(d=>console.warn("Failed to set initial Realtime auth token:",d)),this.rest=new TP(new URL("rest/v1",i).href,{headers:this.headers,schema:c.db.schema,fetch:this.fetch,timeout:c.db.timeout,urlLengthLimit:c.db.urlLengthLimit,retry:c.db.retry}),this.storage=new YA(this.storageUrl.href,this.headers,this.fetch,r==null?void 0:r.storage),c.accessToken||this._listenForAuthEvents()}get functions(){return new xP(this.functionsUrl.href,{headers:this.headers,customFetch:this.functionsFetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}getOpenApiSpec(){return this.rest.getOpenApiSpec()}rpc(e,t={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,r)}
331channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getSessionToken(){var e=this,t,r;if(e.accessToken)return await e.accessToken();const{data:n}=await e.auth.getSession();return(t=(r=n.session)===null||r===void 0?void 0:r.access_token)!==null&&t!==void 0?t:null}async _getAccessToken(){var e=this,t;return(t=await e._getSessionToken())!==null&&t!==void 0?t:e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,userStorage:s,storageKey:i,flowType:o,lock:l,debug:c,throwOnError:u,experimental:d,lockAcquireTimeout:h,skipAutoInitialize:m},p,w){const g={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new _I({url:this.authUrl.href,headers:Oe(Oe({},g),p),storageKey:i,autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,userStorage:s,flowType:o,lock:l,debug:c,throwOnError:u,experimental:d,fetch:w,lockAcquireTimeout:h,skipAutoInitialize:m,hasCustomAuthorizationHeader:Object.keys(this.headers).some(v=>v.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new wA(this.realtimeUrl.href,Oe(Oe({},e),{},{params:Oe(Oe({},{apikey:this.supabaseKey}),e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",t==null?void 0:t.access_token)})}_handleTokenChanged(e,t,r){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN"||e==="INITIAL_SESSION")&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const jI=(e,t,r)=>new SI(e,t,r);function EI(){if(typeof window<"u"||globalThis.Deno!==void 0)return!1;const e=globalThis.process;if(!e)return!1;const t=e.version;if(t==null)return!1;const r=t.match(/^v(\d+)\./);return r?parseInt(r[1],10)<=20:!1}EI()&&console.warn("â ï¸ Node.js 20 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 22 or later. For more information, visit: https://github.com/orgs/supabase/discussions/45715");function CI(){var v,x;if(typeof window>"u")return;const e=location.hostname,r=["lovableproject.com","lovableproject-dev.com","lovable.app","gpt-eng.com","gptengineer.run"].some(y=>e===y||e.endsWith("."+y)),n="[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}",s=r?((v=e.match(new RegExp("^(?:id-preview(?:-[a-z0-9]+)?|project)--("+n+")(?:-dev)?(?=\\.|$)","i")))==null?void 0:v[1])??((x=e.match(new RegExp("^("+n+")(?=[.-])","i")))==null?void 0:x[1]):void 0,i=window.parent&&window.parent!==window;if(!s||!i)return localStorage;const o=e.endsWith(".lovableproject-dev.com")||e.endsWith(".gpt-eng.com"),l=o?/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$|^http:\/\/localhost:3000$/:/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$/,c=location.ancestorOrigins&&location.ancestorOrigins[0]||(document.referrer?new URL(document.referrer).origin:""),u=c&&l.test(c)?[c]:o?["https://lovable.dev","http://localhost:3000"]:["https://lovable.dev"],d="lovable-preview-auth:result",h=2e3,m=()=>Math.random().toString(36).slice(2)+Date.now().toString(36),p=(y,b,S)=>new Promise(_=>{const j=m();let E=!1,C;const N=I=>{E||(E=!0,clearTimeout(C),window.removeEventListener("message",R),_(I))},R=I=>
331{if(u.indexOf(I.origin)<0)return;const J=I.data;J&&J.type===d&&J.requestId===j&&N(J)};window.addEventListener("message",R);const F={type:y,requestId:j,projectId:s,key:b};S!==void 0&&(F.value=S);for(const I of u)window.parent.postMessage(F,I);C=setTimeout(()=>N(null),h)});let w=!0;const g=250;return{getItem:async y=>{let b=await p("lovable-preview-auth:get",y);return!b&&w&&(await new Promise(S=>setTimeout(S,g)),b=await p("lovable-preview-auth:get",y)),w=!1,b&&b.ok&&typeof b.value=="string"?b.value===""?(localStorage.removeItem(y),null):b.value:localStorage.getItem(y)},setItem:(y,b)=>(localStorage.setItem(y,b),p("lovable-preview-auth:set",y,b).then(S=>{S&&S.ok&&typeof S.value=="string"&&localStorage.getItem(y)===b&&(S.value===""?localStorage.removeItem(y):localStorage.setItem(y,S.value))})),removeItem:y=>(localStorage.removeItem(y),p("lovable-preview-auth:remove",y).then(()=>{}))}}const NI="https://evolution-api-supabase.1z1nyh.easypanel.host",kI="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJhbm9uIiwKICAgICJpc3MiOiAic3VwYWJhc2UtZGVtbyIsCiAgICAiaWF0IjogMTY0MTc2OTIwMCwKICAgICJleHAiOiAxNzk5NTM1NjAwCn0.dc_X5iR_VP_qT0zsiyj_I_OZ2T9FtRU2BBNWN8Bu4GE",V=jI(NI,kI,{auth:{storage:CI(),persistSession:!0,autoRefreshToken:!0}}),Ji="/assets/logo-BtgbyFGD.png",La=()=>{const[e,t]=f.useState(!1),[r,n]=f.useState(!1),[s,i]=f.useState([]);f.useEffect(()=>{const c=()=>{n(window.scrollY>50)};return window.addEventListener("scroll",c),()=>window.removeEventListener("scroll",c)},[]),f.useEffect(()=>{l()},[]);const o=c=>c.startsWith("#")?`/${c}`:c,l=async()=>{try{const{data:c,error:u}=await V.from("menu_items").select("*").order("display_order",{ascending:!0});if(u)throw u;const d=c||[],m=d.filter(p=>!p.parent_id).map(p=>({...p,children:d.filter(w=>w.parent_id===p.id)}));i(m)}catch(c){console.error("Error loading menu items:",c)}};return a.jsxs("header",{className:"fixed top-0 left-0 right-0 z-50",children:[a.jsx("div",{className:"h-1 bg-gradient-to-r from-primary via-primary-glow to-primary"}),a.jsxs("div",{className:`transition-smooth ${r?"bg-background/95 backdrop-blur-md shadow-elegant":"bg-background/80 backdrop-blur-sm"}`,children:[a.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"grid grid-cols-[auto_1fr_auto] items-center gap-4 h-20 lg:h-24",children:[a.jsx("a",{href:"/#inicio",className:"flex items-center justify-start shrink-0",children:a.jsx("img",{src:Ji,alt:"DCC Energy",className:"h-12 lg:h-14 w-auto object-contain"})}),a.jsx(Ob,{className:"hidden lg:flex mx-auto",children:a.jsxs(Ib,{className:"flex items-center gap-1",children:[a.jsx(dd,{children:a.jsx(hd,{asChild:!0,children:a.jsx(Ns,{to:"/blog",className:"group inline-flex h-10 w-max items-center justify-center rounded-md bg-transparent px-4 py-2 text-sm font-medium transition-colors hover:text-primary focus:text-primary focus:outline-none relative after:content-[''] after:absolute after:w-full after:scale-x-0 after:h-0.5 after:bottom-2 after:left-0 after:bg-primary after:origin-bottom-right after:transition-transform after:duration-300 hover:after:scale-x-100 hover:after:origin-bottom-left",children:"Blog"})})}),s.map(c=>c.children&&c.children.length>0?a.jsxs(dd,{children:[a.jsx(Db,{className:"bg-transparent hover:bg-transparent hover:text-primary data-[state=open]:bg-transparent data-[state=open]:text-primary relative after:content-[''] after:absolute after:w-full after:scale-x-0 after:h-0.5 after:bottom-2 after:left-0 after:bg-primary after:origin-bottom-right after:transition-transform after:duration-300 hover:after:scale-x-100 hover:after:origin-bottom-left data-[state=open]:after:scale-x-100",children:c.label}),a.jsx(Lb,{children:a.jsx("ul",{className:"grid w-[200px] gap-1 p-2 bg-background border border-border rounded-md shadow-lg z-50",children:c.children.map(u=>a.jsx("li",{children:a.jsx(hd,{asChild:!0,children:a.jsx("a",{href:o(u.link),target:u.link.startsWith("http")?"_blank":void 0,rel:u.link.startsWith("http")?"noopener noreferrer":void 0,className:"block select-none rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",children:u.label})})},u.id))})})]},c.id):a.jsx(dd,{children:a.jsx(hd,{asChild:!0,children:a.jsx("a",{href:o(c.link),target:c.link.startsWith("http")?"_blank":void 0,rel:c.link.startsWith("http")?"noopener noreferrer":void 0,className:"group inline-flex h-10 w-max items-center justify-center rounded-md bg-transparent px-4 py-2 text-sm font-medium transition-colors hover:text-primary focus:text-primary focus:outline-none disabled:pointer-events-none disabled:opacity-50 relative after:content-[''] after:absolute after:w-full after:scale-x-0 after:h-0.5 after:bottom-2 after:left-0 after:bg-primary after:origin-bottom-right after:transition-transform after:duration-300 hover:after:scale-x-100 hover:after:origin-bottom-left",children:c.label})})},c.id))]})}),a.jsxs("div",{className:"hidden lg:flex items-center justify-end gap-2 shrink-0",children:[a.jsx(B,{variant:"hero",size:"sm",asChild:!0,className:"text-sm px-4 whitespace-nowrap",children:a.jsx("a",{href:"/#contato",children:"Solicite um Orçamento"})}),a.jsx(iv,{})]}),a.jsx("button",{className:"lg:hidden ml-auto p-2 hover:bg-accent rounded-md transition-colors shrink-0",onClick:()=>t(!e),"aria-label":"Toggle menu",children:e?a.jsx(gp,{size:24,className:"text-foreground"}):a.jsx(CN,{size:24,className:"text-foreground"})})]})}),e&&a.jsx("div",{className:"lg:hidden bg-background border-t border-border animate-fade-in",children:a.jsxs("nav",{className:"flex flex-col space-y-1 px-4 py-4 max-w-7xl mx-auto",children:[a.jsx("div",{className:"flex justify-center pb-4 mb-4 border-b border-border",children:a.jsx("img",{src:Ji,alt:"DCC Energy",className:"h-12 w-auto object-contain"})}),a.jsx(Ns,{to:"/blog",className:"relative text-foreground hover:text-primary hover:bg-accent/50 transition-smooth font-medium py-2 px-3 rounded-md text-base after:content-[''] after:absolute after:w-full after:scale-x-0 after:h-0.5 after:bottom-1 after:left-0 after:bg-primary after:origin-bottom-right after:transition-transform after:duration-300 hover:after:scale-x-100 hover:after:origin-bottom-left",onClick:()=>t(!1),children:"Blog"}),s.map(c=>a.jsx("div",{children:c.children&&c.children.length>0?a.jsxs(a.Fragment,{children:[a.jsxs("button",{onClick:()=>{const u=document.getElementById(`submenu-${c.id}`);u&&u.classList.toggle("hidden")},className:"w-full flex items-center justify-between text-foreground hover:text-primary hover:bg-accent/50 transition-smooth font-medium py-2 px-3 rounded-md text-base",children:[a.jsx("span",{children:c.label}),a.jsx(Pa,{className:"h-4 w-4"})]}),a.jsx("div",{id:`submenu-${c.id}`,className:"hidden pl-4 mt-1 space-y-1",children:c.children.map(u=>a.jsx("a",{href:o(u.link),target:u.link.startsWith("http")?"_blank":void 0,rel:u.link.startsWith("http")?"noopener noreferrer":void 0,className:"block text-sm text-muted-foreground hover:text-primary hover:bg-accent/50 transition-smooth py-2 px-3 rounded-md",onClick:()=>t(!1),children:u.label},u.id))})]}):a.jsx("a",{href:o(c.link),target:c.link.startsWith("http")?"_blank":void 0,rel:c.link.startsWith("http")?"noopener noreferrer":void 0,className:"relative text-foreground hover:text-primary hover:bg-accent/50 transition-smooth font-medium py-2 px-3 rounded-md text-base after:content-[''] after:absolute after:w-full after:scale-x-0 after:h-0.5 after:bottom-1 after:left-0 after:bg-primary after:origin-bottom-right after:transition-transform after:duration-300 hover:after:scale-x-100 hover:after:origin-bottom-left",onClick:()=>t(!1),children:c.label})},c.id)),a.jsxs("div",{className:"flex items-center gap-3 pt-2 border-t border-border mt-2",children:[a.jsx(B,{variant:"hero",size:"sm",asChild:!0,className:"flex-1",children:a.jsx("a",{href:"/#contato",onClick:()=>t(!1),children:"Solicite um Orçamento"})}),a.jsx(iv,{})]})]})})]})]})};var xd="focusScope.autoFocusOnMount",wd="focusScope.autoFocusOnUnmount",Jv={bubbles:!1,cancelable:!0},TI="FocusScope",zp=f.forwardRef((e,t)=>
vendor: 5,003 bytes, line 331
331{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...o}=e,[l,c]=f.useState(null),u=xe(s),d=xe(i),h=f.useRef(null),m=oe(t,g=>c(g)),p=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(n){let g=function(b){if(p.paused||!l)return;const S=b.target;l.contains(S)?h.current=S:bn(h.current,{select:!0})},v=function(b){if(p.paused||!l)return;const S=b.relatedTarget;S!==null&&(l.contains(S)||bn(h.current,{select:!0}))},x=function(b){if(document.activeElement===document.body)for(const _ of b)_.removedNodes.length>0&&bn(l)};document.addEventListener("focusin",g),document.addEventListener("focusout",v);const y=new MutationObserver(x);return l&&y.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",v),y.disconnect()}}},[n,l,p.paused]),f.useEffect(()=>{if(l){Qv.add(p);const g=document.activeElement;if(!l.contains(g)){const x=new CustomEvent(xd,Jv);l.addEventListener(xd,u),l.dispatchEvent(x),x.defaultPrevented||(RI(DI(u1(l)),{select:!0}),document.activeElement===g&&bn(l))}return()=>{l.removeEventListener(xd,u),setTimeout(()=>{const x=new CustomEvent(wd,Jv);l.addEventListener(wd,d),l.dispatchEvent(x),x.defaultPrevented||bn(g??document.body,{select:!0}),l.removeEventListener(wd,d),Qv.remove(p)},0)}}},[l,u,d,p]);const w=f.useCallback(g=>{if(!r&&!n||p.paused)return;const v=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,x=document.activeElement;if(v&&x){const y=g.currentTarget,[b,S]=PI(y);b&&S?!g.shiftKey&&x===S?(g.preventDefault(),r&&bn(b,{select:!0})):g.shiftKey&&x===b&&(g.preventDefault(),r&&bn(S,{select:!0})):x===y&&g.preventDefault()}},[r,n,p.paused]);return a.jsx(K.div,{tabIndex:-1,...o,ref:m,onKeyDown:w})});zp.displayName=TI;function RI(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(bn(n,{select:t}),document.activeElement!==r)return}function PI(e){const t=u1(e),r=Yv(t,e),n=Yv(t.reverse(),e);return[r,n]}function u1(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Yv(e,t){for(const r of e)if(!AI(r,{upTo:t}))return r}function AI(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 OI(e){return e instanceof HTMLInputElement&&"select"in e}function bn(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&OI(e)&&t&&e.select()}}var Qv=II();function II(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=Xv(e,t),e.unshift(t)},remove(t){var r;e=Xv(e,t),(r=e[0])==null||r.resume()}}}function Xv(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function DI(e){return e.filter(t=>t.tagName!=="A")}var bd=0;function d1(){f.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Zv()),document.body.insertAdjacentElement("beforeend",e[1]??Zv()),bd++,()=>{bd===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),bd--}},[])}function Zv(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Rr=function(){return Rr=Object.assign||function(t){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},Rr.apply(this,arguments)};function h1(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}function LI(e,t,r){if(r||arguments.length===2)for(var n=0,s=t.length,i;n<s;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}var Ul="right-scroll-bar-position",zl="width-before-scroll-bar",MI="with-scroll-bars-hidden",$I="--removed-body-scroll-bar-size";function _d(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function FI(e,t){var r=f.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var s=r.value;s!==n&&(r.value=n,r.callback(n,s))}}}})[0];return r.callback=t,r.facade}var UI=typeof window<"u"?f.useLayoutEffect:f.useEffect,ey=new WeakMap;function zI(e,t){var r=FI(null,function(n){return e.forEach(function(s){return _d(s,n)})});return UI(function(){var n=ey.get(r);if(n){var s=new Set(n),i=new Set(e),o=r.current;
vendor: 4,196 bytes, lines 331-346
331s.forEach(function(l){i.has(l)||_d(l,null)}),i.forEach(function(l){s.has(l)||_d(l,o)})}ey.set(r,e)},[e]),r}function BI(e){return e}function VI(e,t){t===void 0&&(t=BI);var r=[],n=!1,s={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var o=t(i,n);return r.push(o),function(){r=r.filter(function(l){return l!==o})}},assignSyncMedium:function(i){for(n=!0;r.length;){var o=r;r=[],o.forEach(i)}r={push:function(l){return i(l)},filter:function(){return r}}},assignMedium:function(i){n=!0;var o=[];if(r.length){var l=r;r=[],l.forEach(i),o=r}var c=function(){var d=o;o=[],d.forEach(i)},u=function(){return Promise.resolve().then(c)};u(),r={push:function(d){o.push(d),u()},filter:function(d){return o=o.filter(d),r}}}};return s}function WI(e){e===void 0&&(e={});var t=VI(null);return t.options=Rr({async:!0,ssr:!1},e),t}var f1=function(e){var t=e.sideCar,r=h1(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return f.createElement(n,Rr({},r))};f1.isSideCarExport=!0;function HI(e,t){return e.useMedium(t),f1}var p1=WI(),Sd=function(){},vu=f.forwardRef(function(e,t){var r=f.useRef(null),n=f.useState({onScrollCapture:Sd,onWheelCapture:Sd,onTouchMoveCapture:Sd}),s=n[0],i=n[1],o=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,h=e.shards,m=e.sideCar,p=e.noRelative,w=e.noIsolation,g=e.inert,v=e.allowPinchZoom,x=e.as,y=x===void 0?"div":x,b=e.gapMode,S=h1(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=m,j=zI([r,t]),E=Rr(Rr({},S),s);return f.createElement(f.Fragment,null,d&&f.createElement(_,{sideCar:p1,removeScrollBar:u,shards:h,noRelative:p,noIsolation:w,inert:g,setCallbacks:i,allowPinchZoom:!!v,lockRef:r,gapMode:b}),o?f.cloneElement(f.Children.only(l),Rr(Rr({},E),{ref:j})):f.createElement(y,Rr({},E,{className:c,ref:j}),l))});vu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};vu.classNames={fullWidth:zl,zeroRight:Ul};var qI=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function KI(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=qI();return t&&e.setAttribute("nonce",t),e}function GI(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function JI(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var YI=function(){var e=0,t=null;return{add:function(r){e==0&&(t=KI())&&(GI(t,r),JI(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},QI=function(){var e=YI();return function(t,r){f.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},m1=function(){var e=QI(),t=function(r){var n=r.styles,s=r.dynamic;return e(n,s),null};return t},XI={left:0,top:0,right:0,gap:0},jd=function(e){return parseInt(e||"",10)||0},ZI=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[jd(r),jd(n),jd(s)]},e4=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return XI;var t=ZI(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},t4=m1(),ki="data-scroll-locked",r4=function(e,t,r,n){var s=e.left,i=e.top,o=e.right,l=e.gap;return r===void 0&&(r="margin"),` 332 .`.concat(MI,` { 333 overflow: hidden `).concat(n,`; 334 padding-right: `).concat(l,"px ").concat(n,`; 335 } 336 body[`).concat(ki,`] { 337 overflow: hidden `).concat(n,`; 338 overscroll-behavior: contain; 339 `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&` 340 padding-left: `.concat(s,`px; 341 padding-top: `).concat(i,`px; 342 padding-right: `).concat(o,`px; 343 margin-left:0; 344 margin-top:0; 345 margin-right: `).concat(l,"px ").concat(n,`; 346 `),r==="padding"&&"padding-right: ".concat(l,"px ").concat(n,";
346")].filter(Boolean).join(""),` 347 } 348 349 .`).concat(Ul,` { 350 right: `).concat(l,"px ").concat(n,`; 351 } 352 353 .`).concat(zl,` { 354 margin-right: `).concat(l,"px ").concat(n,`; 355 } 356 357 .`).concat(Ul," .").concat(Ul,` { 358 right: 0 `).concat(n,`; 359 } 360 361 .`).concat(zl," .").concat(zl,` { 362 margin-right: 0 `).concat(n,`; 363 } 364 365 body[`).concat(ki,`] { 366 `).concat($I,": ").concat(l,`px; 367 } 368`)},ty=function(){var e=parseInt(document.body.getAttribute(ki)||"0",10);return isFinite(e)?e:0},n4=function(){f.useEffect(function(){return document.body.setAttribute(ki,(ty()+1).toString()),function(){var e=ty()-1;e<=0?document.body.removeAttribute(ki):document.body.setAttribute(ki,e.toString())}},[])},s4=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,s=n===void 0?"margin":n;n4();var i=f.useMemo(function(){return e4(s)},[s]);return f.createElement(t4,{styles:r4(i,!t,s,r?"":"!important")})},Zh=!1;if(typeof window<"u")try{var vl=Object.defineProperty({},"passive",{get:function(){return Zh=!0,!0}});window.addEventListener("test",vl,vl),window.removeEventListener("test",vl,vl)}catch{Zh=!1}var Xs=Zh?{passive:!1}:!1,i4=function(e){return e.tagName==="TEXTAREA"},g1=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!i4(e)&&r[t]==="visible")},o4=function(e){return g1(e,"overflowY")},a4=function(e){return g1(e,"overflowX")},ry=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=v1(e,n);if(s){var i=y1(e,n),o=i[1],l=i[2];if(o>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},l4=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},c4=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},v1=function(e,t){return e==="v"?o4(t):a4(t)},y1=function(e,t){return e==="v"?l4(t):c4(t)},u4=function(e,t){return e==="h"&&t==="rtl"?-1:1},d4=function(e,t,r,n,s){var i=u4(e,window.getComputedStyle(t).direction),o=i*n,l=r.target,c=t.contains(l),u=!1,d=o>0,h=0,m=0;do{if(!l)break;var p=y1(e,l),w=p[0],g=p[1],v=p[2],x=g-v-i*w;(w||x)&&v1(e,l)&&(h+=x,m+=w);var y=l.parentNode;l=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&(Math.abs(h)<1||!s)||!d&&(Math.abs(m)<1||!s))&&(u=!0),u},yl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ny=function(e){return[e.deltaX,e.deltaY]},sy=function(e){return e&&"current"in e?e.current:e},h4=function(e,t){return e[0]===t[0]&&e[1]===t[1]},f4=function(e){return` 369 .block-interactivity-`.concat(e,` {pointer-events: none;} 370 .allow-interactivity-`).concat(e,` {pointer-events: all;} 371`)},p4=0,Zs=[];function m4(e){var t=f.useRef([]),r=f.useRef([0,0]),n=f.useRef(),s=f.useState(p4++)[0],i=f.useState(m1)[0],o=f.useRef(e);f.useEffect(function(){o.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var g=LI([e.lockRef.current],(e.shards||[]).map(sy),!0).filter(Boolean);return g.forEach(function(v){return v.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),g.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=f.useCallback(function(g,v){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!o.current.allowPinchZoom;var x=yl(g),y=r.current,b="deltaX"in g?g.deltaX:y[0]-x[0],S="deltaY"in g?g.deltaY:y[1]-x[1],_,j=g.target,E=Math.abs(b)>Math.abs(S)?"h":"v";if("touches"in g&&E==="h"&&j.type==="range")return!1;var C=ry(E,j);if(!C)return!0;if(C?_=E:(_=E==="v"?"h":"v",C=ry(E,j)),!C)return!1;if(!n.current&&"changedTouches"in g&&(b||S)&&(n.current=_),!_)return!0;var N=n.current||_;return d4(N,v,g,N==="h"?b:S,!0)},[]),c=f.useCallback(function(g){var v=g;if(!(!Zs.length||Zs[Zs.length-1]!==i)){var x="deltaY"in v?ny(v):yl(v),y=t.current.filter(function(_){return _.name===v.type&&(_.target===v.target||v.target===_.shadowParent)&&h4(_.delta,x)})[0];if(y&&y.should){v.cancelable&&v.preventDefault();return}
vendor: 4,331 bytes, line 371
371if(!y){var b=(o.current.shards||[]).map(sy).filter(Boolean).filter(function(_){return _.contains(v.target)}),S=b.length>0?l(v,b[0]):!o.current.noIsolation;S&&v.cancelable&&v.preventDefault()}}},[]),u=f.useCallback(function(g,v,x,y){var b={name:g,delta:v,target:x,should:y,shadowParent:g4(x)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(S){return S!==b})},1)},[]),d=f.useCallback(function(g){r.current=yl(g),n.current=void 0},[]),h=f.useCallback(function(g){u(g.type,ny(g),g.target,l(g,e.lockRef.current))},[]),m=f.useCallback(function(g){u(g.type,yl(g),g.target,l(g,e.lockRef.current))},[]);f.useEffect(function(){return Zs.push(i),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:m}),document.addEventListener("wheel",c,Xs),document.addEventListener("touchmove",c,Xs),document.addEventListener("touchstart",d,Xs),function(){Zs=Zs.filter(function(g){return g!==i}),document.removeEventListener("wheel",c,Xs),document.removeEventListener("touchmove",c,Xs),document.removeEventListener("touchstart",d,Xs)}},[]);var p=e.removeScrollBar,w=e.inert;return f.createElement(f.Fragment,null,w?f.createElement(i,{styles:f4(s)}):null,p?f.createElement(s4,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function g4(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const v4=HI(p1,m4);var Bp=f.forwardRef(function(e,t){return f.createElement(vu,Rr({},e,{ref:t,sideCar:v4}))});Bp.classNames=vu.classNames;var y4=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ei=new WeakMap,xl=new WeakMap,wl={},Ed=0,x1=function(e){return e&&(e.host||x1(e.parentNode))},x4=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=x1(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},w4=function(e,t,r,n){var s=x4(t,Array.isArray(e)?e:[e]);wl[r]||(wl[r]=new WeakMap);var i=wl[r],o=[],l=new Set,c=new Set(s),u=function(h){!h||l.has(h)||(l.add(h),u(h.parentNode))};s.forEach(u);var d=function(h){!h||c.has(h)||Array.prototype.forEach.call(h.children,function(m){if(l.has(m))d(m);else try{var p=m.getAttribute(n),w=p!==null&&p!=="false",g=(ei.get(m)||0)+1,v=(i.get(m)||0)+1;ei.set(m,g),i.set(m,v),o.push(m),g===1&&w&&xl.set(m,!0),v===1&&m.setAttribute(r,"true"),w||m.setAttribute(n,"true")}catch(x){console.error("aria-hidden: cannot operate on ",m,x)}})};return d(t),l.clear(),Ed++,function(){o.forEach(function(h){var m=ei.get(h)-1,p=i.get(h)-1;ei.set(h,m),i.set(h,p),m||(xl.has(h)||h.removeAttribute(n),xl.delete(h)),p||h.removeAttribute(r)}),Ed--,Ed||(ei=new WeakMap,ei=new WeakMap,xl=new WeakMap,wl={})}},w1=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),s=y4(e);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live]"))),w4(n,s,r,"aria-hidden")):function(){return null}},yu="Dialog",[b1,WL]=zt(yu),[b4,br]=b1(yu),_1=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:s,onOpenChange:i,modal:o=!0}=e,l=f.useRef(null),c=f.useRef(null),[u,d]=Ir({prop:n,defaultProp:s??!1,onChange:i,caller:yu});return a.jsx(b4,{scope:t,triggerRef:l,contentRef:c,contentId:Or(),titleId:Or(),descriptionId:Or(),open:u,onOpenChange:d,onOpenToggle:f.useCallback(()=>d(h=>!h),[d]),modal:o,children:r})};_1.displayName=yu;var S1="DialogTrigger",j1=f.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=br(S1,r),i=oe(t,s.triggerRef);return a.jsx(K.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Hp(s.open),...n,ref:i,onClick:$(e.onClick,s.onOpenToggle)})});j1.displayName=S1;var Vp="DialogPortal",[_4,E1]=b1(Vp,{forceMount:void 0}),C1=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:s}=e,i=br(Vp,t);return a.jsx(_4,{scope:t,forceMount:r,children:f.Children.map(n,o=>a.jsx(dt,{present:r||i.open,children:a.jsx(eu,{asChild:!0,container:s,children:o})}))})};C1.displayName=Vp;var Pc="DialogOverlay",N1=f.forwardRef((e,t)=>{const r=E1(Pc,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,i=br(Pc,e.__scopeDialog);return i.modal?a.jsx(dt,{present:n||i.open,children:a.jsx(j4,{...s,ref:t})}):null});N1.displayName=Pc;var S4=Wi("DialogOverlay.RemoveScroll"),j4=f.forwardRef((e,t)=>
vendor: 4,632 bytes, lines 371-375
371{const{__scopeDialog:r,...n}=e,s=br(Pc,r);return a.jsx(Bp,{as:S4,allowPinchZoom:!0,shards:[s.contentRef],children:a.jsx(K.div,{"data-state":Hp(s.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),Is="DialogContent",k1=f.forwardRef((e,t)=>{const r=E1(Is,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,i=br(Is,e.__scopeDialog);return a.jsx(dt,{present:n||i.open,children:i.modal?a.jsx(E4,{...s,ref:t}):a.jsx(C4,{...s,ref:t})})});k1.displayName=Is;var E4=f.forwardRef((e,t)=>{const r=br(Is,e.__scopeDialog),n=f.useRef(null),s=oe(t,r.contentRef,n);return f.useEffect(()=>{const i=n.current;if(i)return w1(i)},[]),a.jsx(T1,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:$(e.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=r.triggerRef.current)==null||o.focus()}),onPointerDownOutside:$(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&i.preventDefault()}),onFocusOutside:$(e.onFocusOutside,i=>i.preventDefault())})}),C4=f.forwardRef((e,t)=>{const r=br(Is,e.__scopeDialog),n=f.useRef(!1),s=f.useRef(!1);return a.jsx(T1,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(n.current||(l=r.triggerRef.current)==null||l.focus(),i.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:i=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=i.target;((u=r.triggerRef.current)==null?void 0:u.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),T1=f.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:i,...o}=e,l=br(Is,r),c=f.useRef(null),u=oe(t,c);return d1(),a.jsxs(a.Fragment,{children:[a.jsx(zp,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:i,children:a.jsx(eo,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Hp(l.open),...o,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(N4,{titleId:l.titleId}),a.jsx(T4,{contentRef:c,descriptionId:l.descriptionId})]})]})}),Wp="DialogTitle",R1=f.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=br(Wp,r);return a.jsx(K.h2,{id:s.titleId,...n,ref:t})});R1.displayName=Wp;var P1="DialogDescription",A1=f.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=br(P1,r);return a.jsx(K.p,{id:s.descriptionId,...n,ref:t})});A1.displayName=P1;var O1="DialogClose",I1=f.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=br(O1,r);return a.jsx(K.button,{type:"button",...n,ref:t,onClick:$(e.onClick,()=>s.onOpenChange(!1))})});I1.displayName=O1;function Hp(e){return e?"open":"closed"}var D1="DialogTitleWarning",[HL,L1]=_C(D1,{contentName:Is,titleName:Wp,docsSlug:"dialog"}),N4=({titleId:e})=>{const t=L1(D1),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. 372 373If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. 374 375For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return f.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},k4="DialogDescriptionWarning",T4=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${L1(k4).contentName}}.`;return f.useEffect(()=>{var i;const s=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},R4=_1,P4=j1,A4=C1,M1=N1,$1=k1,F1=R1,U1=A1,O4=I1;const Je=R4,Ct=P4,I4=A4,z1=f.forwardRef(({className:e,...t},r)=>a.jsx(M1,{ref:r,className:te("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}));z1.displayName=M1.displayName;const He=f.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(I4,{children:[a.jsx(z1,{}),a.jsxs($1,{ref:n,className:te("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rou
375nded-lg",e),...r,children:[t,a.jsxs(O4,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[a.jsx(gp,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));He.displayName=$1.displayName;const rt=({className:e,...t})=>a.jsx("div",{className:te("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});rt.displayName="DialogHeader";const Ye=f.forwardRef(({className:e,...t},r)=>a.jsx(F1,{ref:r,className:te("text-lg font-semibold leading-none tracking-tight",e),...t}));Ye.displayName=F1.displayName;const D4=f.forwardRef(({className:e,...t},r)=>a.jsx(U1,{ref:r,className:te("text-sm text-muted-foreground",e),...t}));D4.displayName=U1.displayName;const L4=Ra("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Ze({className:e,variant:t,...r}){return a.jsx("div",{className:te(L4({variant:t}),e),...r})}const M4=()=>{const[e,t]=f.useState(0),[r,n]=f.useState([]),[s,i]=f.useState(!0),[o,l]=f.useState(null);f.useEffect(()=>{c()},[]);const c=async()=>{const{data:g,error:v}=await V.from("hero_slides").select("*").order("display_order",{ascending:!0});if(!v&&g){const x=await Promise.all(g.map(async y=>{if(y.news_link){const{data:b}=await V.from("news").select("*").eq("id",y.news_link).single();return{...y,news_data:b}}return y}));n(x)}i(!1)},u=async g=>{const{data:v,error:x}=await V.from("news").select("*").eq("id",g).single();!x&&v&&l(v)};if(f.useEffect(()=>{var x;if(r.length===0)return;const g=(((x=r[e])==null?void 0:x.duration_seconds)||5)*1e3,v=setInterval(()=>{t(y=>(y+1)%r.length)},g);return()=>clearInterval(v)},[r.length,e,r]),s)return a.jsx("section",{className:"relative w-full h-screen flex items-center justify-center bg-background",children:a.jsx(De,{className:"h-12 w-12 animate-spin text-primary"})});if(r.length===0)return null;const d=r[e],h=d.news_data?d.news_position||"center":null,m=()=>{var g,v,x;return a.jsx("div",{className:"w-full max-w-4xl mx-auto animate-fade-in",children:a.jsxs("div",{className:"flex flex-col gap-4",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"h-px flex-1 bg-gradient-to-r from-transparent via-primary/60 to-primary"}),a.jsx("span",{className:"inline-flex items-center px-4 py-1.5 rounded-full text-xs font-bold bg-primary/90 text-primary-foreground shadow-glow backdrop-blur-sm",children:(g=d.news_data)!=null&&g.is_new?"ð¥ Novidade":"ð° NotÃcia"}),a.jsx("div",{className:"h-px flex-1 bg-gradient-to-r from-primary via-primary/60 to-transparent"})]}),a.jsxs("div",{className:"text-center space-y-3",children:[a.jsx("h3",{className:"font-extrabold text-xl sm:text-2xl lg:text-3xl text-white drop-shadow-2xl leading-tight tracking-tight",children:(v=d.news_data)==null?void 0:v.title}),a.jsx("p",{className:"text-sm sm:text-base lg:text-lg text-white/95 drop-shadow-lg max-w-2xl mx-auto line-clamp-2 leading-relaxed",children:(x=d.news_data)==null?void 0:x.content}),a.jsx(B,{variant:"secondary",size:"sm",onClick:()=>u(d.news_link),className:"shadow-elegant hover:shadow-glow hover:scale-105 transition-all duration-300 text-sm font-bold px-6",children:"Ler Mais â"})]})]})},`news-${e}`)},p=()=>a.jsxs("div",{className:"text-center space-y-6",children:[d.title&&a.jsx("h1",{className:"text-4xl md:text-5xl lg:text-6xl font-bold animate-fade-in text-white",children:d.title}),d.description&&a.jsx("p",{className:"text-lg md:text-xl text-white/90 animate-fade-in max-w-3xl mx-auto",children:d.description}),d.button_link&&d.button_text&&a.jsx(B,{variant:"hero",size:"lg",asChild:!0,className:"animate-fade-in",children:a.jsx("a",{href:d.button_link,target:d.button_link.startsWith("http")?"_blank":void 0,rel:d.button_link.startsWith("http")?"noopener noreferrer":void 0,children:d.button_text})})]}),w=()=>{var g,v,x;return a.jsx("div",{className:"w-full max-w-4xl mx-auto mt-12 animate-fade-in",children:a.jsxs("div",{className:"flex flex-col gap-6",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"h-px flex-1 bg-gradient-to-r from-transparent via-primary/60 to-primary"}),a.jsx("span",{className:"inline-flex items-center px-5 py-2 rounded-full text-sm font-bold bg-primary/90 text-primary-foreground shadow-glow backdrop-blur-sm",children:(g=d.news_data)!=null&&g.is_new?"ð¥ Novidade":"ð° NotÃcia"}),a.jsx("div",{className:"h-px flex-1 bg-gradient-to-r from-primary via-primary/60 to-transparent"})]}),a.jsxs("div",{className:"text-center space-y-5",children:[a.jsx("h3",{className:"font-extrabold text-2xl sm:text-3xl lg:text-4xl xl:text-5xl text-white drop-shadow-2xl leading-tight tracking-tight",children:(v=d.news_data)==null?void 0:v.title}),a.jsx("p",{className:"text-base sm:text-lg lg:text-xl text-white/95 drop-shadow-lg max-w-3xl mx-auto line-clamp-3 leading-relaxed",children:(x=d.news_data)==null?void 0:x.content}),a.jsx("div",{className:"pt-2",children:a.jsx(B,{variant:"secondary",size:"lg",onClick:()=>u(d.news_link),className:"shadow-elegant hover:shadow-glow hover:scale-105 transition-all duration-300 text-base font-bold px-8",children:"Ler Mais â"})})]})]})},`news-${e}`)};return a.jsxs("section",{id:"inicio",className:"relative w-full h-[70vh] flex items-center justify-center overflow-hidden z-0",children:[a.jsx("div",{className:"absolute inset-0",children:r.map((g,v)=>a.jsx("div",{className:`absolute inset-0 transition-opacity duration-1000 ${e===v?"opacity-100":"opacity-0"}`,children:g.media_type==="video"&&g.video_url?a.jsx("video",{src:g.video_url,className:"w-full h-full object-cover",autoPlay:!0,loop:!0,muted:!0,playsInl
375ine:!0}):a.jsx("div",{className:"w-full h-full bg-cover bg-center",style:{backgroundImage:`url(${g.image_url})`}})},g.id))}),a.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-black/60 via-black/50 to-black/70"}),a.jsxs("div",{className:"relative z-10 max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 h-full flex flex-col",children:[h==="top"&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"pt-8",children:m()}),a.jsx("div",{className:"flex-1 flex items-center justify-center",children:p()})]}),h==="bottom"&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"flex-1 flex items-center justify-center",children:p()}),a.jsx("div",{className:"pb-16",children:m()})]}),(h==="center"||!h)&&a.jsx("div",{className:"flex-1 flex items-center justify-center",children:a.jsxs("div",{className:"w-full",children:[p(),d.news_data&&w()]})})]}),a.jsx("div",{className:"absolute bottom-8 left-1/2 -translate-x-1/2 flex gap-2 z-20",children:r.map((g,v)=>a.jsx("button",{onClick:()=>t(v),className:`h-2 rounded-full transition-all duration-300 ${e===v?"w-8 bg-white":"w-2 bg-white/50"}`,"aria-label":`Ir para slide ${v+1}`},v))}),a.jsx(Je,{open:!!o,onOpenChange:()=>l(null),children:a.jsxs(He,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[a.jsx(rt,{children:a.jsxs(Ye,{className:"text-2xl flex items-center gap-2",children:[(o==null?void 0:o.is_new)&&a.jsx(Ze,{className:"bg-accent text-accent-foreground",children:"Novidade"}),o==null?void 0:o.title]})}),a.jsxs("div",{className:"space-y-4",children:[(o==null?void 0:o.image_url)&&a.jsx("img",{src:o.image_url,alt:o.title,className:"w-full h-64 object-cover rounded-lg"}),a.jsx("div",{className:"prose prose-sm max-w-none dark:prose-invert",children:a.jsx("p",{className:"whitespace-pre-wrap text-foreground",children:o==null?void 0:o.content})})]})]})})]})},$4=()=>{const[e,t]=f.useState(null),[r,n]=f.useState([]),[s,i]=f.useState(!0);f.useEffect(()=>{o()},[]);const o=async()=>{const[l,c]=await Promise.all([V.from("impact_stats").select("*").order("display_order",{ascending:!0}).limit(1).single(),V.from("impact_numbers").select("*").order("display_order",{ascending:!0})]);l.data&&t(l.data),c.data&&n(c.data),i(!1)};return s?a.jsx("section",{className:"py-16 bg-background/50 backdrop-blur-sm",children:a.jsx("div",{className:"container mx-auto px-4 flex justify-center",children:a.jsx(De,{className:"h-8 w-8 animate-spin text-primary"})})}):!e||r.length===0?null:a.jsx("section",{className:"py-16 bg-gradient-to-b from-background/50 to-background backdrop-blur-sm border-y border-border/50",children:a.jsxs("div",{className:"container mx-auto px-4",children:[a.jsxs("div",{className:"text-center mb-12 animate-fade-in",children:[a.jsxs("div",{className:"flex items-center justify-center gap-3 mb-4",children:[a.jsx(DN,{className:"h-10 w-10 text-primary animate-pulse"}),a.jsx("h2",{className:"text-4xl md:text-5xl font-bold bg-gradient-to-r from-primary via-accent to-primary bg-clip-text text-transparent animate-slide-in-right",children:e.title})]}),a.jsx("p",{className:"text-lg md:text-xl text-muted-foreground animate-fade-in",style:{animationDelay:"200ms"}
375,children:e.subtitle})]}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-8 max-w-5xl mx-auto",children:r.map((l,c)=>a.jsxs("div",{className:"text-center p-6 rounded-lg bg-card/50 backdrop-blur-sm border border-border/50 hover:bg-card/80 transition-all duration-300 hover:scale-110 hover:shadow-elegant animate-scale-in group cursor-pointer",style:{animationDelay:`${c*100}ms`},children:[a.jsx("div",{className:"text-3xl md:text-4xl font-bold text-primary mb-2 transition-all duration-300 group-hover:scale-125",children:l.value}),a.jsx("div",{className:"text-sm md:text-base text-muted-foreground transition-colors group-hover:text-foreground",children:l.label})]},l.id))})]})})},F4="/assets/app-screen-1-BnZyrInp.png",U4="/assets/app-screen-2-CFsCtdLS.png",z4="/assets/app-bg-DDzq2X2F.jpg",B4=()=>{const e=[F4,U4],[t,r]=O.useState(0);O.useEffect(()=>{const i=setInterval(()=>{r(o=>(o+1)%e.length)},4e3);return()=>clearInterval(i)},[e.length]);const n=()=>{r(i=>(i+1)%e.length)},s=()=>{r(i=>(i-1+e.length)%e.length)};return a.jsxs("section",{id:"dados",className:"w-full py-20 relative overflow-hidden bg-gradient-to-br from-primary via-primary to-accent",children:[a.jsx("div",{className:"absolute inset-0",style:{backgroundImage:`url(${z4})`,backgroundSize:"cover",backgroundPosition:"center",opacity:.2}}),a.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 relative z-10",children:a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-12 items-center",children:[a.jsxs("div",{className:"text-center lg:text-left space-y-8 animate-fade-in",children:[a.jsxs("div",{className:"flex items-center justify-center lg:justify-start gap-3",children:[a.jsx(AN,{className:"h-10 w-10 text-white animate-pulse"}),a.jsx("h2",{className:"text-4xl md:text-5xl font-bold bg-gradient-to-r from-white via-white/90 to-white bg-clip-text text-transparent animate-slide-in-right",children:"BAIXE O NOSSO APP"})]}),a.jsx("p",{className:"text-lg md:text-xl text-white/90 animate-fade-in",style:{animationDelay:"200ms"},children:"Tenha controle e informações preciosas! Descubra os eletropostos disponÃveis na nossa rede DCC Energy e obtenha informações valiosas como quantos kms você ganhou, tempo de recarga, redução de CO2 e muito mais!"}),a.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center lg:justify-start animate-scale-in",style:{animationDelay:"400ms"},children:[a.jsx(B,{variant:"secondary",size:"lg",asChild:!0,className:"min-w-[220px] gap-2 hover-scale hover:shadow-elegant",children:a.jsxs("a",{href:"https://play.google.com/store/apps/details?id=br.com.dccenergy.app",target:"_blank",rel:"noopener noreferrer",children:[a.jsx("svg",{viewBox:"0 0 24 24",className:"h-5 w-5",fill:"currentColor",children:a.jsx("path",{d:"M3,20.5V3.5C3,2.91 3.34,2.39 3.84,2.15L13.69,12L3.84,21.85C3.34,21.6 3,21.09 3,20.5M16.81,15.12L6.05,21.34L14.54,12.85L16.81,15.12M20.16,10.81C20.5,11.08 20.75,11.5 20.75,12C20.75,12.5 20.53,12.9 20.18,13.18L17.89,14.5L15.39,12L17.89,9.5L20.16,10.81M6.05,2.66L16.81,8.88L14.54,11.15L6.05,2.66Z"})}),"Download para Android"]})}),a.jsx(B,{variant:"secondary",size:"lg",asChild:!0,className:"min-w-[220px] gap-2 hover-scale hover:shadow-elegant",children:a.jsxs("a",{href:"https://apps.apple.com/br/app/dcc-energy/id6447991108",target:"_blank",rel:"noopener noreferrer",children:[a.jsx("svg",{viewBox:"0 0 24 24",className:"h-5 w-5",fill:"currentColor",children:a.jsx("path",{d:"M17.05 20.28c-.98.95-2.05.8-3.08.35-1.09-.46-2.09-.48-3.24 0-1.44.62-2.2.44-3.06-.35C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.54 4.09l.01-.01zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z"})}),"Download para iOS"]})})]})]}),a.jsx("div",{className:"flex justify-center lg:justify-end animate-scale-in",style:{animationDelay:"600ms"},children:a.jsxs("div",{className:"relative w-full max-w-sm",children:[a.jsx("div",{className:"relative overflow-hidden rounded-3xl shadow-glow hover:shadow-[0_0_60px_rgba(255,255,255,0.3)] transition-shadow duration-500",children:a.jsx("div",{className:"flex transition-transform duration-700 ease-in-out",style:{transform:`translateX(-${t*100}%)`},children:e.map((i,o)=>a.jsx("div",{className:"w-full flex-shrink-0 p-6",children:a.jsx("img",{src:i,alt:`App DCC Energy - Tela ${o+1}`,className:"w-full h-auto rounded-2xl hover:scale-105 transition-transform duration-300"})},o))})}),a.jsx("button",{onClick:s,className:"absolute -left-6 top-1/2 -translate-y-1/2 bg-white/90 hover:bg-white p-3 rounded-full shadow-xl transition-all hover:scale-125 hover:shadow-elegant animate-fade-in","aria-label":"Slide anterior",children:a.jsx(mp,{className:"h-6 w-6 text-primary"})}),a.jsx("button",{onClick:n,className:"absolute -right-6 top-1/2 -translate-y-1/2 bg-white/90 hover:bg-white p-3 rounded-full shadow-xl transition-all hover:scale-125 hover:shadow-elegant animate-fade-in","aria-label":"Próximo
375slide",children:a.jsx(ia,{className:"h-6 w-6 text-primary"})}),a.jsx("div",{className:"flex justify-center gap-3 mt-6",children:e.map((i,o)=>a.jsx("button",{onClick:()=>r(o),className:`h-2.5 rounded-full transition-all duration-300 ${t===o?"w-10 bg-white":"w-2.5 bg-white/40 hover:bg-white/60"}`,"aria-label":`Ir para slide ${o+1}`},o))})]})})]})})]})},V4=()=>{const[e,t]=f.useState(null),[r,n]=f.useState([]),[s,i]=f.useState(!0),o=O.useRef(null);f.useEffect(()=>{l()},[]);const l=async()=>{const{data:d,error:h}=await V.from("videos").select("*").order("created_at",{ascending:!1});!h&&d&&n(d),i(!1)},c=d=>{const h=/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/,m=d.match(h);return m&&m[2].length===11?m[2]:d},u=d=>{o.current&&o.current.scrollBy({left:d==="left"?-400:400,behavior:"smooth"})};return a.jsxs("section",{id:"videos",className:"w-full py-20 bg-gradient-to-br from-background via-background to-accent/5",children:[a.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[a.jsxs("div",{className:"text-center mb-12 animate-fade-in",children:[a.jsxs("div",{className:"flex items-center justify-center gap-3 mb-4",children:[a.jsx(Tg,{className:"h-10 w-10 text-primary animate-pulse"}),a.jsx("h2",{className:"text-4xl md:text-5xl font-bold bg-gradient-to-r from-primary via-accent to-primary bg-clip-text text-transparent animate-slide-in-right",children:"Conheça Nosso Canal"})]}),a.jsx("p",{className:"text-lg md:text-xl text-muted-foreground max-w-2xl mx-auto",children:"Acompanhe nossos vÃdeos e fique por dentro das novidades sobre mobilidade elétrica"})]}),a.jsxs("div",{className:"relative group",children:[a.jsx(B,{variant:"outline",size:"icon",className:"absolute left-0 top-1/2 -translate-y-1/2 z-10 opacity-0 group-hover:opacity-100 transition-opacity bg-background/90 backdrop-blur-sm",onClick:()=>u("left"),children:a.jsx(mp,{className:"h-6 w-6"})}),s?a.jsx("div",{className:"flex justify-center py-12",children:a.jsx(De,{className:"h-12 w-12 animate-spin text-primary"})}):a.jsx("div",{ref:o,className:"flex gap-6 overflow-x-auto scrollbar-hide scroll-smooth pb-4",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:r.map(d=>{const h=c(d.youtube_url);return a.jsxs("div",{className:"relative flex-shrink-0 w-[350px] group/video cursor-pointer",onClick:()=>t(h),children:[d.is_new&&a.jsx("div",{className:"absolute top-2 left-2 z-20 bg-accent text-accent-foreground px-3 py-1 rounded-full text-xs font-bold shadow-lg",children:"Novidade"}),a.jsxs("div",{className:"relative overflow-hidden rounded-2xl shadow-xl transition-all duration-300 group-hover/video:scale-105 group-hover/video:shadow-2xl",children:[a.jsx("img",{src:`https://img.youtube.com/vi/${h}/maxresdefault.jpg`,alt:d.title,className:"w-full h-[200px] object-cover",onError:m=>{m.currentTarget.src=`https://img.youtube.com/vi/${h}/hqdefault.jpg`}}),a.jsx("div",{className:"absolute inset-0 bg-black/40 flex items-center justify-center opacity-0 group-hover/video:opacity-100 transition-opacity",children:a.jsx("div",{className:"bg-primary rounded-full p-4",children:a.jsx(iw,{className:"h-8 w-8 text-primary-foreground fill-current"})})})]}),a.jsx("h3",{className:"mt-3 text-sm font-medium text-foreground line-clamp-2",children:d.title})]},d.id)})}),a.jsx(B,{variant:"outline",size:"icon",className:"absolute right-0 top-1/2 -translate-y-1/2 z-10 opacity-0 group-hover:opacity-100 transition-opacity bg-background/90 backdrop-blur-sm",onClick:()=>u("right"),children:a.jsx(ia,{className:"h-6 w-6"})})]}),a.jsx("div",{className:"text-center mt-8",children:a.jsx(B,{variant:"outline",size:"lg",asChild:!0,children:a.jsxs("a",{href:"https://www.youtube.com/@DCCEnergy",target:"_blank",rel:"noopener noreferrer",className:"gap-2",children:[a.jsx(Tg,{className:"h-5 w-5"}),"Ver Todos os VÃdeos"]})})})]}),a.jsx(Je,{open:!!e,onOpenChange:()=>t(null),children:a.jsxs(He,{className:"max-w-4xl w-full p-0 overflow-hidden",children:[a.jsx(Ye,{className:"sr-only",children:"VÃdeo do YouTube"}),e&&a.jsx("div",{className:"relative w-full pt-[56.25%]",children:a.jsx("iframe",{className:"absolute top-0 left-0 w-full h-full",src:`https://www.youtube.com/embed/${e}
375?autoplay=1`,title:"YouTube video player",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})})]})})]})},ze=f.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:te("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));ze.displayName="Card";const Lt=f.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:te("flex flex-col space-y-1.5 p-6",e),...t}));Lt.displayName="CardHeader";const Mt=f.forwardRef(({className:e,...t},r)=>a.jsx("h3",{ref:r,className:te("text-2xl font-semibold leading-none tracking-tight",e),...t}));Mt.displayName="CardTitle";const $t=f.forwardRef(({className:e,...t},r)=>a.jsx("p",{ref:r,className:te("text-sm text-muted-foreground",e),...t}));$t.displayName="CardDescription";const Be=f.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:te("p-6 pt-0",e),...t}));Be.displayName="CardContent";const W4=f.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:te("flex items-center p-6 pt-0",e),...t}));W4.displayName="CardFooter";const H4=()=>{const[e,t]=f.useState([]),[r,n]=f.useState(!0);f.useEffect(()=>{s()},[]);const s=async()=>{const{data:i,error:o}=await V.from("services").select("*").order("created_at",{ascending:!0});!o&&i&&t(i),n(!1)};return a.jsx("section",{id:"servicos",className:"w-full py-20 bg-background",children:a.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[a.jsxs("div",{className:"text-center mb-16 animate-fade-in",children:[a.jsxs("div",{className:"flex items-center justify-center gap-3 mb-4",children:[a.jsx(PN,{className:"h-10 w-10 text-primary animate-pulse"}),a.jsx("h2",{className:"text-4xl md:text-5xl font-bold bg-gradient-to-r from-primary via-accent to-primary bg-clip-text text-transparent animate-slide-in-right",children:"Nossas Soluções"})]}),a.jsx("p",{className:"text-lg md:text-xl text-muted-foreground max-w-2xl mx-auto",children:"PossuÃmos soluções diversas para fomentar a eletromobilidade beneficiando usuários de veÃculos elétricos, o comércio local e a sociedade como um todo."})]}),r?a.jsx("div",{className:"flex justify-center py-12",children:a.jsx(De,{className:"h-12 w-12 animate-spin text-primary"})}):a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:e.map(i=>a.jsxs(ze,{className:"border-2 border-border hover:border-primary transition-smooth hover:shadow-elegant group relative",children:[i.is_new&&a.jsx(Ze,{className:"absolute top-4 right-4 z-10 bg-accent text-accent-foreground",children:"Novidade"}),a.jsxs(Lt,{children:[i.image_url&&a.jsx("div",{className:"w-full h-48 mb-4 rounded-lg overflow-hidden group-hover:scale-105 transition-smooth",children:a.jsx("img",{src:i.image_url,alt:i.title,className:"w-full h-full object-cover"})}),a.jsx(Mt,{className:"text-xl",children:i.title})]}),a.jsx(Be,{children:a.jsx($t,{className:"text-base",children:i.description})})]},i.id))})]})})},q4=()=>{const[e,t]=f.useState([]),[r,n]=f.useState(!0),[s,i]=f.useState(null);f.useEffect(()=>{o()},[]);const o=async()=>{const{data:l,error:c}=await V.from("news").select("*").order("created_at",{ascending:!1}).limit(6);!c&&l&&t(l),n(!1)};return r?a.jsx("section",{className:"w-full py-20 bg-accent/5",children:a.jsx("div",{className:"flex justify-center",children:a.jsx(De,{className:"h-12 w-12 animate-spin text-primary"})})}):e.length===0?null:a.jsxs("section",{id:"noticias",className:"w-full py-20 bg-accent/5",children:[a.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[a.jsxs("div",{className:"text-center mb-12 animate-fade-in",children:[a.jsxs("div",{className:"flex items-center justify-center gap-3 mb-4",children:[a.jsx(oa,{className:"h-10 w-10 text-primary animate-pulse"}),a.jsx("h2",{className:"text-4xl md:text-5xl font-bold bg-gradient-to-r from-primary via-accent to-primary bg-clip-text text-transparent animate-slide-in-right",children:"Ãltimas NotÃcias"})]}),a.jsx("p",{className:"text-lg md:text-xl text-muted-foreground max-w-2xl mx-auto",children:"Fique por dentro das novidades e atualizações da DCC Energy"})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:e.map(l=>a.jsxs(ze,{className:"cursor-pointer hover:shadow-elegant transition-smooth group border-2 border-border hover:border-primary overflow-hidden",onClick:()=>i(l),children:[l.image_url&&a.jsxs("div",{className:"relative w-full h-48 overflow-hidden",children:[a.jsx("img",{src:l.image_url,alt:l.title,className:"w-full h-full object-cover group-hover:scale-110 transition-smooth"}),l.is_new&&a.jsx(Ze,{className:"absolute top-2 right-2 bg-accent text-accent-foreground",children:"Novidade"})]}),a.jsx(Lt,{children:a.jsxs(Mt,{className:"text-xl line-clamp-2 flex items-start gap-2",children:[!l.image_url&&l.is_new&&a.jsx(Ze,{className:"bg-accent text-accent-foreground shrink-0",children:"Novidade"}
375),l.title]})}),a.jsx(Be,{children:a.jsx($t,{className:"line-clamp-3",children:l.content})})]},l.id))})]}),a.jsx(Je,{open:!!s,onOpenChange:()=>i(null),children:a.jsxs(He,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[a.jsx(rt,{children:a.jsxs(Ye,{className:"text-2xl flex items-center gap-2",children:[(s==null?void 0:s.is_new)&&a.jsx(Ze,{className:"bg-accent text-accent-foreground",children:"Novidade"}),s==null?void 0:s.title]})}),a.jsxs("div",{className:"space-y-4",children:[(s==null?void 0:s.image_url)&&a.jsx("img",{src:s.image_url,alt:s.title,className:"w-full h-64 object-cover rounded-lg"}),a.jsx("div",{className:"prose prose-sm max-w-none dark:prose-invert",children:a.jsx("p",{className:"whitespace-pre-wrap text-foreground",children:s==null?void 0:s.content})})]})]})})]})},K4="/assets/sustainability-bg-Bi_ut10Z.jpg",G4=()=>{const[e,t]=f.useState(null);f.useEffect(()=>{(async()=>{var s;try{const o=await(await fetch("https://api-dcc-proxy.ti-16e.workers.dev/")).json();t({envIndicator:parseFloat(o.envIndicator||0),cultivatedTree:((s=o.energy)==null?void 0:s.cultivatedTree)||"--"})}catch(i){console.error("Error fetching sustainability data:",i)}})()},[]);const r=n=>n.toLocaleString("pt-BR",{minimumFractionDigits:2,maximumFractionDigits:2});return a.jsxs("section",{id:"sustentabilidade",className:"relative w-full min-h-screen overflow-hidden",children:[a.jsx("div",{className:"absolute inset-0 bg-cover bg-center",style:{backgroundImage:`url(${K4})`}}),a.jsx("div",{className:"absolute inset-0 bg-black/60"}),a.jsx("div",{className:"relative h-full min-h-screen flex flex-col items-center justify-center px-4 sm:px-6 lg:px-8 py-20",children:a.jsxs("div",{className:"text-center space-y-12 max-w-6xl mx-auto",children:[a.jsx("div",{className:"flex justify-center mb-8 animate-fade-in",children:a.jsx("div",{className:"relative bg-accent/20 p-8 rounded-full backdrop-blur-sm hover:bg-accent/30 transition-all duration-500 group",children:a.jsxs("div",{className:"relative",children:[a.jsx(gN,{className:"h-24 w-24 text-accent group-hover:text-accent/80 transition-colors"}),a.jsx("div",{className:"absolute -bottom-2 -right-2 bg-background/90 p-2 rounded-full shadow-glow",children:a.jsx(SN,{className:"h-8 w-8 text-green-500"})})]})})}),a.jsx("h1",{className:"text-4xl md:text-5xl lg:text-6xl font-bold px-4 text-white animate-slide-in-right",children:"Energia limpa que faz a diferença ð±"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8 lg:gap-16 max-w-5xl mx-auto px-4",children:[a.jsxs("div",{className:"bg-gradient-card/80 backdrop-blur-md rounded-2xl p-8 lg:p-12 border-2 border-accent/30 shadow-glow hover:scale-105 transition-all duration-500 hover:shadow-[0_0_50px_rgba(var(--accent),0.5)] animate-scale-in group cursor-pointer",style:{animationDelay:"200ms"},children:[a.jsx("div",{className:"text-lg lg:text-xl text-white/80 mb-4 transition-all group-hover:text-white",children:"KgCOâ Economizados"}),a.jsx("div",{className:"text-4xl lg:text-6xl font-bold text-accent transition-all duration-500 group-hover:scale-110",children:e?r(e.envIndicator):"--"})]}),a.jsxs("div",{className:"bg-gradient-card/80 backdrop-blur-md rounded-2xl p-8 lg:p-12 border-2 border-accent/30 shadow-glow hover:scale-105 transition-all duration-500 hover:shadow-[0_0_50px_rgba(var(--accent),0.5)] animate-scale-in group cursor-pointer",style:{animationDelay:"400ms"},children:[a.jsx("div",{className:"text-lg lg:text-xl text-white/80 mb-4 transition-all group-hover:text-white",children:"Ãrvores Cultivadas"}),a.jsx("div",{className:"text-4xl lg:text-6xl font-bold text-accent transition-all duration-500 group-hover:scale-110",children:(e==null?void 0:e.cultivatedTree)||"--"})]})]}),a.jsx("p",{className:"text-2xl md:text-3xl text-white/90 mt-16 px-4 animate-fade-in",style:{animationDelay:"600ms"},children:"Nossa tecnologia já evitou toneladas de COâ e ajudou a cultivar milhares de árvores. Faça parte dessa mudança!"}),a.jsx("div",{className:"mt-12 flex justify-center animate-fade-in",style:{animationDelay:"800ms"},children:a.jsx("img",{src:Ji,alt:"DCC Energy",className:"h-16 md:h-20 w-auto hover:scale-110 transition-transform duration-300"})})]})})]})},J4=()=>{const[e,t]=f.useState([]),[r,n]=f.useState(null),[s,i]=f.useState(!0),[o,l]=f.useState({});f.useEffect(()=>{c()},[]);const c=async()=>{var m;try{const[p,w]=await Promise.all([V.from("products").select("*").order("display_order",{ascending:!0}),V.from("products_section").select("*").single()]);if(p.error)throw p.error;if(w.error)throw w.error;t(p.data||[]),n(w.data);const g={};(m=p.data)==null||m.forEach(v=>{g[v.id]=0}
375),l(g)}catch(p){console.error("Error loading products:",p)}finally{i(!1)}},u=m=>[m.image_url_1,m.image_url_2,m.image_url_3].filter(w=>w!==null&&w!==""),d=(m,p)=>{l(w=>({...w,[m]:(w[m]+1)%p}))},h=(m,p)=>{l(w=>({...w,[m]:w[m]===0?p-1:w[m]-1}))};return s?a.jsx("section",{className:"py-16 bg-background",children:a.jsx("div",{className:"container mx-auto px-4 flex justify-center",children:a.jsx(De,{className:"h-8 w-8 animate-spin text-primary"})})}):a.jsxs("section",{id:"produtos",className:"py-20 bg-gradient-to-b from-background via-primary/5 to-background relative overflow-hidden",children:[a.jsxs("div",{className:"absolute top-0 left-0 w-full h-full overflow-hidden pointer-events-none",children:[a.jsx("div",{className:"absolute top-20 left-10 w-72 h-72 bg-primary/10 rounded-full blur-3xl animate-pulse"}),a.jsx("div",{className:"absolute bottom-20 right-10 w-96 h-96 bg-accent/10 rounded-full blur-3xl animate-pulse",style:{animationDelay:"1s"}})]}),a.jsxs("div",{className:"container mx-auto px-4 relative z-10",children:[a.jsxs("div",{className:"text-center mb-16 animate-fade-in",children:[a.jsxs("div",{className:"flex items-center justify-center gap-3 mb-4",children:[a.jsx(MN,{className:"h-10 w-10 text-primary animate-pulse"}),a.jsx("h2",{className:"text-4xl md:text-5xl font-bold bg-gradient-to-r from-primary via-accent to-primary bg-clip-text text-transparent animate-slide-in-right",children:(r==null?void 0:r.title)||"Nossos Produtos"})]}),a.jsx("p",{className:"text-lg md:text-xl text-muted-foreground max-w-2xl mx-auto",children:(r==null?void 0:r.description)||"Conheça sobre nossos produtos"})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-8",children:e.map((m,p)=>{const w=u(m),g=o[m.id]||0;return a.jsx(ze,{className:"group hover:shadow-2xl hover:shadow-primary/20 transition-all duration-500 hover:-translate-y-2 bg-card/80 backdrop-blur-sm border-2 border-border hover:border-primary/50 overflow-hidden animate-fade-in",style:{animationDelay:`${p*100}ms`},children:a.jsxs(Be,{className:"p-0",children:[w.length>0&&a.jsxs("div",{className:"relative aspect-square bg-white overflow-hidden",children:[a.jsx("img",{src:w[g],alt:m.title,className:"w-full h-full object-contain transition-transform duration-500 group-hover:scale-110"}),w.length>1&&a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:()=>h(m.id,w.length),className:"absolute left-2 top-1/2 -translate-y-1/2 bg-background/80 hover:bg-background p-2 rounded-full transition-all opacity-0 group-hover:opacity-100",children:a.jsx(mp,{className:"h-4 w-4"})}),a.jsx("button",{onClick:()=>d(m.id,w.length),className:"absolute right-2 top-1/2 -translate-y-1/2 bg-background/80 hover:bg-background p-2 rounded-full transition-all opacity-0 group-hover:opacity-100",children:a.jsx(ia,{className:"h-4 w-4"})}),a.jsx("div",{className:"absolute bottom-2 left-1/2 -translate-x-1/2 flex gap-1",children:w.map((v,x)=>a.jsx("div",{className:`w-2 h-2 rounded-full transition-all ${x===g?"bg-primary w-4":"bg-background/60"}`},x))})]}),m.is_new&&a.jsx(Ze,{className:"absolute top-4 right-4 bg-accent text-accent-foreground animate-pulse",children:"NOVO"}),m.is_promotion&&a.jsx(Ze,{className:"absolute top-4 left-4 bg-destructive text-destructive-foreground animate-pulse",children:"ð¥ PROMOÃÃO"})]}),a.jsxs("div",{className:"p-6 space-y-4",children:[a.jsx("h3",{className:"text-xl font-bold text-foreground group-hover:text-primary transition-colors line-clamp-2",children:m.title}),a.jsx("p",{className:"text-sm text-muted-foreground line-clamp-3",children:m.description}),a.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[a.jsx(Ze,{variant:"outline",className:"text-primary border-primary/50",children:m.power}),m.tags&&m.tags.length>0&&m.tags.map((v,x)=>a.jsx(Ze,{variant:"secondary",className:"text-xs",children:v},x))]}),a.jsx(B,{className:"w-full bg-gradient-to-r from-primary to-accent hover:from-primary/90 hover:to-accent/90 text-primary-foreground font-semibold shadow-lg hover:shadow-xl transition-all duration-300",onClick:()=>window.open(m.button_link,"_blank"),children:m.button_text})]})]})},m.id)})}),e.length===0&&a.jsx("div",{className:"text-center py-12",children:a.jsx("p",{className:"text-muted-foreground text-lg",children:"Nenhum produto disponÃvel no momento."})})]})]})},Y4=()=>{const[e,t]=f.useState(!1),[r,n]=f.useState(null),[s,i]=f.useState([]),[o,l]=f.useState(!0),c=(d,h,m,p)=>{const g=(m-d)*Math.PI/180,v=(p-h)*Math.PI/180,x=Math.sin(g/2)*Math.sin(g/2)+Math.cos(d*Math.PI/180)*Math.cos(m*Math.PI/180)*Math.sin(v/2)*
375Math.sin(v/2);return 6371*(2*Math.atan2(Math.sqrt(x),Math.sqrt(1-x)))};f.useEffect(()=>{(async()=>{l(!0);const{data:h}=await V.from("charging_stations").select("*").order("nome");if(h){const m=h.map(p=>({id:p.id,nome:p.nome,endereco:p.endereco,potencia:p.potencia,imagem:p.imagem_url||"",lat:p.lat,lng:p.lng,is_new:p.is_new}));if(r){const p=m.map(w=>({...w,distancia:c(r.lat,r.lng,w.lat,w.lng)}));p.sort((w,g)=>(w.distancia||0)-(g.distancia||0)),i(p)}else i(m)}l(!1)})()},[r]),f.useEffect(()=>{navigator.geolocation&&navigator.geolocation.getCurrentPosition(d=>{const{latitude:h,longitude:m}=d.coords;n({lat:h,lng:m})},d=>{console.log("Não foi possÃvel obter a localização:",d)})},[]);const u=d=>{const h=`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(d)}`;window.open(h,"_blank")};return o?a.jsx("section",{id:"eletropostos",className:"w-full py-20 bg-muted/30",children:a.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:a.jsx("div",{className:"text-center",children:a.jsx("p",{className:"text-muted-foreground",children:"Carregando eletropostos..."})})})}):a.jsx("section",{id:"eletropostos",className:"w-full py-20 bg-muted/30",children:a.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[a.jsxs("div",{className:"text-center mb-12 animate-fade-in",children:[a.jsxs("div",{className:"flex items-center justify-center gap-3 mb-4",children:[a.jsx(Cg,{className:"h-10 w-10 text-primary animate-pulse"}),a.jsx("h2",{className:"text-4xl md:text-5xl font-bold bg-gradient-to-r from-primary via-accent to-primary bg-clip-text text-transparent animate-slide-in-right",children:"Nossos Eletropostos"})]}),a.jsx("p",{className:"text-lg md:text-xl text-muted-foreground flex items-center justify-center gap-2",children:r?a.jsxs(a.Fragment,{children:[a.jsx(kN,{className:"h-5 w-5 text-primary"}),"Ordenados por proximidade da sua localização"]}):"Encontre o eletroposto mais próximo de você"})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:(e?s:s.slice(0,6)).map(d=>a.jsxs("div",{className:"bg-card rounded-xl p-6 border border-border hover:shadow-elegant transition-smooth relative",children:[d.is_new&&a.jsx(Ze,{className:"absolute top-4 right-4 z-10 bg-accent text-accent-foreground",children:"Novidade"}),a.jsxs(Je,{children:[a.jsx(Ct,{asChild:!0,children:a.jsxs("div",{className:"relative mb-4 cursor-pointer group",children:[a.jsx("img",{src:d.imagem,alt:d.nome,className:"w-full h-48 object-cover rounded-lg"}),a.jsx("div",{className:"absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 transition-smooth rounded-lg flex items-center justify-center",children:a.jsx($N,{className:"h-8 w-8 text-white"})})]})}),a.jsx(He,{className:"max-w-4xl p-2",children:a.jsx("img",{src:d.imagem,alt:d.nome,className:"w-full h-auto object-contain max-h-[85vh] rounded-lg"})})]}),a.jsxs("div",{className:"flex items-start gap-4 mb-4",children:[a.jsx("div",{className:"bg-primary/10 p-3 rounded-full flex-shrink-0",children:a.jsx(Cg,{className:"h-6 w-6 text-primary"})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2",children:[a.jsx("h3",{className:"font-semibold text-lg",children:d.nome}),d.distancia&&a.jsx("div",{className:"bg-primary/10 px-2 py-1 rounded-full flex-shrink-0",children:a.jsxs("p",{className:"text-primary text-xs font-semibold whitespace-nowrap",children:[d.distancia.toFixed(1)," km"]})})]}),a.jsx("p",{className:"text-muted-foreground text-sm mb-2",children:d.endereco}),a.jsx("div",{className:"bg-energy/10 px-3 py-1 rounded-full inline-block",children:a.jsx("p",{className:"text-energy text-xs font-semibold",children:d.potencia})})]})]}),a.jsxs("button",{onClick:()=>u(d.endereco),className:"w-full bg-primary/10 hover:bg-primary hover:text-primary-foreground text-primary font-medium py-2 px-4 rounded-lg transition-smooth flex items-center justify-center gap-2",children:[a.jsx(wN,{className:"h-4 w-4"}),"Ver no Google Maps"]})]},d.id))}),!e&&s.length>6&&a.jsx("div",{className:"flex justify-center mt-8",children:a.jsxs("button",{onClick:()=>t(!0),className:"bg-primary hover:bg-primary/90 text-primary-foreground font-medium py-3 px-6 rounded-lg transition-smooth flex items-center gap-2",children:["Ver mais eletropostos",a.jsx(Pa,{className:"h-5 w-5"})]})}),a.jsx("div",{className:"bg-accent/10 rounded-xl p-6 border border-accent mt-8",children:a.jsx("p",{className:"text-center text-muted-foreground",children:"Mais eletropostos serão adicionados em breve!"})})]})})},Q4=()=>(f.useEffect(()=>{const e="https://d335luupugsy2.cloudfront.net/js/rdstation-forms/stable/rdstation-forms.min.js",t="formulario-site-1aa4564798d1031f88bd",r=()=>{new window.RDStationForms(t,"").createForm()};if(window.RDStationForms){r();return}const n=document.querySelector(`script[src="${e}"]`);if(n){n.addEventListener("load",r);return}const s=document.createElement("script");s.src=e,s.type="text/javascript",s.onload=r,document.head.appendChild(s)},[]),a.jsx("section",{id:"contato",className:"w-full py-20 bg-muted/30",children:a.jsxs("div",{className:"max-w-3xl mx-auto px-4 sm:px-6 lg:px-8",children:[a.jsxs("div",{className:"text-center mb-12 animate-fade-in",children:[a.jsxs("div",{className:"flex items-center justify-center gap-3 mb-4",children:[a.jsx(sw,{className:"h-10 w-10 text-primary animate-pulse"}),a.jsx("h2",{className:"text-4xl md:text-5xl font-bold bg-gradient-to-r from-primary via-accent to-primary bg-clip-text text-transparent animate-slide-in-right",children:"Fale com a DCC Energy"})]}),a.jsx("p",{className:"text-lg md:text-xl text-muted-foreground max-w-2xl mx-auto",children:"Quer instalar um carregador ou fazer parte da nossa rede? Entre em contato!"})]}),a.jsx("div",{role:"main",id:"formulario-site-1aa4564798d1031f88bd"})]})}));function ef(e,[t,r]){return Math.min(r,Math.max(t,e))}function X4(e,t){return f.useReducer((r,n)=>t[r][n]??r,e)}var qp="ScrollArea",[B1,qL]=zt(qp),[Z4,er]=B1(qp),V1=f.forwardRef((e,t)=>
vendor: 9,447 bytes, line 375
375{const{__scopeScrollArea:r,type:n="hover",dir:s,scrollHideDelay:i=600,...o}=e,[l,c]=f.useState(null),[u,d]=f.useState(null),[h,m]=f.useState(null),[p,w]=f.useState(null),[g,v]=f.useState(null),[x,y]=f.useState(0),[b,S]=f.useState(0),[_,j]=f.useState(!1),[E,C]=f.useState(!1),N=oe(t,F=>c(F)),R=io(s);return a.jsx(Z4,{scope:r,type:n,dir:R,scrollHideDelay:i,scrollArea:l,viewport:u,onViewportChange:d,content:h,onContentChange:m,scrollbarX:p,onScrollbarXChange:w,scrollbarXEnabled:_,onScrollbarXEnabledChange:j,scrollbarY:g,onScrollbarYChange:v,scrollbarYEnabled:E,onScrollbarYEnabledChange:C,onCornerWidthChange:y,onCornerHeightChange:S,children:a.jsx(K.div,{dir:R,...o,ref:N,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":b+"px",...e.style}})})});V1.displayName=qp;var W1="ScrollAreaViewport",H1=f.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:s,...i}=e,o=er(W1,r),l=f.useRef(null),c=oe(t,l,o.onViewportChange);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),a.jsx(K.div,{"data-radix-scroll-area-viewport":"",...i,ref:c,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style},children:a.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});H1.displayName=W1;var Fr="ScrollAreaScrollbar",Kp=f.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=er(Fr,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:o}=s,l=e.orientation==="horizontal";return f.useEffect(()=>(l?i(!0):o(!0),()=>{l?i(!1):o(!1)}),[l,i,o]),s.type==="hover"?a.jsx(eD,{...n,ref:t,forceMount:r}):s.type==="scroll"?a.jsx(tD,{...n,ref:t,forceMount:r}):s.type==="auto"?a.jsx(q1,{...n,ref:t,forceMount:r}):s.type==="always"?a.jsx(Gp,{...n,ref:t}):null});Kp.displayName=Fr;var eD=f.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=er(Fr,e.__scopeScrollArea),[i,o]=f.useState(!1);return f.useEffect(()=>{const l=s.scrollArea;let c=0;if(l){const u=()=>{window.clearTimeout(c),o(!0)},d=()=>{c=window.setTimeout(()=>o(!1),s.scrollHideDelay)};return l.addEventListener("pointerenter",u),l.addEventListener("pointerleave",d),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",u),l.removeEventListener("pointerleave",d)}}},[s.scrollArea,s.scrollHideDelay]),a.jsx(dt,{present:r||i,children:a.jsx(q1,{"data-state":i?"visible":"hidden",...n,ref:t})})}),tD=f.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=er(Fr,e.__scopeScrollArea),i=e.orientation==="horizontal",o=wu(()=>c("SCROLL_END"),100),[l,c]=X4("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 f.useEffect(()=>{if(l==="idle"){const u=window.setTimeout(()=>c("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(u)}},[l,s.scrollHideDelay,c]),f.useEffect(()=>{const u=s.viewport,d=i?"scrollLeft":"scrollTop";if(u){let h=u[d];const m=()=>{const p=u[d];h!==p&&(c("SCROLL"),o()),h=p};return u.addEventListener("scroll",m),()=>u.removeEventListener("scroll",m)}},[s.viewport,i,c,o]),a.jsx(dt,{present:r||l!=="hidden",children:a.jsx(Gp,{"data-state":l==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:$(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:$(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),q1=f.forwardRef((e,t)=>{const r=er(Fr,e.__scopeScrollArea),{forceMount:n,...s}=e,[i,o]=f.useState(!1),l=e.orientation==="horizontal",c=wu(()=>{if(r.viewport){const u=r.viewport.offsetWidth<r.viewport.scrollWidth,d=r.viewport.offsetHeight<r.viewport.scrollHeight;o(l?u:d)}},10);return Yi(r.viewport,c),Yi(r.content,c),a.jsx(dt,{present:n||i,children:a.jsx(Gp,{"data-state":i?"visible":"hidden",...s,ref:t})})}),Gp=f.forwardRef((e,t)=>{const{orientation:r="vertical",...n}=e,s=er(Fr,e.__scopeScrollArea),i=f.useRef(null),o=f.useRef(0),[l,c]=f.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=Q1(l.viewport,l.content),d={...n,sizes:l,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:m=>i.current=m,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:m=>o.current=m};function h(m,p){return aD(m,o.current,l,p)}return r==="horizontal"?a.jsx(rD,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&i.current){const m=s.viewport.scrollLeft,p=iy(m,l,s.dir);i.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:m=>{s.viewport&&(s.viewport.scrollLeft=m)},onDragScroll:m=>{s.viewport&&(s.viewport.scrollLeft=h(m,s.dir))}}):r==="vertical"?a.jsx(nD,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&i.current){const m=s.viewport.scrollTop,p=iy(m,l);i.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:m=>{s.viewport&&(s.viewport.scrollTop=m)},onDragScroll:m=>{s.viewport&&(s.viewport.scrollTop=h(m))}}):null}),rD=f.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,i=er(Fr,e.__scopeScrollArea),[o,l]=f.useState(),c=f.useRef(null),u=oe(t,c,i.onScrollbarXChange);return f.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),a.jsx(G1,{"data-orientation":"horizontal",...s,ref:u,sizes:r,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":xu(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,h)=>{if(i.viewport){const m=i.viewport.scrollLeft+d.deltaX;e.onWheelScroll(m),Z1(m,h)&&d.preventDefault()}},onResize:()=>{c.current&&i.viewport&&o&&n({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Oc(o.paddingLeft),paddingEnd:Oc(o.paddingRight)}})}})}),nD=f.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,i=er(Fr,e.__scopeScrollArea),[o,l]=f.useState(),c=f.useRef(null),u=oe(t,c,i.onScrollbarYChange);return f.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),a.jsx(G1,{"data-orientation":"vertical",...s,ref:u,sizes:r,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":xu(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,h)=>{if(i.viewport){const m=i.viewport.scrollTop+d.deltaY;e.onWheelScroll(m),Z1(m,h)&&d.preventDefault()}},onResize:()=>{c.current&&i.viewport&&o&&n({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Oc(o.paddingTop),paddingEnd:Oc(o.paddingBottom)}})}})}),[sD,K1]=B1(Fr),G1=f.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:s,onThumbChange:i,onThumbPointerUp:o,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:d,onResize:h,...m}=e,p=er(Fr,r),[w,g]=f.useState(null),v=oe(t,N=>g(N)),x=f.useRef(null),y=f.useRef(""),b=p.viewport,S=n.content-n.viewport,_=xe(d),j=xe(c),E=wu(h,10);function C(N){if(x.current){const R=N.clientX-x.current.left,F=N.clientY-x.current.top;u({x:R,y:F})}}return f.useEffect(()=>{const N=R=>{const F=R.target;(w==null?void 0:w.contains(F))&&_(R,S)};return document.addEventListener("wheel",N,{passive:!1}),()=>document.removeEventListener("wheel",N,{passive:!1})},[b,w,S,_]),f.useEffect(j,[n,j]),Yi(w,E),Yi(p.content,E),a.jsx(sD,{scope:r,scrollbar:w,hasThumb:s,onThumbChange:xe(i),onThumbPointerUp:xe(o),onThumbPositionChange:j,onThumbPointerDown:xe(l),children:a.jsx(K.div,{...m,ref:v,style:{position:"absolute",...m.style},onPointerDown:$(e.onPointerDown,N=>{N.button===0&&(N.target.setPointerCapture(N.pointerId),x.current=w.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),C(N))}),onPointerMove:$(e.onPointerMove,C),onPointerUp:$(e.onPointerUp,N=>{const R=N.target;R.hasPointerCapture(N.pointerId)&&R.releasePointerCapture(N.pointerId),document.body.style.webkitUserSelect=y.current,p.viewport&&(p.viewport.style.scrollBehavior=""),x.current=null})})})}),Ac="ScrollAreaThumb",J1=f.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=K1(Ac,e.__scopeScrollArea);return a.jsx(dt,{present:r||s.hasThumb,children:a.jsx(iD,{ref:t,...n})})}),iD=f.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...s}=e,i=er(Ac,r),o=K1(Ac,r),{onThumbPositionChange:l}=o,c=oe(t,h=>o.onThumbChange(h)),u=f.useRef(void 0),d=wu(()=>{u.current&&(u.current(),u.current=void 0)},100);return f.useEffect(()=>{const h=i.viewport;if(h){const m=()=>{if(d(),!u.current){const p=lD(h,l);u.current=p,l()}};return l(),h.addEventListener("scroll",m),()=>h.removeEventListener("scroll",m)}},[i.viewport,d,l]),a.jsx(K.div,{"data-state":o.hasThumb?"visible":"hidden",...s,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:$(e.onPointerDownCapture,h=>{const p=h.target.getBoundingClientRect(),w=h.clientX-p.left,g=h.clientY-p.top;o.onThumbPointerDown({x:w,y:g})}),onPointerUp:$(e.onPointerUp,o.onThumbPointerUp)})});J1.displayName=Ac;var Jp="ScrollAreaCorner",Y1=f.forwardRef((e,t)=>
vendor: 4,181 bytes, line 375
375{const r=er(Jp,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?a.jsx(oD,{...e,ref:t}):null});Y1.displayName=Jp;var oD=f.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,s=er(Jp,r),[i,o]=f.useState(0),[l,c]=f.useState(0),u=!!(i&&l);return Yi(s.scrollbarX,()=>{var h;const d=((h=s.scrollbarX)==null?void 0:h.offsetHeight)||0;s.onCornerHeightChange(d),c(d)}),Yi(s.scrollbarY,()=>{var h;const d=((h=s.scrollbarY)==null?void 0:h.offsetWidth)||0;s.onCornerWidthChange(d),o(d)}),u?a.jsx(K.div,{...n,ref:t,style:{width:i,height:l,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Oc(e){return e?parseInt(e,10):0}function Q1(e,t){const r=e/t;return isNaN(r)?0:r}function xu(e){const t=Q1(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function aD(e,t,r,n="ltr"){const s=xu(r),i=s/2,o=t||i,l=s-o,c=r.scrollbar.paddingStart+o,u=r.scrollbar.size-r.scrollbar.paddingEnd-l,d=r.content-r.viewport,h=n==="ltr"?[0,d]:[d*-1,0];return X1([c,u],h)(e)}function iy(e,t,r="ltr"){const n=xu(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-s,o=t.content-t.viewport,l=i-n,c=r==="ltr"?[0,o]:[o*-1,0],u=ef(e,c);return X1([0,o],[0,l])(u)}function X1(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function Z1(e,t){return e>0&&e<t}var lD=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function s(){const i={left:e.scrollLeft,top:e.scrollTop},o=r.left!==i.left,l=r.top!==i.top;(o||l)&&t(),r=i,n=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(n)};function wu(e,t){const r=xe(e),n=f.useRef(0);return f.useEffect(()=>()=>window.clearTimeout(n.current),[]),f.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function Yi(e,t){const r=xe(t);Me(()=>{let n=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return s.observe(e),()=>{window.cancelAnimationFrame(n),s.unobserve(e)}}},[e,r])}var e_=V1,cD=H1,uD=Y1;const tf=f.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(e_,{ref:n,className:te("relative overflow-hidden",e),...r,children:[a.jsx(cD,{className:"h-full w-full rounded-[inherit]",children:t}),a.jsx(t_,{}),a.jsx(uD,{})]}));tf.displayName=e_.displayName;const t_=f.forwardRef(({className:e,orientation:t="vertical",...r},n)=>a.jsx(Kp,{ref:n,orientation:t,className:te("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:a.jsx(J1,{className:"relative flex-1 rounded-full bg-border"})}));t_.displayName=Kp.displayName;const Ma=()=>a.jsxs(a.Fragment,{children:[a.jsx("a",{href:"https://wa.me/5585924693325",target:"_blank",rel:"noopener noreferrer",className:"fixed bottom-6 right-6 z-50 group","aria-label":"Contato via WhatsApp",children:a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute bottom-full right-0 mb-2 opacity-0 group-hover:opacity-100 transition-opacity",children:a.jsxs("div",{className:"bg-card border border-border rounded-lg px-4 py-2 shadow-lg whitespace-nowrap",children:[a.jsx("p",{className:"text-sm font-medium",children:"Posso ajudar?"}),a.jsx("div",{className:"absolute bottom-0 right-4 transform translate-y-1/2 rotate-45 w-3 h-3 bg-card border-r border-b border-border"})]})}),a.jsx("div",{className:"bg-[#25D366] rounded-full p-3 shadow-lg hover:shadow-glow hover:scale-110 transition-smooth",children:a.jsx("svg",{viewBox:"0 0 24 24",className:"h-10 w-10 text-white",fill:"currentColor",children:a.jsx("path",{d:"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.
375198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z"})})})]})}),a.jsx("footer",{className:"w-full bg-card border-t border-border py-12",children:a.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-8 mb-8",children:[a.jsxs("div",{className:"flex flex-col items-center md:items-start gap-4",children:[a.jsx("img",{src:Ji,alt:"DCC Energy",className:"h-10 w-auto"}),a.jsxs("p",{className:"text-muted-foreground text-sm",children:["© 2025 DCC Energy - Todos os direitos reservados. Desenvolvido por"," ",a.jsx("a",{href:"https://www.linkedin.com/in/franciscosoaresfilho/",target:"_blank",rel:"noopener noreferrer",className:"hover:text-primary transition-smooth",children:"FS Devs"})]})]}),a.jsxs("div",{className:"flex flex-col items-center md:items-start gap-4",children:[a.jsx("h3",{className:"font-semibold text-lg",children:"Fale conosco:"}),a.jsxs("a",{href:"https://wa.me/5585924693325",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-muted-foreground hover:text-primary transition-smooth",children:[a.jsx("svg",{viewBox:"0 0 24 24",className:"h-5 w-5",fill:"currentColor",children:a.jsx("path",{d:"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z"})}),"+55 85 9246-9325"]}),a.jsxs("a",{href:"mailto:[email protected]",className:"flex items-center gap-2 text-muted-foreground hover:text-primary transition-smooth",children:[a.jsx(sw,{className:"h-5 w-5"}),"[email protected]"]})]}),a.jsxs("div",{className:"flex flex-col items-center md:items-start gap-4",children:[a.jsx("h3",{className:"font-semibold text-lg",children:"Redes Sociais:"}),a.jsxs("a",{href:"https://www.instagram.com/dcc.energy/",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-muted-foreground hover:text-primary transition-smooth",children:[a.jsx("svg",{viewBox:"0 0 24 24",className:"h-5 w-5",fill:"currentColor",children:a.jsx("path",{d:"M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259
3750-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z"})}),"@dcc.energy"]}),a.jsxs("a",{href:"https://www.youtube.com/@dccenergyoficial",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-muted-foreground hover:text-primary transition-smooth",children:[a.jsx("svg",{viewBox:"0 0 24 24",className:"h-5 w-5",fill:"currentColor",children:a.jsx("path",{d:"M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"})}),"@dccenergyoficial"]})]}),a.jsxs("div",{className:"flex flex-col items-center md:items-start gap-4",children:[a.jsx("h3",{className:"font-semibold text-lg",children:"Informações:"}),a.jsxs(Je,{children:[a.jsx(Ct,{asChild:!0,children:a.jsx("button",{className:"text-muted-foreground hover:text-primary transition-smooth",children:"PolÃtica de Privacidade"})}),a.jsxs(He,{className:"max-w-4xl max-h-[80vh]",children:[a.jsx(rt,{children:a.jsx(Ye,{className:"text-2xl",children:"PolÃtica de Privacidade"})}),a.jsx(tf,{className:"h-[60vh] pr-4",children:a.jsxs("div",{className:"space-y-6",children:[a.jsxs("section",{children:[a.jsx("h2",{className:"text-xl font-semibold mb-3",children:"1. Introdução"}),a.jsx("p",{className:"text-muted-foreground",children:"A DCC Energy está comprometida em proteger a privacidade e os dados pessoais de seus usuários. Esta PolÃtica de Privacidade descreve como coletamos, usamos, armazenamos e protegemos suas informações."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-xl font-semibold mb-3",children:"2. Informações Coletadas"}),a.jsx("p",{className:"text-muted-foreground mb-2",children:"Coletamos as seguintes informações:"}),a.jsxs("ul",{className:"list-disc pl-6 space-y-2 text-muted-foreground",children:[a.jsxs("li",{children:[a.jsx("strong",{children:"Dados de Cadastro:"})," nome, email, telefone, CPF/CNPJ"]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Dados do VeÃculo:"})," modelo, placa, autonomia"]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Dados de Uso:"})," histórico de carregamentos, consumo de energia, localização dos eletropostos utilizados"]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Dados de Pagamento:"})," informações de cartão de crédito (processadas por gateway seguro)"]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Dados de Navegação:"})," endereço IP, tipo de dispositivo, sistema operacional"]})]})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-xl font-semibold mb-3",children:"3. Uso das Informações"}),a.jsx("p",{className:"text-muted-foreground mb-2",children:"Utilizamos suas informações para:"}),a.jsxs("ul",{className:"list-disc pl-6 space-y-2 text-muted-foreground",children:[a.jsx("li",{children:"Fornecer e gerenciar nossos serviços de carregamento"}),a.jsx("li",{children:"Processar pagamentos e emitir faturas"}),a.jsx("li",{children:"Melhorar a experiência do usuário no aplicativo"}),a.jsx("li",{children:"Enviar notificações sobre seu carregamento e atualizações do serviço"}),a.jsx("li",{children:"Calcular e informar a redução de emissões de COâ"}),a.jsx("li",{children:"Realizar análises estatÃsticas e melhorias nos serviços"}),a.jsx("li",{children:"Cumprir obrigações legais e regulatórias"})]})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-xl font-semibold mb-3",children:"4. Compartilhamento de Informações"}),a.jsx("p",{className:"text-muted-foreground mb-2",children:"Suas informações podem ser compartilhadas com:"}),a.jsxs("ul",{className:"list-disc pl-6 space-y-2 text-muted-foreground",children:[a.jsxs("li",{children:[a.jsx("strong",{children:"Prestadores de Serviço:"})," empresas que auxiliam na operação dos eletropostos e processamento de pagamentos"]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Autoridades Legais:"})," quando exigido por lei ou para proteção de direitos"]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Parceiros Comerciais:"})," apenas com seu consentimento explÃcito"]})]}),a.jsx("p",{className:"mt-3 text-muted-foreground",children:"Nunca vendemos suas informações pessoais para terceiros."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-xl font-semibold mb-3",children:"5. Segurança dos Dados"}),a.jsx("p",{className:"text-muted-foreground mb-2",children:"Implementamos medidas de segurança técnicas e organizacionais para proteger seus dados:"}),a.jsxs("ul",{className:"list-disc pl-6 space-y-2 text-muted-foreground",children:[a.jsx("li",{children:"Criptografia de dados em trânsito e em repouso"}),a.jsx("li",{children:"Controle de acesso restrito à s informações"}),a.jsx("li",{children:"Monitoramento contÃnuo de sistemas"}),a.jsx("li",{children:"Auditorias regulares de segurança"}),a.jsx("li",{children:"Treinamento de equipe em proteção de dados"})]})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-xl font-semibold mb-3",children:"6. Retenção de Dados"}),a.jsx("p",{className:"text-muted-foreground",children:"Mantemos suas informações pelo tempo necessário para fornecer nossos serviços e cumprir obrigações legais. Dados de transações são mantidos conforme exigid
375o pela legislação fiscal e contábil."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-xl font-semibold mb-3",children:"7. Seus Direitos"}),a.jsx("p",{className:"text-muted-foreground mb-2",children:"De acordo com a Lei Geral de Proteção de Dados (LGPD), você tem direito a:"}),a.jsxs("ul",{className:"list-disc pl-6 space-y-2 text-muted-foreground",children:[a.jsx("li",{children:"Acessar seus dados pessoais"}),a.jsx("li",{children:"Corrigir dados incompletos, inexatos ou desatualizados"}),a.jsx("li",{children:"Solicitar a exclusão de dados desnecessários"}),a.jsx("li",{children:"Revogar consentimento para tratamento de dados"}),a.jsx("li",{children:"Solicitar portabilidade de dados"}),a.jsx("li",{children:"Obter informações sobre compartilhamento de dados"})]})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-xl font-semibold mb-3",children:"8. Cookies e Tecnologias Similares"}),a.jsx("p",{className:"text-muted-foreground",children:"Utilizamos cookies e tecnologias similares para melhorar sua experiência. Você pode gerenciar suas preferências de cookies nas configurações do navegador."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-xl font-semibold mb-3",children:"9. Dados de Menores"}),a.jsx("p",{className:"text-muted-foreground",children:"Nossos serviços não são direcionados a menores de 18 anos. Não coletamos intencionalmente dados de menores sem o consentimento dos responsáveis legais."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-xl font-semibold mb-3",children:"10. Alterações na PolÃtica"}),a.jsx("p",{className:"text-muted-foreground",children:"Esta PolÃtica de Privacidade pode ser atualizada periodicamente. Notificaremos sobre alterações significativas através do aplicativo ou por email."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-xl font-semibold mb-3",children:"11. Encarregado de Dados (DPO)"}),a.jsx("p",{className:"text-muted-foreground mb-2",children:"Para exercer seus direitos ou esclarecer dúvidas sobre privacidade, entre em contato:"}),a.jsxs("ul",{className:"list-none space-y-2 text-muted-foreground",children:[a.jsx("li",{children:"Email: [email protected]"}),a.jsx("li",{children:"WhatsApp: +55 85 9246-9325"})]})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-xl font-semibold mb-3",children:"12. Legislação Aplicável"}),a.jsx("p",{className:"text-muted-foreground",children:"Esta PolÃtica de Privacidade é regida pela Lei Geral de Proteção de Dados (Lei nº 13.709/2018) e demais legislações aplicáveis no Brasil."})]}),a.jsx("section",{children:a.jsx("p",{className:"text-sm text-muted-foreground mt-8",children:"Ãltima atualização: Janeiro de 2025"})})]})})]})]}),a.jsxs(Je,{children:[a.jsx(Ct,{asChild:!0,children:a.jsx("button",{className:"text-muted-foreground hover:text-primary transition-smooth",children:"Termos de Uso"})}),a.jsxs(He,{className:"max-w-4xl max-h-[80vh]",children:[a.jsx(rt,{children:a.jsx(Ye,{className:"text-2xl",children:"Termos de Uso"})}),a.jsx(tf,{className:"h-[60vh] pr-4",children:a.jsxs("div",{className:"space-y-6",children:[a.jsxs("section",{children:[a.jsx("h2",{className:"text-xl font-semibold mb-3",children:"1. Aceitação dos Termos"}),a.jsx("p",{className:"text-muted-foreground",children:"Ao acessar e usar os serviços da DCC Energy, você concorda com estes Termos de Uso. Se você não concordar com algum dos termos, não utilize nossos serviços."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-xl font-semibold mb-3",children:"2. Serviços Oferecidos"}),a.jsx("p",{className:"text-muted-foreground mb-2",children:"A DCC Energy oferece serviços de carregamento de veÃculos elétricos através de uma rede de eletropostos em Fortaleza e região. Nossos serviços incluem:"}),a.jsxs("ul",{className:"list-disc pl-6 space-y-2 text-muted-foreground",children:[a.jsx("li",{children:"Acesso à rede de eletropostos"}),a.jsx("li",{children:"Aplicativo mobile para localização e gestão de carregamentos"}),a.jsx("li",{children:"Instalação de soluções de carregamento residencial e comercial"}),a.jsx("li",{children:"Consultoria em eletromobilidade"})]})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-xl font-semibold mb-3",children:"3. Cadastro e Conta de Usuário"}),a.jsx("p",{className:"text-muted-foreground",children:"Para utilizar nossos serviços, você deve criar uma conta fornecendo informações verdadeiras e atualizadas. Você é responsável por manter a confidencialidade de suas credenciais de acesso."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-xl font-semibold mb-3",children:"4. Uso dos Eletropostos"}),a.jsxs("ul",{className:"list-disc pl-6 space-y-2 text-muted-foreground",children:[a.jsx("li",{children:"Os eletropostos devem ser utilizados exclusivamente para carregamento de veÃculos elétricos"}),a.jsx("li",{children:"à proibido danificar ou fazer uso inadequado dos equipamentos"}),a.jsx("li",{children:"O tempo de carregamento deve respeitar as regras de cada estação"}),a.jsx("li",{children:"Vagas de carregamento não devem ser ocupadas por veÃculos que não estejam carregando"})]})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-xl font-semibold mb-3",children:"5. Pagamento e Tarifas"}),a.jsx("p",{className:"text-muted-foreground",children:"As tarifas de carregamento são estabelecidas pela DCC Energy e podem variar conforme a localização, horário e tipo de carregamento. Os valores serão informados no aplicativo antes do inÃcio do carregamento."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-xl font-semibold mb-3",children:"6. Responsabilidades"}),a.jsx("p",{className:"text-muted-foreground mb-2",children:"A DCC Energy não se responsabiliza por:"}),a.jsxs("ul",{className:"list-disc pl-6 space-y-2 text-muted-foreground",children:[a.jsx("li",{children:"Danos ao veÃculo decorrentes de mau uso dos equipamentos pelo usuário"}),a.jsx("li",{children:"Incompatibilidade entre o veÃculo e os conectores disponÃveis"}),a.jsx("li",{children:"Interrupções no serviço devido a manutenção ou problemas técnicos"}),a.jsx("li",{children:"Objetos deixados ou esquecidos nas dependências dos eletropostos"})]})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-xl font-semibold mb-3",children:"7. Sustentabilidade e Meio Ambiente"}),a.jsx("p",{className:"text-muted-foreground",children:"Ao utilizar nossos serviços, você contribui para a redução de emissões de COâ e para um futuro mais
375sustentável. Comprometemo-nos a utilizar energia de fontes renováveis sempre que possÃvel."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-xl font-semibold mb-3",children:"8. Modificações nos Termos"}),a.jsx("p",{className:"text-muted-foreground",children:"A DCC Energy reserva-se o direito de modificar estes termos a qualquer momento. As alterações entrarão em vigor imediatamente após sua publicação no site ou aplicativo."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-xl font-semibold mb-3",children:"9. Cancelamento e Suspensão"}),a.jsx("p",{className:"text-muted-foreground",children:"A DCC Energy pode suspender ou cancelar sua conta em caso de violação destes termos ou uso inadequado dos serviços."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-xl font-semibold mb-3",children:"10. Contato"}),a.jsx("p",{className:"text-muted-foreground mb-2",children:"Para dúvidas ou questões relacionadas a estes Termos de Uso, entre em contato conosco:"}),a.jsxs("ul",{className:"list-none space-y-2 text-muted-foreground",children:[a.jsx("li",{children:"Email: [email protected]"}),a.jsx("li",{children:"WhatsApp: +55 85 9246-9325"})]})]}),a.jsx("section",{children:a.jsx("p",{className:"text-sm text-muted-foreground mt-8",children:"Ãltima atualização: Janeiro de 2025"})})]})})]})]})]})]}),a.jsx("div",{className:"mt-8 pt-4 border-t border-border/50",children:a.jsx("div",{className:"flex justify-center",children:a.jsx("a",{href:"/admin-login",className:"text-xs text-muted-foreground/50 hover:text-primary transition-smooth",children:"Admin"})})})]})})]}),dD=()=>a.jsxs("div",{className:"min-h-screen",children:[a.jsx(La,{}),a.jsxs("main",{className:"pt-[81px] lg:pt-[97px]",children:[a.jsx(M4,{}),a.jsx($4,{}),a.jsx(G4,{}),a.jsx(J4,{}),a.jsx(H4,{}),a.jsx(B4,{}),a.jsx(V4,{}),a.jsx(q4,{}),a.jsx(Y4,{}),a.jsx(Q4,{})]}),a.jsx(Ma,{})]}),hD=()=>a.jsxs("div",{className:"min-h-screen",children:[a.jsx(La,{}),a.jsx("main",{className:"pt-32 pb-20",children:a.jsxs("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8",children:[a.jsx("h1",{className:"text-4xl font-bold mb-8",children:"Termos de Uso"}),a.jsxs("div",{className:"prose prose-lg max-w-none space-y-6",children:[a.jsxs("section",{children:[a.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"1. Aceitação dos Termos"}),a.jsx("p",{children:"Ao acessar e usar os serviços da DCC Energy, você concorda com estes Termos de Uso. Se você não concordar com algum dos termos, não utilize nossos serviços."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"2. Serviços Oferecidos"}),a.jsx("p",{children:"A DCC Energy oferece serviços de carregamento de veÃculos elétricos através de uma rede de eletropostos em Fortaleza e região. Nossos serviços incluem:"}),a.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[a.jsx("li",{children:"Acesso à rede de eletropostos"}),a.jsx("li",{children:"Aplicativo mobile para localização e gestão de carregamentos"}),a.jsx("li",{children:"Instalação de soluções de carregamento residencial e comercial"}),a.jsx("li",{children:"Consultoria em eletromobilidade"})]})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"3. Cadastro e Conta de Usuário"}),a.jsx("p",{children:"Para utilizar nossos serviços, você deve criar uma conta fornecendo informações verdadeiras e atualizadas. Você é responsável por manter a confidencialidade de suas credenciais de acesso."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"4. Uso dos Eletropostos"}),a.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[a.jsx("li",{children:"Os eletropostos devem ser utilizados exclusivamente para carregamento de veÃculos elétricos"}),a.jsx("li",{children:"à proibido danificar ou fazer uso inadequado dos equipamentos"}),a.jsx("li",{children:"O tempo de carregamento deve respeitar as regras de cada estação"}),a.jsx("li",{children:"Vagas de carregamento não devem ser ocupadas por veÃculos que não estejam carregando"})]})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"5. Pagamento e Tarifas"}),a.jsx("p",{children:"As tarifas de carregamento são estabelecidas pela DCC Energy e podem variar conforme a localização, horário e tipo de carregamento. Os valores serão informados no aplicativo antes do inÃcio do carregamento."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"6. Responsabilidades"}),a.jsx("p",{children:"A DCC Energy não se responsabiliza por:"}),a.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[a.jsx("li",{children:"Danos ao veÃculo decorrentes de mau uso dos equipamentos pelo usuário"}),a.jsx("li",{children:"Incompatibilidade entre o veÃculo e os conectores disponÃveis"}),a.jsx("li",{children:"Interrupções no serviço devido a manutenção ou problemas técnicos"}),a.jsx("li",{children:"Objetos deixados ou esquecidos nas dependências dos eletropostos"})]})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"7. Sustentabilidade e Meio Ambiente"}),a.jsx("p",{children:"Ao utilizar nossos serviços, você contribui para a redução de emissões de COâ e para um futuro mais
375sustentável. Comprometemo-nos a utilizar energia de fontes renováveis sempre que possÃvel."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"8. Modificações nos Termos"}),a.jsx("p",{children:"A DCC Energy reserva-se o direito de modificar estes termos a qualquer momento. As alterações entrarão em vigor imediatamente após sua publicação no site ou aplicativo."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"9. Cancelamento e Suspensão"}),a.jsx("p",{children:"A DCC Energy pode suspender ou cancelar sua conta em caso de violação destes termos ou uso inadequado dos serviços."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"10. Contato"}),a.jsx("p",{children:"Para dúvidas ou questões relacionadas a estes Termos de Uso, entre em contato conosco:"}),a.jsxs("ul",{className:"list-none space-y-2",children:[a.jsx("li",{children:"Email: [email protected]"}),a.jsx("li",{children:"WhatsApp: +55 85 9246-9325"})]})]}),a.jsx("section",{children:a.jsx("p",{className:"text-sm text-muted-foreground mt-8",children:"Ãltima atualização: Janeiro de 2025"})})]})]})}),a.jsx(Ma,{})]}),fD=()=>a.jsxs("div",{className:"min-h-screen",children:[a.jsx(La,{}),a.jsx("main",{className:"pt-32 pb-20",children:a.jsxs("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8",children:[a.jsx("h1",{className:"text-4xl font-bold mb-8",children:"PolÃtica de Privacidade"}),a.jsxs("div",{className:"prose prose-lg max-w-none space-y-6",children:[a.jsxs("section",{children:[a.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"1. Introdução"}),a.jsx("p",{children:"A DCC Energy está comprometida em proteger a privacidade e os dados pessoais de seus usuários. Esta PolÃtica de Privacidade descreve como coletamos, usamos, armazenamos e protegemos suas informações."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"2. Informações Coletadas"}),a.jsx("p",{children:"Coletamos as seguintes informações:"}),a.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[a.jsxs("li",{children:[a.jsx("strong",{children:"Dados de Cadastro:"})," nome, email, telefone, CPF/CNPJ"]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Dados do VeÃculo:"})," modelo, placa, autonomia"]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Dados de Uso:"})," histórico de carregamentos, consumo de energia, localização dos eletropostos utilizados"]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Dados de Pagamento:"})," informações de cartão de crédito (processadas por gateway seguro)"]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Dados de Navegação:"})," endereço IP, tipo de dispositivo, sistema operacional"]})]})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"3. Uso das Informações"}),a.jsx("p",{children:"Utilizamos suas informações para:"}),a.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[a.jsx("li",{children:"Fornecer e gerenciar nossos serviços de carregamento"}),a.jsx("li",{children:"Processar pagamentos e emitir faturas"}),a.jsx("li",{children:"Melhorar a experiência do usuário no aplicativo"}),a.jsx("li",{children:"Enviar notificações sobre seu carregamento e atualizações do serviço"}),a.jsx("li",{children:"Calcular e informar a redução de emissões de COâ"}),a.jsx("li",{children:"Realizar análises estatÃsticas e melhorias nos serviços"}),a.jsx("li",{children:"Cumprir obrigações legais e regulatórias"})]})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"4. Compartilhamento de Informações"}),a.jsx("p",{children:"Suas informações podem ser compartilhadas com:"}),a.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[a.jsxs("li",{children:[a.jsx("strong",{children:"Prestadores de Serviço:"})," empresas que auxiliam na operação dos eletropostos e processamento de pagamentos"]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Autoridades Legais:"})," quando exigido por lei ou para proteção de direitos"]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Parceiros Comerciais:"})," apenas com seu consentimento explÃcito"]})]}),a.jsx("p",{className:"mt-4",children:"Nunca vendemos suas informações pessoais para terceiros."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"5. Segurança dos Dados"}),a.jsx("p",{children:"Implementamos medidas de segurança técnicas e organizacionais para proteger seus dados:"}),a.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[a.jsx("li",{children:"Criptografia de dados em trânsito e em repouso"}),a.jsx("li",{children:"Controle de acesso restrito à s informações"}),a.jsx("li",{children:"Monitoramento contÃnuo de sistemas"}),a.jsx("li",{children:"Auditorias regulares de segurança"}),a.jsx("li",{children:"Treinamento de equipe em proteção de dados"})]})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"6. Retenção de Dados"}),a.jsx("p",{children:"Mantemos suas informações pelo tempo necessário para fornecer nossos serviços e cumprir obrigações legais. Dados de transações são mantidos conforme exigid
375o pela legislação fiscal e contábil."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"7. Seus Direitos"}),a.jsx("p",{children:"De acordo com a Lei Geral de Proteção de Dados (LGPD), você tem direito a:"}),a.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[a.jsx("li",{children:"Acessar seus dados pessoais"}),a.jsx("li",{children:"Corrigir dados incompletos, inexatos ou desatualizados"}),a.jsx("li",{children:"Solicitar a exclusão de dados desnecessários"}),a.jsx("li",{children:"Revogar consentimento para tratamento de dados"}),a.jsx("li",{children:"Solicitar portabilidade de dados"}),a.jsx("li",{children:"Obter informações sobre compartilhamento de dados"})]})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"8. Cookies e Tecnologias Similares"}),a.jsx("p",{children:"Utilizamos cookies e tecnologias similares para melhorar sua experiência. Você pode gerenciar suas preferências de cookies nas configurações do navegador."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"9. Dados de Menores"}),a.jsx("p",{children:"Nossos serviços não são direcionados a menores de 18 anos. Não coletamos intencionalmente dados de menores sem o consentimento dos responsáveis legais."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"10. Alterações na PolÃtica"}),a.jsx("p",{children:"Esta PolÃtica de Privacidade pode ser atualizada periodicamente. Notificaremos sobre alterações significativas através do aplicativo ou por email."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"11. Encarregado de Dados (DPO)"}),a.jsx("p",{children:"Para exercer seus direitos ou esclarecer dúvidas sobre privacidade, entre em contato:"}),a.jsxs("ul",{className:"list-none space-y-2",children:[a.jsx("li",{children:"Email: [email protected]"}),a.jsx("li",{children:"WhatsApp: +55 85 9246-9325"})]})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"12. Legislação Aplicável"}),a.jsx("p",{children:"Esta PolÃtica de Privacidade é regida pela Lei Geral de Proteção de Dados (Lei nº 13.709/2018) e demais legislações aplicáveis no Brasil."})]}),a.jsx("section",{children:a.jsx("p",{className:"text-sm text-muted-foreground mt-8",children:"Ãltima atualização: Janeiro de 2025"})})]})]})}),a.jsx(Ma,{})]}),pD=()=>{const e=Ia();return f.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),a.jsx("div",{className:"flex min-h-screen items-center justify-center bg-gray-100",children:a.jsxs("div",{className:"text-center",children:[a.jsx("h1",{className:"mb-4 text-4xl font-bold",children:"404"}),a.jsx("p",{className:"mb-4 text-xl text-gray-600",children:"Oops! Page not found"}),a.jsx("a",{href:"/",className:"text-blue-500 underline hover:text-blue-700",children:"Return to Home"})]})})},Q=f.forwardRef(({className:e,type:t,...r},n)=>a.jsx("input",{type:t,className:te("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...r}));Q.displayName="Input";var mD="Label",r_=f.forwardRef((e,t)=>a.jsx(K.label,{...e,ref:t,onMouseDown:r=>{var s;r.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));r_.displayName=mD;var n_=r_;const gD=Ra("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),M=f.forwardRef(({className:e,...t},r)=>a.jsx(n_,{ref:r,className:te(gD(),e),...t}));M.displayName=n_.displayName;const vD=()=>{const[e,t]=f.useState(""),[r,n]=f.useState(""),[s,i]=f.useState(!1),o=Ap(),{toast:l}=Xt(),c=async u=>{u.preventDefault(),i(!0);try{const{data:d,error:h}=await V.auth.signInWithPassword({email:e,password:r});if(h){l({title:"Erro ao fazer login",description:h.message,variant:"destructive"});return}if(d.user){const{data:m}=await V.from("user_roles").select("role").eq("user_id",d.user.id).single();(m==null?void 0:m.role)==="admin"?(l({title:"Login realizado",description:"Bem-vindo ao painel administrativo!"}),o("/admin")):(await V.auth.signOut(),l({title:"Acesso negado",description:"Você não tem permissão de administrador.",variant:"destructive"}))}}catch(d){l({title:"Erro",description:d.message,variant:"destructive"})}finally{i(!1)}};return a.jsx("div",{className:"min-h-screen flex items-center justify-center p-4 bg-gradient-to-br from-background to-muted",children:a.jsxs(ze,{className:"w-full max-w-md",children:[a.jsxs(Lt,{className:"space-y-4 text-center",children:[a.jsx("div",{className:"flex justify-center",children:a.jsx("img",{src:Ji,alt:"DCC Energy",className:"h-16 w-auto"})}),a.jsxs("div",{className:"flex items-center justify-center gap-2",children:[a.jsx(jN,{className:"h-5 w-5 text-primary"}),a.jsx(Mt,{className:"text-2xl",children:"Painel Administrativo"})]}),a.jsx($t,{children:"Acesso restrito para administradores"})]}),a.jsx(Be,{children:a.jsxs("form",{onSubmit:c,className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"email",children:"Email"}),a.jsx(Q,{id:"email",type:"email",placeholder:"[email protected]",value:e,onCh
vendor: 7,194 bytes, line 375
375ange:u=>t(u.target.value),required:!0,disabled:s})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"password",children:"Senha"}),a.jsx(Q,{id:"password",type:"password",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",value:r,onChange:u=>n(u.target.value),required:!0,disabled:s})]}),a.jsx(B,{type:"submit",className:"w-full",disabled:s,children:s?a.jsxs(a.Fragment,{children:[a.jsx(De,{className:"mr-2 h-4 w-4 animate-spin"}),"Entrando..."]}):"Entrar"}),a.jsx(B,{type:"button",variant:"ghost",className:"w-full",onClick:()=>o("/"),children:"Voltar ao Site"})]})})]})})};var Cd="rovingFocusGroup.onEntryFocus",yD={bubbles:!1,cancelable:!0},$a="RovingFocusGroup",[rf,s_,xD]=ka($a),[wD,bu]=zt($a,[xD]),[bD,_D]=wD($a),i_=f.forwardRef((e,t)=>a.jsx(rf.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(rf.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(SD,{...e,ref:t})})}));i_.displayName=$a;var SD=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:s=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...h}=e,m=f.useRef(null),p=oe(t,m),w=io(i),[g,v]=Ir({prop:o,defaultProp:l??null,onChange:c,caller:$a}),[x,y]=f.useState(!1),b=xe(u),S=s_(r),_=f.useRef(!1),[j,E]=f.useState(0);return f.useEffect(()=>{const C=m.current;if(C)return C.addEventListener(Cd,b),()=>C.removeEventListener(Cd,b)},[b]),a.jsx(bD,{scope:r,orientation:n,dir:w,loop:s,currentTabStopId:g,onItemFocus:f.useCallback(C=>v(C),[v]),onItemShiftTab:f.useCallback(()=>y(!0),[]),onFocusableItemAdd:f.useCallback(()=>E(C=>C+1),[]),onFocusableItemRemove:f.useCallback(()=>E(C=>C-1),[]),children:a.jsx(K.div,{tabIndex:x||j===0?-1:0,"data-orientation":n,...h,ref:p,style:{outline:"none",...e.style},onMouseDown:$(e.onMouseDown,()=>{_.current=!0}),onFocus:$(e.onFocus,C=>{const N=!_.current;if(C.target===C.currentTarget&&N&&!x){const R=new CustomEvent(Cd,yD);if(C.currentTarget.dispatchEvent(R),!R.defaultPrevented){const F=S().filter(H=>H.focusable),I=F.find(H=>H.active),J=F.find(H=>H.id===g),Z=[I,J,...F].filter(Boolean).map(H=>H.ref.current);l_(Z,d)}}_.current=!1}),onBlur:$(e.onBlur,()=>y(!1))})})}),o_="RovingFocusGroupItem",a_=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:s=!1,tabStopId:i,children:o,...l}=e,c=Or(),u=i||c,d=_D(o_,r),h=d.currentTabStopId===u,m=s_(r),{onFocusableItemAdd:p,onFocusableItemRemove:w,currentTabStopId:g}=d;return f.useEffect(()=>{if(n)return p(),()=>w()},[n,p,w]),a.jsx(rf.ItemSlot,{scope:r,id:u,focusable:n,active:s,children:a.jsx(K.span,{tabIndex:h?0:-1,"data-orientation":d.orientation,...l,ref:t,onMouseDown:$(e.onMouseDown,v=>{n?d.onItemFocus(u):v.preventDefault()}),onFocus:$(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:$(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){d.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const x=CD(v,d.orientation,d.dir);if(x!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let b=m().filter(S=>S.focusable).map(S=>S.ref.current);if(x==="last")b.reverse();else if(x==="prev"||x==="next"){x==="prev"&&b.reverse();const S=b.indexOf(v.currentTarget);b=d.loop?ND(b,S+1):b.slice(S+1)}setTimeout(()=>l_(b))}}),children:typeof o=="function"?o({isCurrentTabStop:h,hasTabStop:g!=null}):o})})});a_.displayName=o_;var jD={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ED(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function CD(e,t,r){const n=ED(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return jD[n]}function l_(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function ND(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var c_=i_,u_=a_,_u="Tabs",[kD,KL]=zt(_u,[bu]),d_=bu(),[TD,Yp]=kD(_u),h_=f.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:s,defaultValue:i,orientation:o="horizontal",dir:l,activationMode:c="automatic",...u}=e,d=io(l),[h,m]=Ir({prop:n,onChange:s,defaultProp:i??"",caller:_u});return a.jsx(TD,{scope:r,baseId:Or(),value:h,onValueChange:m,orientation:o,dir:d,activationMode:c,children:a.jsx(K.div,{dir:d,"data-orientation":o,...u,ref:t})})});h_.displayName=_u;var f_="TabsList",p_=f.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...s}=e,i=Yp(f_,r),o=d_(r);return a.jsx(c_,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:n,children:a.jsx(K.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:t})})});p_.displayName=f_;var m_="TabsTrigger",g_=f.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:s=!1,...i}=e,o=Yp(m_,r),l=d_(r),c=x_(o.baseId,n),u=w_(o.baseId,n),d=n===o.value;return a.jsx(u_,{asChild:!0,...l,focusable:!s,active:d,children:a.jsx(K.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:c,...i,ref:t,onMouseDown:$(e.onMouseDown,h=>{!s&&h.button===0&&h.ctrlKey===!1?o.onValueChange(n):h.preventDefault()}),onKeyDown:$(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&o.onValueChange(n)}),onFocus:$(e.onFocus,()=>{const h=o.activationMode!=="manual";!d&&!s&&h&&o.onValueChange(n)})})})});g_.displayName=m_;var v_="TabsContent",y_=f.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:s,children:i,...o}=e,l=Yp(v_,r),c=x_(l.baseId,n),u=w_(l.baseId,n),d=n===l.value,h=f.useRef(d);return f.useEffect(()=>{const m=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(m)},[]),a.jsx(dt,{present:s||d,children:({present:m})=>a.jsx(K.div,{"data-state":d?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!m,id:u,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:m&&i})})});y_.displayName=v_;function x_(e,t){return`${e}-trigger-${t}`}function w_(e,t){return`${e}-content-${t}`}var RD=h_,b_=p_,__=g_,S_=y_;const j_=RD,Qp=f.forwardRef(({className:e,...t},r)=>a.jsx(b_,{ref:r,className:te("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Qp.displayName=b_.displayName;const Nt=f.forwardRef(({className:e,...t},r)=>a.jsx(__,{ref:r,className:te("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",e),...t}));Nt.displayName=__.displayName;const kt=f.forwardRef(({className:e,...t},r)=>a.jsx(S_,{ref:r,className:te("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));kt.displayName=S_.displayName;const un=f.forwardRef(({className:e,...t},r)=>a.jsx("textarea",{className:te("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
375ing-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...t}));un.displayName="Textarea";var Su="Switch",[PD,GL]=zt(Su),[AD,OD]=PD(Su),E_=f.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:s,defaultChecked:i,required:o,disabled:l,value:c="on",onCheckedChange:u,form:d,...h}=e,[m,p]=f.useState(null),w=oe(t,b=>p(b)),g=f.useRef(!1),v=m?d||!!m.closest("form"):!0,[x,y]=Ir({prop:s,defaultProp:i??!1,onChange:u,caller:Su});return a.jsxs(AD,{scope:r,checked:x,disabled:l,children:[a.jsx(K.button,{type:"button",role:"switch","aria-checked":x,"aria-required":o,"data-state":T_(x),"data-disabled":l?"":void 0,disabled:l,value:c,...h,ref:w,onClick:$(e.onClick,b=>{y(S=>!S),v&&(g.current=b.isPropagationStopped(),g.current||b.stopPropagation())})}),v&&a.jsx(k_,{control:m,bubbles:!g.current,name:n,value:c,checked:x,required:o,disabled:l,form:d,style:{transform:"translateX(-100%)"}})]})});E_.displayName=Su;var C_="SwitchThumb",N_=f.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,s=OD(C_,r);return a.jsx(K.span,{"data-state":T_(s.checked),"data-disabled":s.disabled?"":void 0,...n,ref:t})});N_.displayName=C_;var ID="SwitchBubbleInput",k_=f.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...s},i)=>{const o=f.useRef(null),l=oe(o,i),c=hu(r),u=jp(t);return f.useEffect(()=>{const d=o.current;if(!d)return;const h=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(h,"checked").set;if(c!==r&&p){const w=new Event("click",{bubbles:n});p.call(d,r),d.dispatchEvent(w)}},[c,r,n]),a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:l,style:{...s.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});k_.displayName=ID;function T_(e){return e?"checked":"unchecked"}var R_=E_,DD=N_;const dn=f.forwardRef(({className:e,...t},r)=>a.jsx(R_,{className:te("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",e),...t,ref:r,children:a.jsx(DD,{className:te("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));dn.displayName=R_.displayName;const LD=()=>{const[e,t]=f.useState([]),[r,n]=f.useState(!0),[s,i]=f.useState(null),[o,l]=f.useState({title:"",description:"",image_url:"",is_new:!1}),[c,u]=f.useState(!1),{toast:d}=Xt();f.useEffect(()=>{h()},[]);const h=async()=>{n(!0);const{data:v,error:x}=await V.from("services").select("*").order("created_at",{ascending:!1});x?d({title:"Erro ao carregar serviços",description:x.message,variant:"destructive"}):t(v||[]),n(!1)},m=async v=>{if(v.preventDefault(),s){const{error:x}=await V.from("services").update(o).eq("id",s.id);if(x){d({title:"Erro ao atualizar serviço",description:x.message,variant:"destructive"});return}d({title:"Serviço atualizado",description:"O serviço foi atualizado com sucesso!"})}else{const{error:x}=await V.from("services").insert([o]);if(x){d({title:"Erro ao adicionar serviço",description:x.message,variant:"destructive"});return}d({title:"Serviço adicionado",description:"O serviço foi adicionado com sucesso!"})}l({title:"",description:"",image_url:"",is_new:!1}),i(null),u(!1),h()},p=v=>{i(v),l({title:v.title,description:v.description,image_url:v.image_url||"",is_new:v.is_new}),u(!0)},w=async v=>{if(!confirm("Tem certeza que deseja excluir este serviço?"))return;const{error:x}=await V.from("services").delete().eq("id",v);if(x){d({title:"Erro ao excluir serviço",description:x.message,variant:"destructive"});return}d({title:"Serviço excluÃdo",description:"O serviço foi excluÃdo com sucesso!"}),h()},g=()=>{u(!1),i(null),l({title:"",description:"",image_url:"",is_new:!1})};return r?a.jsx("div",{className:"flex justify-center p-8",children:a.jsx(De,{className:"h-8 w-8 animate-spin"})}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("h2",{className:"text-2xl font-bold",children:"Gerenciar Serviços"}),a.jsxs(Je,{open:c,onOpenChange:u,children:[a.jsx(Ct,{asChild:!0,children:a.jsxs(B,{onClick:()=>g(),children:[a.jsx(on,{className:"mr-2 h-4 w-4"}),"Adicionar Serviço"]})}),a.jsxs(He,{className:"max-w-[95vw] sm:max-w-lg max-h-[90vh] overflow-hidden flex flex-col",children:[a.jsx(rt,{children:a.jsx(Ye,{children:s?"Editar Serviço":"Novo Serviço"})}),a.jsxs("form",{onSubmit:m,className:"space-y-4 overflow-y-auto px-1 -mx-1",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"title",children:"TÃtulo"}),a.jsx(Q,{id:"title",value:o.title,onChange:v=>l({...o,title:v.target.value}),required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"description",children:"Descrição"}),a.jsx(un,{id:"description",value:o.description,onChange:v=>l({...o,description:v.target.value}),required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"image_url",children:"URL da Imagem"}),a.jsx(Q,{id:"image_url",value:o.image_url,onChange:v=>l({...o,image_url:v.target.value}),placeholder:"https://exemplo.com/imagem.jpg"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Cole a URL direta da imagem"}),o.image_url&&a.jsx("div",{className:"mt-2",children:a.jsx("img",{src:o.image_url,alt:"Preview",className:"w-32 h-32 object-cover rounded"})})]}),a.jsxs("div",{className:"flex items-center justify-between space-x-2",children:[a.jsxs(M,{htmlFor:"is_new",className:"flex flex-col space-y-1",children:[a.jsx("span",{children:"Marcar como Novidade"}),a.jsx("span",{className:"text-sm text-muted-foreground font-normal",children:'Exibe um badge de "Novida
375de" no card'})]}),a.jsx(dn,{id:"is_new",checked:o.is_new,onCheckedChange:v=>l({...o,is_new:v})})]}),a.jsx(B,{type:"submit",className:"w-full",children:s?"Atualizar":"Adicionar"})]})]})]})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:e.map(v=>a.jsxs(ze,{children:[a.jsxs(Lt,{children:[a.jsxs(Mt,{className:"flex items-center justify-between gap-2",children:[a.jsx("span",{children:v.title}),v.is_new&&a.jsx(Ze,{className:"bg-accent text-accent-foreground shrink-0",children:"Novidade"})]}),a.jsx($t,{children:v.description})]}),a.jsxs(Be,{children:[v.image_url&&a.jsx("img",{src:v.image_url,alt:v.title,className:"w-full h-32 object-cover rounded mb-4"}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(B,{variant:"outline",size:"sm",onClick:()=>p(v),className:"flex-1",children:[a.jsx(an,{className:"mr-2 h-4 w-4"}),"Editar"]}),a.jsxs(B,{variant:"destructive",size:"sm",onClick:()=>w(v.id),className:"flex-1",children:[a.jsx(Dr,{className:"mr-2 h-4 w-4"}),"Excluir"]})]})]})]},v.id))})]})},MD=()=>{const[e,t]=f.useState([]),[r,n]=f.useState(!0),[s,i]=f.useState(null),[o,l]=f.useState({nome:"",endereco:"",potencia:"",lat:0,lng:0,imagem_url:"",is_new:!1}),[c,u]=f.useState(!1),{toast:d}=Xt();f.useEffect(()=>{h()},[]);const h=async()=>{n(!0);const{data:v,error:x}=await V.from("charging_stations").select("*").order("created_at",{ascending:!1});x?d({title:"Erro ao carregar eletropostos",description:x.message,variant:"destructive"}):t(v||[]),n(!1)},m=async v=>{v.preventDefault();const x={...o};if(s){const{error:y}=await V.from("charging_stations").update(x).eq("id",s.id);if(y){d({title:"Erro ao atualizar eletroposto",description:y.message,variant:"destructive"});return}d({title:"Eletroposto atualizado",description:"O eletroposto foi atualizado com sucesso!"})}else{const{error:y}=await V.from("charging_stations").insert([x]);if(y){d({title:"Erro ao adicionar eletroposto",description:y.message,variant:"destructive"});return}d({title:"Eletroposto adicionado",description:"O eletroposto foi adicionado com sucesso!"})}g(),h()},p=v=>{i(v),l({nome:v.nome,endereco:v.endereco,potencia:v.potencia,lat:v.lat,lng:v.lng,imagem_url:v.imagem_url||"",is_new:v.is_new}),u(!0)},w=async v=>{if(!confirm("Tem certeza que deseja excluir este eletroposto?"))return;const{error:x}=await V.from("charging_stations").delete().eq("id",v);if(x){d({title:"Erro ao excluir eletroposto",description:x.message,variant:"destructive"});return}d({title:"Eletroposto excluÃdo",description:"O eletroposto foi excluÃdo com sucesso!"}),h()},g=()=>{u(!1),i(null),l({nome:"",endereco:"",potencia:"",lat:0,lng:0,imagem_url:"",is_new:!1})};return r?a.jsx("div",{className:"flex justify-center p-8",children:a.jsx(De,{className:"h-8 w-8 animate-spin"})}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("h2",{className:"text-2xl font-bold",children:"Gerenciar Eletropostos"}),a.jsxs(Je,{open:c,onOpenChange:u,children:[a.jsx(Ct,{asChild:!0,children:a.jsxs(B,{onClick:()=>g(),children:[a.jsx(on,{className:"mr-2 h-4 w-4"}),"Adicionar Eletroposto"]})}),a.jsxs(He,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[a.jsx(rt,{children:a.jsx(Ye,{children:s?"Editar Eletroposto":"Novo Eletroposto"})}),a.jsxs("form",{onSubmit:m,className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"nome",children:"Nome"}),a.jsx(Q,{id:"nome",value:o.nome,onChange:v=>l({...o,nome:v.target.value}),required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"endereco",children:"Endereço"}),a.jsx(un,{id:"endereco",value:o.endereco,onChange:v=>l({...o,endereco:v.target.value}),required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"potencia",children:"Potência"}),a.jsx(Q,{id:"potencia",value:o.potencia,onChange:v=>l({...o,potencia:v.target.value}),placeholder:"Ex: 1 AC 22KW, 1 DC 50KW",required:!0})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"lat",children:"Latitude"}),a.jsx(Q,{id:"lat",type:"number",step:"any",value:o.lat,onChange:v=>l({...o,lat:parseFloat(v.target.value)}),required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"lng",children:"Longitude"}),a.jsx(Q,{id:"lng",type:"number",step:"any",value:o.lng,onChange:v=>l({...o,lng:parseFloat(v.target.value)}),required:!0})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"imagem_url",children:"URL da Imagem"}),a.jsx(Q,{id:"imagem_url",value:o.imagem_url,onChange:v=>l({...o,imagem_url:v.target.value}),placeholder:"https://exemplo.com/imagem.jpg"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Cole a URL direta da imagem"}),o.imagem_url&&a.jsx("div",{className:"mt-2",children:a.jsx("img",{src:o.imagem_url,alt:"Preview",className:"w-full h-32 object-cover rounded"})})]}),a.jsxs("div",{className:"flex items-center justify-between space-x-2",children:[a.jsxs(M,{htmlFor:"is_new",className:"flex flex-col space-y-1",children:[a.jsx("span",{children:"Marcar como Novidade"}),a.jsx("span",{className:"text-sm text-muted-foreground font-normal",children:'Exibe um badge de "Novida
375de" no card'})]}),a.jsx(dn,{id:"is_new",checked:o.is_new,onCheckedChange:v=>l({...o,is_new:v})})]}),a.jsx(B,{type:"submit",className:"w-full",children:s?"Atualizar":"Adicionar"})]})]})]})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:e.map(v=>a.jsxs(ze,{children:[a.jsxs(Lt,{children:[v.imagem_url&&a.jsx("img",{src:v.imagem_url,alt:v.nome,className:"w-full h-32 object-cover rounded-lg mb-2"}),a.jsxs(Mt,{className:"flex items-center justify-between gap-2",children:[a.jsx("span",{children:v.nome}),v.is_new&&a.jsx(Ze,{className:"bg-accent text-accent-foreground shrink-0",children:"Novidade"})]}),a.jsx($t,{className:"text-xs",children:v.endereco})]}),a.jsxs(Be,{children:[a.jsxs("p",{className:"text-sm mb-2",children:[a.jsx("strong",{children:"Potência:"})," ",v.potencia]}),a.jsxs("p",{className:"text-xs text-muted-foreground mb-4",children:["Lat: ",v.lat,", Lng: ",v.lng]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(B,{variant:"outline",size:"sm",onClick:()=>p(v),className:"flex-1",children:[a.jsx(an,{className:"mr-2 h-4 w-4"}),"Editar"]}),a.jsxs(B,{variant:"destructive",size:"sm",onClick:()=>w(v.id),className:"flex-1",children:[a.jsx(Dr,{className:"mr-2 h-4 w-4"}),"Excluir"]})]})]})]},v.id))})]})},$D=()=>{const[e,t]=f.useState([]),[r,n]=f.useState(!0),[s,i]=f.useState({email:"",password:"",full_name:""}),[o,l]=f.useState(null),[c,u]=f.useState(!1),[d,h]=f.useState(!1),[m,p]=f.useState(!1),{toast:w}=Xt();f.useEffect(()=>{g()},[]);const g=async()=>{n(!0);const{data:S,error:_}=await V.from("user_roles").select("user_id").eq("role","admin");if(_){w({title:"Erro ao carregar usuários",description:_.message,variant:"destructive"}),n(!1);return}if(!S||S.length===0){t([]),n(!1);return}const j=S.map(N=>N.user_id),{data:E,error:C}=await V.from("profiles").select("*").in("id",j);C?w({title:"Erro ao carregar perfis",description:C.message,variant:"destructive"}):t(E||[]),n(!1)},v=async S=>{S.preventDefault(),p(!0);try{const{data:_,error:j}=await V.auth.signUp({email:s.email,password:s.password,options:{data:{full_name:s.full_name}}});if(j){w({title:"Erro ao criar usuário",description:j.message,variant:"destructive"}),p(!1);return}if(!_.user){w({title:"Erro",description:"Usuário não foi criado",variant:"destructive"}),p(!1);return}const{error:E}=await V.from("user_roles").insert([{user_id:_.user.id,role:"admin"}]);if(E){w({title:"Erro ao definir permissões",description:E.message,variant:"destructive"}),p(!1);return}w({title:"Administrador adicionado",description:"O novo administrador foi criado com sucesso!"}),i({email:"",password:"",full_name:""}),u(!1),g()}catch(_){w({title:"Erro",description:_.message,variant:"destructive"})}finally{p(!1)}},x=S=>{l({user_id:S.id,email:S.email,full_name:S.full_name||"",password:""}),h(!0)},y=async S=>{if(S.preventDefault(),!!o)try{const{error:_}=await V.from("profiles").update({email:o.email,full_name:o.full_name}).eq("id",o.user_id);if(_)throw _;if(o.password){const{error:j}=await V.auth.admin.updateUserById(o.user_id,{password:o.password});if(j)throw j}w({title:"Usuário atualizado",description:"O usuário foi atualizado com sucesso!"}),h(!1),l(null),g()}catch(_){w({title:"Erro ao atualizar usuário",description:_.message,variant:"destructive"})}},b=async S=>{if(!confirm("Tem certeza que deseja remover este administrador?"))return;const{error:_}=await V.from("user_roles").delete().eq("user_id",S).eq("role","admin");if(_){w({title:"Erro ao remover administrador",description:_.message,variant:"destructive"});return}w({title:"Administrador removido",description:"O administrador foi removido com sucesso!"}),g()};return r?a.jsx("div",{className:"flex justify-center p-8",children:a.jsx(De,{className:"h-8 w-8 animate-spin"})}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("h2",{className:"text-2xl font-bold",children:"Gerenciar Administradores"}),a.jsxs(Je,{open:c,onOpenChange:u,children:[a.jsx(Ct,{asChild:!0,children:a.jsxs(B,{children:[a.jsx(Ng,{className:"mr-2 h-4 w-4"}),"Adicionar Administrador"]})}),a.jsxs(He,{children:[a.jsx(rt,{children:a.jsx(Ye,{children:"Novo Administrador"})}),a.jsxs("form",{onSubmit:v,className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"full_name",children:"Nome Completo"}),a.jsx(Q,{id:"full_name",value:s.full_name,onChange:S=>i({...s,full_name:S.target.value}),required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"email",children:"Email"}),a.jsx(Q,{id:"email",type:"email",value:s.email,onChange:S=>i({...s,email:S.target.value}),required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"password",children:"Senha"}),a.jsx(Q,{id:"password",type:"password",value:s.password,onChange:S=>i({...s,password:S.target.value}),required:!0,minLength:6}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"MÃnimo de 6 caracteres"})]}
375),a.jsx(B,{type:"submit",className:"w-full",disabled:m,children:m?a.jsxs(a.Fragment,{children:[a.jsx(De,{className:"mr-2 h-4 w-4 animate-spin"}),"Criando..."]}):"Adicionar"})]})]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[e.map(S=>a.jsxs(ze,{children:[a.jsxs(Lt,{children:[a.jsx(Mt,{children:S.full_name||"Sem nome"}),a.jsx($t,{children:S.email})]}),a.jsxs(Be,{children:[a.jsxs("p",{className:"text-sm text-muted-foreground mb-4",children:["Criado em: ",new Date(S.created_at).toLocaleDateString("pt-BR")]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(B,{variant:"outline",size:"sm",onClick:()=>x(S),className:"flex-1",children:[a.jsx(an,{className:"mr-2 h-4 w-4"}),"Editar"]}),a.jsxs(B,{variant:"destructive",size:"sm",onClick:()=>b(S.id),className:"flex-1",children:[a.jsx(Dr,{className:"mr-2 h-4 w-4"}),"Remover"]})]})]})]},S.id)),e.length===0&&a.jsx(ze,{className:"col-span-full",children:a.jsxs(Be,{className:"flex flex-col items-center justify-center py-8",children:[a.jsx("p",{className:"text-muted-foreground mb-4",children:"Nenhum administrador cadastrado"}),a.jsxs(B,{onClick:()=>u(!0),children:[a.jsx(Ng,{className:"mr-2 h-4 w-4"}),"Adicionar Primeiro Administrador"]})]})})]}),a.jsx(Je,{open:d,onOpenChange:h,children:a.jsxs(He,{children:[a.jsx(rt,{children:a.jsx(Ye,{children:"Editar Usuário Admin"})}),o&&a.jsxs("form",{onSubmit:y,className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"edit_full_name",children:"Nome Completo"}),a.jsx(Q,{id:"edit_full_name",value:o.full_name,onChange:S=>l({...o,full_name:S.target.value}),required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"edit_email",children:"Email"}),a.jsx(Q,{id:"edit_email",type:"email",value:o.email,onChange:S=>l({...o,email:S.target.value}),required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"edit_password",children:"Nova Senha (opcional)"}),a.jsx(Q,{id:"edit_password",type:"password",value:o.password||"",onChange:S=>l({...o,password:S.target.value}),placeholder:"Deixe em branco para não alterar",minLength:6}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"MÃnimo de 6 caracteres se informado"})]}),a.jsx(B,{type:"submit",className:"w-full",children:"Atualizar Usuário"})]})]})})]})},FD=()=>{const[e,t]=f.useState([]),[r,n]=f.useState(!0),[s,i]=f.useState(null),[o,l]=f.useState({title:"",description:"",youtube_url:"",is_new:!1}),[c,u]=f.useState(!1),{toast:d}=Xt();f.useEffect(()=>{h()},[]);const h=async()=>{n(!0);const{data:v,error:x}=await V.from("videos").select("*").order("created_at",{ascending:!1});x?d({title:"Erro ao carregar vÃdeos",description:x.message,variant:"destructive"}):t(v||[]),n(!1)},m=async v=>{if(v.preventDefault(),s){const{error:x}=await V.from("videos").update(o).eq("id",s.id);if(x){d({title:"Erro ao atualizar vÃdeo",description:x.message,variant:"destructive"});return}d({title:"VÃdeo atualizado",description:"O vÃdeo foi atualizado com sucesso!"})}else{const{error:x}=await V.from("videos").insert([o]);if(x){d({title:"Erro ao adicionar vÃdeo",description:x.message,variant:"destructive"});return}d({title:"VÃdeo adicionado",description:"O vÃdeo foi adicionado com sucesso!"})}l({title:"",description:"",youtube_url:"",is_new:!1}),i(null),u(!1),h()},p=v=>{i(v),l({title:v.title,description:v.description,youtube_url:v.youtube_url,is_new:v.is_new}),u(!0)},w=async v=>{if(!confirm("Tem certeza que deseja excluir este vÃdeo?"))return;const{error:x}=await V.from("videos").delete().eq("id",v);if(x){d({title:"Erro ao excluir vÃdeo",description:x.message,variant:"destructive"});return}d({title:"VÃdeo excluÃdo",description:"O vÃdeo foi excluÃdo com sucesso!"}),h()},g=()=>{u(!1),i(null),l({title:"",description:"",youtube_url:"",is_new:!1})};return r?a.jsx("div",{className:"flex justify-center p-8",children:a.jsx(De,{className:"h-8 w-8 animate-spin"})}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("h2",{className:"text-2xl font-bold",children:"Gerenciar VÃdeos"}),a.jsxs(Je,{open:c,onOpenChange:u,children:[a.jsx(Ct,{asChild:!0,children:a.jsxs(B,{onClick:()=>g(),children:[a.jsx(on,{className:"mr-2 h-4 w-4"}),"Adicionar VÃdeo"]})}),a.jsxs(He,{className:"max-w-[95vw] sm:max-w-lg max-h-[90vh] overflow-hidden flex flex-col",children:[a.jsx(rt,{children:a.jsx(Ye,{children:s?"Editar VÃdeo":"Novo VÃdeo"})}),a.jsxs("form",{onSubmit:m,className:"space-y-4 overflow-y-auto px-1 -mx-1",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"title",children:"TÃtulo"}),a.jsx(Q,{id:"title",value:o.title,onChange:v=>l({...o,title:v.target.value}),required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"description",children:"Descrição"}),a.jsx(un,{id:"description",value:o.description,onChange:v=>l({...o,description:v.target.value}),required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"youtube_url",children:"URL do YouTube"}),a.jsx(Q,{id:"youtube_url",value:o.youtube_url,onChange:v=>l({...o,youtube_url:v.target.value}),placeholder:"https://www.youtube.com/watch?v=...",required:!0})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(dn,{id:"is_new",checked:o.is_new,onCheckedChange:v=>l({...o,is_new:v})}
375),a.jsx(M,{htmlFor:"is_new",children:"Marcar como novidade"})]}),a.jsx(B,{type:"submit",className:"w-full",children:s?"Atualizar":"Adicionar"})]})]})]})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:e.map(v=>a.jsxs(ze,{children:[a.jsxs(Lt,{children:[a.jsxs(Mt,{className:"flex items-center justify-between",children:[a.jsx("span",{children:v.title}),v.is_new&&a.jsx("span",{className:"text-xs bg-primary text-primary-foreground px-2 py-1 rounded",children:"NOVO"})]}),a.jsx($t,{children:v.description})]}),a.jsx(Be,{children:a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(B,{variant:"outline",size:"sm",onClick:()=>p(v),className:"flex-1",children:[a.jsx(an,{className:"mr-2 h-4 w-4"}),"Editar"]}),a.jsxs(B,{variant:"destructive",size:"sm",onClick:()=>w(v.id),className:"flex-1",children:[a.jsx(Dr,{className:"mr-2 h-4 w-4"}),"Excluir"]})]})})]},v.id))})]})},UD=()=>{const[e,t]=f.useState([]),[r,n]=f.useState(!0),[s,i]=f.useState(null),[o,l]=f.useState({title:"",content:"",image_url:"",is_new:!1}),[c,u]=f.useState(!1),{toast:d}=Xt();f.useEffect(()=>{h()},[]);const h=async()=>{n(!0);const{data:v,error:x}=await V.from("news").select("*").order("created_at",{ascending:!1});x?d({title:"Erro ao carregar notÃcias",description:x.message,variant:"destructive"}):t(v||[]),n(!1)},m=async v=>{if(v.preventDefault(),s){const{error:x}=await V.from("news").update(o).eq("id",s.id);if(x){d({title:"Erro ao atualizar notÃcia",description:x.message,variant:"destructive"});return}d({title:"NotÃcia atualizada",description:"A notÃcia foi atualizada com sucesso!"})}else{const{error:x}=await V.from("news").insert([o]);if(x){d({title:"Erro ao adicionar notÃcia",description:x.message,variant:"destructive"});return}d({title:"NotÃcia adicionada",description:"A notÃcia foi adicionada com sucesso!"})}l({title:"",content:"",image_url:"",is_new:!1}),i(null),u(!1),h()},p=v=>{i(v),l({title:v.title,content:v.content,image_url:v.image_url||"",is_new:v.is_new}),u(!0)},w=async v=>{if(!confirm("Tem certeza que deseja excluir esta notÃcia?"))return;const{error:x}=await V.from("news").delete().eq("id",v);if(x){d({title:"Erro ao excluir notÃcia",description:x.message,variant:"destructive"});return}d({title:"NotÃcia excluÃda",description:"A notÃcia foi excluÃda com sucesso!"}),h()},g=()=>{u(!1),i(null),l({title:"",content:"",image_url:"",is_new:!1})};return r?a.jsx("div",{className:"flex justify-center p-8",children:a.jsx(De,{className:"h-8 w-8 animate-spin"})}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("h2",{className:"text-2xl font-bold",children:"Gerenciar NotÃcias"}),a.jsxs(Je,{open:c,onOpenChange:u,children:[a.jsx(Ct,{asChild:!0,children:a.jsxs(B,{onClick:()=>g(),children:[a.jsx(on,{className:"mr-2 h-4 w-4"}),"Adicionar NotÃcia"]})}),a.jsxs(He,{className:"max-w-[95vw] sm:max-w-lg max-h-[90vh] overflow-hidden flex flex-col",children:[a.jsx(rt,{children:a.jsx(Ye,{children:s?"Editar NotÃcia":"Nova NotÃcia"})}),a.jsxs("form",{onSubmit:m,className:"space-y-4 overflow-y-auto px-1 -mx-1",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"title",children:"TÃtulo"}),a.jsx(Q,{id:"title",value:o.title,onChange:v=>l({...o,title:v.target.value}),required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"content",children:"Conteúdo"}),a.jsx(un,{id:"content",value:o.content,onChange:v=>l({...o,content:v.target.value}),required:!0,className:"min-h-[120px]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"image_url",children:"URL da Imagem"}),a.jsx(Q,{id:"image_url",value:o.image_url,onChange:v=>l({...o,image_url:v.target.value}),placeholder:"https://exemplo.com/imagem.jpg"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Cole a URL direta da imagem"}),o.image_url&&a.jsx("div",{className:"mt-2",children:a.jsx("img",{src:o.image_url,alt:"Preview",className:"w-full h-48 object-cover rounded"})})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(dn,{id:"is_new",checked:o.is_new,onCheckedChange:v=>l({...o,is_new:v})}
vendor: 22,998 bytes, line 375
375),a.jsx(M,{htmlFor:"is_new",children:"Marcar como novidade"})]}),a.jsx(B,{type:"submit",className:"w-full",children:s?"Atualizar":"Adicionar"})]})]})]})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:e.map(v=>a.jsxs(ze,{children:[a.jsxs(Lt,{children:[a.jsxs(Mt,{className:"flex items-center justify-between",children:[a.jsx("span",{children:v.title}),v.is_new&&a.jsx("span",{className:"text-xs bg-primary text-primary-foreground px-2 py-1 rounded",children:"NOVO"})]}),a.jsxs($t,{children:[v.content.substring(0,100),"..."]})]}),a.jsxs(Be,{children:[v.image_url&&a.jsx("img",{src:v.image_url,alt:v.title,className:"w-full h-32 object-cover rounded mb-4"}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(B,{variant:"outline",size:"sm",onClick:()=>p(v),className:"flex-1",children:[a.jsx(an,{className:"mr-2 h-4 w-4"}),"Editar"]}),a.jsxs(B,{variant:"destructive",size:"sm",onClick:()=>w(v.id),className:"flex-1",children:[a.jsx(Dr,{className:"mr-2 h-4 w-4"}),"Excluir"]})]})]})]},v.id))})]})};var Xp="Radio",[zD,P_]=zt(Xp),[BD,VD]=zD(Xp),A_=f.forwardRef((e,t)=>{const{__scopeRadio:r,name:n,checked:s=!1,required:i,disabled:o,value:l="on",onCheck:c,form:u,...d}=e,[h,m]=f.useState(null),p=oe(t,v=>m(v)),w=f.useRef(!1),g=h?u||!!h.closest("form"):!0;return a.jsxs(BD,{scope:r,checked:s,disabled:o,children:[a.jsx(K.button,{type:"button",role:"radio","aria-checked":s,"data-state":L_(s),"data-disabled":o?"":void 0,disabled:o,value:l,...d,ref:p,onClick:$(e.onClick,v=>{s||c==null||c(),g&&(w.current=v.isPropagationStopped(),w.current||v.stopPropagation())})}),g&&a.jsx(D_,{control:h,bubbles:!w.current,name:n,value:l,checked:s,required:i,disabled:o,form:u,style:{transform:"translateX(-100%)"}})]})});A_.displayName=Xp;var O_="RadioIndicator",I_=f.forwardRef((e,t)=>{const{__scopeRadio:r,forceMount:n,...s}=e,i=VD(O_,r);return a.jsx(dt,{present:n||i.checked,children:a.jsx(K.span,{"data-state":L_(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:t})})});I_.displayName=O_;var WD="RadioBubbleInput",D_=f.forwardRef(({__scopeRadio:e,control:t,checked:r,bubbles:n=!0,...s},i)=>{const o=f.useRef(null),l=oe(o,i),c=hu(r),u=jp(t);return f.useEffect(()=>{const d=o.current;if(!d)return;const h=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(h,"checked").set;if(c!==r&&p){const w=new Event("click",{bubbles:n});p.call(d,r),d.dispatchEvent(w)}},[c,r,n]),a.jsx(K.input,{type:"radio","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:l,style:{...s.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});D_.displayName=WD;function L_(e){return e?"checked":"unchecked"}var HD=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ju="RadioGroup",[qD,JL]=zt(ju,[bu,P_]),M_=bu(),$_=P_(),[KD,GD]=qD(ju),F_=f.forwardRef((e,t)=>{const{__scopeRadioGroup:r,name:n,defaultValue:s,value:i,required:o=!1,disabled:l=!1,orientation:c,dir:u,loop:d=!0,onValueChange:h,...m}=e,p=M_(r),w=io(u),[g,v]=Ir({prop:i,defaultProp:s??null,onChange:h,caller:ju});return a.jsx(KD,{scope:r,name:n,required:o,disabled:l,value:g,onValueChange:v,children:a.jsx(c_,{asChild:!0,...p,orientation:c,dir:w,loop:d,children:a.jsx(K.div,{role:"radiogroup","aria-required":o,"aria-orientation":c,"data-disabled":l?"":void 0,dir:w,...m,ref:t})})})});F_.displayName=ju;var U_="RadioGroupItem",z_=f.forwardRef((e,t)=>{const{__scopeRadioGroup:r,disabled:n,...s}=e,i=GD(U_,r),o=i.disabled||n,l=M_(r),c=$_(r),u=f.useRef(null),d=oe(t,u),h=i.value===s.value,m=f.useRef(!1);return f.useEffect(()=>{const p=g=>{HD.includes(g.key)&&(m.current=!0)},w=()=>m.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",w),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",w)}},[]),a.jsx(u_,{asChild:!0,...l,focusable:!o,active:h,children:a.jsx(A_,{disabled:o,required:i.required,checked:h,...c,...s,name:i.name,ref:d,onCheck:()=>i.onValueChange(s.value),onKeyDown:$(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:$(s.onFocus,()=>{var p;m.current&&((p=u.current)==null||p.click())})})})});z_.displayName=U_;var JD="RadioGroupIndicator",B_=f.forwardRef((e,t)=>{const{__scopeRadioGroup:r,...n}=e,s=$_(r);return a.jsx(I_,{...s,...n,ref:t})});B_.displayName=JD;var V_=F_,W_=z_,YD=B_;const H_=f.forwardRef(({className:e,...t},r)=>a.jsx(V_,{className:te("grid gap-2",e),...t,ref:r}));H_.displayName=V_.displayName;const nf=f.forwardRef(({className:e,...t},r)=>a.jsx(W_,{ref:r,className:te("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:a.jsx(YD,{className:"flex items-center justify-center",children:a.jsx(xN,{className:"h-2.5 w-2.5 fill-current text-current"})})}));nf.displayName=W_.displayName;var QD=[" ","Enter","ArrowUp","ArrowDown"],XD=[" ","Enter"],Ds="Select",[Eu,Cu,ZD]=ka(Ds),[ao,YL]=zt(Ds,[ZD,ou]),Nu=ou(),[eL,ts]=ao(Ds),[tL,rL]=ao(Ds),q_=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:s,onOpenChange:i,value:o,defaultValue:l,onValueChange:c,dir:u,name:d,autoComplete:h,disabled:m,required:p,form:w}=e,g=Nu(t),[v,x]=f.useState(null),[y,b]=f.useState(null),[S,_]=f.useState(!1),j=io(u),[E,C]=Ir({prop:n,defaultProp:s??!1,onChange:i,caller:Ds}),[N,R]=Ir({prop:o,defaultProp:l,onChange:c,caller:Ds}),F=f.useRef(null),I=v?w||!!v.closest("form"):!0,[J,D]=f.useState(new Set),Z=Array.from(J).map(H=>H.props.value).join(";");return a.jsx(rT,{...g,children:a.jsxs(eL,{required:p,scope:t,trigger:v,onTriggerChange:x,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:S,onValueNodeHasChildrenChange:_,contentId:Or(),value:N,onValueChange:R,open:E,onOpenChange:C,dir:j,triggerPointerDownPosRef:F,disabled:m,children:[a.jsx(Eu.Provider,{scope:t,children:a.jsx(tL,{scope:e.__scopeSelect,onNativeOptionAdd:f.useCallback(H=>{D(X=>new Set(X).add(H))},[]),onNativeOptionRemove:f.useCallback(H=>{D(X=>{const k=new Set(X);return k.delete(H),k})},[]),children:r})}),I?a.jsxs(gS,{"aria-hidden":!0,required:p,tabIndex:-1,name:d,autoComplete:h,value:N,onChange:H=>R(H.target.value),disabled:m,form:w,children:[N===void 0?a.jsx("option",{value:""}):null,Array.from(J)]},Z):null]})})};q_.displayName=Ds;var K_="SelectTrigger",G_=f.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...s}=e,i=Nu(r),o=ts(K_,r),l=o.disabled||n,c=oe(t,o.onTriggerChange),u=Cu(r),d=f.useRef("touch"),[h,m,p]=yS(g=>{const v=u().filter(b=>!b.disabled),x=v.find(b=>b.value===o.value),y=xS(v,g,x);y!==void 0&&o.onValueChange(y.value)}),w=g=>{l||(o.onOpenChange(!0),p()),g&&(o.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return a.jsx(Iw,{asChild:!0,...i,children:a.jsx(K.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":vS(o.value)?"":void 0,...s,ref:c,onClick:$(s.onClick,g=>{g.currentTarget.focus(),d.current!=="mouse"&&w(g)}),onPointerDown:$(s.onPointerDown,g=>{d.current=g.pointerType;const v=g.target;v.hasPointerCapture(g.pointerId)&&v.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(w(g),g.preventDefault())}),onKeyDown:$(s.onKeyDown,g=>{const v=h.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&m(g.key),!(v&&g.key===" ")&&QD.includes(g.key)&&(w(),g.preventDefault())})})})});G_.displayName=K_;var J_="SelectValue",Y_=f.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,children:i,placeholder:o="",...l}=e,c=ts(J_,r),{onValueNodeHasChildrenChange:u}=c,d=i!==void 0,h=oe(t,c.onValueNodeChange);return Me(()=>{u(d)},[u,d]),a.jsx(K.span,{...l,ref:h,style:{pointerEvents:"none"},children:vS(c.value)?a.jsx(a.Fragment,{children:o}):i})});Y_.displayName=J_;var nL="SelectIcon",Q_=f.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...s}=e;return a.jsx(K.span,{"aria-hidden":!0,...s,ref:t,children:n||"â¼"})});Q_.displayName=nL;var sL="SelectPortal",X_=e=>a.jsx(eu,{asChild:!0,...e});X_.displayName=sL;var Ls="SelectContent",Z_=f.forwardRef((e,t)=>{const r=ts(Ls,e.__scopeSelect),[n,s]=f.useState();if(Me(()=>{s(new DocumentFragment)},[]),!r.open){const i=n;return i?Fs.createPortal(a.jsx(eS,{scope:e.__scopeSelect,children:a.jsx(Eu.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),i):null}return a.jsx(tS,{...e,ref:t})});Z_.displayName=Ls;var ar=10,[eS,rs]=ao(Ls),iL="SelectContentImpl",oL=Wi("SelectContent.RemoveScroll"),tS=f.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:o,side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:m,collisionPadding:p,sticky:w,hideWhenDetached:g,avoidCollisions:v,...x}=e,y=ts(Ls,r),[b,S]=f.useState(null),[_,j]=f.useState(null),E=oe(t,z=>S(z)),[C,N]=f.useState(null),[R,F]=f.useState(null),I=Cu(r),[J,D]=f.useState(!1),Z=f.useRef(!1);f.useEffect(()=>{if(b)return w1(b)},[b]),d1();const H=f.useCallback(z=>{const[me,...Pe]=I().map(he=>he.ref.current),[pe]=Pe.slice(-1),ue=document.activeElement;for(const he of z)if(he===ue||(he==null||he.scrollIntoView({block:"nearest"}),he===me&&_&&(_.scrollTop=0),he===pe&&_&&(_.scrollTop=_.scrollHeight),he==null||he.focus(),document.activeElement!==ue))return},[I,_]),X=f.useCallback(()=>H([C,b]),[H,C,b]);f.useEffect(()=>{J&&X()},[J,X]);const{onOpenChange:k,triggerPointerDownPosRef:P}=y;f.useEffect(()=>{if(b){let z={x:0,y:0};const me=pe=>{var ue,he;z={x:Math.abs(Math.round(pe.pageX)-(((ue=P.current)==null?void 0:ue.x)??0)),y:Math.abs(Math.round(pe.pageY)-(((he=P.current)==null?void 0:he.y)??0))}},Pe=pe=>{z.x<=10&&z.y<=10?pe.preventDefault():b.contains(pe.target)||k(!1),document.removeEventListener("pointermove",me),P.current=null};return P.current!==null&&(document.addEventListener("pointermove",me),document.addEventListener("pointerup",Pe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",me),document.removeEventListener("pointerup",Pe,{capture:!0})}}},[b,k,P]),f.useEffect(()=>{const z=()=>k(!1);return window.addEventListener("blur",z),window.addEventListener("resize",z),()=>{window.removeEventListener("blur",z),window.removeEventListener("resize",z)}},[k]);const[U,ee]=yS(z=>{const me=I().filter(ue=>!ue.disabled),Pe=me.find(ue=>ue.ref.current===document.activeElement),pe=xS(me,z,Pe);pe&&setTimeout(()=>pe.ref.current.focus())}),G=f.useCallback((z,me,Pe)=>{const pe=!Z.current&&!Pe;(y.value!==void 0&&y.value===me||pe)&&(N(z),pe&&(Z.current=!0))},[y.value]),ae=f.useCallback(()=>b==null?void 0:b.focus(),[b]),re=f.useCallback((z,me,Pe)=>{const pe=!Z.current&&!Pe;(y.value!==void 0&&y.value===me||pe)&&F(z)},[y.value]),be=n==="popper"?sf:rS,Re=be===sf?{side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:m,collisionPadding:p,sticky:w,hideWhenDetached:g,avoidCollisions:v}:{};return a.jsx(eS,{scope:r,content:b,viewport:_,onViewportChange:j,itemRefCallback:G,selectedItem:C,onItemLeave:ae,itemTextRefCallback:re,focusSelectedItem:X,selectedItemText:R,position:n,isPositioned:J,searchRef:U,children:a.jsx(Bp,{as:oL,allowPinchZoom:!0,children:a.jsx(zp,{asChild:!0,trapped:y.open,onMountAutoFocus:z=>{z.preventDefault()},onUnmountAutoFocus:$(s,z=>{var me;(me=y.trigger)==null||me.focus({preventScroll:!0}),z.preventDefault()}),children:a.jsx(eo,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:z=>z.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:a.jsx(be,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:z=>z.preventDefault(),...x,...Re,onPlaced:()=>D(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:$(x.onKeyDown,z=>{const me=z.ctrlKey||z.altKey||z.metaKey;if(z.key==="Tab"&&z.preventDefault(),!me&&z.key.length===1&&ee(z.key),["ArrowUp","ArrowDown","Home","End"].includes(z.key)){let pe=I().filter(ue=>!ue.disabled).map(ue=>ue.ref.current);if(["ArrowUp","End"].includes(z.key)&&(pe=pe.slice().reverse()),["ArrowUp","ArrowDown"].includes(z.key)){const ue=z.target,he=pe.indexOf(ue);pe=pe.slice(he+1)}setTimeout(()=>H(pe)),z.preventDefault()}})})})})})})});tS.displayName=iL;var aL="SelectItemAlignedPosition",rS=f.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...s}=e,i=ts(Ls,r),o=rs(Ls,r),[l,c]=f.useState(null),[u,d]=f.useState(null),h=oe(t,E=>d(E)),m=Cu(r),p=f.useRef(!1),w=f.useRef(!0),{viewport:g,selectedItem:v,selectedItemText:x,focusSelectedItem:y}=o,b=f.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&u&&g&&v&&x){const E=i.trigger.getBoundingClientRect(),C=u.getBoundingClientRect(),N=i.valueNode.getBoundingClientRect(),R=x.getBoundingClientRect();if(i.dir!=="rtl"){const ue=R.left-C.left,he=N.left-ue,nt=E.left-he,Bt=E.width+nt,ns=Math.max(Bt,C.width),fn=window.innerWidth-ar,ss=ef(he,[ar,Math.max(ar,fn-ns)]);l.style.minWidth=Bt+"px",l.style.left=ss+"px"}else{const ue=C.right-R.right,he=window.innerWidth-N.right-ue,nt=window.innerWidth-E.right-he,Bt=E.width+nt,ns=Math.max(Bt,C.width),fn=window.innerWidth-ar,ss=ef(he,[ar,Math.max(ar,fn-ns)]);l.style.minWidth=Bt+"px",l.style.right=ss+"px"}const F=m(),I=window.innerHeight-ar*2,J=g.scrollHeight,D=window.getComputedStyle(u),Z=parseInt(D.borderTopWidth,10),H=parseInt(D.paddingTop,10),X=parseInt(D.borderBottomWidth,10),k=parseInt(D.paddingBottom,10),P=Z+H+J+k+X,U=Math.min(v.offsetHeight*5,P),ee=window.getComputedStyle(g),G=parseInt(ee.paddingTop,10),ae=parseInt(ee.paddingBottom,10),re=E.top+E.height/2-ar,be=I-re,Re=v.offsetHeight/2,z=v.offsetTop+Re,me=Z+H+z,Pe=P-me;if(me<=re){const ue=F.length>0&&v===F[F.length-1].ref.current;l.style.bottom="0px";const he=u.clientHeight-g.offsetTop-g.offsetHeight,nt=Math.max(be,Re+(ue?ae:0)+he+X),Bt=me+nt;l.style.height=Bt+"px"}else{const ue=F.length>0&&v===F[0].ref.current;l.style.top="0px";const nt=Math.max(re,Z+g.offsetTop+(ue?G:0)+Re)+Pe;l.style.height=nt+"px",g.scrollTop=me-re+g.offsetTop}l.style.margin=`${ar}px 0`,l.style.minHeight=U+"px",l.style.maxHeight=I+"px",n==null||n(),requestAnimationFrame(()=>p.current=!0)}},[m,i.trigger,i.valueNode,l,u,g,v,x,i.dir,n]);Me(()=>b(),[b]);const[S,_]=f.useState();Me(()=>{u&&_(window.getComputedStyle(u).zIndex)},[u]);const j=f.useCallback(E=>{E&&w.current===!0&&(b(),y==null||y(),w.current=!1)},[b,y]);return a.jsx(cL,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:p,onScrollButtonChange:j,children:a.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:a.jsx(K.div,{...s,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});rS.displayName=aL;var lL="SelectPopperPosition",sf=f.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:s=ar,...i}=e,o=Nu(r);return a.jsx(Dw,{...o,...i,ref:t,align:n,collisionPadding:s,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});sf.displayName=lL;var[cL,Zp]=ao(Ls,{}),of="SelectViewport",nS=f.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...s}=e,i=rs(of,r),o=Zp(of,r),l=oe(t,i.onViewportChange),c=f.useRef(0);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),a.jsx(Eu.Slot,{scope:r,children:a.jsx(K.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:$(s.onScroll,u=>{const d=u.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:m}=o;if(m!=null&&m.current&&h){const p=Math.abs(c.current-d.scrollTop);if(p>0){const w=window.innerHeight-ar*2,g=parseFloat(h.style.minHeight),v=parseFloat(h.style.height),x=Math.max(g,v);if(x<w){const y=x+p,b=Math.min(w,y),S=y-b;h.style.height=b+"px",h.style.bottom==="0px"&&(d.scrollTop=S>0?S:0,h.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});nS.displayName=of;var sS="SelectGroup",[uL,dL]=ao(sS),hL=f.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=Or();return a.jsx(uL,{scope:r,id:s,children:a.jsx(K.div,{role:"group","aria-labelledby":s,...n,ref:t})})});hL.displayName=sS;var iS="SelectLabel",oS=f.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=dL(iS,r);return a.jsx(K.div,{id:s.id,...n,ref:t})});oS.displayName=iS;var Ic="SelectItem",[fL,aS]=ao(Ic),lS=f.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:s=!1,textValue:i,...o}=e,l=ts(Ic,r),c=rs(Ic,r),u=l.value===n,[d,h]=f.useState(i??""),[m,p]=f.useState(!1),w=oe(t,y=>{var b;return(b=c.itemRefCallback)==null?void 0:b.call(c,y,n,s)}),g=Or(),v=f.useRef("touch"),x=()=>{s||(l.onValueChange(n),l.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return a.jsx(fL,{scope:r,value:n,disabled:s,textId:g,isSelected:u,onItemTextChange:f.useCallback(y=>{h(b=>b||((y==null?void 0:y.textContent)??"").trim())},[]),children:a.jsx(Eu.ItemSlot,{scope:r,value:n,disabled:s,textValue:d,children:a.jsx(K.div,{role:"option","aria-labelledby":g,"data-highlighted":m?"":void 0,"aria-selected":u&&m,"data-state":u?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...o,ref:w,onFocus:$(o.onFocus,()=>p(!0)),onBlur:$(o.onBlur,()=>p(!1)),onClick:$(o.onClick,()=>{v.current!=="mouse"&&x()}),onPointerUp:$(o.onPointerUp,()=>{v.current==="mouse"&&x()}),onPointerDown:$(o.onPointerDown,y=>{v.current=y.pointerType}),onPointerMove:$(o.onPointerMove,y=>{var b;v.current=y.pointerType,s?(b=c.onItemLeave)==null||b.call(c):v.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:$(o.onPointerLeave,y=>{var b;y.currentTarget===document.activeElement&&((b=c.onItemLeave)==null||b.call(c))}),onKeyDown:$(o.onKeyDown,y=>{var S;((S=c.searchRef)==null?void 0:S.current)!==""&&y.key===" "||(XD.includes(y.key)&&x(),y.key===" "&&y.preventDefault())})})})})});lS.displayName=Ic;var Ro="SelectItemText",cS=f.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,...i}=e,o=ts(Ro,r),l=rs(Ro,r),c=aS(Ro,r),u=rL(Ro,r),[d,h]=f.useState(null),m=oe(t,x=>h(x),c.onItemTextChange,x=>{var y;return(y=l.itemTextRefCallback)==null?void 0:y.call(l,x,c.value,c.disabled)}),p=d==null?void 0:d.textContent,w=f.useMemo(()=>a.jsx("option",{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:g,onNativeOptionRemove:v}=u;return Me(()=>(g(w),()=>v(w)),[g,v,w]),a.jsxs(a.Fragment,{children:[a.jsx(K.span,{id:c.textId,...i,ref:m}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Fs.createPortal(i.children,o.valueNode):null]})});cS.displayName=Ro;var uS="SelectItemIndicator",dS=f.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return aS(uS,r).isSelected?a.jsx(K.span,{"aria-hidden":!0,...n,ref:t}):null});dS.displayName=uS;var af="SelectScrollUpButton",hS=f.forwardRef((e,t)=>{const r=rs(af,e.__scopeSelect),n=Zp(af,e.__scopeSelect),[s,i]=f.useState(!1),o=oe(t,n.onScrollButtonChange);return Me(()=>{if(r.viewport&&r.isPositioned){let l=function(){const u=c.scrollTop>0;i(u)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),s?a.jsx(pS,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});hS.displayName=af;var lf="SelectScrollDownButton",fS=f.forwardRef((e,t)=>{const r=rs(lf,e.__scopeSelect),n=Zp(lf,e.__scopeSelect),[s,i]=f.useState(!1),o=oe(t,n.onScrollButtonChange);return Me(()=>{if(r.viewport&&r.isPositioned){let l=function(){const u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)<u;i(d)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),s?a.jsx(pS,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});fS.displayName=lf;var pS=f.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...s}=e,i=rs("SelectScrollButton",r),o=f.useRef(null),l=Cu(r),c=f.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return f.useEffect(()=>()=>c(),[c]),Me(()=>{var d;const u=l().find(h=>h.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[l]),a.jsx(K.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:$(s.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(n,50))}),onPointerMove:$(s.onPointerMove,()=>{var u;(u=i.onItemLeave)==null||u.call(i),o.current===null&&(o.current=window.setInterval(n,50))}),onPointerLeave:$(s.onPointerLeave,()=>{c()})})}),pL="SelectSeparator",mS=f.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return a.jsx(K.div,{"aria-hidden":!0,...n,ref:t})});mS.displayName=pL;var cf="SelectArrow",mL=f.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=Nu(r),i=ts(cf,r),o=rs(cf,r);return i.open&&o.position==="popper"?a.jsx(Lw,{...s,...n,ref:t}):null});mL.displayName=cf;var gL="SelectBubbleInput",gS=f.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const s=f.useRef(null),i=oe(n,s),o=hu(t);return f.useEffect(()=>{const l=s.current;if(!l)return;const c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==t&&d){const h=new Event("change",{bubbles:!0});d.call(l,t),l.dispatchEvent(h)}},[o,t]),a.jsx(K.select,{...r,style:{...O0,...r.style},ref:i,defaultValue:t})});gS.displayName=gL;function vS(e){return e===""||e===void 0}function yS(e){const t=xe(e),r=f.useRef(""),n=f.useRef(0),s=f.useCallback(o=>{const l=r.current+o;t(l),function c(u){r.current=u,window.clearTimeout(n.current),u!==""&&(n.current=window.setTimeout(()=>c(""),1e3))}(l)},[t]),i=f.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return f.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,s,i]}function xS(e,t,r){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let o=vL(e,Math.max(i,0));s.length===1&&(o=o.filter(u=>u!==r));const c=o.find(u=>u.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==r?c:void 0}function vL(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var yL=q_,wS=G_,xL=Y_,wL=Q_,bL=X_,bS=Z_,_L=nS,_S=oS,SS=lS,SL=cS,jL=dS,jS=hS,ES=fS,CS=mS;const uf=yL,df=xL,Dc=f.forwardRef(({className:e,children:t,...r},n)=>
375a.jsxs(wS,{ref:n,className:te("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,a.jsx(wL,{asChild:!0,children:a.jsx(Pa,{className:"h-4 w-4 opacity-50"})})]}));Dc.displayName=wS.displayName;const NS=f.forwardRef(({className:e,...t},r)=>a.jsx(jS,{ref:r,className:te("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(yN,{className:"h-4 w-4"})}));NS.displayName=jS.displayName;const kS=f.forwardRef(({className:e,...t},r)=>a.jsx(ES,{ref:r,className:te("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(Pa,{className:"h-4 w-4"})}));kS.displayName=ES.displayName;const Lc=f.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>a.jsx(bL,{children:a.jsxs(bS,{ref:s,className:te("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[a.jsx(NS,{}),a.jsx(_L,{className:te("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),a.jsx(kS,{})]})}));Lc.displayName=bS.displayName;const EL=f.forwardRef(({className:e,...t},r)=>a.jsx(_S,{ref:r,className:te("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));EL.displayName=_S.displayName;const ys=f.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(SS,{ref:n,className:te("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...r,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(jL,{children:a.jsx(vN,{className:"h-4 w-4"})})}),a.jsx(SL,{children:t})]}));ys.displayName=SS.displayName;const CL=f.forwardRef(({className:e,...t},r)=>a.jsx(CS,{ref:r,className:te("-mx-1 my-1 h-px bg-muted",e),...t}));CL.displayName=CS.displayName;const NL=()=>{var b,S;const[e,t]=f.useState([]),[r,n]=f.useState([]),[s,i]=f.useState(!0),[o,l]=f.useState(null),[c,u]=f.useState({title:"",description:"",button_text:"",button_link:"",image_url:"",display_order:0,media_type:"image",video_url:"",duration_seconds:5,news_link:"",news_position:"center"}),[d,h]=f.useState(!1),{toast:m}=Xt();f.useEffect(()=>{w(),p()},[]);const p=async()=>{const{data:_,error:j}=await V.from("news").select("id, title, content, image_url, is_new").order("created_at",{ascending:!1});!j&&_&&n(_)},w=async()=>{i(!0);const{data:_,error:j}=await V.from("hero_slides").select("*").order("display_order",{ascending:!0});j?m({title:"Erro ao carregar slides",description:j.message,variant:"destructive"}):t(_||[]),i(!1)},g=async _=>{if(_.preventDefault(),o){const{error:j}=await V.from("hero_slides").update(c).eq("id",o.id);if(j){m({title:"Erro ao atualizar slide",description:j.message,variant:"destructive"});return}m({title:"Slide atualizado",description:"O slide foi atualizado com sucesso!"})}else{const{error:j}=await V.from("hero_slides").insert([c]);if(j){m({title:"Erro ao adicionar slide",description:j.message,variant:"destructive"});return}m({title:"Slide adicionado",description:"O slide foi adicionado com sucesso!"})}u({title:"",description:"",button_text:"",button_link:"",image_url:"",display_order:0,media_type:"image",video_url:"",duration_seconds:5,news_link:"",news_position:"center"}),l(null),h(!1),w()},v=_=>
375{l(_),u({title:_.title,description:_.description,button_text:_.button_text,button_link:_.button_link,image_url:_.image_url,display_order:_.display_order,media_type:_.media_type,video_url:_.video_url||"",duration_seconds:_.duration_seconds,news_link:_.news_link||"",news_position:_.news_position||"center"}),h(!0)},x=async _=>{if(!confirm("Tem certeza que deseja excluir este slide?"))return;const{error:j}=await V.from("hero_slides").delete().eq("id",_);if(j){m({title:"Erro ao excluir slide",description:j.message,variant:"destructive"});return}m({title:"Slide excluÃdo",description:"O slide foi excluÃdo com sucesso!"}),w()},y=()=>{h(!1),l(null),u({title:"",description:"",button_text:"",button_link:"",image_url:"",display_order:0,media_type:"image",video_url:"",duration_seconds:5,news_link:"",news_position:"center"})};return s?a.jsx("div",{className:"flex justify-center p-8",children:a.jsx(De,{className:"h-8 w-8 animate-spin"})}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("h2",{className:"text-2xl font-bold",children:"Gerenciar Slides Hero"}),a.jsxs(Je,{open:d,onOpenChange:h,children:[a.jsx(Ct,{asChild:!0,children:a.jsxs(B,{onClick:()=>y(),children:[a.jsx(on,{className:"mr-2 h-4 w-4"}),"Adicionar Slide"]})}),a.jsxs(He,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-hidden flex flex-col",children:[a.jsx(rt,{children:a.jsx(Ye,{children:o?"Editar Slide":"Novo Slide"})}),a.jsxs("form",{onSubmit:g,className:"space-y-4 overflow-y-auto px-1 -mx-1",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"title",children:"TÃtulo (Opcional)"}),a.jsx(Q,{id:"title",value:c.title,onChange:_=>u({...c,title:_.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"description",children:"Descrição (Opcional)"}),a.jsx(un,{id:"description",value:c.description,onChange:_=>u({...c,description:_.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"button_text",children:"Texto do Botão (Opcional)"}),a.jsx(Q,{id:"button_text",value:c.button_text,onChange:_=>u({...c,button_text:_.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"button_link",children:"Link do Botão (Opcional)"}),a.jsx(Q,{id:"button_link",value:c.button_link,onChange:_=>u({...c,button_link:_.target.value}),placeholder:"#contato"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"news_link",children:"NotÃcia Vinculada (Opcional)"}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(uf,{value:c.news_link||void 0,onValueChange:_=>u({...c,news_link:_}),children:[a.jsx(Dc,{className:"flex-1",children:a.jsx(df,{placeholder:"Selecione uma notÃcia (opcional)"})}),a.jsx(Lc,{className:"bg-background border shadow-lg z-50",children:r.map(_=>a.jsxs(ys,{value:_.id,children:[_.is_new&&"ð ",_.title]},_.id))})]}),c.news_link&&a.jsx(B,{type:"button",variant:"outline",size:"sm",onClick:()=>u({...c,news_link:""}),children:"Limpar"})]}),c.news_link&&c.news_link!==""&&a.jsx("div",{className:"mt-2 p-3 border rounded-lg bg-muted/50",children:a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx(oa,{className:"h-4 w-4 mt-1 text-primary"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("p",{className:"text-sm font-medium",children:(b=r.find(_=>_.id===c.news_link))==null?void 0:b.title}),a.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2 mt-1",children:(S=r.find(_=>_.id===c.news_link))==null?void 0:S.content})]})]})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:'Se selecionada, aparecerá um botão "Ver NotÃcia" que abre um popup com o conteúdo completo'})]}),c.news_link&&a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"news_position",children:"Posição da Manchete"}),a.jsxs(uf,{value:c.news_position,onValueChange:_=>u({...c,news_position:_}),children:[a.jsx(Dc,{children:a.jsx(df,{placeholder:"Selecione a posição"})}),a.jsxs(Lc,{className:"bg-background border shadow-lg z-50",children:[a.jsx(ys,{value:"top",children:"Topo"}),a.jsx(ys,{value:"center",children:"Centro"}),a.jsx(ys,{value:"bottom",children:"Rodapé"})]})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Define onde a manchete será exibida no slide"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"display_order",children:"Ordem de Exibição"}),a.jsx(Q,{id:"display_order",type:"number",value:c.display_order,onChange:_=>u({...c,display_order:parseInt(_.target.value)}),required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"duration_seconds",children:"Duração do Slide (segundos)"}),a.jsx(Q,{id:"duration_seconds",type:"number",min:"2",max:"200",value:c.duration_seconds,onChange:_=>u({...c,duration_seconds:parseInt(_.target.value)}),required:!0}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Entre 2 e 200 segundos"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{children:"Tipo de MÃdia"}),a.jsxs(H_,{value:c.media_type,onValueChange:_=>u({...c,media_type:_}),children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(nf,{value:"image",id:"media-image"}),a.jsxs(M,{htmlFor:"media-image",className:"flex items-center cursor-pointer",children:[a.jsx(Eh,{className:"mr-2 h-4 w-4"}),"Imagem"]})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(nf,{value:"video",id:"media-video"}),a.jsxs(M,{htmlFor:"media-video",className:"flex items-center cursor-pointer",children:[a.jsx(kg,{className:"mr-2 h-4 w-4"}),"VÃdeo"]})]})]})]}),c.media_type==="image"?a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"image_url",children:"URL da Imagem de Fundo"}),a.jsx(Q,{id:"image_url",value:c.image_url,onChange:_=>u({...c,image_url:_.target.value}),placeholder:"https://exemplo.com/imagem.jpg",required:!0}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Cole a URL direta da imagem"}),c.image_url&&a.jsx("div",{className:"mt-2",children:a.jsx("img",{src:c.image_url,alt:"Preview",className:"w-full h-48 object-cover rounded"})})]}):a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"video_url",children:"URL do VÃdeo"}),a.jsx(Q,{id:"video_url",value:c.video_url,onChange:_=>u({...c,video_url:_.target.value}),placeholder:"https://exemplo.com/video.mp4",required:!0}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Cole a URL direta do vÃdeo (MP4, WebM, etc.)"})]}
375),a.jsx(B,{type:"submit",className:"w-full",children:o?"Atualizar":"Adicionar"})]})]})]})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:e.map(_=>{var j;return a.jsxs(ze,{children:[a.jsxs(Lt,{children:[a.jsxs(Mt,{className:"flex items-center justify-between",children:[a.jsxs("span",{className:"flex items-center gap-2",children:[_.media_type==="video"?a.jsx(kg,{className:"h-4 w-4"}):a.jsx(Eh,{className:"h-4 w-4"}),_.title]}),a.jsxs("span",{className:"text-xs bg-muted px-2 py-1 rounded",children:["Ordem: ",_.display_order]})]}),a.jsx($t,{children:_.description})]}),a.jsxs(Be,{children:[_.media_type==="image"&&_.image_url&&a.jsx("img",{src:_.image_url,alt:_.title,className:"w-full h-48 object-cover rounded mb-4"}),_.media_type==="video"&&_.video_url&&a.jsx("video",{src:_.video_url,className:"w-full h-48 object-cover rounded mb-4",muted:!0}),a.jsxs("div",{className:"mb-4 text-sm space-y-1",children:[a.jsxs("p",{children:[a.jsx("strong",{children:"Tipo:"})," ",_.media_type==="video"?"VÃdeo":"Imagem"]}),a.jsxs("p",{children:[a.jsx("strong",{children:"Duração:"})," ",_.duration_seconds,"s"]}),a.jsxs("p",{children:[a.jsx("strong",{children:"Botão:"})," ",_.button_text]}),a.jsxs("p",{children:[a.jsx("strong",{children:"Link:"})," ",_.button_link]}),_.news_link&&a.jsx("div",{className:"mt-2 pt-2 border-t",children:a.jsxs("p",{className:"flex items-center gap-2 text-xs",children:[a.jsx(oa,{className:"h-3 w-3 text-primary"}),a.jsx("strong",{children:"NotÃcia Vinculada:"})," ",((j=r.find(E=>E.id===_.news_link))==null?void 0:j.title)||_.news_link]})})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(B,{variant:"outline",size:"sm",onClick:()=>v(_),className:"flex-1",children:[a.jsx(an,{className:"mr-2 h-4 w-4"}),"Editar"]}),a.jsxs(B,{variant:"destructive",size:"sm",onClick:()=>x(_.id),className:"flex-1",children:[a.jsx(Dr,{className:"mr-2 h-4 w-4"}),"Excluir"]})]})]})]},_.id)})})]})},kL=()=>{const[e,t]=f.useState([]),[r,n]=f.useState(!0),[s,i]=f.useState(!1),[o,l]=f.useState(null),[c,u]=f.useState({label:"",link:"",display_order:0,parent_id:null});f.useEffect(()=>{d()},[]);const d=async()=>{try{const{data:g,error:v}=await V.from("menu_items").select("*").order("display_order",{ascending:!0});if(v)throw v;t(g||[])}catch(g){Ks.error("Erro ao carregar itens do menu"),console.error(g)}finally{n(!1)}},h=async g=>{g.preventDefault();try{if(o){const{error:v}=await V.from("menu_items").update(c).eq("id",o);if(v)throw v;Ks.success("Item do menu atualizado com sucesso")}else{const{error:v}=await V.from("menu_items").insert([c]);if(v)throw v;Ks.success("Item do menu adicionado com sucesso")}i(!1),u({label:"",link:"",display_order:0,parent_id:null}),l(null),d()}catch(v){Ks.error("Erro ao salvar item do menu"),console.error(v)}},m=g=>{l(g.id),u({label:g.label,link:g.link,display_order:g.display_order,parent_id:g.parent_id}),i(!0)},p=async g=>{if(confirm("Tem certeza que deseja excluir este item do menu?"))try{const{error:v}=await V.from("menu_items").delete().eq("id",g);if(v)throw v;Ks.success("Item do menu excluÃdo com sucesso"),d()}catch(v){Ks.error("Erro ao excluir item do menu"),console.error(v)}},w=()=>{i(!1),u({label:"",link:"",display_order:0,parent_id:null}),l(null)};return r?a.jsx("div",{className:"flex justify-center items-center py-8",children:a.jsx(De,{className:"h-8 w-8 animate-spin"})}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs(Je,{open:s,onOpenChange:i,children:[a.jsx(Ct,{asChild:!0,children:a.jsx(B,{onClick:()=>i(!0),children:"Adicionar Item do Menu"})}),a.jsxs(He,{children:[a.jsx(rt,{children:a.jsxs(Ye,{children:[o?"Editar":"Adicionar"," Item do Menu"]})}),a.jsxs("form",{onSubmit:h,className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(M,{htmlFor:"label",children:"Texto do Menu"}),a.jsx(Q,{id:"label",value:c.label,onChange:g=>u({...c,label:g.target.value}),required:!0,placeholder:"Ex: InÃcio, Contato..."})]}),a.jsxs("div",{children:[a.jsx(M,{htmlFor:"link",children:"Link"}),a.jsx(Q,{id:"link",value:c.link,onChange:g=>u({...c,link:g.target.value}),required:!0,placeholder:"Ex: #inicio, https://exemplo.com..."}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Use #id para links internos ou URLs completas para links externos"})]}),a.jsxs("div",{children:[a.jsx(M,{htmlFor:"display_order",children:"Ordem de Exibição"}),a.jsx(Q,{id:"display_order",type:"number",value:c.display_order,onChange:g=>u({...c,display_order:parseInt(g.target.value)}),required:!0})]}),a.jsxs("div",{children:[a.jsx(M,{htmlFor:"parent_id",children:"Menu Pai (opcional)"}),a.jsxs(uf,{value:c.parent_id||"none",onValueChange:g=>u({...c,parent_id:g==="none"?null:g}),children:[a.jsx(Dc,{children:a.jsx(df,{placeholder:"Selecione um menu pai (ou deixe vazio para menu principal)"})}),a.jsxs(Lc,{children:[a.jsx(ys,{value:"none",children:"Nenhum (Menu Principal)"}),e.filter(g=>!g.parent_id&&g.id!==o).map(g=>a.jsx(ys,{value:g.id,children:g.label},g.id))]})]}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Se selecionado, este item aparecerá como submenu do item pai"})]}
375),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(B,{type:"submit",className:"flex-1",children:o?"Atualizar":"Adicionar"}),a.jsx(B,{type:"button",variant:"outline",onClick:w,children:"Cancelar"})]})]})]})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:e.filter(g=>!g.parent_id).map(g=>a.jsx(ze,{children:a.jsx(Be,{className:"pt-6",children:a.jsxs("div",{className:"space-y-2",children:[a.jsx("h3",{className:"font-semibold text-lg",children:g.label}),a.jsx("p",{className:"text-sm text-muted-foreground break-all",children:g.link}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:["Ordem: ",g.display_order]}),e.filter(v=>v.parent_id===g.id).length>0&&a.jsxs("div",{className:"mt-3 pt-3 border-t border-border",children:[a.jsx("p",{className:"text-xs font-semibold text-muted-foreground mb-2",children:"Submenus:"}),a.jsx("div",{className:"space-y-1",children:e.filter(v=>v.parent_id===g.id).map(v=>a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsx(ia,{className:"h-3 w-3 text-muted-foreground"}),a.jsx("span",{className:"text-muted-foreground",children:v.label})]},v.id))})]}),a.jsxs("div",{className:"flex gap-2 pt-2",children:[a.jsx(B,{onClick:()=>m(g),variant:"outline",size:"sm",children:"Editar"}),a.jsx(B,{onClick:()=>p(g.id),variant:"destructive",size:"sm",children:"Excluir"})]})]})})},g.id))}),e.filter(g=>g.parent_id).length>0&&a.jsxs("div",{className:"mt-8",children:[a.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Submenus"}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:e.filter(g=>g.parent_id).map(g=>{const v=e.find(x=>x.id===g.parent_id);return a.jsx(ze,{children:a.jsx(Be,{className:"pt-6",children:a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ia,{className:"h-4 w-4 text-primary"}),a.jsx("h3",{className:"font-semibold text-lg",children:g.label})]}),a.jsx("p",{className:"text-sm text-muted-foreground break-all",children:g.link}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Submenu de: ",a.jsx("span",{className:"font-semibold",children:(v==null?void 0:v.label)||"Menu não encontrado"})]}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:["Ordem: ",g.display_order]}),a.jsxs("div",{className:"flex gap-2 pt-2",children:[a.jsx(B,{onClick:()=>m(g),variant:"outline",size:"sm",children:"Editar"}),a.jsx(B,{onClick:()=>p(g.id),variant:"destructive",size:"sm",children:"Excluir"})]})]})})},g.id)})})]})]})},TL=()=>{const[e,t]=f.useState([]),[r,n]=f.useState([]),[s,i]=f.useState(!0),[o,l]=f.useState(null),[c,u]=f.useState(null),[d,h]=f.useState({title:"",subtitle:"",display_order:0}),[m,p]=f.useState({label:"",value:"",display_order:0}),[w,g]=f.useState(!1),[v,x]=f.useState(!1),{toast:y}=Xt();f.useEffect(()=>{b()},[]);const b=async()=>{i(!0);const[C,N]=await Promise.all([V.from("impact_stats").select("*").order("display_order",{ascending:!0}),V.from("impact_numbers").select("*").order("display_order",{ascending:!0})]);C.error?y({title:"Erro ao carregar estatÃsticas",description:C.error.message,variant:"destructive"}):t(C.data||[]),N.error?y({title:"Erro ao carregar números",description:N.error.message,variant:"destructive"}):n(N.data||[]),i(!1)},S=async C=>{if(C.preventDefault(),o){const{error:N}=await V.from("impact_stats").update(d).eq("id",o.id);if(N){y({title:"Erro ao atualizar",description:N.message,variant:"destructive"});return}y({title:"Atualizado com sucesso",description:"A estatÃstica foi atualizada!"})}else{const{error:N}=await V.from("impact_stats").insert([d]);if(N){y({title:"Erro ao adicionar",description:N.message,variant:"destructive"});return}y({title:"Adicionado com sucesso",description:"A estatÃstica foi adicionada!"})}h({title:"",subtitle:"",display_order:0}),l(null),g(!1),b()},_=async C=>{if(C.preventDefault(),c){const{error:N}=await V.from("impact_numbers").update(m).eq("id",c.id);if(N){y({title:"Erro ao atualizar",description:N.message,variant:"destructive"});return}y({title:"Atualizado com sucesso",description:"O número foi atualizado!"})}else{const{error:N}=await V.from("impact_numbers").insert([m]);if(N){y({title:"Erro ao adicionar",description:N.message,variant:"destructive"});return}y({title:"Adicionado com sucesso",description:"O número foi adicionado!"})}p({label:"",value:"",display_order:0}),u(null),x(!1),b()},j=async C=>
375{if(!confirm("Tem certeza que deseja excluir?"))return;const{error:N}=await V.from("impact_stats").delete().eq("id",C);if(N){y({title:"Erro ao excluir",description:N.message,variant:"destructive"});return}y({title:"ExcluÃdo com sucesso"}),b()},E=async C=>{if(!confirm("Tem certeza que deseja excluir?"))return;const{error:N}=await V.from("impact_numbers").delete().eq("id",C);if(N){y({title:"Erro ao excluir",description:N.message,variant:"destructive"});return}y({title:"ExcluÃdo com sucesso"}),b()};return s?a.jsx("div",{className:"flex justify-center p-8",children:a.jsx(De,{className:"h-8 w-8 animate-spin"})}):a.jsxs("div",{className:"space-y-6",children:[a.jsx("h2",{className:"text-2xl font-bold",children:"Gerenciar Impacto"}),a.jsxs(j_,{defaultValue:"header",children:[a.jsxs(Qp,{children:[a.jsx(Nt,{value:"header",children:"Cabeçalho"}),a.jsx(Nt,{value:"numbers",children:"Números"})]}),a.jsxs(kt,{value:"header",className:"space-y-4",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"TÃtulo e subtÃtulo da seção"}),a.jsxs(Je,{open:w,onOpenChange:g,children:[a.jsx(Ct,{asChild:!0,children:a.jsxs(B,{onClick:()=>{l(null),h({title:"",subtitle:"",display_order:0})},children:[a.jsx(on,{className:"mr-2 h-4 w-4"}),"Adicionar"]})}),a.jsxs(He,{children:[a.jsx(rt,{children:a.jsxs(Ye,{children:[o?"Editar":"Novo"," Cabeçalho"]})}),a.jsxs("form",{onSubmit:S,className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"title",children:"TÃtulo"}),a.jsx(Q,{id:"title",value:d.title,onChange:C=>h({...d,title:C.target.value}),required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"subtitle",children:"SubtÃtulo"}),a.jsx(Q,{id:"subtitle",value:d.subtitle,onChange:C=>h({...d,subtitle:C.target.value}),required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"stat-order",children:"Ordem"}),a.jsx(Q,{id:"stat-order",type:"number",value:d.display_order,onChange:C=>h({...d,display_order:parseInt(C.target.value)}),required:!0})]}),a.jsx(B,{type:"submit",className:"w-full",children:o?"Atualizar":"Adicionar"})]})]})]})]}),a.jsx("div",{className:"grid gap-4",children:e.map(C=>a.jsxs(ze,{children:[a.jsxs(Lt,{children:[a.jsx(Mt,{children:C.title}),a.jsx($t,{children:C.subtitle})]}),a.jsx(Be,{children:a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(B,{variant:"outline",size:"sm",onClick:()=>{l(C),h({title:C.title,subtitle:C.subtitle,display_order:C.display_order}),g(!0)},className:"flex-1",children:[a.jsx(an,{className:"mr-2 h-4 w-4"}),"Editar"]}),a.jsxs(B,{variant:"destructive",size:"sm",onClick:()=>j(C.id),className:"flex-1",children:[a.jsx(Dr,{className:"mr-2 h-4 w-4"}),"Excluir"]})]})})]},C.id))})]}),a.jsxs(kt,{value:"numbers",className:"space-y-4",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Números e estatÃsticas"}),a.jsxs(Je,{open:v,onOpenChange:x,children:[a.jsx(Ct,{asChild:!0,children:a.jsxs(B,{onClick:()=>{u(null),p({label:"",value:"",display_order:0})},children:[a.jsx(on,{className:"mr-2 h-4 w-4"}),"Adicionar"]})}),a.jsxs(He,{children:[a.jsx(rt,{children:a.jsxs(Ye,{children:[c?"Editar":"Novo"," Número"]})}),a.jsxs("form",{onSubmit:_,className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"value",children:"Valor"}),a.jsx(Q,{id:"value",value:m.value,onChange:C=>p({...m,value:C.target.value}),placeholder:"2.000+",required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"label",children:"Descrição"}),a.jsx(Q,{id:"label",value:m.label,onChange:C=>p({...m,label:C.target.value}),placeholder:"Instalações Realizadas",required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"number-order",children:"Ordem"}),a.jsx(Q,{id:"number-order",type:"number",value:m.display_order,onChange:C=>p({...m,display_order:parseInt(C.target.value)}),required:!0})]}),a.jsx(B,{type:"submit",className:"w-full",children:c?"Atualizar":"Adicionar"})]})]})]})]}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4",children:r.map(C=>a.jsxs(ze,{children:[a.jsxs(Lt,{children:[a.jsx(Mt,{className:"text-2xl text-primary",children:C.value}),a.jsx($t,{children:C.label})]}),a.jsx(Be,{children:a.jsxs("div",{className:"flex gap-2",children:[a.jsx(B,{variant:"outline",size:"sm",onClick:()=>{u(C),p({label:C.label,value:C.value,display_order:C.display_order}),x(!0)},className:"flex-1",children:a.jsx(an,{className:"h-4 w-4"})}),a.jsx(B,{variant:"destructive",size:"sm",onClick:()=>E(C.id),className:"flex-1",children:a.jsx(Dr,{className:"h-4 w-4"})})]})})]},C.id))})]})]})]})},RL=()=>{const[e,t]=f.useState([]),[r,n]=f.useState(null),[s,i]=f.useState(!0),[o,l]=f.useState(!1),[c,u]=f.useState(null),[d,h]=f.useState({id:"",title:"",description:"",power:"",image_url_1:"",image_url_2:"",image_url_3:"",button_text:"Fale conosco",button_link:"",is_new:!1,is_promotion:!1,tags:[],display_order:0}),[m,p]=f.useState({title:"",description:""}),{toast:w}=Xt();f.useEffect(()=>{g()},[]);const g=async()=>{try{const[_,j]=await Promise.all([V.from("products").select("*").order("display_order",{ascending:!0}),V.from("products_section").select("*").single()]);if(_.error)throw _.error;if(j.error)throw j.error;
375t(_.data||[]),n(j.data),p({title:j.data.title,description:j.data.description})}catch(_){w({title:"Erro ao carregar dados",description:_.message,variant:"destructive"})}finally{i(!1)}},v=async _=>{_.preventDefault();try{if(d.id){const{error:j}=await V.from("products").update({title:d.title,description:d.description,power:d.power,image_url_1:d.image_url_1||null,image_url_2:d.image_url_2||null,image_url_3:d.image_url_3||null,button_text:d.button_text,button_link:d.button_link,is_new:d.is_new,is_promotion:d.is_promotion,tags:d.tags,display_order:d.display_order}).eq("id",d.id);if(j)throw j;w({title:"Produto atualizado com sucesso!"})}else{const{error:j}=await V.from("products").insert([{title:d.title,description:d.description,power:d.power,image_url_1:d.image_url_1||null,image_url_2:d.image_url_2||null,image_url_3:d.image_url_3||null,button_text:d.button_text,button_link:d.button_link,is_new:d.is_new,is_promotion:d.is_promotion,tags:d.tags,display_order:d.display_order}]);if(j)throw j;w({title:"Produto adicionado com sucesso!"})}b(),g()}catch(j){w({title:"Erro ao salvar produto",description:j.message,variant:"destructive"})}},x=_=>{h({id:_.id,title:_.title,description:_.description,power:_.power,image_url_1:_.image_url_1||"",image_url_2:_.image_url_2||"",image_url_3:_.image_url_3||"",button_text:_.button_text,button_link:_.button_link,is_new:_.is_new,is_promotion:_.is_promotion,tags:_.tags||[],display_order:_.display_order}),l(!0)},y=async _=>{if(confirm("Tem certeza que deseja excluir este produto?"))try{const{error:j}=await V.from("products").delete().eq("id",_);if(j)throw j;w({title:"Produto excluÃdo com sucesso!"}),g()}catch(j){w({title:"Erro ao excluir produto",description:j.message,variant:"destructive"})}},b=()=>{l(!1),h({id:"",title:"",description:"",power:"",image_url_1:"",image_url_2:"",image_url_3:"",button_text:"Fale conosco",button_link:"",is_new:!1,is_promotion:!1,tags:[],display_order:0})},S=async()=>{if(r)try{const{error:_}=await V.from("products_section").update({title:m.title,description:m.description}).eq("id",r.id);if(_)throw _;w({title:"Seção atualizada com sucesso!"}),u(null),g()}catch(_){w({title:"Erro ao atualizar seção",description:_.message,variant:"destructive"})}};return s?a.jsx("div",{className:"flex justify-center p-8",children:a.jsx(De,{className:"h-8 w-8 animate-spin"})}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs(ze,{children:[a.jsxs(Lt,{children:[a.jsx(Mt,{children:"Configurações da Seção"}),a.jsx($t,{children:"Edite o tÃtulo e descrição da seção de produtos"})]}),a.jsxs(Be,{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"section-title",children:"TÃtulo da Seção"}),a.jsx(Q,{id:"section-title",value:m.title,onChange:_=>p({...m,title:_.target.value}),placeholder:"Nossos Produtos"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"section-description",children:"Descrição da Seção"}),a.jsx(Q,{id:"section-description",value:m.description,onChange:_=>p({...m,description:_.target.value}),placeholder:"Conheça sobre nossos produtos"})]}),a.jsxs(B,{onClick:S,className:"w-full",children:[a.jsx(RN,{className:"mr-2 h-4 w-4"}),"Salvar Configurações"]})]})]}),a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("h2",{className:"text-2xl font-bold",children:"Gerenciar Produtos"}),a.jsxs(Je,{open:o,onOpenChange:l,children:[a.jsx(Ct,{asChild:!0,children:a.jsxs(B,{onClick:()=>b(),children:[a.jsx(on,{className:"mr-2 h-4 w-4"}),"Adicionar Produto"]})}),a.jsxs(He,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[a.jsx(rt,{children:a.jsx(Ye,{children:d.id?"Editar Produto":"Adicionar Produto"})}),a.jsx("form",{onSubmit:v,className:"space-y-4",children:a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"title",children:"TÃtulo *"}),a.jsx(Q,{id:"title",value:d.title,onChange:_=>h({...d,title:_.target.value}),required:!0})]}),a.jsxs("div",{className:"space-y-2 md:col-span-2",children:[a.jsx(M,{htmlFor:"description",children:"Descrição *"}),a.jsx(un,{id:"description",value:d.description,onChange:_=>h({...d,description:_.target.value}),required:!0,rows:3})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"power",children:"Potência *"}),a.jsx(Q,{id:"power",value:d.power,onChange:_=>h({...d,power:_.target.value}),placeholder:"Ex: 150 kW",required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"image1",children:"URL da Imagem 1"}),a.jsx(Q,{id:"image1",type:"url",value:d.image_url_1,onChange:_=>h({...d,image_url_1:_.target.value}),placeholder:"https://..."})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"image2",children:"URL da Imagem 2"}),a.jsx(Q,{id:"image2",type:"url",value:d.image_url_2,onChange:_=>h({...d,image_url_2:_.target.value}),placeholder:"https://..."})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"image3",children:"URL da Imagem 3"}),a.jsx(Q,{id:"image3",type:"url",value:d.image_url_3,onChange:_=>h({...d,image_url_3:_.target.value}),placeholder:"https://..."})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"button-text",children:"Texto do Botão *"}),a.jsx(Q,{id:"button-text",value:d.button_text,onChange:_=>h({...d,button_text:_.target.value}),required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"button-link",children:"Link do Botão *"}),a.jsx(Q,{id:"button-link",type:"url",value:d.button_link,onChange:_=>h({...d,button_link:_.target.value}),placeholder:"https://...",required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"display-order",children:"Ordem de Exibição"}),a.jsx(Q,{id:"display-order",type:"number",value:d.display_order,onChange:_=>h({...d,display_order:parseInt(_.target.value)})})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(dn,{id:"is-new",checked:d.is_new,onCheckedChange:_=>h({...d,is_new:_})}),a.jsx(M,{htmlFor:"is-new",children:"Marcar como Novo"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(dn,{id:"is-promotion",checked:d.is_promotion,onCheckedChange:_=>h({...d,is_promotion:_})}),a.jsx(M,{htmlFor:"is-promotion",children:"ð¥ Marcar como Promoção"})]}),a.jsxs("div",{className:"space-y-2 md:col-span-2",children:[a.jsx(M,{htmlFor:"tags",children:"Tags (separadas por vÃrgula)"}),a.jsx(Q,{id:"tags",value:d.tags.join(", "),onChange:_=>{const E=_.target.value.split(",").map(C=>C.trim()).filter(C=>C!=="");h({...d,tags:E})},placeholder:"Trifásico, Monofásico, Rápido, Lento..."}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Exemplos: Trifásico, Monofásico, Rápido, Lento, Ultra Rápido, etc."})]}
375),a.jsx(B,{type:"submit",className:"w-full md:col-span-2",children:d.id?"Atualizar":"Adicionar"})]})})]})]})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:e.map(_=>a.jsx(ze,{children:a.jsxs(Be,{className:"pt-6",children:[_.image_url_1&&a.jsx("img",{src:_.image_url_1,alt:_.title,className:"w-full h-48 object-contain rounded-lg mb-4"}),a.jsx("h3",{className:"font-bold text-lg mb-2",children:_.title}),a.jsx("p",{className:"text-sm text-muted-foreground mb-2 line-clamp-2",children:_.description}),a.jsx("p",{className:"text-sm font-semibold text-primary mb-4",children:_.power}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(B,{variant:"outline",size:"sm",onClick:()=>x(_),children:a.jsx(TN,{className:"h-4 w-4"})}),a.jsx(B,{variant:"destructive",size:"sm",onClick:()=>y(_.id),children:a.jsx(Dr,{className:"h-4 w-4"})})]})]})},_.id))})]})};function PL(e){if(!e)return null;const t=e.match(/(?:youtu\.be\/|youtube\.com\/(?:watch\?v=|embed\/|shorts\/))([\w-]{11})/);return t?`https://www.youtube.com/embed/${t[1]}`:null}function Mc(e){return e?new Intl.DateTimeFormat("pt-BR",{day:"2-digit",month:"long",year:"numeric"}).format(new Date(e)):"Em breve"}function hf(e){const t=e.trim().split(/\s+/).length;return`${Math.max(1,Math.round(t/200))} min de leitura`}const wa=({imageUrl:e,videoUrl:t,title:r,className:n="",priority:s=!1})=>{const i=PL(t);return e?a.jsxs("div",{className:`relative overflow-hidden bg-muted ${n}`,children:[a.jsx("img",{src:e,alt:r,loading:s?"eager":"lazy",className:"h-full w-full object-cover transition-transform duration-700 group-hover:scale-105"}),t&&a.jsx("span",{className:"absolute bottom-3 right-3 grid h-10 w-10 place-items-center rounded-full bg-background/90 text-primary shadow-elegant backdrop-blur-sm",children:a.jsx(iw,{className:"h-4 w-4 fill-current","aria-hidden":"true"})})]}):i?a.jsx("div",{className:`overflow-hidden bg-muted ${n}`,children:a.jsx("iframe",{src:i,title:r,className:"h-full w-full",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})}):t?a.jsx("div",{className:`overflow-hidden bg-muted ${n}`,children:a.jsx("video",{src:t,controls:!0,preload:"metadata",className:"h-full w-full object-cover"})}):a.jsx("div",{className:`grid place-items-center bg-muted text-muted-foreground ${n}`,children:a.jsx(Eh,{className:"h-10 w-10","aria-hidden":"true"})})},Nd={title:"",excerpt:"",content:"",category:"Mobilidade elétrica",author:"DCC Energy",image_url:"",video_url:"",is_featured:!1,is_published:!1,published_at:""},AL=()=>{const[e,t]=f.useState([]),[r,n]=f.useState(!0),[s,i]=f.useState(!1),[o,l]=f.useState(!1),[c,u]=f.useState(null),[d,h]=f.useState(Nd),{toast:m}=Xt(),p=async()=>{n(!0);const{data:y,error:b}=await V.from("blog_posts").select("*").order("created_at",{ascending:!1});b?m({title:"Erro ao carregar posts",description:b.message,variant:"destructive"}):t(y||[]),n(!1)};f.useEffect(()=>{p()},[]);const w=()=>{l(!1),u(null),h(Nd)},g=y=>{u(y.id),h({title:y.title,excerpt:y.excerpt,content:y.content,category:y.category,author:y.author,image_url:y.image_url||"",video_url:y.video_url||"",is_featured:y.is_featured,is_published:y.is_published,published_at:y.published_at?y.published_at.slice(0,16):""}),l(!0)},v=async y=>{y.preventDefault(),i(!0);const b={...d,image_url:d.image_url||null,video_url:d.video_url||null,published_at:d.is_published?d.published_at?new Date(d.published_at).toISOString():new Date().toISOString():null},S=c?await V.from("blog_posts").update(b).eq("id",c):await V.from("blog_posts").insert([b]);if(i(!1),S.error){m({title:"Erro ao salvar post",description:S.error.message,variant:"destructive"});return}m({title:c?"Post atualizado":"Post criado",description:"As alterações foram salvas com sucesso."}),w(),p()},x=async y=>{if(!confirm("Tem certeza que deseja excluir este post?"))return;const{error:b}=await V.from("blog_posts").delete().eq("id",y);b?m({title:"Erro ao excluir post",description:b.message,variant:"destructive"}):(m({title:"Post excluÃdo"}),p())};return r?a.jsx("div",{className:"flex justify-center p-12",children:a.jsx(De,{className:"h-8 w-8 animate-spin text-primary"})}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-2xl font-bold",children:"Gerenciar Blog"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Publique matérias com foto, vÃdeo ou ambos."})]}),a.jsxs(Je,{open:o,onOpenChange:y=>y?l(!0):w(),children:[a.jsx(Ct,{asChild:!0,children:a.jsxs(B,{onClick:()=>{h(Nd),u(null)},children:[a.jsx(on,{className:"mr-2 h-4 w-4"}),"Novo post"]})}),a.jsxs(He,{className:"flex max-h-[90vh] w-[calc(100vw-2rem)] max-w-4xl flex-col overflow-hidden p-0",children:[a.jsx(rt,{className:"shrink-0 border-b border-border px-6 py-5",children:a.jsx(Ye,{children:c?"Editar post":"Novo post"})}),a.jsxs("form",{onSubmit:v,className:"min-h-0 flex-1 overflow-y-auto px-6 py-5",children:[a.jsxs("div",{className:"grid gap-5 md:grid-cols-2",children:[a.jsxs("div",{className:"space-y-2 md:col-span-2",children:[a.jsx(M,{htmlFor:"blog-title",children:"TÃtulo *"}),a.jsx(Q,{id:"blog-title",value:d.title,onChange:y=>h({...d,title:y.target.value}),required:!0})]}),a.jsxs("div",{className:"space-y-2 md:col-span-2",children:[a.jsx(M,{htmlFor:"blog-excerpt",children:"Resumo *"}),a.jsx(un,{id:"blog-excerpt",value:d.excerpt,onChange:y=>h({...d,excerpt:y.target.value}),rows:3,required:!0})]}),a.jsxs("div",{className:"space-y-2 md:col-span-2",children:[a.jsx(M,{htmlFor:"blog-content",children:"Conteúdo *"}),a.jsx(un,{id:"blog-content",value:d.content,onChange:y=>h({...d,content:y.target.value}),className:"min-h-56",required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"blog-category",children:"Categoria *"}),a.jsx(Q,{id:"blog-category",value:d.category,onChange:y=>h({...d,category:y.target.value}),required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"blog-author",children:"Autor *"}),a.jsx(Q,{id:"blog-author",value:d.author,onChange:y=>h({...d,author:y.target.value}),required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"blog-image",children:"Link da imagem"}),a.jsx(Q,{id:"blog-image",type:"url",value:d.image_url,onChange:y=>h({...d,image_url:y.target.value}),placeholder:"https://..."})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"blog-video",children:"Link do vÃdeo"}),a.jsx(Q,{id:"blog-video",type:"url",value:d.video_url,onChange:y=>h({...d,video_url:y.target.value}),placeholder:"YouTube ou arquivo de vÃdeo"})]}),(d.image_url||d.video_url)&&a.jsxs("div",{className:"md:col-span-2",children:[a.jsx(M,{children:"Prévia da mÃdia"}),a.jsx(wa,{imageUrl:d.image_url||null,videoUrl:d.video_url||null,title:d.title||"Prévia",className:"mt-2 aspect-video max-h-80 rounded-lg border border-border"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(M,{htmlFor:"blog-d
375ate",children:"Data de publicação"}),a.jsx(Q,{id:"blog-date",type:"datetime-local",value:d.published_at,onChange:y=>h({...d,published_at:y.target.value})})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-6 md:pt-7",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(dn,{id:"blog-featured",checked:d.is_featured,onCheckedChange:y=>h({...d,is_featured:y})}),a.jsx(M,{htmlFor:"blog-featured",children:"Destaque"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(dn,{id:"blog-published",checked:d.is_published,onCheckedChange:y=>h({...d,is_published:y})}),a.jsx(M,{htmlFor:"blog-published",children:"Publicado"})]})]})]}),a.jsxs("div",{className:"sticky bottom-0 -mx-6 mt-6 flex justify-end gap-3 border-t border-border bg-background px-6 py-4",children:[a.jsx(B,{type:"button",variant:"outline",onClick:w,children:"Cancelar"}),a.jsxs(B,{type:"submit",disabled:s,children:[s&&a.jsx(De,{className:"mr-2 h-4 w-4 animate-spin"}),c?"Salvar alterações":"Criar post"]})]})]})]})]})]}),e.length===0?a.jsx(ze,{children:a.jsx(Be,{className:"py-14 text-center text-muted-foreground",children:"Nenhum post criado ainda."})}):a.jsx("div",{className:"grid gap-5 md:grid-cols-2 xl:grid-cols-3",children:e.map(y=>a.jsxs(ze,{className:"overflow-hidden",children:[a.jsx(wa,{imageUrl:y.image_url,videoUrl:y.video_url,title:y.title,className:"aspect-[16/8]"}),a.jsxs(Be,{className:"p-5",children:[a.jsxs("div",{className:"mb-3 flex flex-wrap gap-2",children:[a.jsx(Ze,{variant:y.is_published?"default":"secondary",children:y.is_published?a.jsxs(a.Fragment,{children:[a.jsx(_N,{className:"mr-1 h-3 w-3"}),"Publicado"]}):a.jsxs(a.Fragment,{children:[a.jsx(bN,{className:"mr-1 h-3 w-3"}),"Rascunho"]})}),y.is_featured&&a.jsxs(Ze,{variant:"outline",children:[a.jsx(ON,{className:"mr-1 h-3 w-3"}),"Destaque"]})]}),a.jsx("h3",{className:"line-clamp-2 text-lg font-bold",children:y.title}),a.jsx("p",{className:"mt-2 line-clamp-2 text-sm text-muted-foreground",children:y.excerpt}),a.jsxs("p",{className:"mt-3 text-xs text-muted-foreground",children:[y.category," · ",Mc(y.published_at)]}),a.jsxs("div",{className:"mt-5 flex gap-2",children:[a.jsxs(B,{variant:"outline",size:"sm",onClick:()=>g(y),className:"flex-1",children:[a.jsx(an,{className:"mr-2 h-4 w-4"}),"Editar"]}),a.jsx(B,{variant:"destructive",size:"icon",onClick:()=>x(y.id),"aria-label":`Excluir ${y.title}`,children:a.jsx(Dr,{className:"h-4 w-4"})})]})]})]},y.id))})]})},OL=()=>{const[e,t]=f.useState(!0),[r,n]=f.useState(!1),s=Ap(),{toast:i}=Xt();f.useEffect(()=>{o()},[]);const o=async()=>{try{const{data:{user:c}}=await V.auth.getUser();if(!c){s("/admin-login");return}const{data:u}=await V.from("user_roles").select("role").eq("user_id",c.id).single();if((u==null?void 0:u.role)!=="admin"){i({title:"Acesso negado",description:"Você não tem permissão de administrador.",variant:"destructive"}),s("/");return}n(!0)}catch{s("/admin-login")}finally{t(!1)}},l=async()=>{await V.auth.signOut(),i({title:"Logout realizado",description:"Até logo!"}),s("/")};return e?a.jsx("div",{className:"min-h-screen flex items-center justify-center",children:a.jsx(De,{className:"h-8 w-8 animate-spin text-primary"})}):r?a.jsxs("div",{className:"min-h-screen bg-muted/30",children:[a.jsx("header",{className:"bg-background border-b border-border sticky top-0 z-50",children:a.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"flex items-center justify-between h-16",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("img",{src:Ji,alt:"DCC Energy",className:"h-10 w-auto"}),a.jsx("h1",{className:"text-xl font-bold",children:"Painel Administrativo"})]}),a.jsxs(B,{variant:"outline",onClick:l,children:[a.jsx(EN,{className:"mr-2 h-4 w-4"}),"Sair"]})]})})}),a.jsx("main",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:a.jsxs(j_,{defaultValue:"services",className:"w-full",children:[a.jsxs(Qp,{className:"grid w-full grid-cols-3 lg:grid-cols-10 mb-8",children:[a.jsx(Nt,{value:"services",children:"Serviços"}),a.jsx(Nt,{value:"products",children:"Produtos"}),a.jsx(Nt,{value:"stations",children:"Eletropostos"}),a.jsx(Nt,{value:"videos",children:"VÃdeos"}),a.jsx(Nt,{value:"news",children:"NotÃcias"}),a.jsx(Nt,{value:"slides",children:"Slides Hero"}),a.jsx(Nt,{value:"impact",children:"Impacto"}),a.jsx(Nt,{value:"menu",children:"Menu"}),a.jsx(Nt,{value:"blog",children:"Blog"}),a.jsx(Nt,{value:"users",children:"Usuários"})]}),a.jsx(kt,{value:"services",children:a.jsx(LD,{})}),a.jsx(kt,{value:"products",children:a.jsx(RL,{})}),a.jsx(kt,{value:"stations",children:a.jsx(MD,{})}),a.jsx(kt,{value:"videos",children:a.jsx(FD,{})}),a.jsx(kt,{value:"news",children:a.jsx(UD,{})}),a.jsx(kt,{value:"slides",children:a.jsx(NL,{})}),a.jsx(kt,{value:"impact",children:a.jsx(TL,{})}),a.jsx(kt,{value:"menu",children:a.jsx(kL,{})}),a.jsx(kt,{value:"blog",children:a.jsx(AL,{})}),a.jsx(kt,{value:"users",children:a.jsx($D,{})})]})})]}):null},IL=()=>{const[e,t]=f.useState([]),[r,n]=f.useState(!0),[s,i]=f.useState(null);f.useEffect(()=>{(async()=>{const{data:h}=await V.from("blog_posts").select("*").eq("is_published",!0).order("is_featured",{ascending:!1}).order("published_at",{ascending:!1});t(h||[]),n(!1)})()},[]);const o=f.useMemo(()=>Array.from(new Set(e.map(d=>
375d.category).filter(Boolean))),[e]),l=f.useMemo(()=>s?e.filter(d=>d.category===s):e,[e,s]),c=l[0],u=f.useMemo(()=>l.slice(1),[l]);return a.jsxs("div",{className:"min-h-screen bg-background",children:[a.jsx(La,{}),a.jsxs("main",{className:"pt-[81px] lg:pt-[97px]",children:[a.jsx("section",{className:"bg-gradient-primary py-16 md:py-24",children:a.jsx("div",{className:"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"max-w-2xl animate-fade-in",children:[a.jsxs("div",{className:"mb-5 inline-flex items-center gap-2 rounded-full bg-white/20 px-4 py-1.5 text-sm font-medium text-white backdrop-blur-sm",children:[a.jsx(oa,{className:"h-4 w-4"}),"Blog DCC Energy"]}),a.jsxs("h1",{className:"text-4xl font-bold leading-tight text-white md:text-6xl",children:["Mobilidade elétrica",a.jsx("br",{className:"hidden sm:block"})," em foco"]}),a.jsx("p",{className:"mt-5 text-lg leading-relaxed text-white/80 md:text-xl",children:"NotÃcias, tendências e caminhos para um futuro conectado à energia limpa."})]})})}),o.length>0&&a.jsx("div",{className:"sticky top-[81px] z-10 border-b border-border bg-background/95 backdrop-blur-sm lg:top-[97px]",children:a.jsx("div",{className:"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"scrollbar-hide flex gap-2 overflow-x-auto py-3",children:[a.jsx("button",{onClick:()=>i(null),className:`shrink-0 rounded-full px-4 py-1.5 text-sm font-medium transition-smooth ${s?"bg-muted text-muted-foreground hover:bg-primary/10 hover:text-primary":"bg-primary text-primary-foreground"}`,children:"Todos"}),o.map(d=>a.jsx("button",{onClick:()=>i(d===s?null:d),className:`shrink-0 rounded-full px-4 py-1.5 text-sm font-medium transition-smooth ${s===d?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-primary/10 hover:text-primary"}`,children:d},d))]})})}),a.jsx("section",{className:"py-12 md:py-20",children:a.jsx("div",{className:"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8",children:r?a.jsx("div",{className:"flex min-h-72 items-center justify-center",children:a.jsx(De,{className:"h-10 w-10 animate-spin text-primary"})}):l.length===0?a.jsxs("div",{className:"mx-auto max-w-xl py-20 text-center",children:[a.jsx(oa,{className:"mx-auto mb-5 h-12 w-12 text-primary"}),a.jsx("h2",{className:"text-2xl font-bold",children:"Novos conteúdos estão chegando"}),a.jsx("p",{className:"mt-3 text-muted-foreground",children:"Em breve, novidades sobre energia e mobilidade elétrica por aqui."})]}):a.jsxs(a.Fragment,{children:[c&&a.jsx(Ns,{to:`/blog/${c.id}`,className:"group block",children:a.jsxs("article",{className:"grid overflow-hidden rounded-2xl border border-border bg-card shadow-elegant transition-smooth hover:-translate-y-1 hover:shadow-glow md:grid-cols-[1.4fr_1fr]",children:[a.jsx(wa,{imageUrl:c.image_url,videoUrl:c.video_url,title:c.title,priority:!0,className:"aspect-[16/10] md:aspect-auto md:min-h-[420px]"}),a.jsxs("div",{className:"flex flex-col justify-center p-7 md:p-10",children:[a.jsxs("div",{className:"mb-4 flex flex-wrap items-center gap-2",children:[a.jsx(Ze,{className:"border-0 bg-gradient-primary text-white",children:"Destaque"}),a.jsx("span",{className:"text-sm text-muted-foreground",children:c.category})]}),a.jsx("h2",{className:"text-3xl font-bold leading-tight transition-smooth group-hover:text-primary md:text-4xl",children:c.title}),a.jsx("p",{className:"mt-4 line-clamp-3 text-base leading-relaxed text-muted-foreground",children:c.excerpt}),a.jsxs("div",{className:"mt-6 flex flex-wrap items-center gap-4 text-sm text-muted-foreground",children:[a.jsxs("span",{className:"flex items-center gap-1.5",children:[a.jsx(nw,{className:"h-4 w-4"}),Mc(c.published_at)]}),a.jsxs("span",{className:"flex items-center gap-1.5",children:[a.jsx(jh,{className:"h-4 w-4"}),hf(c.content)]})]}),a.jsxs("div",{className:"mt-8 inline-flex items-center gap-2 font-semibold text-primary",children:["Ler matéria",a.jsx(mN,{className:"h-4 w-4 transition-transform group-hover:translate-x-1"})]})]})]})}),u.length>0&&a.jsx("div",{className:"mt-14 grid gap-7 sm:grid-cols-2 lg:grid-cols-3",children:u.map((d,h)=>a.jsxs(Ns,{to:`/blog/${d.id}`,className:"group animate-fade-in flex flex-col overflow-hidden rounded-2xl border border-border bg-card transition-smooth hover:-translate-y-1 hover:shadow-elegant",style:{animationDelay:`${Math.min(h,5)*80}ms`,animationFillMode:"both"},children:[a.jsx(wa,{imageUrl:d.image_url,videoUrl:d.video_url,t
375itle:d.title,className:"aspect-[16/10]"}),a.jsxs("div",{className:"flex flex-1 flex-col p-6",children:[a.jsxs("div",{className:"mb-3 flex items-center justify-between gap-2",children:[a.jsx(Ze,{variant:"outline",className:"border-primary/30 text-xs text-primary",children:d.category}),a.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[a.jsx(jh,{className:"h-3 w-3"}),hf(d.content)]})]}),a.jsx("h2",{className:"line-clamp-2 text-xl font-bold leading-snug transition-smooth group-hover:text-primary",children:d.title}),a.jsx("p",{className:"mt-3 line-clamp-3 text-sm leading-relaxed text-muted-foreground",children:d.excerpt}),a.jsxs("div",{className:"mt-auto flex items-center justify-between border-t border-border pt-5 text-xs text-muted-foreground",children:[a.jsx("span",{children:d.author}),a.jsx("span",{children:Mc(d.published_at)})]})]})]},d.id))})]})})})]}),a.jsx(Ma,{})]})},DL=()=>{const{id:e}=bR(),[t,r]=f.useState(null),[n,s]=f.useState(!0);return f.useEffect(()=>{(async()=>{if(!e)return s(!1);const{data:o}=await V.from("blog_posts").select("*").eq("id",e).eq("is_published",!0).maybeSingle();r(o),s(!1)})()},[e]),a.jsxs("div",{className:"min-h-screen bg-background",children:[a.jsx(La,{}),a.jsx("main",{className:"pt-[81px] lg:pt-[97px]",children:n?a.jsx("div",{className:"flex min-h-[70vh] items-center justify-center",children:a.jsx(De,{className:"h-10 w-10 animate-spin text-primary"})}):t?a.jsxs("article",{children:[a.jsx("header",{className:"bg-gradient-primary py-14 md:py-20",children:a.jsxs("div",{className:"mx-auto max-w-3xl px-4 sm:px-6 lg:px-8 animate-fade-in",children:[a.jsx(B,{asChild:!0,variant:"ghost",className:"-ml-3 mb-6 gap-2 text-white/80 hover:bg-white/10 hover:text-white",children:a.jsxs(Ns,{to:"/blog",children:[a.jsx(Eg,{className:"h-4 w-4"})," Voltar ao blog"]})}),a.jsx(Ze,{className:"mb-4 border-0 bg-white/20 text-white backdrop-blur-sm",children:t.category}),a.jsx("h1",{className:"text-3xl font-bold leading-tight text-white md:text-5xl",children:t.title}),a.jsx("p",{className:"mt-5 text-lg leading-relaxed text-white/75",children:t.excerpt}),a.jsxs("div",{className:"mt-7 flex flex-wrap gap-5 text-sm text-white/70",children:[a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx(LN,{className:"h-4 w-4"}),t.author]}),a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx(nw,{className:"h-4 w-4"}),Mc(t.published_at)]}),a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx(jh,{className:"h-4 w-4"}),hf(t.content)]})]})]})}),(t.image_url||t.video_url)&&a.jsx("div",{className:"mx-auto -mt-10 max-w-4xl px-4 sm:px-6 lg:px-8",children:a.jsx(wa,{imageUrl:t.image_url,videoUrl:t.video_url,t
375itle:t.title,priority:!0,className:"aspect-video overflow-hidden rounded-2xl shadow-elegant"})}),a.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-12 sm:px-6 md:py-16 lg:px-8",children:[a.jsx("div",{className:"whitespace-pre-wrap text-base leading-8 text-foreground md:text-lg",children:t.content}),a.jsxs("div",{className:"mt-14 flex items-start gap-5 rounded-2xl border border-primary/20 bg-primary/5 p-6",children:[a.jsx("div",{className:"grid h-14 w-14 shrink-0 place-items-center rounded-full bg-gradient-primary text-xl font-bold text-white shadow-elegant",children:t.author.charAt(0).toUpperCase()}),a.jsxs("div",{children:[a.jsx("p",{className:"font-semibold text-foreground",children:t.author}),a.jsx("p",{className:"mt-1 text-sm leading-relaxed text-muted-foreground",children:"Equipe DCC Energy â compartilhando o futuro da mobilidade elétrica no Brasil."})]})]}),a.jsx("div",{className:"mt-10 border-t border-border pt-10",children:a.jsx(B,{asChild:!0,variant:"outline",className:"gap-2",children:a.jsxs(Ns,{to:"/blog",children:[a.jsx(Eg,{className:"h-4 w-4"})," Ver todos os artigos"]})})})]})]}):a.jsxs("section",{className:"mx-auto flex min-h-[70vh] max-w-xl flex-col items-center justify-center px-4 text-center",children:[a.jsx("h1",{className:"text-3xl font-bold",children:"Post não encontrado"}),a.jsx("p",{className:"mt-3 text-muted-foreground",children:"Este conteúdo não está disponÃvel ou ainda não foi publicado."}),a.jsx(B,{asChild:!0,className:"mt-7",children:a.jsx(Ns,{to:"/blog",children:"Voltar ao blog"})})]})}),a.jsx(Ma,{})]})},LL=new WT,ML=()=>a.jsx(qT,{client:LL,children:a.jsxs(wT,{children:[a.jsx(wk,{}),a.jsx(Gk,{}),a.jsx(VR,{children:a.jsxs(LR,{children:[a.jsx(Vr,{path:"/",element:a.jsx(dD,{})}),a.jsx(Vr,{path:"/termos-uso",element:a.jsx(hD,{})}),a.jsx(Vr,{path:"/politica-privacidade",element:a.jsx(fD,{})}),a.jsx(Vr,{path:"/admin-login",element:a.jsx(vD,{})}),a.jsx(Vr,{path:"/admin",element:a.jsx(OL,{})}),a.jsx(Vr,{path:"/blog",element:a.jsx(IL,{})}),a.jsx(Vr,{path:"/blog/:id",element:a.jsx(DL,{})}),a.jsx(Vr,{path:"*",element:a.jsx(pD,{})})]})})]})});N0(document.getElementById("root")).render(a.jsx(hC,{attribute:"class",defaultTheme:"light",enableSystem:!0,children:a.jsx(ML,{})}));
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.