var t0=e=>{throw TypeError(e)};var Wd=(e,t,n)=>t.has(e)||t0("Cannot "+n);var B=(e,t,n)=>(Wd(e,t,"read from private field"),n?n.call(e):t.get(e)),Se=(e,t,n)=>t.has(e)?t0("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ce=(e,t,n,r)=>(Wd(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),gt=(e,t,n)=>(Wd(e,t,"access private method"),n);var zl=(e,t,n,r)=>({set _(s){ce(e,t,s,n)},get _(){return B(e,t,r)}});function JC(e,t){for(var n=0;nr[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(s){if(s.ep)return;s.ep=!0;const a=n(s);fetch(s.href,a)}})();var Qc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ku(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var n2={exports:{}},Xu={},r2={exports:{}},ye={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Cl=Symbol.for("react.element"),QC=Symbol.for("react.portal"),YC=Symbol.for("react.fragment"),ZC=Symbol.for("react.strict_mode"),ej=Symbol.for("react.profiler"),tj=Symbol.for("react.provider"),nj=Symbol.for("react.context"),rj=Symbol.for("react.forward_ref"),sj=Symbol.for("react.suspense"),aj=Symbol.for("react.memo"),oj=Symbol.for("react.lazy"),n0=Symbol.iterator;function ij(e){return e===null||typeof e!="object"?null:(e=n0&&e[n0]||e["@@iterator"],typeof e=="function"?e:null)}var s2={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},a2=Object.assign,o2={};function Lo(e,t,n){this.props=e,this.context=t,this.refs=o2,this.updater=n||s2}Lo.prototype.isReactComponent={};Lo.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")};Lo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function i2(){}i2.prototype=Lo.prototype;function tp(e,t,n){this.props=e,this.context=t,this.refs=o2,this.updater=n||s2}var np=tp.prototype=new i2;np.constructor=tp;a2(np,Lo.prototype);np.isPureReactComponent=!0;var r0=Array.isArray,l2=Object.prototype.hasOwnProperty,rp={current:null},c2={key:!0,ref:!0,__self:!0,__source:!0};function u2(e,t,n){var r,s={},a=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(a=""+t.key),t)l2.call(t,r)&&!c2.hasOwnProperty(r)&&(s[r]=t[r]);var l=arguments.length-2;if(l===1)s.children=n;else if(1>>1,X=M[Y];if(0>>1;Ys(ke,E))fes(me,ke)?(M[Y]=me,M[fe]=E,Y=fe):(M[Y]=ke,M[te]=E,Y=te);else if(fes(me,E))M[Y]=me,M[fe]=E,Y=fe;else break e}}return $}function s(M,$){var E=M.sortIndex-$.sortIndex;return E!==0?E:M.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],d=[],h=1,f=null,p=3,m=!1,y=!1,g=!1,S=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(M){for(var $=n(d);$!==null;){if($.callback===null)r(d);else if($.startTime<=M)r(d),$.sortIndex=$.expirationTime,t(c,$);else break;$=n(d)}}function k(M){if(g=!1,x(M),!y)if(n(c)!==null)y=!0,G(j);else{var $=n(d);$!==null&&W(k,$.startTime-M)}}function j(M,$){y=!1,g&&(g=!1,w(P),P=-1),m=!0;var E=p;try{for(x($),f=n(c);f!==null&&(!(f.expirationTime>$)||M&&!I());){var Y=f.callback;if(typeof Y=="function"){f.callback=null,p=f.priorityLevel;var X=Y(f.expirationTime<=$);$=e.unstable_now(),typeof X=="function"?f.callback=X:f===n(c)&&r(c),x($)}else r(c);f=n(c)}if(f!==null)var N=!0;else{var te=n(d);te!==null&&W(k,te.startTime-$),N=!1}return N}finally{f=null,p=E,m=!1}}var C=!1,T=null,P=-1,_=5,R=-1;function I(){return!(e.unstable_now()-R<_)}function A(){if(T!==null){var M=e.unstable_now();R=M;var $=!0;try{$=T(!0,M)}finally{$?z():(C=!1,T=null)}}else C=!1}var z;if(typeof v=="function")z=function(){v(A)};else if(typeof MessageChannel<"u"){var D=new MessageChannel,F=D.port2;D.port1.onmessage=A,z=function(){F.postMessage(null)}}else z=function(){S(A,0)};function G(M){T=M,C||(C=!0,z())}function W(M,$){P=S(function(){M(e.unstable_now())},$)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(M){M.callback=null},e.unstable_continueExecution=function(){y||m||(y=!0,G(j))},e.unstable_forceFrameRate=function(M){0>M||125Y?(M.sortIndex=E,t(d,M),n(c)===null&&M===n(d)&&(g?(w(P),P=-1):g=!0,W(k,E-Y))):(M.sortIndex=X,t(c,M),y||m||(y=!0,G(j))),M},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(M){var $=p;return function(){var E=p;p=$;try{return M.apply(this,arguments)}finally{p=E}}}})(p2);m2.exports=p2;var xj=m2.exports;/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var vj=b,fn=xj;function H(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),of=Object.prototype.hasOwnProperty,bj=/^[: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]*$/,a0={},o0={};function wj(e){return of.call(o0,e)?!0:of.call(a0,e)?!1:bj.test(e)?o0[e]=!0:(a0[e]=!0,!1)}function Sj(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function kj(e,t,n,r){if(t===null||typeof t>"u"||Sj(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function At(e,t,n,r,s,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var ft={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ft[e]=new At(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ft[t]=new At(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ft[e]=new At(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ft[e]=new At(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){ft[e]=new At(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ft[e]=new At(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ft[e]=new At(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ft[e]=new At(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ft[e]=new At(e,5,!1,e.toLowerCase(),null,!1,!1)});var op=/[\-:]([a-z])/g;function ip(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(op,ip);ft[t]=new At(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(op,ip);ft[t]=new At(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(op,ip);ft[t]=new At(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ft[e]=new At(e,1,!1,e.toLowerCase(),null,!1,!1)});ft.xlinkHref=new At("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ft[e]=new At(e,1,!1,e.toLowerCase(),null,!0,!0)});function lp(e,t,n,r){var s=ft.hasOwnProperty(t)?ft[t]:null;(s!==null?s.type!==0:r||!(2l||s[o]!==a[l]){var c=` `+s[o].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{Jd=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?pi(e):""}function Cj(e){switch(e.tag){case 5:return pi(e.type);case 16:return pi("Lazy");case 13:return pi("Suspense");case 19:return pi("SuspenseList");case 0:case 2:case 15:return e=Qd(e.type,!1),e;case 11:return e=Qd(e.type.render,!1),e;case 1:return e=Qd(e.type,!0),e;default:return""}}function df(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 za:return"Fragment";case Ua:return"Portal";case lf:return"Profiler";case cp:return"StrictMode";case cf:return"Suspense";case uf:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case x2:return(e.displayName||"Context")+".Consumer";case y2:return(e._context.displayName||"Context")+".Provider";case up:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case dp:return t=e.displayName||null,t!==null?t:df(e.type)||"Memo";case ss:t=e._payload,e=e._init;try{return df(e(t))}catch{}}return null}function jj(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 df(t);case 8:return t===cp?"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 Ts(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function b2(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ej(e){var t=b2(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){r=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ql(e){e._valueTracker||(e._valueTracker=Ej(e))}function w2(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=b2(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Yc(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 hf(e,t){var n=t.checked;return ze({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function l0(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ts(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function S2(e,t){t=t.checked,t!=null&&lp(e,"checked",t,!1)}function ff(e,t){S2(e,t);var n=Ts(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?mf(e,t.type,n):t.hasOwnProperty("defaultValue")&&mf(e,t.type,Ts(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function c0(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function mf(e,t,n){(t!=="number"||Yc(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var gi=Array.isArray;function so(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=Gl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function $i(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var wi={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},Nj=["Webkit","ms","Moz","O"];Object.keys(wi).forEach(function(e){Nj.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),wi[t]=wi[e]})});function E2(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||wi.hasOwnProperty(e)&&wi[e]?(""+t).trim():t+"px"}function N2(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=E2(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var _j=ze({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 yf(e,t){if(t){if(_j[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(H(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(H(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(H(61))}if(t.style!=null&&typeof t.style!="object")throw Error(H(62))}}function xf(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 vf=null;function hp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var bf=null,ao=null,oo=null;function h0(e){if(e=Nl(e)){if(typeof bf!="function")throw Error(H(280));var t=e.stateNode;t&&(t=ed(t),bf(e.stateNode,e.type,t))}}function _2(e){ao?oo?oo.push(e):oo=[e]:ao=e}function T2(){if(ao){var e=ao,t=oo;if(oo=ao=null,h0(e),t)for(e=0;e>>=0,e===0?32:31-($j(e)/Bj|0)|0}var Wl=64,Kl=4194304;function yi(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 nu(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~s;l!==0?r=yi(l):(a&=o,a!==0&&(r=yi(a)))}else o=n&~s,o!==0?r=yi(o):a!==0&&(r=yi(a));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,a=t&-t,s>=a||s===16&&(a&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function jl(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Hn(t),e[t]=n}function Hj(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=ki),w0=" ",S0=!1;function X2(e,t){switch(e){case"keyup":return xE.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function J2(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Va=!1;function bE(e,t){switch(e){case"compositionend":return J2(t);case"keypress":return t.which!==32?null:(S0=!0,w0);case"textInput":return e=t.data,e===w0&&S0?null:e;default:return null}}function wE(e,t){if(Va)return e==="compositionend"||!bp&&X2(e,t)?(e=W2(),Ic=yp=gs=null,Va=!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)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=E0(n)}}function e1(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?e1(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function t1(){for(var e=window,t=Yc();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Yc(e.document)}return t}function wp(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 PE(e){var t=t1(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&e1(n.ownerDocument.documentElement,n)){if(r!==null&&wp(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,a=Math.min(r.start,s);r=r.end===void 0?a:Math.min(r.end,s),!e.extend&&a>r&&(s=r,r=a,a=s),s=N0(n,a);var o=N0(n,r);s&&o&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Ha=null,Ef=null,ji=null,Nf=!1;function _0(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Nf||Ha==null||Ha!==Yc(r)||(r=Ha,"selectionStart"in r&&wp(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ji&&qi(ji,r)||(ji=r,r=au(Ef,"onSelect"),0Wa||(e.current=If[Wa],If[Wa]=null,Wa--)}function Re(e,t){Wa++,If[Wa]=e.current,e.current=t}var Ps={},wt=Ms(Ps),Ht=Ms(!1),da=Ps;function No(e,t){var n=e.type.contextTypes;if(!n)return Ps;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},a;for(a in n)s[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function qt(e){return e=e.childContextTypes,e!=null}function iu(){De(Ht),De(wt)}function M0(e,t,n){if(wt.current!==Ps)throw Error(H(168));Re(wt,t),Re(Ht,n)}function u1(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(H(108,jj(e)||"Unknown",s));return ze({},n,r)}function lu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ps,da=wt.current,Re(wt,e),Re(Ht,Ht.current),!0}function L0(e,t,n){var r=e.stateNode;if(!r)throw Error(H(169));n?(e=u1(e,t,da),r.__reactInternalMemoizedMergedChildContext=e,De(Ht),De(wt),Re(wt,e)):De(Ht),Re(Ht,n)}var Mr=null,td=!1,dh=!1;function d1(e){Mr===null?Mr=[e]:Mr.push(e)}function zE(e){td=!0,d1(e)}function Ls(){if(!dh&&Mr!==null){dh=!0;var e=0,t=Ee;try{var n=Mr;for(Ee=1;e>=o,s-=o,Dr=1<<32-Hn(t)+s|n<P?(_=T,T=null):_=T.sibling;var R=p(w,T,x[P],k);if(R===null){T===null&&(T=_);break}e&&T&&R.alternate===null&&t(w,T),v=a(R,v,P),C===null?j=R:C.sibling=R,C=R,T=_}if(P===x.length)return n(w,T),Fe&&Gs(w,P),j;if(T===null){for(;PP?(_=T,T=null):_=T.sibling;var I=p(w,T,R.value,k);if(I===null){T===null&&(T=_);break}e&&T&&I.alternate===null&&t(w,T),v=a(I,v,P),C===null?j=I:C.sibling=I,C=I,T=_}if(R.done)return n(w,T),Fe&&Gs(w,P),j;if(T===null){for(;!R.done;P++,R=x.next())R=f(w,R.value,k),R!==null&&(v=a(R,v,P),C===null?j=R:C.sibling=R,C=R);return Fe&&Gs(w,P),j}for(T=r(w,T);!R.done;P++,R=x.next())R=m(T,w,P,R.value,k),R!==null&&(e&&R.alternate!==null&&T.delete(R.key===null?P:R.key),v=a(R,v,P),C===null?j=R:C.sibling=R,C=R);return e&&T.forEach(function(A){return t(w,A)}),Fe&&Gs(w,P),j}function S(w,v,x,k){if(typeof x=="object"&&x!==null&&x.type===za&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Hl:e:{for(var j=x.key,C=v;C!==null;){if(C.key===j){if(j=x.type,j===za){if(C.tag===7){n(w,C.sibling),v=s(C,x.props.children),v.return=w,w=v;break e}}else if(C.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===ss&&$0(j)===C.type){n(w,C.sibling),v=s(C,x.props),v.ref=ai(w,C,x),v.return=w,w=v;break e}n(w,C);break}else t(w,C);C=C.sibling}x.type===za?(v=ua(x.props.children,w.mode,k,x.key),v.return=w,w=v):(k=Uc(x.type,x.key,x.props,null,w.mode,k),k.ref=ai(w,v,x),k.return=w,w=k)}return o(w);case Ua:e:{for(C=x.key;v!==null;){if(v.key===C)if(v.tag===4&&v.stateNode.containerInfo===x.containerInfo&&v.stateNode.implementation===x.implementation){n(w,v.sibling),v=s(v,x.children||[]),v.return=w,w=v;break e}else{n(w,v);break}else t(w,v);v=v.sibling}v=vh(x,w.mode,k),v.return=w,w=v}return o(w);case ss:return C=x._init,S(w,v,C(x._payload),k)}if(gi(x))return y(w,v,x,k);if(ei(x))return g(w,v,x,k);tc(w,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,v!==null&&v.tag===6?(n(w,v.sibling),v=s(v,x),v.return=w,w=v):(n(w,v),v=xh(x,w.mode,k),v.return=w,w=v),o(w)):n(w,v)}return S}var To=p1(!0),g1=p1(!1),du=Ms(null),hu=null,Ja=null,jp=null;function Ep(){jp=Ja=hu=null}function Np(e){var t=du.current;De(du),e._currentValue=t}function Lf(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function lo(e,t){hu=e,jp=Ja=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(zt=!0),e.firstContext=null)}function Cn(e){var t=e._currentValue;if(jp!==e)if(e={context:e,memoizedValue:t,next:null},Ja===null){if(hu===null)throw Error(H(308));Ja=e,hu.dependencies={lanes:0,firstContext:e}}else Ja=Ja.next=e;return t}var ea=null;function _p(e){ea===null?ea=[e]:ea.push(e)}function y1(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,_p(t)):(n.next=s.next,s.next=n),t.interleaved=n,Hr(e,r)}function Hr(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var as=!1;function Tp(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function x1(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 Br(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ks(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,we&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,Hr(e,n)}return s=r.interleaved,s===null?(t.next=t,_p(r)):(t.next=s.next,s.next=t),r.interleaved=t,Hr(e,n)}function Mc(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,mp(e,n)}}function B0(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?s=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?s=a=t:a=a.next=t}else s=a=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function fu(e,t,n,r){var s=e.updateQueue;as=!1;var a=s.firstBaseUpdate,o=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var c=l,d=c.next;c.next=null,o===null?a=d:o.next=d,o=c;var h=e.alternate;h!==null&&(h=h.updateQueue,l=h.lastBaseUpdate,l!==o&&(l===null?h.firstBaseUpdate=d:l.next=d,h.lastBaseUpdate=c))}if(a!==null){var f=s.baseState;o=0,h=d=c=null,l=a;do{var p=l.lane,m=l.eventTime;if((r&p)===p){h!==null&&(h=h.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var y=e,g=l;switch(p=t,m=n,g.tag){case 1:if(y=g.payload,typeof y=="function"){f=y.call(m,f,p);break e}f=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=g.payload,p=typeof y=="function"?y.call(m,f,p):y,p==null)break e;f=ze({},f,p);break e;case 2:as=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,p=s.effects,p===null?s.effects=[l]:p.push(l))}else m={eventTime:m,lane:p,tag:l.tag,payload:l.payload,callback:l.callback,next:null},h===null?(d=h=m,c=f):h=h.next=m,o|=p;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;p=l,l=p.next,p.next=null,s.lastBaseUpdate=p,s.shared.pending=null}}while(!0);if(h===null&&(c=f),s.baseState=c,s.firstBaseUpdate=d,s.lastBaseUpdate=h,t=s.shared.interleaved,t!==null){s=t;do o|=s.lane,s=s.next;while(s!==t)}else a===null&&(s.shared.lanes=0);ma|=o,e.lanes=o,e.memoizedState=f}}function U0(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=fh.transition;fh.transition={};try{e(!1),t()}finally{Ee=n,fh.transition=r}}function M1(){return jn().memoizedState}function GE(e,t,n){var r=js(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},L1(e))D1(t,n);else if(n=y1(e,t,n,r),n!==null){var s=Tt();qn(n,e,r,s),F1(n,t,r)}}function WE(e,t,n){var r=js(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(L1(e))D1(t,s);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,l=a(o,n);if(s.hasEagerState=!0,s.eagerState=l,Gn(l,o)){var c=t.interleaved;c===null?(s.next=s,_p(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}n=y1(e,t,s,r),n!==null&&(s=Tt(),qn(n,e,r,s),F1(n,t,r))}}function L1(e){var t=e.alternate;return e===Ue||t!==null&&t===Ue}function D1(e,t){Ei=pu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function F1(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,mp(e,n)}}var gu={readContext:Cn,useCallback:yt,useContext:yt,useEffect:yt,useImperativeHandle:yt,useInsertionEffect:yt,useLayoutEffect:yt,useMemo:yt,useReducer:yt,useRef:yt,useState:yt,useDebugValue:yt,useDeferredValue:yt,useTransition:yt,useMutableSource:yt,useSyncExternalStore:yt,useId:yt,unstable_isNewReconciler:!1},KE={readContext:Cn,useCallback:function(e,t){return ar().memoizedState=[e,t===void 0?null:t],e},useContext:Cn,useEffect:V0,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Dc(4194308,4,P1.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Dc(4194308,4,e,t)},useInsertionEffect:function(e,t){return Dc(4,2,e,t)},useMemo:function(e,t){var n=ar();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=ar();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=GE.bind(null,Ue,e),[r.memoizedState,e]},useRef:function(e){var t=ar();return e={current:e},t.memoizedState=e},useState:z0,useDebugValue:Dp,useDeferredValue:function(e){return ar().memoizedState=e},useTransition:function(){var e=z0(!1),t=e[0];return e=qE.bind(null,e[1]),ar().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ue,s=ar();if(Fe){if(n===void 0)throw Error(H(407));n=n()}else{if(n=t(),ot===null)throw Error(H(349));fa&30||S1(r,t,n)}s.memoizedState=n;var a={value:n,getSnapshot:t};return s.queue=a,V0(C1.bind(null,r,a,e),[e]),r.flags|=2048,Zi(9,k1.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=ar(),t=ot.identifierPrefix;if(Fe){var n=Fr,r=Dr;n=(r&~(1<<32-Hn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Qi++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[hr]=t,e[Ki]=r,K1(e,t,!1,!1),t.stateNode=e;e:{switch(o=xf(n,r),n){case"dialog":Me("cancel",e),Me("close",e),s=r;break;case"iframe":case"object":case"embed":Me("load",e),s=r;break;case"video":case"audio":for(s=0;sRo&&(t.flags|=128,r=!0,oi(a,!1),t.lanes=4194304)}else{if(!r)if(e=mu(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),oi(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!Fe)return xt(t),null}else 2*Xe()-a.renderingStartTime>Ro&&n!==1073741824&&(t.flags|=128,r=!0,oi(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(n=a.last,n!==null?n.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Xe(),t.sibling=null,n=Be.current,Re(Be,r?n&1|2:n&1),t):(xt(t),null);case 22:case 23:return Vp(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?rn&1073741824&&(xt(t),t.subtreeFlags&6&&(t.flags|=8192)):xt(t),null;case 24:return null;case 25:return null}throw Error(H(156,t.tag))}function nN(e,t){switch(kp(t),t.tag){case 1:return qt(t.type)&&iu(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Po(),De(Ht),De(wt),Rp(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ap(t),null;case 13:if(De(Be),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(H(340));_o()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return De(Be),null;case 4:return Po(),null;case 10:return Np(t.type._context),null;case 22:case 23:return Vp(),null;case 24:return null;default:return null}}var rc=!1,bt=!1,rN=typeof WeakSet=="function"?WeakSet:Set,J=null;function Qa(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ge(e,t,r)}else n.current=null}function qf(e,t,n){try{n()}catch(r){Ge(e,t,r)}}var ey=!1;function sN(e,t){if(_f=ru,e=t1(),wp(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,d=0,h=0,f=e,p=null;t:for(;;){for(var m;f!==n||s!==0&&f.nodeType!==3||(l=o+s),f!==a||r!==0&&f.nodeType!==3||(c=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break t;if(p===n&&++d===s&&(l=o),p===a&&++h===r&&(c=o),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Tf={focusedElem:e,selectionRange:n},ru=!1,J=t;J!==null;)if(t=J,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,J=e;else for(;J!==null;){t=J;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var g=y.memoizedProps,S=y.memoizedState,w=t.stateNode,v=w.getSnapshotBeforeUpdate(t.elementType===t.type?g:Dn(t.type,g),S);w.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(H(163))}}catch(k){Ge(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,J=e;break}J=t.return}return y=ey,ey=!1,y}function Ni(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var a=s.destroy;s.destroy=void 0,a!==void 0&&qf(t,n,a)}s=s.next}while(s!==r)}}function sd(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Gf(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Q1(e){var t=e.alternate;t!==null&&(e.alternate=null,Q1(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[hr],delete t[Ki],delete t[Rf],delete t[BE],delete t[UE])),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 Y1(e){return e.tag===5||e.tag===3||e.tag===4}function ty(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Y1(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 Wf(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ou));else if(r!==4&&(e=e.child,e!==null))for(Wf(e,t,n),e=e.sibling;e!==null;)Wf(e,t,n),e=e.sibling}function Kf(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Kf(e,t,n),e=e.sibling;e!==null;)Kf(e,t,n),e=e.sibling}var ut=null,zn=!1;function Yr(e,t,n){for(n=n.child;n!==null;)Z1(e,t,n),n=n.sibling}function Z1(e,t,n){if(gr&&typeof gr.onCommitFiberUnmount=="function")try{gr.onCommitFiberUnmount(Ju,n)}catch{}switch(n.tag){case 5:bt||Qa(n,t);case 6:var r=ut,s=zn;ut=null,Yr(e,t,n),ut=r,zn=s,ut!==null&&(zn?(e=ut,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ut.removeChild(n.stateNode));break;case 18:ut!==null&&(zn?(e=ut,n=n.stateNode,e.nodeType===8?uh(e.parentNode,n):e.nodeType===1&&uh(e,n),Vi(e)):uh(ut,n.stateNode));break;case 4:r=ut,s=zn,ut=n.stateNode.containerInfo,zn=!0,Yr(e,t,n),ut=r,zn=s;break;case 0:case 11:case 14:case 15:if(!bt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var a=s,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&qf(n,t,o),s=s.next}while(s!==r)}Yr(e,t,n);break;case 1:if(!bt&&(Qa(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Ge(n,t,l)}Yr(e,t,n);break;case 21:Yr(e,t,n);break;case 22:n.mode&1?(bt=(r=bt)||n.memoizedState!==null,Yr(e,t,n),bt=r):Yr(e,t,n);break;default:Yr(e,t,n)}}function ny(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new rN),t.forEach(function(r){var s=fN.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function In(e,t){var n=t.deletions;if(n!==null)for(var r=0;rs&&(s=o),r&=~a}if(r=s,r=Xe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*oN(r/1960))-r,10e?16:e,ys===null)var r=!1;else{if(e=ys,ys=null,vu=0,we&6)throw Error(H(331));var s=we;for(we|=4,J=e.current;J!==null;){var a=J,o=a.child;if(J.flags&16){var l=a.deletions;if(l!==null){for(var c=0;cXe()-Up?ca(e,0):Bp|=n),Gt(e,t)}function ib(e,t){t===0&&(e.mode&1?(t=Kl,Kl<<=1,!(Kl&130023424)&&(Kl=4194304)):t=1);var n=Tt();e=Hr(e,t),e!==null&&(jl(e,t,n),Gt(e,n))}function hN(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ib(e,n)}function fN(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(H(314))}r!==null&&r.delete(t),ib(e,n)}var lb;lb=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ht.current)zt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return zt=!1,eN(e,t,n);zt=!!(e.flags&131072)}else zt=!1,Fe&&t.flags&1048576&&h1(t,uu,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Fc(e,t),e=t.pendingProps;var s=No(t,wt.current);lo(t,n),s=Op(null,t,r,e,s,n);var a=Mp();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,qt(r)?(a=!0,lu(t)):a=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Tp(t),s.updater=rd,t.stateNode=s,s._reactInternals=t,Ff(t,r,e,n),t=Uf(null,t,r,!0,a,n)):(t.tag=0,Fe&&a&&Sp(t),Et(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Fc(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=pN(r),e=Dn(r,e),s){case 0:t=Bf(null,t,r,e,n);break e;case 1:t=Q0(null,t,r,e,n);break e;case 11:t=X0(null,t,r,e,n);break e;case 14:t=J0(null,t,r,Dn(r.type,e),n);break e}throw Error(H(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Dn(r,s),Bf(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Dn(r,s),Q0(e,t,r,s,n);case 3:e:{if(q1(t),e===null)throw Error(H(387));r=t.pendingProps,a=t.memoizedState,s=a.element,x1(e,t),fu(t,r,null,n);var o=t.memoizedState;if(r=o.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){s=Ao(Error(H(423)),t),t=Y0(e,t,r,n,s);break e}else if(r!==s){s=Ao(Error(H(424)),t),t=Y0(e,t,r,n,s);break e}else for(ln=Ss(t.stateNode.containerInfo.firstChild),un=t,Fe=!0,Vn=null,n=g1(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(_o(),r===s){t=qr(e,t,n);break e}Et(e,t,r,n)}t=t.child}return t;case 5:return v1(t),e===null&&Mf(t),r=t.type,s=t.pendingProps,a=e!==null?e.memoizedProps:null,o=s.children,Pf(r,s)?o=null:a!==null&&Pf(r,a)&&(t.flags|=32),H1(e,t),Et(e,t,o,n),t.child;case 6:return e===null&&Mf(t),null;case 13:return G1(e,t,n);case 4:return Pp(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=To(t,null,r,n):Et(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Dn(r,s),X0(e,t,r,s,n);case 7:return Et(e,t,t.pendingProps,n),t.child;case 8:return Et(e,t,t.pendingProps.children,n),t.child;case 12:return Et(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,a=t.memoizedProps,o=s.value,Re(du,r._currentValue),r._currentValue=o,a!==null)if(Gn(a.value,o)){if(a.children===s.children&&!Ht.current){t=qr(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){o=a.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(a.tag===1){c=Br(-1,n&-n),c.tag=2;var d=a.updateQueue;if(d!==null){d=d.shared;var h=d.pending;h===null?c.next=c:(c.next=h.next,h.next=c),d.pending=c}}a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),Lf(a.return,n,t),l.lanes|=n;break}c=c.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(H(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Lf(o,n,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}Et(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,lo(t,n),s=Cn(s),r=r(s),t.flags|=1,Et(e,t,r,n),t.child;case 14:return r=t.type,s=Dn(r,t.pendingProps),s=Dn(r.type,s),J0(e,t,r,s,n);case 15:return z1(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Dn(r,s),Fc(e,t),t.tag=1,qt(r)?(e=!0,lu(t)):e=!1,lo(t,n),$1(t,r,s),Ff(t,r,s,n),Uf(null,t,r,!0,e,n);case 19:return W1(e,t,n);case 22:return V1(e,t,n)}throw Error(H(156,t.tag))};function cb(e,t){return L2(e,t)}function mN(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Sn(e,t,n,r){return new mN(e,t,n,r)}function qp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function pN(e){if(typeof e=="function")return qp(e)?1:0;if(e!=null){if(e=e.$$typeof,e===up)return 11;if(e===dp)return 14}return 2}function Es(e,t){var n=e.alternate;return n===null?(n=Sn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Uc(e,t,n,r,s,a){var o=2;if(r=e,typeof e=="function")qp(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case za:return ua(n.children,s,a,t);case cp:o=8,s|=8;break;case lf:return e=Sn(12,n,t,s|2),e.elementType=lf,e.lanes=a,e;case cf:return e=Sn(13,n,t,s),e.elementType=cf,e.lanes=a,e;case uf:return e=Sn(19,n,t,s),e.elementType=uf,e.lanes=a,e;case v2:return od(n,s,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case y2:o=10;break e;case x2:o=9;break e;case up:o=11;break e;case dp:o=14;break e;case ss:o=16,r=null;break e}throw Error(H(130,e==null?e:typeof e,""))}return t=Sn(o,n,t,s),t.elementType=e,t.type=r,t.lanes=a,t}function ua(e,t,n,r){return e=Sn(7,e,r,t),e.lanes=n,e}function od(e,t,n,r){return e=Sn(22,e,r,t),e.elementType=v2,e.lanes=n,e.stateNode={isHidden:!1},e}function xh(e,t,n){return e=Sn(6,e,null,t),e.lanes=n,e}function vh(e,t,n){return t=Sn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function gN(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Zd(0),this.expirationTimes=Zd(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Zd(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Gp(e,t,n,r,s,a,o,l,c){return e=new gN(e,t,n,l,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Sn(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Tp(a),e}function yN(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(fb)}catch(e){console.error(e)}}fb(),f2.exports=mn;var Tl=f2.exports;const mb=Ku(Tl);var pb,uy=Tl;pb=uy.createRoot,uy.hydrateRoot;const SN=1,kN=1e6;let bh=0;function CN(){return bh=(bh+1)%Number.MAX_SAFE_INTEGER,bh.toString()}const wh=new Map,dy=e=>{if(wh.has(e))return;const t=setTimeout(()=>{wh.delete(e),Pi({type:"REMOVE_TOAST",toastId:e})},kN);wh.set(e,t)},jN=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,SN)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?dy(n):e.toasts.forEach(r=>{dy(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},zc=[];let Vc={toasts:[]};function Pi(e){Vc=jN(Vc,e),zc.forEach(t=>{t(Vc)})}function EN({...e}){const t=CN(),n=s=>Pi({type:"UPDATE_TOAST",toast:{...s,id:t}}),r=()=>Pi({type:"DISMISS_TOAST",toastId:t});return Pi({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||r()}}}),{id:t,dismiss:r,update:n}}function NN(){const[e,t]=b.useState(Vc);return b.useEffect(()=>(zc.push(t),()=>{const n=zc.indexOf(t);n>-1&&zc.splice(n,1)}),[e]),{...e,toast:EN,dismiss:n=>Pi({type:"DISMISS_TOAST",toastId:n})}}function Ae(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function hy(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function gb(...e){return t=>{let n=!1;const r=e.map(s=>{const a=hy(s,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let s=0;s{const{children:o,...l}=a,c=b.useMemo(()=>l,Object.values(l));return i.jsx(n.Provider,{value:c,children:o})};r.displayName=e+"Provider";function s(a){const o=b.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,s]}function wa(e,t=[]){let n=[];function r(a,o){const l=b.createContext(o),c=n.length;n=[...n,o];const d=f=>{var w;const{scope:p,children:m,...y}=f,g=((w=p==null?void 0:p[e])==null?void 0:w[c])||l,S=b.useMemo(()=>y,Object.values(y));return i.jsx(g.Provider,{value:S,children:m})};d.displayName=a+"Provider";function h(f,p){var g;const m=((g=p==null?void 0:p[e])==null?void 0:g[c])||l,y=b.useContext(m);if(y)return y;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${a}\``)}return[d,h]}const s=()=>{const a=n.map(o=>b.createContext(o));return function(l){const c=(l==null?void 0:l[e])||a;return b.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[r,TN(s,...t)]}function TN(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(a){const o=r.reduce((l,{useScope:c,scopeName:d})=>{const f=c(a)[`__scope${d}`];return{...l,...f}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function tl(e){const t=PN(e),n=b.forwardRef((r,s)=>{const{children:a,...o}=r,l=b.Children.toArray(a),c=l.find(RN);if(c){const d=c.props.children,h=l.map(f=>f===c?b.Children.count(d)>1?b.Children.only(null):b.isValidElement(d)?d.props.children:null:f);return i.jsx(t,{...o,ref:s,children:b.isValidElement(d)?b.cloneElement(d,void 0,h):null})}return i.jsx(t,{...o,ref:s,children:a})});return n.displayName=`${e}.Slot`,n}var $o=tl("Slot");function PN(e){const t=b.forwardRef((n,r)=>{const{children:s,...a}=n;if(b.isValidElement(s)){const o=ON(s),l=IN(a,s.props);return s.type!==b.Fragment&&(l.ref=r?gb(r,o):o),b.cloneElement(s,l)}return b.Children.count(s)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var yb=Symbol("radix.slottable");function AN(e){const t=({children:n})=>i.jsx(i.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=yb,t}function RN(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===yb}function IN(e,t){const n={...t};for(const r in t){const s=e[r],a=t[r];/^on[A-Z]/.test(r)?s&&a?n[r]=(...l)=>{const c=a(...l);return s(...l),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...a}:r==="className"&&(n[r]=[s,a].filter(Boolean).join(" "))}return{...e,...n}}function ON(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function xb(e){const t=e+"CollectionProvider",[n,r]=wa(t),[s,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=g=>{const{scope:S,children:w}=g,v=U.useRef(null),x=U.useRef(new Map).current;return i.jsx(s,{scope:S,itemMap:x,collectionRef:v,children:w})};o.displayName=t;const l=e+"CollectionSlot",c=tl(l),d=U.forwardRef((g,S)=>{const{scope:w,children:v}=g,x=a(l,w),k=mt(S,x.collectionRef);return i.jsx(c,{ref:k,children:v})});d.displayName=l;const h=e+"CollectionItemSlot",f="data-radix-collection-item",p=tl(h),m=U.forwardRef((g,S)=>{const{scope:w,children:v,...x}=g,k=U.useRef(null),j=mt(S,k),C=a(h,w);return U.useEffect(()=>(C.itemMap.set(k,{ref:k,...x}),()=>void C.itemMap.delete(k))),i.jsx(p,{[f]:"",ref:j,children:v})});m.displayName=h;function y(g){const S=a(e+"CollectionConsumer",g);return U.useCallback(()=>{const v=S.collectionRef.current;if(!v)return[];const x=Array.from(v.querySelectorAll(`[${f}]`));return Array.from(S.itemMap.values()).sort((C,T)=>x.indexOf(C.ref.current)-x.indexOf(T.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:o,Slot:d,ItemSlot:m},y,r]}var MN=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],_e=MN.reduce((e,t)=>{const n=tl(`Primitive.${t}`),r=b.forwardRef((s,a)=>{const{asChild:o,...l}=s,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(c,{...l,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function vb(e,t){e&&Tl.flushSync(()=>e.dispatchEvent(t))}function vr(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function LN(e,t=globalThis==null?void 0:globalThis.document){const n=vr(e);b.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var DN="DismissableLayer",Zf="dismissableLayer.update",FN="dismissableLayer.pointerDownOutside",$N="dismissableLayer.focusOutside",fy,bb=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),dd=b.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:o,onDismiss:l,...c}=e,d=b.useContext(bb),[h,f]=b.useState(null),p=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=b.useState({}),y=mt(t,T=>f(T)),g=Array.from(d.layers),[S]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),w=g.indexOf(S),v=h?g.indexOf(h):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,k=v>=w,j=UN(T=>{const P=T.target,_=[...d.branches].some(R=>R.contains(P));!k||_||(s==null||s(T),o==null||o(T),T.defaultPrevented||l==null||l())},p),C=zN(T=>{const P=T.target;[...d.branches].some(R=>R.contains(P))||(a==null||a(T),o==null||o(T),T.defaultPrevented||l==null||l())},p);return LN(T=>{v===d.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&l&&(T.preventDefault(),l()))},p),b.useEffect(()=>{if(h)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(fy=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),my(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=fy)}},[h,p,n,d]),b.useEffect(()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),my())},[h,d]),b.useEffect(()=>{const T=()=>m({});return document.addEventListener(Zf,T),()=>document.removeEventListener(Zf,T)},[]),i.jsx(_e.div,{...c,ref:y,style:{pointerEvents:x?k?"auto":"none":void 0,...e.style},onFocusCapture:Ae(e.onFocusCapture,C.onFocusCapture),onBlurCapture:Ae(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:Ae(e.onPointerDownCapture,j.onPointerDownCapture)})});dd.displayName=DN;var BN="DismissableLayerBranch",wb=b.forwardRef((e,t)=>{const n=b.useContext(bb),r=b.useRef(null),s=mt(t,r);return b.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),i.jsx(_e.div,{...e,ref:s})});wb.displayName=BN;function UN(e,t=globalThis==null?void 0:globalThis.document){const n=vr(e),r=b.useRef(!1),s=b.useRef(()=>{});return b.useEffect(()=>{const a=l=>{if(l.target&&!r.current){let c=function(){Sb(FN,n,d,{discrete:!0})};const d={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);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function zN(e,t=globalThis==null?void 0:globalThis.document){const n=vr(e),r=b.useRef(!1);return b.useEffect(()=>{const s=a=>{a.target&&!r.current&&Sb($N,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function my(){const e=new CustomEvent(Zf);document.dispatchEvent(e)}function Sb(e,t,n,{discrete:r}){const s=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?vb(s,a):s.dispatchEvent(a)}var VN=dd,HN=wb,br=globalThis!=null&&globalThis.document?b.useLayoutEffect:()=>{},qN="Portal",Jp=b.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[s,a]=b.useState(!1);br(()=>a(!0),[]);const o=n||s&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?mb.createPortal(i.jsx(_e.div,{...r,ref:t}),o):null});Jp.displayName=qN;function GN(e,t){return b.useReducer((n,r)=>t[n][r]??n,e)}var Sa=e=>{const{present:t,children:n}=e,r=WN(t),s=typeof n=="function"?n({present:r.isPresent}):b.Children.only(n),a=mt(r.ref,KN(s));return typeof n=="function"||r.isPresent?b.cloneElement(s,{ref:a}):null};Sa.displayName="Presence";function WN(e){const[t,n]=b.useState(),r=b.useRef(null),s=b.useRef(e),a=b.useRef("none"),o=e?"mounted":"unmounted",[l,c]=GN(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const d=oc(r.current);a.current=l==="mounted"?d:"none"},[l]),br(()=>{const d=r.current,h=s.current;if(h!==e){const p=a.current,m=oc(d);e?c("MOUNT"):m==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(h&&p!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),br(()=>{if(t){let d;const h=t.ownerDocument.defaultView??window,f=m=>{const g=oc(r.current).includes(m.animationName);if(m.target===t&&g&&(c("ANIMATION_END"),!s.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",d=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},p=m=>{m.target===t&&(a.current=oc(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{h.clearTimeout(d),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:b.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function oc(e){return(e==null?void 0:e.animationName)||"none"}function KN(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var XN=ap[" useInsertionEffect ".trim().toString()]||br;function Bo({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,a,o]=JN({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:s;{const h=b.useRef(e!==void 0);b.useEffect(()=>{const f=h.current;f!==l&&console.warn(`${r} is changing from ${f?"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.`),h.current=l},[l,r])}const d=b.useCallback(h=>{var f;if(l){const p=QN(h)?h(e):h;p!==e&&((f=o.current)==null||f.call(o,p))}else a(h)},[l,e,a,o]);return[c,d]}function JN({defaultProp:e,onChange:t}){const[n,r]=b.useState(e),s=b.useRef(n),a=b.useRef(t);return XN(()=>{a.current=t},[t]),b.useEffect(()=>{var o;s.current!==n&&((o=a.current)==null||o.call(a,n),s.current=n)},[n,s]),[n,r,a]}function QN(e){return typeof e=="function"}var YN=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"}),ZN="VisuallyHidden",hd=b.forwardRef((e,t)=>i.jsx(_e.span,{...e,ref:t,style:{...YN,...e.style}}));hd.displayName=ZN;var e_=hd,Qp="ToastProvider",[Yp,t_,n_]=xb("Toast"),[kb,qB]=wa("Toast",[n_]),[r_,fd]=kb(Qp),Cb=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:a=50,children:o}=e,[l,c]=b.useState(null),[d,h]=b.useState(0),f=b.useRef(!1),p=b.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Qp}\`. Expected non-empty \`string\`.`),i.jsx(Yp.Provider,{scope:t,children:i.jsx(r_,{scope:t,label:n,duration:r,swipeDirection:s,swipeThreshold:a,toastCount:d,viewport:l,onViewportChange:c,onToastAdd:b.useCallback(()=>h(m=>m+1),[]),onToastRemove:b.useCallback(()=>h(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:p,children:o})})};Cb.displayName=Qp;var jb="ToastViewport",s_=["F8"],em="toast.viewportPause",tm="toast.viewportResume",Eb=b.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=s_,label:s="Notifications ({hotkey})",...a}=e,o=fd(jb,n),l=t_(n),c=b.useRef(null),d=b.useRef(null),h=b.useRef(null),f=b.useRef(null),p=mt(t,f,o.onViewportChange),m=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=o.toastCount>0;b.useEffect(()=>{const S=w=>{var x;r.length!==0&&r.every(k=>w[k]||w.code===k)&&((x=f.current)==null||x.focus())};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[r]),b.useEffect(()=>{const S=c.current,w=f.current;if(y&&S&&w){const v=()=>{if(!o.isClosePausedRef.current){const C=new CustomEvent(em);w.dispatchEvent(C),o.isClosePausedRef.current=!0}},x=()=>{if(o.isClosePausedRef.current){const C=new CustomEvent(tm);w.dispatchEvent(C),o.isClosePausedRef.current=!1}},k=C=>{!S.contains(C.relatedTarget)&&x()},j=()=>{S.contains(document.activeElement)||x()};return S.addEventListener("focusin",v),S.addEventListener("focusout",k),S.addEventListener("pointermove",v),S.addEventListener("pointerleave",j),window.addEventListener("blur",v),window.addEventListener("focus",x),()=>{S.removeEventListener("focusin",v),S.removeEventListener("focusout",k),S.removeEventListener("pointermove",v),S.removeEventListener("pointerleave",j),window.removeEventListener("blur",v),window.removeEventListener("focus",x)}}},[y,o.isClosePausedRef]);const g=b.useCallback(({tabbingDirection:S})=>{const v=l().map(x=>{const k=x.ref.current,j=[k,...y_(k)];return S==="forwards"?j:j.reverse()});return(S==="forwards"?v.reverse():v).flat()},[l]);return b.useEffect(()=>{const S=f.current;if(S){const w=v=>{var j,C,T;const x=v.altKey||v.ctrlKey||v.metaKey;if(v.key==="Tab"&&!x){const P=document.activeElement,_=v.shiftKey;if(v.target===S&&_){(j=d.current)==null||j.focus();return}const A=g({tabbingDirection:_?"backwards":"forwards"}),z=A.findIndex(D=>D===P);Sh(A.slice(z+1))?v.preventDefault():_?(C=d.current)==null||C.focus():(T=h.current)==null||T.focus()}};return S.addEventListener("keydown",w),()=>S.removeEventListener("keydown",w)}},[l,g]),i.jsxs(HN,{ref:c,role:"region","aria-label":s.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&i.jsx(nm,{ref:d,onFocusFromOutsideViewport:()=>{const S=g({tabbingDirection:"forwards"});Sh(S)}}),i.jsx(Yp.Slot,{scope:n,children:i.jsx(_e.ol,{tabIndex:-1,...a,ref:p})}),y&&i.jsx(nm,{ref:h,onFocusFromOutsideViewport:()=>{const S=g({tabbingDirection:"backwards"});Sh(S)}})]})});Eb.displayName=jb;var Nb="ToastFocusProxy",nm=b.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=e,a=fd(Nb,n);return i.jsx(hd,{"aria-hidden":!0,tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:o=>{var d;const l=o.relatedTarget;!((d=a.viewport)!=null&&d.contains(l))&&r()}})});nm.displayName=Nb;var Pl="Toast",a_="toast.swipeStart",o_="toast.swipeMove",i_="toast.swipeCancel",l_="toast.swipeEnd",_b=b.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:a,...o}=e,[l,c]=Bo({prop:r,defaultProp:s??!0,onChange:a,caller:Pl});return i.jsx(Sa,{present:n||l,children:i.jsx(d_,{open:l,...o,ref:t,onClose:()=>c(!1),onPause:vr(e.onPause),onResume:vr(e.onResume),onSwipeStart:Ae(e.onSwipeStart,d=>{d.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Ae(e.onSwipeMove,d=>{const{x:h,y:f}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","move"),d.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${h}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:Ae(e.onSwipeCancel,d=>{d.currentTarget.setAttribute("data-swipe","cancel"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Ae(e.onSwipeEnd,d=>{const{x:h,y:f}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","end"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${h}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),c(!1)})})})});_b.displayName=Pl;var[c_,u_]=kb(Pl,{onClose(){}}),d_=b.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:s,open:a,onClose:o,onEscapeKeyDown:l,onPause:c,onResume:d,onSwipeStart:h,onSwipeMove:f,onSwipeCancel:p,onSwipeEnd:m,...y}=e,g=fd(Pl,n),[S,w]=b.useState(null),v=mt(t,D=>w(D)),x=b.useRef(null),k=b.useRef(null),j=s||g.duration,C=b.useRef(0),T=b.useRef(j),P=b.useRef(0),{onToastAdd:_,onToastRemove:R}=g,I=vr(()=>{var F;(S==null?void 0:S.contains(document.activeElement))&&((F=g.viewport)==null||F.focus()),o()}),A=b.useCallback(D=>{!D||D===1/0||(window.clearTimeout(P.current),C.current=new Date().getTime(),P.current=window.setTimeout(I,D))},[I]);b.useEffect(()=>{const D=g.viewport;if(D){const F=()=>{A(T.current),d==null||d()},G=()=>{const W=new Date().getTime()-C.current;T.current=T.current-W,window.clearTimeout(P.current),c==null||c()};return D.addEventListener(em,G),D.addEventListener(tm,F),()=>{D.removeEventListener(em,G),D.removeEventListener(tm,F)}}},[g.viewport,j,c,d,A]),b.useEffect(()=>{a&&!g.isClosePausedRef.current&&A(j)},[a,j,g.isClosePausedRef,A]),b.useEffect(()=>(_(),()=>R()),[_,R]);const z=b.useMemo(()=>S?Mb(S):null,[S]);return g.viewport?i.jsxs(i.Fragment,{children:[z&&i.jsx(h_,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:z}),i.jsx(c_,{scope:n,onClose:I,children:Tl.createPortal(i.jsx(Yp.ItemSlot,{scope:n,children:i.jsx(VN,{asChild:!0,onEscapeKeyDown:Ae(l,()=>{g.isFocusedToastEscapeKeyDownRef.current||I(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:i.jsx(_e.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":a?"open":"closed","data-swipe-direction":g.swipeDirection,...y,ref:v,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Ae(e.onKeyDown,D=>{D.key==="Escape"&&(l==null||l(D.nativeEvent),D.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,I()))}),onPointerDown:Ae(e.onPointerDown,D=>{D.button===0&&(x.current={x:D.clientX,y:D.clientY})}),onPointerMove:Ae(e.onPointerMove,D=>{if(!x.current)return;const F=D.clientX-x.current.x,G=D.clientY-x.current.y,W=!!k.current,M=["left","right"].includes(g.swipeDirection),$=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,E=M?$(0,F):0,Y=M?0:$(0,G),X=D.pointerType==="touch"?10:2,N={x:E,y:Y},te={originalEvent:D,delta:N};W?(k.current=N,ic(o_,f,te,{discrete:!1})):py(N,g.swipeDirection,X)?(k.current=N,ic(a_,h,te,{discrete:!1}),D.target.setPointerCapture(D.pointerId)):(Math.abs(F)>X||Math.abs(G)>X)&&(x.current=null)}),onPointerUp:Ae(e.onPointerUp,D=>{const F=k.current,G=D.target;if(G.hasPointerCapture(D.pointerId)&&G.releasePointerCapture(D.pointerId),k.current=null,x.current=null,F){const W=D.currentTarget,M={originalEvent:D,delta:F};py(F,g.swipeDirection,g.swipeThreshold)?ic(l_,m,M,{discrete:!0}):ic(i_,p,M,{discrete:!0}),W.addEventListener("click",$=>$.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),h_=e=>{const{__scopeToast:t,children:n,...r}=e,s=fd(Pl,t),[a,o]=b.useState(!1),[l,c]=b.useState(!1);return p_(()=>o(!0)),b.useEffect(()=>{const d=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(d)},[]),l?null:i.jsx(Jp,{asChild:!0,children:i.jsx(hd,{...r,children:a&&i.jsxs(i.Fragment,{children:[s.label," ",n]})})})},f_="ToastTitle",Tb=b.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return i.jsx(_e.div,{...r,ref:t})});Tb.displayName=f_;var m_="ToastDescription",Pb=b.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return i.jsx(_e.div,{...r,ref:t})});Pb.displayName=m_;var Ab="ToastAction",Rb=b.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?i.jsx(Ob,{altText:n,asChild:!0,children:i.jsx(Zp,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Ab}\`. Expected non-empty \`string\`.`),null)});Rb.displayName=Ab;var Ib="ToastClose",Zp=b.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,s=u_(Ib,n);return i.jsx(Ob,{asChild:!0,children:i.jsx(_e.button,{type:"button",...r,ref:t,onClick:Ae(e.onClick,s.onClose)})})});Zp.displayName=Ib;var Ob=b.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...s}=e;return i.jsx(_e.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:t})});function Mb(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),g_(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",a=r.dataset.radixToastAnnounceExclude==="";if(!s)if(a){const o=r.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...Mb(r))}}),t}function ic(e,t,n,{discrete:r}){const s=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?vb(s,a):s.dispatchEvent(a)}var py=(e,t,n=0)=>{const r=Math.abs(e.x),s=Math.abs(e.y),a=r>s;return t==="left"||t==="right"?a&&r>n:!a&&s>n};function p_(e=()=>{}){const t=vr(e);br(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function g_(e){return e.nodeType===e.ELEMENT_NODE}function y_(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Sh(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var x_=Cb,Lb=Eb,Db=_b,Fb=Tb,$b=Pb,Bb=Rb,Ub=Zp;function zb(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;ttypeof e=="boolean"?`${e}`:e===0?"0":e,yy=Vb,Uo=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return yy(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:a}=t,o=Object.keys(s).map(d=>{const h=n==null?void 0:n[d],f=a==null?void 0:a[d];if(h===null)return null;const p=gy(h)||gy(f);return s[d][p]}),l=n&&Object.entries(n).reduce((d,h)=>{let[f,p]=h;return p===void 0||(d[f]=p),d},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,h)=>{let{class:f,className:p,...m}=h;return Object.entries(m).every(y=>{let[g,S]=y;return Array.isArray(S)?S.includes({...a,...l}[g]):{...a,...l}[g]===S})?[...d,f,p]:d},[]);return yy(e,o,c,n==null?void 0:n.class,n==null?void 0:n.className)};/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const v_=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Hb=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var b_={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"};/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const w_=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:a,iconNode:o,...l},c)=>b.createElement("svg",{ref:c,...b_,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Hb("lucide",s),...l},[...o.map(([d,h])=>b.createElement(d,h)),...Array.isArray(a)?a:[a]]));/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const K=(e,t)=>{const n=b.forwardRef(({className:r,...s},a)=>b.createElement(w_,{ref:a,iconNode:t,className:Hb(`lucide-${v_(e)}`,r),...s}));return n.displayName=`${e}`,n};/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const S_=K("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const k_=K("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const C_=K("Award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const j_=K("Banknote",[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M6 12h.01M18 12h.01",key:"113zkx"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const E_=K("Car",[["path",{d:"M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2",key:"5owen"}],["circle",{cx:"7",cy:"17",r:"2",key:"u2ysq9"}],["path",{d:"M9 17h6",key:"r8uit2"}],["circle",{cx:"17",cy:"17",r:"2",key:"axvx0g"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Vt=K("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ur=K("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const N_=K("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Su=K("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const qb=K("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const rm=K("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const an=K("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const __=K("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ns=K("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const nl=K("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const eg=K("Droplets",[["path",{d:"M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z",key:"1ptgy4"}],["path",{d:"M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97",key:"1sl1rz"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Gb=K("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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const T_=K("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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const xy=K("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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const vy=K("FileCheck",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m9 15 2 2 4-4",key:"1grp1n"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const md=K("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const P_=K("FileX",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m14.5 12.5-5 5",key:"b62r18"}],["path",{d:"m9.5 12.5 5 5",key:"1rk7el"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const by=K("Gift",[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const A_=K("Grip",[["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"19",cy:"5",r:"1",key:"w8mnmm"}],["circle",{cx:"5",cy:"5",r:"1",key:"lttvr7"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}],["circle",{cx:"19",cy:"19",r:"1",key:"shf9b7"}],["circle",{cx:"5",cy:"19",r:"1",key:"bfqh0e"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Wb=K("Headphones",[["path",{d:"M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3",key:"1xhozi"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Kb=K("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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const R_=K("Instagram",[["rect",{width:"20",height:"20",x:"2",y:"2",rx:"5",ry:"5",key:"2e1cvw"}],["path",{d:"M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z",key:"9exkf1"}],["line",{x1:"17.5",x2:"17.51",y1:"6.5",y2:"6.5",key:"r4j83e"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const I_=K("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const O_=K("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const M_=K("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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const L_=K("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Wt=K("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ls=K("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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const D_=K("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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ku=K("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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Al=K("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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const F_=K("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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Cu=K("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const tg=K("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const $_=K("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const B_=K("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ju=K("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const U_=K("Receipt",[["path",{d:"M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z",key:"q3az6g"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 17.5v-11",key:"1jc1ny"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const z_=K("RefreshCcw",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const V_=K("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ng=K("Ruler",[["path",{d:"M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z",key:"icamh8"}],["path",{d:"m14.5 12.5 2-2",key:"inckbg"}],["path",{d:"m11.5 9.5 2-2",key:"fmmyf7"}],["path",{d:"m8.5 6.5 2-2",key:"vc6u1g"}],["path",{d:"m17.5 15.5 2-2",key:"wo5hmg"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ai=K("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Xb=K("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const jr=K("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const $r=K("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const wy=K("ShoppingBag",[["path",{d:"M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z",key:"hou9p0"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const H_=K("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const q_=K("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Jb=K("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const G_=K("SprayCan",[["path",{d:"M3 3h.01",key:"159qn6"}],["path",{d:"M7 5h.01",key:"1hq22a"}],["path",{d:"M11 7h.01",key:"1osv80"}],["path",{d:"M3 7h.01",key:"1xzrh3"}],["path",{d:"M7 9h.01",key:"19b3jx"}],["path",{d:"M3 11h.01",key:"1eifu7"}],["rect",{width:"4",height:"4",x:"15",y:"5",key:"mri9e4"}],["path",{d:"m19 9 2 2v10c0 .6-.4 1-1 1h-6c-.6 0-1-.4-1-1V11l2-2",key:"aib6hk"}],["path",{d:"m13 14 8-2",key:"1d7bmk"}],["path",{d:"m13 19 8-2",key:"1y2vml"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const W_=K("StarHalf",[["path",{d:"M12 18.338a2.1 2.1 0 0 0-.987.244L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.12 2.12 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.12 2.12 0 0 0 1.597-1.16l2.309-4.679A.53.53 0 0 1 12 2",key:"2ksp49"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const wr=K("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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Sy=K("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ky=K("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Qb=K("ThumbsUp",[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const K_=K("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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const X_=K("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const dn=K("Truck",[["path",{d:"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2",key:"wrbu53"}],["path",{d:"M15 18H9",key:"1lyqi6"}],["path",{d:"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14",key:"lysw3i"}],["circle",{cx:"17",cy:"18",r:"2",key:"332jqn"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const J_=K("Twitter",[["path",{d:"M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z",key:"pff0z6"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const rl=K("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Q_=K("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Y_=K("Wallet",[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Rl=K("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Sr=K("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Yb=K("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"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Z_=K("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"}]]),rg="-",eT=e=>{const t=nT(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const l=o.split(rg);return l[0]===""&&l.length!==1&&l.shift(),Zb(l,t)||tT(o)},getConflictingClassGroupIds:(o,l)=>{const c=n[o]||[];return l&&r[o]?[...c,...r[o]]:c}}},Zb=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?Zb(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const a=e.join(rg);return(o=t.validators.find(({validator:l})=>l(a)))==null?void 0:o.classGroupId},Cy=/^\[(.+)\]$/,tT=e=>{if(Cy.test(e)){const t=Cy.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},nT=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return sT(Object.entries(e.classGroups),n).forEach(([a,o])=>{sm(o,r,a,t)}),r},sm=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const a=s===""?t:jy(t,s);a.classGroupId=n;return}if(typeof s=="function"){if(rT(s)){sm(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([a,o])=>{sm(o,jy(t,a),n,r)})})},jy=(e,t)=>{let n=e;return t.split(rg).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},rT=e=>e.isThemeGetter,sT=(e,t)=>t?e.map(([n,r])=>{const s=r.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([o,l])=>[t+o,l])):a);return[n,s]}):e,aT=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(a,o)=>{n.set(a,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(a){let o=n.get(a);if(o!==void 0)return o;if((o=r.get(a))!==void 0)return s(a,o),o},set(a,o){n.has(a)?n.set(a,o):s(a,o)}}},ew="!",oT=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],a=t.length,o=l=>{const c=[];let d=0,h=0,f;for(let S=0;Sh?f-h:void 0;return{modifiers:c,hasImportantModifier:m,baseClassName:y,maybePostfixModifierPosition:g}};return n?l=>n({className:l,parseClassName:o}):o},iT=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},lT=e=>({cache:aT(e.cacheSize),parseClassName:oT(e),...eT(e)}),cT=/\s+/,uT=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,a=[],o=e.trim().split(cT);let l="";for(let c=o.length-1;c>=0;c-=1){const d=o[c],{modifiers:h,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(d);let y=!!m,g=r(y?p.substring(0,m):p);if(!g){if(!y){l=d+(l.length>0?" "+l:l);continue}if(g=r(p),!g){l=d+(l.length>0?" "+l:l);continue}y=!1}const S=iT(h).join(":"),w=f?S+ew:S,v=w+g;if(a.includes(v))continue;a.push(v);const x=s(g,y);for(let k=0;k0?" "+l:l)}return l};function dT(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rf(h),e());return n=lT(d),r=n.cache.get,s=n.cache.set,a=l,l(c)}function l(c){const d=r(c);if(d)return d;const h=uT(c,n);return s(c,h),h}return function(){return a(dT.apply(null,arguments))}}const Oe=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},nw=/^\[(?:([a-z-]+):)?(.+)\]$/i,fT=/^\d+\/\d+$/,mT=new Set(["px","full","screen"]),pT=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,gT=/\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$/,yT=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,xT=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,vT=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Pr=e=>uo(e)||mT.has(e)||fT.test(e),Zr=e=>zo(e,"length",NT),uo=e=>!!e&&!Number.isNaN(Number(e)),kh=e=>zo(e,"number",uo),li=e=>!!e&&Number.isInteger(Number(e)),bT=e=>e.endsWith("%")&&uo(e.slice(0,-1)),de=e=>nw.test(e),es=e=>pT.test(e),wT=new Set(["length","size","percentage"]),ST=e=>zo(e,wT,rw),kT=e=>zo(e,"position",rw),CT=new Set(["image","url"]),jT=e=>zo(e,CT,TT),ET=e=>zo(e,"",_T),ci=()=>!0,zo=(e,t,n)=>{const r=nw.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},NT=e=>gT.test(e)&&!yT.test(e),rw=()=>!1,_T=e=>xT.test(e),TT=e=>vT.test(e),PT=()=>{const e=Oe("colors"),t=Oe("spacing"),n=Oe("blur"),r=Oe("brightness"),s=Oe("borderColor"),a=Oe("borderRadius"),o=Oe("borderSpacing"),l=Oe("borderWidth"),c=Oe("contrast"),d=Oe("grayscale"),h=Oe("hueRotate"),f=Oe("invert"),p=Oe("gap"),m=Oe("gradientColorStops"),y=Oe("gradientColorStopPositions"),g=Oe("inset"),S=Oe("margin"),w=Oe("opacity"),v=Oe("padding"),x=Oe("saturate"),k=Oe("scale"),j=Oe("sepia"),C=Oe("skew"),T=Oe("space"),P=Oe("translate"),_=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto",de,t],A=()=>[de,t],z=()=>["",Pr,Zr],D=()=>["auto",uo,de],F=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],G=()=>["solid","dashed","dotted","double","none"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],M=()=>["start","end","center","between","around","evenly","stretch"],$=()=>["","0",de],E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Y=()=>[uo,de];return{cacheSize:500,separator:":",theme:{colors:[ci],spacing:[Pr,Zr],blur:["none","",es,de],brightness:Y(),borderColor:[e],borderRadius:["none","","full",es,de],borderSpacing:A(),borderWidth:z(),contrast:Y(),grayscale:$(),hueRotate:Y(),invert:$(),gap:A(),gradientColorStops:[e],gradientColorStopPositions:[bT,Zr],inset:I(),margin:I(),opacity:Y(),padding:A(),saturate:Y(),scale:Y(),sepia:$(),skew:Y(),space:A(),translate:A()},classGroups:{aspect:[{aspect:["auto","square","video",de]}],container:["container"],columns:[{columns:[es]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"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:[...F(),de]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],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",li,de]}],basis:[{basis:I()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",de]}],grow:[{grow:$()}],shrink:[{shrink:$()}],order:[{order:["first","last","none",li,de]}],"grid-cols":[{"grid-cols":[ci]}],"col-start-end":[{col:["auto",{span:["full",li,de]},de]}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":[ci]}],"row-start-end":[{row:["auto",{span:[li,de]},de]}],"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",de]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",de]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...M()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...M(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...M(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[S]}],mx:[{mx:[S]}],my:[{my:[S]}],ms:[{ms:[S]}],me:[{me:[S]}],mt:[{mt:[S]}],mr:[{mr:[S]}],mb:[{mb:[S]}],ml:[{ml:[S]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",de,t]}],"min-w":[{"min-w":[de,t,"min","max","fit"]}],"max-w":[{"max-w":[de,t,"none","full","min","max","fit","prose",{screen:[es]},es]}],h:[{h:[de,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[de,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[de,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[de,t,"auto","min","max","fit"]}],"font-size":[{text:["base",es,Zr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",kh]}],"font-family":[{font:[ci]}],"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",de]}],"line-clamp":[{"line-clamp":["none",uo,kh]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Pr,de]}],"list-image":[{"list-image":["none",de]}],"list-style-type":[{list:["none","disc","decimal",de]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...G(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Pr,Zr]}],"underline-offset":[{"underline-offset":["auto",Pr,de]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",de]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",de]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...F(),kT]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",ST]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},jT]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"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":[w]}],"border-style":[{border:[...G(),"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":[w]}],"divide-style":[{divide:G()}],"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:["",...G()]}],"outline-offset":[{"outline-offset":[Pr,de]}],"outline-w":[{outline:[Pr,Zr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[Pr,Zr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",es,ET]}],"shadow-color":[{shadow:[ci]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...W(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",es,de]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[f]}],saturate:[{saturate:[x]}],sepia:[{sepia:[j]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[j]}],"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",de]}],duration:[{duration:Y()}],ease:[{ease:["linear","in","out","in-out",de]}],delay:[{delay:Y()}],animate:[{animate:["none","spin","ping","pulse","bounce",de]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[k]}],"scale-x":[{"scale-x":[k]}],"scale-y":[{"scale-y":[k]}],rotate:[{rotate:[li,de]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",de]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",de]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"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"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",de]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Pr,Zr,kh]}],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"]}}},AT=hT(PT);function Z(...e){return AT(Vb(e))}const RT=x_,sw=b.forwardRef(({className:e,...t},n)=>i.jsx(Lb,{ref:n,className:Z("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}));sw.displayName=Lb.displayName;const IT=Uo("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"}}),aw=b.forwardRef(({className:e,variant:t,...n},r)=>i.jsx(Db,{ref:r,className:Z(IT({variant:t}),e),...n}));aw.displayName=Db.displayName;const OT=b.forwardRef(({className:e,...t},n)=>i.jsx(Bb,{ref:n,className:Z("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}));OT.displayName=Bb.displayName;const ow=b.forwardRef(({className:e,...t},n)=>i.jsx(Ub,{ref:n,className:Z("absolute right-2 top-2 rounded-md p-1 text-foreground/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:i.jsx(Sr,{className:"h-4 w-4"})}));ow.displayName=Ub.displayName;const iw=b.forwardRef(({className:e,...t},n)=>i.jsx(Fb,{ref:n,className:Z("text-sm font-semibold",e),...t}));iw.displayName=Fb.displayName;const lw=b.forwardRef(({className:e,...t},n)=>i.jsx($b,{ref:n,className:Z("text-sm opacity-90",e),...t}));lw.displayName=$b.displayName;function MT(){const{toasts:e}=NN();return i.jsxs(RT,{children:[e.map(function({id:t,title:n,description:r,action:s,...a}){return i.jsxs(aw,{...a,children:[i.jsxs("div",{className:"grid gap-1",children:[n&&i.jsx(iw,{children:n}),r&&i.jsx(lw,{children:r})]}),s,i.jsx(ow,{})]},t)}),i.jsx(sw,{})]})}var Ey=["light","dark"],LT="(prefers-color-scheme: dark)",DT=b.createContext(void 0),FT={setTheme:e=>{},themes:[]},$T=()=>{var e;return(e=b.useContext(DT))!=null?e:FT};b.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:s,defaultTheme:a,value:o,attrs:l,nonce:c})=>{let d=a==="system",h=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${l.map(y=>`'${y}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,f=s?Ey.includes(a)&&a?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${a}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",p=(y,g=!1,S=!0)=>{let w=o?o[y]:y,v=g?y+"|| ''":`'${w}'`,x="";return s&&S&&!g&&Ey.includes(y)&&(x+=`d.style.colorScheme = '${y}';`),n==="class"?g||w?x+=`c.add(${v})`:x+="null":w&&(x+=`d[s](n,${v})`),x},m=e?`!function(){${h}${p(e)}}()`:r?`!function(){try{${h}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${d})){var t='${LT}',m=window.matchMedia(t);if(m.media!==t||m.matches){${p("dark")}}else{${p("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${p(o?"x[e]":"e",!0)}}${d?"":"else{"+p(a,!1,!1)+"}"}${f}}catch(e){}}()`:`!function(){try{${h}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${p(o?"x[e]":"e",!0)}}else{${p(a,!1,!1)};}${f}}catch(t){}}();`;return b.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:m}})});var BT=e=>{switch(e){case"success":return VT;case"info":return qT;case"warning":return HT;case"error":return GT;default:return null}},UT=Array(12).fill(0),zT=({visible:e,className:t})=>U.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},U.createElement("div",{className:"sonner-spinner"},UT.map((n,r)=>U.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),VT=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},U.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),HT=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},U.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),qT=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},U.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),GT=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},U.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),WT=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},U.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),U.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),KT=()=>{let[e,t]=U.useState(document.hidden);return U.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},am=1,XT=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,s=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:am++,a=this.toasts.find(l=>l.id===s),o=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),a?this.toasts=this.toasts.map(l=>l.id===s?(this.publish({...l,...e,id:s,title:n}),{...l,...e,id:s,dismissible:o,title:n}):l):this.addToast({title:n,...r,dismissible:o,id:s}),s},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),s=n!==void 0,a,o=r.then(async c=>{if(a=["resolve",c],U.isValidElement(c))s=!1,this.create({id:n,type:"default",message:c});else if(QT(c)&&!c.ok){s=!1;let d=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,h=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:n,type:"error",message:d,description:h})}else if(t.success!==void 0){s=!1;let d=typeof t.success=="function"?await t.success(c):t.success,h=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"success",message:d,description:h})}}).catch(async c=>{if(a=["reject",c],t.error!==void 0){s=!1;let d=typeof t.error=="function"?await t.error(c):t.error,h=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"error",message:d,description:h})}}).finally(()=>{var c;s&&(this.dismiss(n),n=void 0),(c=t.finally)==null||c.call(t)}),l=()=>new Promise((c,d)=>o.then(()=>a[0]==="reject"?d(a[1]):c(a[1])).catch(d));return typeof n!="string"&&typeof n!="number"?{unwrap:l}:Object.assign(n,{unwrap:l})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||am++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},$t=new XT,JT=(e,t)=>{let n=(t==null?void 0:t.id)||am++;return $t.addToast({title:e,...t,id:n}),n},QT=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",YT=JT,ZT=()=>$t.toasts,eP=()=>$t.getActiveToasts(),ve=Object.assign(YT,{success:$t.success,info:$t.info,warning:$t.warning,error:$t.error,custom:$t.custom,message:$t.message,promise:$t.promise,dismiss:$t.dismiss,loading:$t.loading},{getHistory:ZT,getToasts:eP});function tP(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}tP(`: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;left: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}: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%);--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%)} `);function lc(e){return e.label!==void 0}var nP=3,rP="32px",sP="16px",Ny=4e3,aP=356,oP=14,iP=20,lP=200;function On(...e){return e.filter(Boolean).join(" ")}function cP(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var uP=e=>{var t,n,r,s,a,o,l,c,d,h,f;let{invert:p,toast:m,unstyled:y,interacting:g,setHeights:S,visibleToasts:w,heights:v,index:x,toasts:k,expanded:j,removeToast:C,defaultRichColors:T,closeButton:P,style:_,cancelButtonStyle:R,actionButtonStyle:I,className:A="",descriptionClassName:z="",duration:D,position:F,gap:G,loadingIcon:W,expandByDefault:M,classNames:$,icons:E,closeButtonAriaLabel:Y="Close toast",pauseWhenPageIsHidden:X}=e,[N,te]=U.useState(null),[ke,fe]=U.useState(null),[me,it]=U.useState(!1),[Je,pt]=U.useState(!1),[rt,Qn]=U.useState(!1),[Qt,Nr]=U.useState(!1),[Rt,_r]=U.useState(!1),[Qr,Tn]=U.useState(0),[It,Yn]=U.useState(0),Pn=U.useRef(m.duration||D||Ny),Vs=U.useRef(null),An=U.useRef(null),gn=x===0,Zo=x+1<=w,L=m.type,O=m.dismissible!==!1,re=m.className||"",pe=m.descriptionClassName||"",le=U.useMemo(()=>v.findIndex(ie=>ie.toastId===m.id)||0,[v,m.id]),kt=U.useMemo(()=>{var ie;return(ie=m.closeButton)!=null?ie:P},[m.closeButton,P]),yn=U.useMemo(()=>m.duration||D||Ny,[m.duration,D]),Ct=U.useRef(0),Ot=U.useRef(0),Zn=U.useRef(0),$e=U.useRef(null),[er,V]=F.split("-"),ue=U.useMemo(()=>v.reduce((ie,Ce,Ne)=>Ne>=le?ie:ie+Ce.height,0),[v,le]),xe=KT(),Ke=m.invert||p,tr=L==="loading";Ot.current=U.useMemo(()=>le*G+ue,[le,ue]),U.useEffect(()=>{Pn.current=yn},[yn]),U.useEffect(()=>{it(!0)},[]),U.useEffect(()=>{let ie=An.current;if(ie){let Ce=ie.getBoundingClientRect().height;return Yn(Ce),S(Ne=>[{toastId:m.id,height:Ce,position:m.position},...Ne]),()=>S(Ne=>Ne.filter(Mt=>Mt.toastId!==m.id))}},[S,m.id]),U.useLayoutEffect(()=>{if(!me)return;let ie=An.current,Ce=ie.style.height;ie.style.height="auto";let Ne=ie.getBoundingClientRect().height;ie.style.height=Ce,Yn(Ne),S(Mt=>Mt.find(Zt=>Zt.toastId===m.id)?Mt.map(Zt=>Zt.toastId===m.id?{...Zt,height:Ne}:Zt):[{toastId:m.id,height:Ne,position:m.position},...Mt])},[me,m.title,m.description,S,m.id]);let Yt=U.useCallback(()=>{pt(!0),Tn(Ot.current),S(ie=>ie.filter(Ce=>Ce.toastId!==m.id)),setTimeout(()=>{C(m)},lP)},[m,C,S,Ot]);U.useEffect(()=>{if(m.promise&&L==="loading"||m.duration===1/0||m.type==="loading")return;let ie;return j||g||X&&xe?(()=>{if(Zn.current{var Ce;(Ce=m.onAutoClose)==null||Ce.call(m,m),Yt()},Pn.current)),()=>clearTimeout(ie)},[j,g,m,L,X,xe,Yt]),U.useEffect(()=>{m.delete&&Yt()},[Yt,m.delete]);function Ca(){var ie,Ce,Ne;return E!=null&&E.loading?U.createElement("div",{className:On($==null?void 0:$.loader,(ie=m==null?void 0:m.classNames)==null?void 0:ie.loader,"sonner-loader"),"data-visible":L==="loading"},E.loading):W?U.createElement("div",{className:On($==null?void 0:$.loader,(Ce=m==null?void 0:m.classNames)==null?void 0:Ce.loader,"sonner-loader"),"data-visible":L==="loading"},W):U.createElement(zT,{className:On($==null?void 0:$.loader,(Ne=m==null?void 0:m.classNames)==null?void 0:Ne.loader),visible:L==="loading"})}return U.createElement("li",{tabIndex:0,ref:An,className:On(A,re,$==null?void 0:$.toast,(t=m==null?void 0:m.classNames)==null?void 0:t.toast,$==null?void 0:$.default,$==null?void 0:$[L],(n=m==null?void 0:m.classNames)==null?void 0:n[L]),"data-sonner-toast":"","data-rich-colors":(r=m.richColors)!=null?r:T,"data-styled":!(m.jsx||m.unstyled||y),"data-mounted":me,"data-promise":!!m.promise,"data-swiped":Rt,"data-removed":Je,"data-visible":Zo,"data-y-position":er,"data-x-position":V,"data-index":x,"data-front":gn,"data-swiping":rt,"data-dismissible":O,"data-type":L,"data-invert":Ke,"data-swipe-out":Qt,"data-swipe-direction":ke,"data-expanded":!!(j||M&&me),style:{"--index":x,"--toasts-before":x,"--z-index":k.length-x,"--offset":`${Je?Qr:Ot.current}px`,"--initial-height":M?"auto":`${It}px`,..._,...m.style},onDragEnd:()=>{Qn(!1),te(null),$e.current=null},onPointerDown:ie=>{tr||!O||(Vs.current=new Date,Tn(Ot.current),ie.target.setPointerCapture(ie.pointerId),ie.target.tagName!=="BUTTON"&&(Qn(!0),$e.current={x:ie.clientX,y:ie.clientY}))},onPointerUp:()=>{var ie,Ce,Ne,Mt;if(Qt||!O)return;$e.current=null;let Zt=Number(((ie=An.current)==null?void 0:ie.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),nr=Number(((Ce=An.current)==null?void 0:Ce.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Tr=new Date().getTime()-((Ne=Vs.current)==null?void 0:Ne.getTime()),Lt=N==="x"?Zt:nr,Rn=Math.abs(Lt)/Tr;if(Math.abs(Lt)>=iP||Rn>.11){Tn(Ot.current),(Mt=m.onDismiss)==null||Mt.call(m,m),fe(N==="x"?Zt>0?"right":"left":nr>0?"down":"up"),Yt(),Nr(!0),_r(!1);return}Qn(!1),te(null)},onPointerMove:ie=>{var Ce,Ne,Mt,Zt;if(!$e.current||!O||((Ce=window.getSelection())==null?void 0:Ce.toString().length)>0)return;let nr=ie.clientY-$e.current.y,Tr=ie.clientX-$e.current.x,Lt=(Ne=e.swipeDirections)!=null?Ne:cP(F);!N&&(Math.abs(Tr)>1||Math.abs(nr)>1)&&te(Math.abs(Tr)>Math.abs(nr)?"x":"y");let Rn={x:0,y:0};N==="y"?(Lt.includes("top")||Lt.includes("bottom"))&&(Lt.includes("top")&&nr<0||Lt.includes("bottom")&&nr>0)&&(Rn.y=nr):N==="x"&&(Lt.includes("left")||Lt.includes("right"))&&(Lt.includes("left")&&Tr<0||Lt.includes("right")&&Tr>0)&&(Rn.x=Tr),(Math.abs(Rn.x)>0||Math.abs(Rn.y)>0)&&_r(!0),(Mt=An.current)==null||Mt.style.setProperty("--swipe-amount-x",`${Rn.x}px`),(Zt=An.current)==null||Zt.style.setProperty("--swipe-amount-y",`${Rn.y}px`)}},kt&&!m.jsx?U.createElement("button",{"aria-label":Y,"data-disabled":tr,"data-close-button":!0,onClick:tr||!O?()=>{}:()=>{var ie;Yt(),(ie=m.onDismiss)==null||ie.call(m,m)},className:On($==null?void 0:$.closeButton,(s=m==null?void 0:m.classNames)==null?void 0:s.closeButton)},(a=E==null?void 0:E.close)!=null?a:WT):null,m.jsx||b.isValidElement(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:U.createElement(U.Fragment,null,L||m.icon||m.promise?U.createElement("div",{"data-icon":"",className:On($==null?void 0:$.icon,(o=m==null?void 0:m.classNames)==null?void 0:o.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||Ca():null,m.type!=="loading"?m.icon||(E==null?void 0:E[L])||BT(L):null):null,U.createElement("div",{"data-content":"",className:On($==null?void 0:$.content,(l=m==null?void 0:m.classNames)==null?void 0:l.content)},U.createElement("div",{"data-title":"",className:On($==null?void 0:$.title,(c=m==null?void 0:m.classNames)==null?void 0:c.title)},typeof m.title=="function"?m.title():m.title),m.description?U.createElement("div",{"data-description":"",className:On(z,pe,$==null?void 0:$.description,(d=m==null?void 0:m.classNames)==null?void 0:d.description)},typeof m.description=="function"?m.description():m.description):null),b.isValidElement(m.cancel)?m.cancel:m.cancel&&lc(m.cancel)?U.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||R,onClick:ie=>{var Ce,Ne;lc(m.cancel)&&O&&((Ne=(Ce=m.cancel).onClick)==null||Ne.call(Ce,ie),Yt())},className:On($==null?void 0:$.cancelButton,(h=m==null?void 0:m.classNames)==null?void 0:h.cancelButton)},m.cancel.label):null,b.isValidElement(m.action)?m.action:m.action&&lc(m.action)?U.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||I,onClick:ie=>{var Ce,Ne;lc(m.action)&&((Ne=(Ce=m.action).onClick)==null||Ne.call(Ce,ie),!ie.defaultPrevented&&Yt())},className:On($==null?void 0:$.actionButton,(f=m==null?void 0:m.classNames)==null?void 0:f.actionButton)},m.action.label):null))};function _y(){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 dP(e,t){let n={};return[e,t].forEach((r,s)=>{let a=s===1,o=a?"--mobile-offset":"--offset",l=a?sP:rP;function c(d){["top","right","bottom","left"].forEach(h=>{n[`${o}-${h}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${o}-${d}`]=l:n[`${o}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):c(l)}),n}var hP=b.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:s=["altKey","KeyT"],expand:a,closeButton:o,className:l,offset:c,mobileOffset:d,theme:h="light",richColors:f,duration:p,style:m,visibleToasts:y=nP,toastOptions:g,dir:S=_y(),gap:w=oP,loadingIcon:v,icons:x,containerAriaLabel:k="Notifications",pauseWhenPageIsHidden:j}=e,[C,T]=U.useState([]),P=U.useMemo(()=>Array.from(new Set([r].concat(C.filter(X=>X.position).map(X=>X.position)))),[C,r]),[_,R]=U.useState([]),[I,A]=U.useState(!1),[z,D]=U.useState(!1),[F,G]=U.useState(h!=="system"?h:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),W=U.useRef(null),M=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),$=U.useRef(null),E=U.useRef(!1),Y=U.useCallback(X=>{T(N=>{var te;return(te=N.find(ke=>ke.id===X.id))!=null&&te.delete||$t.dismiss(X.id),N.filter(({id:ke})=>ke!==X.id)})},[]);return U.useEffect(()=>$t.subscribe(X=>{if(X.dismiss){T(N=>N.map(te=>te.id===X.id?{...te,delete:!0}:te));return}setTimeout(()=>{mb.flushSync(()=>{T(N=>{let te=N.findIndex(ke=>ke.id===X.id);return te!==-1?[...N.slice(0,te),{...N[te],...X},...N.slice(te+1)]:[X,...N]})})})}),[]),U.useEffect(()=>{if(h!=="system"){G(h);return}if(h==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?G("dark"):G("light")),typeof window>"u")return;let X=window.matchMedia("(prefers-color-scheme: dark)");try{X.addEventListener("change",({matches:N})=>{G(N?"dark":"light")})}catch{X.addListener(({matches:te})=>{try{G(te?"dark":"light")}catch(ke){console.error(ke)}})}},[h]),U.useEffect(()=>{C.length<=1&&A(!1)},[C]),U.useEffect(()=>{let X=N=>{var te,ke;s.every(fe=>N[fe]||N.code===fe)&&(A(!0),(te=W.current)==null||te.focus()),N.code==="Escape"&&(document.activeElement===W.current||(ke=W.current)!=null&&ke.contains(document.activeElement))&&A(!1)};return document.addEventListener("keydown",X),()=>document.removeEventListener("keydown",X)},[s]),U.useEffect(()=>{if(W.current)return()=>{$.current&&($.current.focus({preventScroll:!0}),$.current=null,E.current=!1)}},[W.current]),U.createElement("section",{ref:t,"aria-label":`${k} ${M}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},P.map((X,N)=>{var te;let[ke,fe]=X.split("-");return C.length?U.createElement("ol",{key:X,dir:S==="auto"?_y():S,tabIndex:-1,ref:W,className:l,"data-sonner-toaster":!0,"data-theme":F,"data-y-position":ke,"data-lifted":I&&C.length>1&&!a,"data-x-position":fe,style:{"--front-toast-height":`${((te=_[0])==null?void 0:te.height)||0}px`,"--width":`${aP}px`,"--gap":`${w}px`,...m,...dP(c,d)},onBlur:me=>{E.current&&!me.currentTarget.contains(me.relatedTarget)&&(E.current=!1,$.current&&($.current.focus({preventScroll:!0}),$.current=null))},onFocus:me=>{me.target instanceof HTMLElement&&me.target.dataset.dismissible==="false"||E.current||(E.current=!0,$.current=me.relatedTarget)},onMouseEnter:()=>A(!0),onMouseMove:()=>A(!0),onMouseLeave:()=>{z||A(!1)},onDragEnd:()=>A(!1),onPointerDown:me=>{me.target instanceof HTMLElement&&me.target.dataset.dismissible==="false"||D(!0)},onPointerUp:()=>D(!1)},C.filter(me=>!me.position&&N===0||me.position===X).map((me,it)=>{var Je,pt;return U.createElement(uP,{key:me.id,icons:x,index:it,toast:me,defaultRichColors:f,duration:(Je=g==null?void 0:g.duration)!=null?Je:p,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:n,visibleToasts:y,closeButton:(pt=g==null?void 0:g.closeButton)!=null?pt:o,interacting:z,position:X,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:Y,toasts:C.filter(rt=>rt.position==me.position),heights:_.filter(rt=>rt.position==me.position),setHeights:R,expandByDefault:a,gap:w,loadingIcon:v,expanded:I,pauseWhenPageIsHidden:j,swipeDirections:e.swipeDirections})})):null}))});const fP=({...e})=>{const{theme:t="system"}=$T();return i.jsx(hP,{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 mP=ap[" useId ".trim().toString()]||(()=>{}),pP=0;function ho(e){const[t,n]=b.useState(mP());return br(()=>{n(r=>r??String(pP++))},[e]),t?`radix-${t}`:""}const gP=["top","right","bottom","left"],As=Math.min,sn=Math.max,Eu=Math.round,cc=Math.floor,xr=e=>({x:e,y:e}),yP={left:"right",right:"left",bottom:"top",top:"bottom"},xP={start:"end",end:"start"};function om(e,t,n){return sn(e,As(t,n))}function Gr(e,t){return typeof e=="function"?e(t):e}function Wr(e){return e.split("-")[0]}function Vo(e){return e.split("-")[1]}function sg(e){return e==="x"?"y":"x"}function ag(e){return e==="y"?"height":"width"}const vP=new Set(["top","bottom"]);function pr(e){return vP.has(Wr(e))?"y":"x"}function og(e){return sg(pr(e))}function bP(e,t,n){n===void 0&&(n=!1);const r=Vo(e),s=og(e),a=ag(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=Nu(o)),[o,Nu(o)]}function wP(e){const t=Nu(e);return[im(e),t,im(t)]}function im(e){return e.replace(/start|end/g,t=>xP[t])}const Ty=["left","right"],Py=["right","left"],SP=["top","bottom"],kP=["bottom","top"];function CP(e,t,n){switch(e){case"top":case"bottom":return n?t?Py:Ty:t?Ty:Py;case"left":case"right":return t?SP:kP;default:return[]}}function jP(e,t,n,r){const s=Vo(e);let a=CP(Wr(e),n==="start",r);return s&&(a=a.map(o=>o+"-"+s),t&&(a=a.concat(a.map(im)))),a}function Nu(e){return e.replace(/left|right|bottom|top/g,t=>yP[t])}function EP(e){return{top:0,right:0,bottom:0,left:0,...e}}function cw(e){return typeof e!="number"?EP(e):{top:e,right:e,bottom:e,left:e}}function _u(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function Ay(e,t,n){let{reference:r,floating:s}=e;const a=pr(t),o=og(t),l=ag(o),c=Wr(t),d=a==="y",h=r.x+r.width/2-s.width/2,f=r.y+r.height/2-s.height/2,p=r[l]/2-s[l]/2;let m;switch(c){case"top":m={x:h,y:r.y-s.height};break;case"bottom":m={x:h,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-s.width,y:f};break;default:m={x:r.x,y:r.y}}switch(Vo(t)){case"start":m[o]-=p*(n&&d?-1:1);break;case"end":m[o]+=p*(n&&d?-1:1);break}return m}const NP=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:a=[],platform:o}=n,l=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let d=await o.getElementRects({reference:e,floating:t,strategy:s}),{x:h,y:f}=Ay(d,r,c),p=r,m={},y=0;for(let g=0;g({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:a,platform:o,elements:l,middlewareData:c}=t,{element:d,padding:h=0}=Gr(e,t)||{};if(d==null)return{};const f=cw(h),p={x:n,y:r},m=og(s),y=ag(m),g=await o.getDimensions(d),S=m==="y",w=S?"top":"left",v=S?"bottom":"right",x=S?"clientHeight":"clientWidth",k=a.reference[y]+a.reference[m]-p[m]-a.floating[y],j=p[m]-a.reference[m],C=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let T=C?C[x]:0;(!T||!await(o.isElement==null?void 0:o.isElement(C)))&&(T=l.floating[x]||a.floating[y]);const P=k/2-j/2,_=T/2-g[y]/2-1,R=As(f[w],_),I=As(f[v],_),A=R,z=T-g[y]-I,D=T/2-g[y]/2+P,F=om(A,D,z),G=!c.arrow&&Vo(s)!=null&&D!==F&&a.reference[y]/2-(DD<=0)){var I,A;const D=(((I=a.flip)==null?void 0:I.index)||0)+1,F=T[D];if(F&&(!(f==="alignment"?v!==pr(F):!1)||R.every(M=>M.overflows[0]>0&&pr(M.placement)===v)))return{data:{index:D,overflows:R},reset:{placement:F}};let G=(A=R.filter(W=>W.overflows[0]<=0).sort((W,M)=>W.overflows[1]-M.overflows[1])[0])==null?void 0:A.placement;if(!G)switch(m){case"bestFit":{var z;const W=(z=R.filter(M=>{if(C){const $=pr(M.placement);return $===v||$==="y"}return!0}).map(M=>[M.placement,M.overflows.filter($=>$>0).reduce(($,E)=>$+E,0)]).sort((M,$)=>M[1]-$[1])[0])==null?void 0:z[0];W&&(G=W);break}case"initialPlacement":G=l;break}if(s!==G)return{reset:{placement:G}}}return{}}}};function Ry(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Iy(e){return gP.some(t=>e[t]>=0)}const PP=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=Gr(e,t);switch(r){case"referenceHidden":{const a=await sl(t,{...s,elementContext:"reference"}),o=Ry(a,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Iy(o)}}}case"escaped":{const a=await sl(t,{...s,altBoundary:!0}),o=Ry(a,n.floating);return{data:{escapedOffsets:o,escaped:Iy(o)}}}default:return{}}}}},uw=new Set(["left","top"]);async function AP(e,t){const{placement:n,platform:r,elements:s}=e,a=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=Wr(n),l=Vo(n),c=pr(n)==="y",d=uw.has(o)?-1:1,h=a&&c?-1:1,f=Gr(t,e);let{mainAxis:p,crossAxis:m,alignmentAxis:y}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof y=="number"&&(m=l==="end"?y*-1:y),c?{x:m*h,y:p*d}:{x:p*d,y:m*h}}const RP=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:a,placement:o,middlewareData:l}=t,c=await AP(t,e);return o===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:a+c.y,data:{...c,placement:o}}}}},IP=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:l={fn:S=>{let{x:w,y:v}=S;return{x:w,y:v}}},...c}=Gr(e,t),d={x:n,y:r},h=await sl(t,c),f=pr(Wr(s)),p=sg(f);let m=d[p],y=d[f];if(a){const S=p==="y"?"top":"left",w=p==="y"?"bottom":"right",v=m+h[S],x=m-h[w];m=om(v,m,x)}if(o){const S=f==="y"?"top":"left",w=f==="y"?"bottom":"right",v=y+h[S],x=y-h[w];y=om(v,y,x)}const g=l.fn({...t,[p]:m,[f]:y});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:a,[f]:o}}}}}},OP=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:a,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=Gr(e,t),h={x:n,y:r},f=pr(s),p=sg(f);let m=h[p],y=h[f];const g=Gr(l,t),S=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const x=p==="y"?"height":"width",k=a.reference[p]-a.floating[x]+S.mainAxis,j=a.reference[p]+a.reference[x]-S.mainAxis;mj&&(m=j)}if(d){var w,v;const x=p==="y"?"width":"height",k=uw.has(Wr(s)),j=a.reference[f]-a.floating[x]+(k&&((w=o.offset)==null?void 0:w[f])||0)+(k?0:S.crossAxis),C=a.reference[f]+a.reference[x]+(k?0:((v=o.offset)==null?void 0:v[f])||0)-(k?S.crossAxis:0);yC&&(y=C)}return{[p]:m,[f]:y}}}},MP=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:a,platform:o,elements:l}=t,{apply:c=()=>{},...d}=Gr(e,t),h=await sl(t,d),f=Wr(s),p=Vo(s),m=pr(s)==="y",{width:y,height:g}=a.floating;let S,w;f==="top"||f==="bottom"?(S=f,w=p===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(w=f,S=p==="end"?"top":"bottom");const v=g-h.top-h.bottom,x=y-h.left-h.right,k=As(g-h[S],v),j=As(y-h[w],x),C=!t.middlewareData.shift;let T=k,P=j;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=v),C&&!p){const R=sn(h.left,0),I=sn(h.right,0),A=sn(h.top,0),z=sn(h.bottom,0);m?P=y-2*(R!==0||I!==0?R+I:sn(h.left,h.right)):T=g-2*(A!==0||z!==0?A+z:sn(h.top,h.bottom))}await c({...t,availableWidth:P,availableHeight:T});const _=await o.getDimensions(l.floating);return y!==_.width||g!==_.height?{reset:{rects:!0}}:{}}}};function pd(){return typeof window<"u"}function Ho(e){return dw(e)?(e.nodeName||"").toLowerCase():"#document"}function hn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Er(e){var t;return(t=(dw(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function dw(e){return pd()?e instanceof Node||e instanceof hn(e).Node:!1}function Wn(e){return pd()?e instanceof Element||e instanceof hn(e).Element:!1}function kr(e){return pd()?e instanceof HTMLElement||e instanceof hn(e).HTMLElement:!1}function Oy(e){return!pd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof hn(e).ShadowRoot}const LP=new Set(["inline","contents"]);function Il(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=Kn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!LP.has(s)}const DP=new Set(["table","td","th"]);function FP(e){return DP.has(Ho(e))}const $P=[":popover-open",":modal"];function gd(e){return $P.some(t=>{try{return e.matches(t)}catch{return!1}})}const BP=["transform","translate","scale","rotate","perspective"],UP=["transform","translate","scale","rotate","perspective","filter"],zP=["paint","layout","strict","content"];function ig(e){const t=lg(),n=Wn(e)?Kn(e):e;return BP.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||UP.some(r=>(n.willChange||"").includes(r))||zP.some(r=>(n.contain||"").includes(r))}function VP(e){let t=Rs(e);for(;kr(t)&&!Io(t);){if(ig(t))return t;if(gd(t))return null;t=Rs(t)}return null}function lg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const HP=new Set(["html","body","#document"]);function Io(e){return HP.has(Ho(e))}function Kn(e){return hn(e).getComputedStyle(e)}function yd(e){return Wn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Rs(e){if(Ho(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Oy(e)&&e.host||Er(e);return Oy(t)?t.host:t}function hw(e){const t=Rs(e);return Io(t)?e.ownerDocument?e.ownerDocument.body:e.body:kr(t)&&Il(t)?t:hw(t)}function al(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=hw(e),a=s===((r=e.ownerDocument)==null?void 0:r.body),o=hn(s);if(a){const l=lm(o);return t.concat(o,o.visualViewport||[],Il(s)?s:[],l&&n?al(l):[])}return t.concat(s,al(s,[],n))}function lm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function fw(e){const t=Kn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=kr(e),a=s?e.offsetWidth:n,o=s?e.offsetHeight:r,l=Eu(n)!==a||Eu(r)!==o;return l&&(n=a,r=o),{width:n,height:r,$:l}}function cg(e){return Wn(e)?e:e.contextElement}function fo(e){const t=cg(e);if(!kr(t))return xr(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:a}=fw(t);let o=(a?Eu(n.width):n.width)/r,l=(a?Eu(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const qP=xr(0);function mw(e){const t=hn(e);return!lg()||!t.visualViewport?qP:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function GP(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==hn(e)?!1:t}function ga(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),a=cg(e);let o=xr(1);t&&(r?Wn(r)&&(o=fo(r)):o=fo(e));const l=GP(a,n,r)?mw(a):xr(0);let c=(s.left+l.x)/o.x,d=(s.top+l.y)/o.y,h=s.width/o.x,f=s.height/o.y;if(a){const p=hn(a),m=r&&Wn(r)?hn(r):r;let y=p,g=lm(y);for(;g&&r&&m!==y;){const S=fo(g),w=g.getBoundingClientRect(),v=Kn(g),x=w.left+(g.clientLeft+parseFloat(v.paddingLeft))*S.x,k=w.top+(g.clientTop+parseFloat(v.paddingTop))*S.y;c*=S.x,d*=S.y,h*=S.x,f*=S.y,c+=x,d+=k,y=hn(g),g=lm(y)}}return _u({width:h,height:f,x:c,y:d})}function ug(e,t){const n=yd(e).scrollLeft;return t?t.left+n:ga(Er(e)).left+n}function pw(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=r.left+t.scrollLeft-(n?0:ug(e,r)),a=r.top+t.scrollTop;return{x:s,y:a}}function WP(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const a=s==="fixed",o=Er(r),l=t?gd(t.floating):!1;if(r===o||l&&a)return n;let c={scrollLeft:0,scrollTop:0},d=xr(1);const h=xr(0),f=kr(r);if((f||!f&&!a)&&((Ho(r)!=="body"||Il(o))&&(c=yd(r)),kr(r))){const m=ga(r);d=fo(r),h.x=m.x+r.clientLeft,h.y=m.y+r.clientTop}const p=o&&!f&&!a?pw(o,c,!0):xr(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+h.x+p.x,y:n.y*d.y-c.scrollTop*d.y+h.y+p.y}}function KP(e){return Array.from(e.getClientRects())}function XP(e){const t=Er(e),n=yd(e),r=e.ownerDocument.body,s=sn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=sn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+ug(e);const l=-n.scrollTop;return Kn(r).direction==="rtl"&&(o+=sn(t.clientWidth,r.clientWidth)-s),{width:s,height:a,x:o,y:l}}function JP(e,t){const n=hn(e),r=Er(e),s=n.visualViewport;let a=r.clientWidth,o=r.clientHeight,l=0,c=0;if(s){a=s.width,o=s.height;const d=lg();(!d||d&&t==="fixed")&&(l=s.offsetLeft,c=s.offsetTop)}return{width:a,height:o,x:l,y:c}}const QP=new Set(["absolute","fixed"]);function YP(e,t){const n=ga(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,a=kr(e)?fo(e):xr(1),o=e.clientWidth*a.x,l=e.clientHeight*a.y,c=s*a.x,d=r*a.y;return{width:o,height:l,x:c,y:d}}function My(e,t,n){let r;if(t==="viewport")r=JP(e,n);else if(t==="document")r=XP(Er(e));else if(Wn(t))r=YP(t,n);else{const s=mw(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return _u(r)}function gw(e,t){const n=Rs(e);return n===t||!Wn(n)||Io(n)?!1:Kn(n).position==="fixed"||gw(n,t)}function ZP(e,t){const n=t.get(e);if(n)return n;let r=al(e,[],!1).filter(l=>Wn(l)&&Ho(l)!=="body"),s=null;const a=Kn(e).position==="fixed";let o=a?Rs(e):e;for(;Wn(o)&&!Io(o);){const l=Kn(o),c=ig(o);!c&&l.position==="fixed"&&(s=null),(a?!c&&!s:!c&&l.position==="static"&&!!s&&QP.has(s.position)||Il(o)&&!c&&gw(e,o))?r=r.filter(h=>h!==o):s=l,o=Rs(o)}return t.set(e,r),r}function eA(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const o=[...n==="clippingAncestors"?gd(t)?[]:ZP(t,this._c):[].concat(n),r],l=o[0],c=o.reduce((d,h)=>{const f=My(t,h,s);return d.top=sn(f.top,d.top),d.right=As(f.right,d.right),d.bottom=As(f.bottom,d.bottom),d.left=sn(f.left,d.left),d},My(t,l,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function tA(e){const{width:t,height:n}=fw(e);return{width:t,height:n}}function nA(e,t,n){const r=kr(t),s=Er(t),a=n==="fixed",o=ga(e,!0,a,t);let l={scrollLeft:0,scrollTop:0};const c=xr(0);function d(){c.x=ug(s)}if(r||!r&&!a)if((Ho(t)!=="body"||Il(s))&&(l=yd(t)),r){const m=ga(t,!0,a,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else s&&d();a&&!r&&s&&d();const h=s&&!r&&!a?pw(s,l):xr(0),f=o.left+l.scrollLeft-c.x-h.x,p=o.top+l.scrollTop-c.y-h.y;return{x:f,y:p,width:o.width,height:o.height}}function Ch(e){return Kn(e).position==="static"}function Ly(e,t){if(!kr(e)||Kn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Er(e)===n&&(n=n.ownerDocument.body),n}function yw(e,t){const n=hn(e);if(gd(e))return n;if(!kr(e)){let s=Rs(e);for(;s&&!Io(s);){if(Wn(s)&&!Ch(s))return s;s=Rs(s)}return n}let r=Ly(e,t);for(;r&&FP(r)&&Ch(r);)r=Ly(r,t);return r&&Io(r)&&Ch(r)&&!ig(r)?n:r||VP(e)||n}const rA=async function(e){const t=this.getOffsetParent||yw,n=this.getDimensions,r=await n(e.floating);return{reference:nA(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function sA(e){return Kn(e).direction==="rtl"}const aA={convertOffsetParentRelativeRectToViewportRelativeRect:WP,getDocumentElement:Er,getClippingRect:eA,getOffsetParent:yw,getElementRects:rA,getClientRects:KP,getDimensions:tA,getScale:fo,isElement:Wn,isRTL:sA};function xw(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function oA(e,t){let n=null,r;const s=Er(e);function a(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),a();const d=e.getBoundingClientRect(),{left:h,top:f,width:p,height:m}=d;if(l||t(),!p||!m)return;const y=cc(f),g=cc(s.clientWidth-(h+p)),S=cc(s.clientHeight-(f+m)),w=cc(h),x={rootMargin:-y+"px "+-g+"px "+-S+"px "+-w+"px",threshold:sn(0,As(1,c))||1};let k=!0;function j(C){const T=C[0].intersectionRatio;if(T!==c){if(!k)return o();T?o(!1,T):r=setTimeout(()=>{o(!1,1e-7)},1e3)}T===1&&!xw(d,e.getBoundingClientRect())&&o(),k=!1}try{n=new IntersectionObserver(j,{...x,root:s.ownerDocument})}catch{n=new IntersectionObserver(j,x)}n.observe(e)}return o(!0),a}function iA(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,d=cg(e),h=s||a?[...d?al(d):[],...al(t)]:[];h.forEach(w=>{s&&w.addEventListener("scroll",n,{passive:!0}),a&&w.addEventListener("resize",n)});const f=d&&l?oA(d,n):null;let p=-1,m=null;o&&(m=new ResizeObserver(w=>{let[v]=w;v&&v.target===d&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(t)})),n()}),d&&!c&&m.observe(d),m.observe(t));let y,g=c?ga(e):null;c&&S();function S(){const w=ga(e);g&&!xw(g,w)&&n(),g=w,y=requestAnimationFrame(S)}return n(),()=>{var w;h.forEach(v=>{s&&v.removeEventListener("scroll",n),a&&v.removeEventListener("resize",n)}),f==null||f(),(w=m)==null||w.disconnect(),m=null,c&&cancelAnimationFrame(y)}}const lA=RP,cA=IP,uA=TP,dA=MP,hA=PP,Dy=_P,fA=OP,mA=(e,t,n)=>{const r=new Map,s={platform:aA,...n},a={...s.platform,_c:r};return NP(e,t,{...s,platform:a})};var pA=typeof document<"u",gA=function(){},Hc=pA?b.useLayoutEffect:gA;function Tu(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Tu(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const a=s[r];if(!(a==="_owner"&&e.$$typeof)&&!Tu(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function vw(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Fy(e,t){const n=vw(e);return Math.round(t*n)/n}function jh(e){const t=b.useRef(e);return Hc(()=>{t.current=e}),t}function yA(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:a,floating:o}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[h,f]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=b.useState(r);Tu(p,r)||m(r);const[y,g]=b.useState(null),[S,w]=b.useState(null),v=b.useCallback(M=>{M!==C.current&&(C.current=M,g(M))},[]),x=b.useCallback(M=>{M!==T.current&&(T.current=M,w(M))},[]),k=a||y,j=o||S,C=b.useRef(null),T=b.useRef(null),P=b.useRef(h),_=c!=null,R=jh(c),I=jh(s),A=jh(d),z=b.useCallback(()=>{if(!C.current||!T.current)return;const M={placement:t,strategy:n,middleware:p};I.current&&(M.platform=I.current),mA(C.current,T.current,M).then($=>{const E={...$,isPositioned:A.current!==!1};D.current&&!Tu(P.current,E)&&(P.current=E,Tl.flushSync(()=>{f(E)}))})},[p,t,n,I,A]);Hc(()=>{d===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,f(M=>({...M,isPositioned:!1})))},[d]);const D=b.useRef(!1);Hc(()=>(D.current=!0,()=>{D.current=!1}),[]),Hc(()=>{if(k&&(C.current=k),j&&(T.current=j),k&&j){if(R.current)return R.current(k,j,z);z()}},[k,j,z,R,_]);const F=b.useMemo(()=>({reference:C,floating:T,setReference:v,setFloating:x}),[v,x]),G=b.useMemo(()=>({reference:k,floating:j}),[k,j]),W=b.useMemo(()=>{const M={position:n,left:0,top:0};if(!G.floating)return M;const $=Fy(G.floating,h.x),E=Fy(G.floating,h.y);return l?{...M,transform:"translate("+$+"px, "+E+"px)",...vw(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:$,top:E}},[n,l,G.floating,h.x,h.y]);return b.useMemo(()=>({...h,update:z,refs:F,elements:G,floatingStyles:W}),[h,z,F,G,W])}const xA=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Dy({element:r.current,padding:s}).fn(n):{}:r?Dy({element:r,padding:s}).fn(n):{}}}},vA=(e,t)=>({...lA(e),options:[e,t]}),bA=(e,t)=>({...cA(e),options:[e,t]}),wA=(e,t)=>({...fA(e),options:[e,t]}),SA=(e,t)=>({...uA(e),options:[e,t]}),kA=(e,t)=>({...dA(e),options:[e,t]}),CA=(e,t)=>({...hA(e),options:[e,t]}),jA=(e,t)=>({...xA(e),options:[e,t]});var EA="Arrow",bw=b.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...a}=e;return i.jsx(_e.svg,{...a,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:i.jsx("polygon",{points:"0,0 30,0 15,10"})})});bw.displayName=EA;var NA=bw;function _A(e){const[t,n]=b.useState(void 0);return br(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const a=s[0];let o,l;if("borderBoxSize"in a){const c=a.borderBoxSize,d=Array.isArray(c)?c[0]:c;o=d.inlineSize,l=d.blockSize}else o=e.offsetWidth,l=e.offsetHeight;n({width:o,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var dg="Popper",[ww,Sw]=wa(dg),[TA,kw]=ww(dg),Cw=e=>{const{__scopePopper:t,children:n}=e,[r,s]=b.useState(null);return i.jsx(TA,{scope:t,anchor:r,onAnchorChange:s,children:n})};Cw.displayName=dg;var jw="PopperAnchor",Ew=b.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,a=kw(jw,n),o=b.useRef(null),l=mt(t,o);return b.useEffect(()=>{a.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:i.jsx(_e.div,{...s,ref:l})});Ew.displayName=jw;var hg="PopperContent",[PA,AA]=ww(hg),Nw=b.forwardRef((e,t)=>{var me,it,Je,pt,rt,Qn;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:a="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:h=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:m="optimized",onPlaced:y,...g}=e,S=kw(hg,n),[w,v]=b.useState(null),x=mt(t,Qt=>v(Qt)),[k,j]=b.useState(null),C=_A(k),T=(C==null?void 0:C.width)??0,P=(C==null?void 0:C.height)??0,_=r+(a!=="center"?"-"+a:""),R=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},I=Array.isArray(d)?d:[d],A=I.length>0,z={padding:R,boundary:I.filter(IA),altBoundary:A},{refs:D,floatingStyles:F,placement:G,isPositioned:W,middlewareData:M}=yA({strategy:"fixed",placement:_,whileElementsMounted:(...Qt)=>iA(...Qt,{animationFrame:m==="always"}),elements:{reference:S.anchor},middleware:[vA({mainAxis:s+P,alignmentAxis:o}),c&&bA({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?wA():void 0,...z}),c&&SA({...z}),kA({...z,apply:({elements:Qt,rects:Nr,availableWidth:Rt,availableHeight:_r})=>{const{width:Qr,height:Tn}=Nr.reference,It=Qt.floating.style;It.setProperty("--radix-popper-available-width",`${Rt}px`),It.setProperty("--radix-popper-available-height",`${_r}px`),It.setProperty("--radix-popper-anchor-width",`${Qr}px`),It.setProperty("--radix-popper-anchor-height",`${Tn}px`)}}),k&&jA({element:k,padding:l}),OA({arrowWidth:T,arrowHeight:P}),p&&CA({strategy:"referenceHidden",...z})]}),[$,E]=Pw(G),Y=vr(y);br(()=>{W&&(Y==null||Y())},[W,Y]);const X=(me=M.arrow)==null?void 0:me.x,N=(it=M.arrow)==null?void 0:it.y,te=((Je=M.arrow)==null?void 0:Je.centerOffset)!==0,[ke,fe]=b.useState();return br(()=>{w&&fe(window.getComputedStyle(w).zIndex)},[w]),i.jsx("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...F,transform:W?F.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ke,"--radix-popper-transform-origin":[(pt=M.transformOrigin)==null?void 0:pt.x,(rt=M.transformOrigin)==null?void 0:rt.y].join(" "),...((Qn=M.hide)==null?void 0:Qn.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:i.jsx(PA,{scope:n,placedSide:$,onArrowChange:j,arrowX:X,arrowY:N,shouldHideArrow:te,children:i.jsx(_e.div,{"data-side":$,"data-align":E,...g,ref:x,style:{...g.style,animation:W?void 0:"none"}})})})});Nw.displayName=hg;var _w="PopperArrow",RA={top:"bottom",right:"left",bottom:"top",left:"right"},Tw=b.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,a=AA(_w,r),o=RA[a.placedSide];return i.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:i.jsx(NA,{...s,ref:n,style:{...s.style,display:"block"}})})});Tw.displayName=_w;function IA(e){return e!==null}var OA=e=>({name:"transformOrigin",options:e,fn(t){var S,w,v;const{placement:n,rects:r,middlewareData:s}=t,o=((S=s.arrow)==null?void 0:S.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[d,h]=Pw(n),f={start:"0%",center:"50%",end:"100%"}[h],p=(((w=s.arrow)==null?void 0:w.x)??0)+l/2,m=(((v=s.arrow)==null?void 0:v.y)??0)+c/2;let y="",g="";return d==="bottom"?(y=o?f:`${p}px`,g=`${-c}px`):d==="top"?(y=o?f:`${p}px`,g=`${r.floating.height+c}px`):d==="right"?(y=`${-c}px`,g=o?f:`${m}px`):d==="left"&&(y=`${r.floating.width+c}px`,g=o?f:`${m}px`),{data:{x:y,y:g}}}});function Pw(e){const[t,n="center"]=e.split("-");return[t,n]}var MA=Cw,LA=Ew,DA=Nw,FA=Tw,[xd,GB]=wa("Tooltip",[Sw]),vd=Sw(),Aw="TooltipProvider",$A=700,cm="tooltip.open",[BA,fg]=xd(Aw),Rw=e=>{const{__scopeTooltip:t,delayDuration:n=$A,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:a}=e,o=b.useRef(!0),l=b.useRef(!1),c=b.useRef(0);return b.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),i.jsx(BA,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:b.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:b.useCallback(d=>{l.current=d},[]),disableHoverableContent:s,children:a})};Rw.displayName=Aw;var ol="Tooltip",[UA,bd]=xd(ol),Iw=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:a,disableHoverableContent:o,delayDuration:l}=e,c=fg(ol,e.__scopeTooltip),d=vd(t),[h,f]=b.useState(null),p=ho(),m=b.useRef(0),y=o??c.disableHoverableContent,g=l??c.delayDuration,S=b.useRef(!1),[w,v]=Bo({prop:r,defaultProp:s??!1,onChange:T=>{T?(c.onOpen(),document.dispatchEvent(new CustomEvent(cm))):c.onClose(),a==null||a(T)},caller:ol}),x=b.useMemo(()=>w?S.current?"delayed-open":"instant-open":"closed",[w]),k=b.useCallback(()=>{window.clearTimeout(m.current),m.current=0,S.current=!1,v(!0)},[v]),j=b.useCallback(()=>{window.clearTimeout(m.current),m.current=0,v(!1)},[v]),C=b.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{S.current=!0,v(!0),m.current=0},g)},[g,v]);return b.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),i.jsx(MA,{...d,children:i.jsx(UA,{scope:t,contentId:p,open:w,stateAttribute:x,trigger:h,onTriggerChange:f,onTriggerEnter:b.useCallback(()=>{c.isOpenDelayedRef.current?C():k()},[c.isOpenDelayedRef,C,k]),onTriggerLeave:b.useCallback(()=>{y?j():(window.clearTimeout(m.current),m.current=0)},[j,y]),onOpen:k,onClose:j,disableHoverableContent:y,children:n})})};Iw.displayName=ol;var um="TooltipTrigger",Ow=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=bd(um,n),a=fg(um,n),o=vd(n),l=b.useRef(null),c=mt(t,l,s.onTriggerChange),d=b.useRef(!1),h=b.useRef(!1),f=b.useCallback(()=>d.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),i.jsx(LA,{asChild:!0,...o,children:i.jsx(_e.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:c,onPointerMove:Ae(e.onPointerMove,p=>{p.pointerType!=="touch"&&!h.current&&!a.isPointerInTransitRef.current&&(s.onTriggerEnter(),h.current=!0)}),onPointerLeave:Ae(e.onPointerLeave,()=>{s.onTriggerLeave(),h.current=!1}),onPointerDown:Ae(e.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:Ae(e.onFocus,()=>{d.current||s.onOpen()}),onBlur:Ae(e.onBlur,s.onClose),onClick:Ae(e.onClick,s.onClose)})})});Ow.displayName=um;var zA="TooltipPortal",[WB,VA]=xd(zA,{forceMount:void 0}),Oo="TooltipContent",Mw=b.forwardRef((e,t)=>{const n=VA(Oo,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...a}=e,o=bd(Oo,e.__scopeTooltip);return i.jsx(Sa,{present:r||o.open,children:o.disableHoverableContent?i.jsx(Lw,{side:s,...a,ref:t}):i.jsx(HA,{side:s,...a,ref:t})})}),HA=b.forwardRef((e,t)=>{const n=bd(Oo,e.__scopeTooltip),r=fg(Oo,e.__scopeTooltip),s=b.useRef(null),a=mt(t,s),[o,l]=b.useState(null),{trigger:c,onClose:d}=n,h=s.current,{onPointerInTransitChange:f}=r,p=b.useCallback(()=>{l(null),f(!1)},[f]),m=b.useCallback((y,g)=>{const S=y.currentTarget,w={x:y.clientX,y:y.clientY},v=XA(w,S.getBoundingClientRect()),x=JA(w,v),k=QA(g.getBoundingClientRect()),j=ZA([...x,...k]);l(j),f(!0)},[f]);return b.useEffect(()=>()=>p(),[p]),b.useEffect(()=>{if(c&&h){const y=S=>m(S,h),g=S=>m(S,c);return c.addEventListener("pointerleave",y),h.addEventListener("pointerleave",g),()=>{c.removeEventListener("pointerleave",y),h.removeEventListener("pointerleave",g)}}},[c,h,m,p]),b.useEffect(()=>{if(o){const y=g=>{const S=g.target,w={x:g.clientX,y:g.clientY},v=(c==null?void 0:c.contains(S))||(h==null?void 0:h.contains(S)),x=!YA(w,o);v?p():x&&(p(),d())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[c,h,o,d,p]),i.jsx(Lw,{...e,ref:a})}),[qA,GA]=xd(ol,{isInside:!1}),WA=AN("TooltipContent"),Lw=b.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:a,onPointerDownOutside:o,...l}=e,c=bd(Oo,n),d=vd(n),{onClose:h}=c;return b.useEffect(()=>(document.addEventListener(cm,h),()=>document.removeEventListener(cm,h)),[h]),b.useEffect(()=>{if(c.trigger){const f=p=>{const m=p.target;m!=null&&m.contains(c.trigger)&&h()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,h]),i.jsx(dd,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:f=>f.preventDefault(),onDismiss:h,children:i.jsxs(DA,{"data-state":c.stateAttribute,...d,...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:[i.jsx(WA,{children:r}),i.jsx(qA,{scope:n,isInside:!0,children:i.jsx(e_,{id:c.contentId,role:"tooltip",children:s||r})})]})})});Mw.displayName=Oo;var Dw="TooltipArrow",KA=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=vd(n);return GA(Dw,n).isInside?null:i.jsx(FA,{...s,...r,ref:t})});KA.displayName=Dw;function XA(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,s,a)){case a:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function JA(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function QA(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function YA(e,t){const{x:n,y:r}=e;let s=!1;for(let a=0,o=t.length-1;ar!=p>r&&n<(f-d)*(r-h)/(p-h)+d&&(s=!s)}return s}function ZA(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),eR(t)}function eR(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const a=t[t.length-1],o=t[t.length-2];if((a.x-o.x)*(s.y-o.y)>=(a.y-o.y)*(s.x-o.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const a=n[n.length-1],o=n[n.length-2];if((a.x-o.x)*(s.y-o.y)>=(a.y-o.y)*(s.x-o.x))n.pop();else break}n.push(s)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var tR=Rw,nR=Iw,rR=Ow,Fw=Mw;const $w=tR,sR=nR,aR=rR,Bw=b.forwardRef(({className:e,sideOffset:t=4,...n},r)=>i.jsx(Fw,{ref:r,sideOffset:t,className:Z("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));Bw.displayName=Fw.displayName;var wd=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(){}},Sd=typeof window>"u"||"Deno"in globalThis;function Fn(){}function oR(e,t){return typeof e=="function"?e(t):e}function iR(e){return typeof e=="number"&&e>=0&&e!==1/0}function lR(e,t){return Math.max(e+(t||0)-Date.now(),0)}function dm(e,t){return typeof e=="function"?e(t):e}function cR(e,t){return typeof e=="function"?e(t):e}function $y(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:a,queryKey:o,stale:l}=e;if(o){if(r){if(t.queryHash!==mg(o,t.options))return!1}else if(!ll(t.queryKey,o))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||s&&s!==t.state.fetchStatus||a&&!a(t))}function By(e,t){const{exact:n,status:r,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(il(t.options.mutationKey)!==il(a))return!1}else if(!ll(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function mg(e,t){return((t==null?void 0:t.queryKeyHashFn)||il)(e)}function il(e){return JSON.stringify(e,(t,n)=>hm(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function ll(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>ll(e[n],t[n])):!1}function Uw(e,t){if(e===t)return e;const n=Uy(e)&&Uy(t);if(n||hm(e)&&hm(t)){const r=n?e:Object.keys(e),s=r.length,a=n?t:Object.keys(t),o=a.length,l=n?[]:{},c=new Set(r);let d=0;for(let h=0;h{setTimeout(t,e)})}function dR(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Uw(e,t):t}function hR(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function fR(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var pg=Symbol();function zw(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===pg?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var ra,ds,xo,Kv,mR=(Kv=class extends wd{constructor(){super();Se(this,ra);Se(this,ds);Se(this,xo);ce(this,xo,t=>{if(!Sd&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){B(this,ds)||this.setEventListener(B(this,xo))}onUnsubscribe(){var t;this.hasListeners()||((t=B(this,ds))==null||t.call(this),ce(this,ds,void 0))}setEventListener(t){var n;ce(this,xo,t),(n=B(this,ds))==null||n.call(this),ce(this,ds,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){B(this,ra)!==t&&(ce(this,ra,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof B(this,ra)=="boolean"?B(this,ra):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ra=new WeakMap,ds=new WeakMap,xo=new WeakMap,Kv),Vw=new mR,vo,hs,bo,Xv,pR=(Xv=class extends wd{constructor(){super();Se(this,vo,!0);Se(this,hs);Se(this,bo);ce(this,bo,t=>{if(!Sd&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){B(this,hs)||this.setEventListener(B(this,bo))}onUnsubscribe(){var t;this.hasListeners()||((t=B(this,hs))==null||t.call(this),ce(this,hs,void 0))}setEventListener(t){var n;ce(this,bo,t),(n=B(this,hs))==null||n.call(this),ce(this,hs,t(this.setOnline.bind(this)))}setOnline(t){B(this,vo)!==t&&(ce(this,vo,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return B(this,vo)}},vo=new WeakMap,hs=new WeakMap,bo=new WeakMap,Xv),Pu=new pR;function gR(){let e,t;const n=new Promise((s,a)=>{e=s,t=a});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}function yR(e){return Math.min(1e3*2**e,3e4)}function Hw(e){return(e??"online")==="online"?Pu.isOnline():!0}var qw=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Eh(e){return e instanceof qw}function Gw(e){let t=!1,n=0,r=!1,s;const a=gR(),o=g=>{var S;r||(p(new qw(g)),(S=e.abort)==null||S.call(e))},l=()=>{t=!0},c=()=>{t=!1},d=()=>Vw.isFocused()&&(e.networkMode==="always"||Pu.isOnline())&&e.canRun(),h=()=>Hw(e.networkMode)&&e.canRun(),f=g=>{var S;r||(r=!0,(S=e.onSuccess)==null||S.call(e,g),s==null||s(),a.resolve(g))},p=g=>{var S;r||(r=!0,(S=e.onError)==null||S.call(e,g),s==null||s(),a.reject(g))},m=()=>new Promise(g=>{var S;s=w=>{(r||d())&&g(w)},(S=e.onPause)==null||S.call(e)}).then(()=>{var g;s=void 0,r||(g=e.onContinue)==null||g.call(e)}),y=()=>{if(r)return;let g;const S=n===0?e.initialPromise:void 0;try{g=S??e.fn()}catch(w){g=Promise.reject(w)}Promise.resolve(g).then(f).catch(w=>{var C;if(r)return;const v=e.retry??(Sd?0:3),x=e.retryDelay??yR,k=typeof x=="function"?x(n,w):x,j=v===!0||typeof v=="number"&&nd()?void 0:m()).then(()=>{t?p(w):y()})})};return{promise:a,cancel:o,continue:()=>(s==null||s(),a),cancelRetry:l,continueRetry:c,canStart:h,start:()=>(h()?y():m().then(y),a)}}var xR=e=>setTimeout(e,0);function vR(){let e=[],t=0,n=l=>{l()},r=l=>{l()},s=xR;const a=l=>{t?e.push(l):s(()=>{n(l)})},o=()=>{const l=e;e=[],l.length&&s(()=>{r(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||o()}return c},batchCalls:l=>(...c)=>{a(()=>{l(...c)})},schedule:a,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{s=l}}}var Nt=vR(),sa,Jv,Ww=(Jv=class{constructor(){Se(this,sa)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),iR(this.gcTime)&&ce(this,sa,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Sd?1/0:5*60*1e3))}clearGcTimeout(){B(this,sa)&&(clearTimeout(B(this,sa)),ce(this,sa,void 0))}},sa=new WeakMap,Jv),wo,aa,xn,oa,vt,Sl,ia,Bn,Ar,Qv,bR=(Qv=class extends Ww{constructor(t){super();Se(this,Bn);Se(this,wo);Se(this,aa);Se(this,xn);Se(this,oa);Se(this,vt);Se(this,Sl);Se(this,ia);ce(this,ia,!1),ce(this,Sl,t.defaultOptions),this.setOptions(t.options),this.observers=[],ce(this,oa,t.client),ce(this,xn,B(this,oa).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ce(this,wo,SR(this.options)),this.state=t.state??B(this,wo),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=B(this,vt))==null?void 0:t.promise}setOptions(t){this.options={...B(this,Sl),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&B(this,xn).remove(this)}setData(t,n){const r=dR(this.state.data,t,this.options);return gt(this,Bn,Ar).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){gt(this,Bn,Ar).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,s;const n=(r=B(this,vt))==null?void 0:r.promise;return(s=B(this,vt))==null||s.cancel(t),n?n.then(Fn).catch(Fn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(B(this,wo))}isActive(){return this.observers.some(t=>cR(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===pg||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>dm(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:!lR(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=B(this,vt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=B(this,vt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),B(this,xn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(B(this,vt)&&(B(this,ia)?B(this,vt).cancel({revert:!0}):B(this,vt).cancelRetry()),this.scheduleGc()),B(this,xn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||gt(this,Bn,Ar).call(this,{type:"invalidate"})}fetch(t,n){var d,h,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(B(this,vt))return B(this,vt).continueRetry(),B(this,vt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const p=this.observers.find(m=>m.options.queryFn);p&&this.setOptions(p.options)}const r=new AbortController,s=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(ce(this,ia,!0),r.signal)})},a=()=>{const p=zw(this.options,n),y=(()=>{const g={client:B(this,oa),queryKey:this.queryKey,meta:this.meta};return s(g),g})();return ce(this,ia,!1),this.options.persister?this.options.persister(p,y,this):p(y)},l=(()=>{const p={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:B(this,oa),state:this.state,fetchFn:a};return s(p),p})();(d=this.options.behavior)==null||d.onFetch(l,this),ce(this,aa,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=l.fetchOptions)==null?void 0:h.meta))&>(this,Bn,Ar).call(this,{type:"fetch",meta:(f=l.fetchOptions)==null?void 0:f.meta});const c=p=>{var m,y,g,S;Eh(p)&&p.silent||gt(this,Bn,Ar).call(this,{type:"error",error:p}),Eh(p)||((y=(m=B(this,xn).config).onError)==null||y.call(m,p,this),(S=(g=B(this,xn).config).onSettled)==null||S.call(g,this.state.data,p,this)),this.scheduleGc()};return ce(this,vt,Gw({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var m,y,g,S;if(p===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(p)}catch(w){c(w);return}(y=(m=B(this,xn).config).onSuccess)==null||y.call(m,p,this),(S=(g=B(this,xn).config).onSettled)==null||S.call(g,p,this.state.error,this),this.scheduleGc()},onError:c,onFail:(p,m)=>{gt(this,Bn,Ar).call(this,{type:"failed",failureCount:p,error:m})},onPause:()=>{gt(this,Bn,Ar).call(this,{type:"pause"})},onContinue:()=>{gt(this,Bn,Ar).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0})),B(this,vt).start()}},wo=new WeakMap,aa=new WeakMap,xn=new WeakMap,oa=new WeakMap,vt=new WeakMap,Sl=new WeakMap,ia=new WeakMap,Bn=new WeakSet,Ar=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...wR(r.data,this.options),fetchMeta:t.meta??null};case"success":return ce(this,aa,void 0),{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=t.error;return Eh(s)&&s.revert&&B(this,aa)?{...B(this,aa),fetchStatus:"idle"}:{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Nt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),B(this,xn).notify({query:this,type:"updated",action:t})})},Qv);function wR(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Hw(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function SR(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var lr,Yv,kR=(Yv=class extends wd{constructor(t={}){super();Se(this,lr);this.config=t,ce(this,lr,new Map)}build(t,n,r){const s=n.queryKey,a=n.queryHash??mg(s,n);let o=this.get(a);return o||(o=new bR({client:t,queryKey:s,queryHash:a,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){B(this,lr).has(t.queryHash)||(B(this,lr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=B(this,lr).get(t.queryHash);n&&(t.destroy(),n===t&&B(this,lr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Nt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return B(this,lr).get(t)}getAll(){return[...B(this,lr).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>$y(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>$y(t,r)):n}notify(t){Nt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Nt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Nt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},lr=new WeakMap,Yv),cr,jt,la,ur,ns,Zv,CR=(Zv=class extends Ww{constructor(t){super();Se(this,ur);Se(this,cr);Se(this,jt);Se(this,la);this.mutationId=t.mutationId,ce(this,jt,t.mutationCache),ce(this,cr,[]),this.state=t.state||jR(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){B(this,cr).includes(t)||(B(this,cr).push(t),this.clearGcTimeout(),B(this,jt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ce(this,cr,B(this,cr).filter(n=>n!==t)),this.scheduleGc(),B(this,jt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){B(this,cr).length||(this.state.status==="pending"?this.scheduleGc():B(this,jt).remove(this))}continue(){var t;return((t=B(this,la))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var a,o,l,c,d,h,f,p,m,y,g,S,w,v,x,k,j,C,T,P;const n=()=>{gt(this,ur,ns).call(this,{type:"continue"})};ce(this,la,Gw({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(_,R)=>{gt(this,ur,ns).call(this,{type:"failed",failureCount:_,error:R})},onPause:()=>{gt(this,ur,ns).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>B(this,jt).canRun(this)}));const r=this.state.status==="pending",s=!B(this,la).canStart();try{if(r)n();else{gt(this,ur,ns).call(this,{type:"pending",variables:t,isPaused:s}),await((o=(a=B(this,jt).config).onMutate)==null?void 0:o.call(a,t,this));const R=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t));R!==this.state.context&>(this,ur,ns).call(this,{type:"pending",context:R,variables:t,isPaused:s})}const _=await B(this,la).start();return await((h=(d=B(this,jt).config).onSuccess)==null?void 0:h.call(d,_,t,this.state.context,this)),await((p=(f=this.options).onSuccess)==null?void 0:p.call(f,_,t,this.state.context)),await((y=(m=B(this,jt).config).onSettled)==null?void 0:y.call(m,_,null,this.state.variables,this.state.context,this)),await((S=(g=this.options).onSettled)==null?void 0:S.call(g,_,null,t,this.state.context)),gt(this,ur,ns).call(this,{type:"success",data:_}),_}catch(_){try{throw await((v=(w=B(this,jt).config).onError)==null?void 0:v.call(w,_,t,this.state.context,this)),await((k=(x=this.options).onError)==null?void 0:k.call(x,_,t,this.state.context)),await((C=(j=B(this,jt).config).onSettled)==null?void 0:C.call(j,void 0,_,this.state.variables,this.state.context,this)),await((P=(T=this.options).onSettled)==null?void 0:P.call(T,void 0,_,t,this.state.context)),_}finally{gt(this,ur,ns).call(this,{type:"error",error:_})}}finally{B(this,jt).runNext(this)}}},cr=new WeakMap,jt=new WeakMap,la=new WeakMap,ur=new WeakSet,ns=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Nt.batch(()=>{B(this,cr).forEach(r=>{r.onMutationUpdate(t)}),B(this,jt).notify({mutation:this,type:"updated",action:t})})},Zv);function jR(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Lr,Un,kl,e2,ER=(e2=class extends wd{constructor(t={}){super();Se(this,Lr);Se(this,Un);Se(this,kl);this.config=t,ce(this,Lr,new Set),ce(this,Un,new Map),ce(this,kl,0)}build(t,n,r){const s=new CR({mutationCache:this,mutationId:++zl(this,kl)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){B(this,Lr).add(t);const n=uc(t);if(typeof n=="string"){const r=B(this,Un).get(n);r?r.push(t):B(this,Un).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(B(this,Lr).delete(t)){const n=uc(t);if(typeof n=="string"){const r=B(this,Un).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&B(this,Un).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=uc(t);if(typeof n=="string"){const r=B(this,Un).get(n),s=r==null?void 0:r.find(a=>a.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r;const n=uc(t);if(typeof n=="string"){const s=(r=B(this,Un).get(n))==null?void 0:r.find(a=>a!==t&&a.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Nt.batch(()=>{B(this,Lr).forEach(t=>{this.notify({type:"removed",mutation:t})}),B(this,Lr).clear(),B(this,Un).clear()})}getAll(){return Array.from(B(this,Lr))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>By(n,r))}findAll(t={}){return this.getAll().filter(n=>By(t,n))}notify(t){Nt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Nt.batch(()=>Promise.all(t.map(n=>n.continue().catch(Fn))))}},Lr=new WeakMap,Un=new WeakMap,kl=new WeakMap,e2);function uc(e){var t;return(t=e.options.scope)==null?void 0:t.id}function Vy(e){return{onFetch:(t,n)=>{var h,f,p,m,y;const r=t.options,s=(p=(f=(h=t.fetchOptions)==null?void 0:h.meta)==null?void 0:f.fetchMore)==null?void 0:p.direction,a=((m=t.state.data)==null?void 0:m.pages)||[],o=((y=t.state.data)==null?void 0:y.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const d=async()=>{let g=!1;const S=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},w=zw(t.options,t.fetchOptions),v=async(x,k,j)=>{if(g)return Promise.reject();if(k==null&&x.pages.length)return Promise.resolve(x);const T=(()=>{const I={client:t.client,queryKey:t.queryKey,pageParam:k,direction:j?"backward":"forward",meta:t.options.meta};return S(I),I})(),P=await w(T),{maxPages:_}=t.options,R=j?fR:hR;return{pages:R(x.pages,P,_),pageParams:R(x.pageParams,k,_)}};if(s&&a.length){const x=s==="backward",k=x?NR:Hy,j={pages:a,pageParams:o},C=k(r,j);l=await v(j,C,x)}else{const x=e??a.length;do{const k=c===0?o[0]??r.initialPageParam:Hy(r,l);if(c>0&&k==null)break;l=await v(l,k),c++}while(c{var g,S;return(S=(g=t.options).persister)==null?void 0:S.call(g,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=d}}}function Hy(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function NR(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var He,fs,ms,So,ko,ps,Co,jo,t2,_R=(t2=class{constructor(e={}){Se(this,He);Se(this,fs);Se(this,ms);Se(this,So);Se(this,ko);Se(this,ps);Se(this,Co);Se(this,jo);ce(this,He,e.queryCache||new kR),ce(this,fs,e.mutationCache||new ER),ce(this,ms,e.defaultOptions||{}),ce(this,So,new Map),ce(this,ko,new Map),ce(this,ps,0)}mount(){zl(this,ps)._++,B(this,ps)===1&&(ce(this,Co,Vw.subscribe(async e=>{e&&(await this.resumePausedMutations(),B(this,He).onFocus())})),ce(this,jo,Pu.subscribe(async e=>{e&&(await this.resumePausedMutations(),B(this,He).onOnline())})))}unmount(){var e,t;zl(this,ps)._--,B(this,ps)===0&&((e=B(this,Co))==null||e.call(this),ce(this,Co,void 0),(t=B(this,jo))==null||t.call(this),ce(this,jo,void 0))}isFetching(e){return B(this,He).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return B(this,fs).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=B(this,He).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=B(this,He).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(dm(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return B(this,He).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=B(this,He).get(r.queryHash),a=s==null?void 0:s.state.data,o=oR(t,a);if(o!==void 0)return B(this,He).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return Nt.batch(()=>B(this,He).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=B(this,He).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=B(this,He);Nt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=B(this,He);return Nt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Nt.batch(()=>B(this,He).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Fn).catch(Fn)}invalidateQueries(e,t={}){return Nt.batch(()=>(B(this,He).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Nt.batch(()=>B(this,He).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let a=s.fetch(void 0,n);return n.throwOnError||(a=a.catch(Fn)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(Fn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=B(this,He).build(this,t);return n.isStaleByTime(dm(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Fn).catch(Fn)}fetchInfiniteQuery(e){return e.behavior=Vy(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Fn).catch(Fn)}ensureInfiniteQueryData(e){return e.behavior=Vy(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Pu.isOnline()?B(this,fs).resumePausedMutations():Promise.resolve()}getQueryCache(){return B(this,He)}getMutationCache(){return B(this,fs)}getDefaultOptions(){return B(this,ms)}setDefaultOptions(e){ce(this,ms,e)}setQueryDefaults(e,t){B(this,So).set(il(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...B(this,So).values()],n={};return t.forEach(r=>{ll(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){B(this,ko).set(il(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...B(this,ko).values()],n={};return t.forEach(r=>{ll(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...B(this,ms).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=mg(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===pg&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...B(this,ms).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){B(this,He).clear(),B(this,fs).clear()}},He=new WeakMap,fs=new WeakMap,ms=new WeakMap,So=new WeakMap,ko=new WeakMap,ps=new WeakMap,Co=new WeakMap,jo=new WeakMap,t2),TR=b.createContext(void 0),PR=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),i.jsx(TR.Provider,{value:e,children:t}));/** * @remix-run/router v1.23.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function cl(){return cl=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Kw(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function RR(){return Math.random().toString(36).substr(2,8)}function Gy(e,t){return{usr:e.state,key:e.key,idx:t}}function fm(e,t,n,r){return n===void 0&&(n=null),cl({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?qo(t):t,{state:n,key:t&&t.key||r||RR()})}function Au(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function qo(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function IR(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:a=!1}=r,o=s.history,l=xs.Pop,c=null,d=h();d==null&&(d=0,o.replaceState(cl({},o.state,{idx:d}),""));function h(){return(o.state||{idx:null}).idx}function f(){l=xs.Pop;let S=h(),w=S==null?null:S-d;d=S,c&&c({action:l,location:g.location,delta:w})}function p(S,w){l=xs.Push;let v=fm(g.location,S,w);d=h()+1;let x=Gy(v,d),k=g.createHref(v);try{o.pushState(x,"",k)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;s.location.assign(k)}a&&c&&c({action:l,location:g.location,delta:1})}function m(S,w){l=xs.Replace;let v=fm(g.location,S,w);d=h();let x=Gy(v,d),k=g.createHref(v);o.replaceState(x,"",k),a&&c&&c({action:l,location:g.location,delta:0})}function y(S){let w=s.location.origin!=="null"?s.location.origin:s.location.href,v=typeof S=="string"?S:Au(S);return v=v.replace(/ $/,"%20"),We(w,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,w)}let g={get action(){return l},get location(){return e(s,o)},listen(S){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(qy,f),c=S,()=>{s.removeEventListener(qy,f),c=null}},createHref(S){return t(s,S)},createURL:y,encodeLocation(S){let w=y(S);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:p,replace:m,go(S){return o.go(S)}};return g}var Wy;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Wy||(Wy={}));function OR(e,t,n){return n===void 0&&(n="/"),MR(e,t,n,!1)}function MR(e,t,n,r){let s=typeof t=="string"?qo(t):t,a=Mo(s.pathname||"/",n);if(a==null)return null;let o=Xw(e);LR(o);let l=null;for(let c=0;l==null&&c{let c={relativePath:l===void 0?a.path||"":l,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};c.relativePath.startsWith("/")&&(We(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let d=_s([r,c.relativePath]),h=n.concat(c);a.children&&a.children.length>0&&(We(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),Xw(a.children,t,h,d)),!(a.path==null&&!a.index)&&t.push({path:d,score:VR(d,a.index),routesMeta:h})};return e.forEach((a,o)=>{var l;if(a.path===""||!((l=a.path)!=null&&l.includes("?")))s(a,o);else for(let c of Jw(a.path))s(a,o,c)}),t}function Jw(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return s?[a,""]:[a];let o=Jw(r.join("/")),l=[];return l.push(...o.map(c=>c===""?a:[a,c].join("/"))),s&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function LR(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:HR(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const DR=/^:[\w-]+$/,FR=3,$R=2,BR=1,UR=10,zR=-2,Ky=e=>e==="*";function VR(e,t){let n=e.split("/"),r=n.length;return n.some(Ky)&&(r+=zR),t&&(r+=$R),n.filter(s=>!Ky(s)).reduce((s,a)=>s+(DR.test(a)?FR:a===""?BR:UR),r)}function HR(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function qR(e,t,n){let{routesMeta:r}=e,s={},a="/",o=[];for(let l=0;l{let{paramName:p,isOptional:m}=h;if(p==="*"){let g=l[f]||"";o=a.slice(0,a.length-g.length).replace(/(.)\/+$/,"$1")}const y=l[f];return m&&!y?d[p]=void 0:d[p]=(y||"").replace(/%2F/g,"/"),d},{}),pathname:a,pathnameBase:o,pattern:e}}function GR(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Kw(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function WR(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Kw(!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 Mo(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function KR(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?qo(e):e;return{pathname:n?n.startsWith("/")?n:XR(n,t):t,search:YR(r),hash:ZR(s)}}function XR(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function Nh(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function JR(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Qw(e,t){let n=JR(e);return t?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Yw(e,t,n,r){r===void 0&&(r=!1);let s;typeof e=="string"?s=qo(e):(s=cl({},e),We(!s.pathname||!s.pathname.includes("?"),Nh("?","pathname","search",s)),We(!s.pathname||!s.pathname.includes("#"),Nh("#","pathname","hash",s)),We(!s.search||!s.search.includes("#"),Nh("#","search","hash",s)));let a=e===""||s.pathname==="",o=a?"/":s.pathname,l;if(o==null)l=n;else{let f=t.length-1;if(!r&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),f-=1;s.pathname=p.join("/")}l=f>=0?t[f]:"/"}let c=KR(s,l),d=o&&o!=="/"&&o.endsWith("/"),h=(a||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(d||h)&&(c.pathname+="/"),c}const _s=e=>e.join("/").replace(/\/\/+/g,"/"),QR=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),YR=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,ZR=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function e6(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Zw=["post","put","patch","delete"];new Set(Zw);const t6=["get",...Zw];new Set(t6);/** * React Router v6.30.1 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function ul(){return ul=Object.assign?Object.assign.bind():function(e){for(var t=1;t{l.current=!0}),b.useCallback(function(d,h){if(h===void 0&&(h={}),!l.current)return;if(typeof d=="number"){r.go(d);return}let f=Yw(d,JSON.parse(o),a,h.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:_s([t,f.pathname])),(h.replace?r.replace:r.push)(f,h.state,h)},[t,r,o,a,e])}const s6=b.createContext(null);function a6(e){let t=b.useContext(Xr).outlet;return t&&b.createElement(s6.Provider,{value:e},t)}function o6(){let{matches:e}=b.useContext(Xr),t=e[e.length-1];return t?t.params:{}}function jd(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=b.useContext(Ds),{matches:s}=b.useContext(Xr),{pathname:a}=Xt(),o=JSON.stringify(Qw(s,r.v7_relativeSplatPath));return b.useMemo(()=>Yw(e,JSON.parse(o),a,n==="path"),[e,o,a,n])}function i6(e,t){return l6(e,t)}function l6(e,t,n,r){Ol()||We(!1);let{navigator:s}=b.useContext(Ds),{matches:a}=b.useContext(Xr),o=a[a.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let d=Xt(),h;if(t){var f;let S=typeof t=="string"?qo(t):t;c==="/"||(f=S.pathname)!=null&&f.startsWith(c)||We(!1),h=S}else h=d;let p=h.pathname||"/",m=p;if(c!=="/"){let S=c.replace(/^\//,"").split("/");m="/"+p.replace(/^\//,"").split("/").slice(S.length).join("/")}let y=OR(e,{pathname:m}),g=f6(y&&y.map(S=>Object.assign({},S,{params:Object.assign({},l,S.params),pathname:_s([c,s.encodeLocation?s.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?c:_s([c,s.encodeLocation?s.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),a,n,r);return t&&g?b.createElement(Cd.Provider,{value:{location:ul({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:xs.Pop}},g):g}function c6(){let e=y6(),t=e6(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},t),n?b.createElement("pre",{style:s},n):null,null)}const u6=b.createElement(c6,null);class d6 extends b.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?b.createElement(Xr.Provider,{value:this.props.routeContext},b.createElement(tS.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function h6(e){let{routeContext:t,match:n,children:r}=e,s=b.useContext(kd);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),b.createElement(Xr.Provider,{value:t},r)}function f6(e,t,n,r){var s;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var a;if(!n)return null;if(n.errors)e=n.matches;else if((a=r)!=null&&a.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=(s=n)==null?void 0:s.errors;if(l!=null){let h=o.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);h>=0||We(!1),o=o.slice(0,Math.min(o.length,h+1))}let c=!1,d=-1;if(n&&r&&r.v7_partialHydration)for(let h=0;h=0?o=o.slice(0,d+1):o=[o[0]];break}}}return o.reduceRight((h,f,p)=>{let m,y=!1,g=null,S=null;n&&(m=l&&f.route.id?l[f.route.id]:void 0,g=f.route.errorElement||u6,c&&(d<0&&p===0?(y=!0,S=null):d===p&&(y=!0,S=f.route.hydrateFallbackElement||null)));let w=t.concat(o.slice(0,p+1)),v=()=>{let x;return m?x=g:y?x=S:f.route.Component?x=b.createElement(f.route.Component,null):f.route.element?x=f.route.element:x=h,b.createElement(h6,{match:f,routeContext:{outlet:h,matches:w,isDataRoute:n!=null},children:x})};return n&&(f.route.ErrorBoundary||f.route.errorElement||p===0)?b.createElement(d6,{location:n.location,revalidation:n.revalidation,component:g,error:m,children:v(),routeContext:{outlet:null,matches:w,isDataRoute:!0}}):v()},null)}var rS=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(rS||{}),Iu=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}(Iu||{});function m6(e){let t=b.useContext(kd);return t||We(!1),t}function p6(e){let t=b.useContext(eS);return t||We(!1),t}function g6(e){let t=b.useContext(Xr);return t||We(!1),t}function sS(e){let t=g6(),n=t.matches[t.matches.length-1];return n.route.id||We(!1),n.route.id}function y6(){var e;let t=b.useContext(tS),n=p6(Iu.UseRouteError),r=sS(Iu.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function x6(){let{router:e}=m6(rS.UseNavigateStable),t=sS(Iu.UseNavigateStable),n=b.useRef(!1);return nS(()=>{n.current=!0}),b.useCallback(function(s,a){a===void 0&&(a={}),n.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,ul({fromRouteId:t},a)))},[e,t])}function v6(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function b6(e){return a6(e.context)}function Le(e){We(!1)}function w6(e){let{basename:t="/",children:n=null,location:r,navigationType:s=xs.Pop,navigator:a,static:o=!1,future:l}=e;Ol()&&We(!1);let c=t.replace(/^\/*/,"/"),d=b.useMemo(()=>({basename:c,navigator:a,static:o,future:ul({v7_relativeSplatPath:!1},l)}),[c,l,a,o]);typeof r=="string"&&(r=qo(r));let{pathname:h="/",search:f="",hash:p="",state:m=null,key:y="default"}=r,g=b.useMemo(()=>{let S=Mo(h,c);return S==null?null:{location:{pathname:S,search:f,hash:p,state:m,key:y},navigationType:s}},[c,h,f,p,m,y,s]);return g==null?null:b.createElement(Ds.Provider,{value:d},b.createElement(Cd.Provider,{children:n,value:g}))}function S6(e){let{children:t,location:n}=e;return i6(mm(t),n)}new Promise(()=>{});function mm(e,t){t===void 0&&(t=[]);let n=[];return b.Children.forEach(e,(r,s)=>{if(!b.isValidElement(r))return;let a=[...t,s];if(r.type===b.Fragment){n.push.apply(n,mm(r.props.children,a));return}r.type!==Le&&We(!1),!r.props.index||!r.props.children||We(!1);let o={id:r.props.id||a.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=mm(r.props.children,a)),n.push(o)}),n}/** * React Router DOM v6.30.1 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Ou(){return Ou=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function k6(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function C6(e,t){return e.button===0&&(!t||t==="_self")&&!k6(e)}function pm(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function j6(e,t){let n=pm(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(a=>{n.append(s,a)})}),n}const E6=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],N6=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],_6="6";try{window.__reactRouterVersion=_6}catch{}const T6=b.createContext({isTransitioning:!1}),P6="startTransition",Xy=ap[P6];function A6(e){let{basename:t,children:n,future:r,window:s}=e,a=b.useRef();a.current==null&&(a.current=AR({window:s,v5Compat:!0}));let o=a.current,[l,c]=b.useState({action:o.action,location:o.location}),{v7_startTransition:d}=r||{},h=b.useCallback(f=>{d&&Xy?Xy(()=>c(f)):c(f)},[c,d]);return b.useLayoutEffect(()=>o.listen(h),[o,h]),b.useEffect(()=>v6(r),[r]),b.createElement(w6,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:r})}const R6=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",I6=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,se=b.forwardRef(function(t,n){let{onClick:r,relative:s,reloadDocument:a,replace:o,state:l,target:c,to:d,preventScrollReset:h,viewTransition:f}=t,p=aS(t,E6),{basename:m}=b.useContext(Ds),y,g=!1;if(typeof d=="string"&&I6.test(d)&&(y=d,R6))try{let x=new URL(window.location.href),k=d.startsWith("//")?new URL(x.protocol+d):new URL(d),j=Mo(k.pathname,m);k.origin===x.origin&&j!=null?d=j+k.search+k.hash:g=!0}catch{}let S=n6(d,{relative:s}),w=L6(d,{replace:o,state:l,target:c,preventScrollReset:h,relative:s,viewTransition:f});function v(x){r&&r(x),x.defaultPrevented||w(x)}return b.createElement("a",Ou({},p,{href:y||S,onClick:g||a?r:v,ref:n,target:c}))}),O6=b.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:s=!1,className:a="",end:o=!1,style:l,to:c,viewTransition:d,children:h}=t,f=aS(t,N6),p=jd(c,{relative:f.relative}),m=Xt(),y=b.useContext(eS),{navigator:g,basename:S}=b.useContext(Ds),w=y!=null&&D6(p)&&d===!0,v=g.encodeLocation?g.encodeLocation(p).pathname:p.pathname,x=m.pathname,k=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;s||(x=x.toLowerCase(),k=k?k.toLowerCase():null,v=v.toLowerCase()),k&&S&&(k=Mo(k,S)||k);const j=v!=="/"&&v.endsWith("/")?v.length-1:v.length;let C=x===v||!o&&x.startsWith(v)&&x.charAt(j)==="/",T=k!=null&&(k===v||!o&&k.startsWith(v)&&k.charAt(v.length)==="/"),P={isActive:C,isPending:T,isTransitioning:w},_=C?r:void 0,R;typeof a=="function"?R=a(P):R=[a,C?"active":null,T?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let I=typeof l=="function"?l(P):l;return b.createElement(se,Ou({},f,{"aria-current":_,className:R,ref:n,style:I,to:c,viewTransition:d}),typeof h=="function"?h(P):h)});var gm;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(gm||(gm={}));var Jy;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Jy||(Jy={}));function M6(e){let t=b.useContext(kd);return t||We(!1),t}function L6(e,t){let{target:n,replace:r,state:s,preventScrollReset:a,relative:o,viewTransition:l}=t===void 0?{}:t,c=Go(),d=Xt(),h=jd(e,{relative:o});return b.useCallback(f=>{if(C6(f,n)){f.preventDefault();let p=r!==void 0?r:Au(d)===Au(h);c(e,{replace:p,state:s,preventScrollReset:a,relative:o,viewTransition:l})}},[d,c,h,r,s,n,e,a,o,l])}function Ed(e){let t=b.useRef(pm(e)),n=b.useRef(!1),r=Xt(),s=b.useMemo(()=>j6(r.search,n.current?null:t.current),[r.search]),a=Go(),o=b.useCallback((l,c)=>{const d=pm(typeof l=="function"?l(s):l);n.current=!0,a("?"+d,c)},[a,s]);return[s,o]}function D6(e,t){t===void 0&&(t={});let n=b.useContext(T6);n==null&&We(!1);let{basename:r}=M6(gm.useViewTransitionState),s=jd(e,{relative:t.relative});if(!n.isTransitioning)return!1;let a=Mo(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Mo(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Ru(s.pathname,o)!=null||Ru(s.pathname,a)!=null}const Mu="imperiotapete_utm_params",F6=24;function Nd(){if(typeof window>"u")return Lu();const e=new URLSearchParams(window.location.search);if(e.has("utm_source")||e.has("utm_campaign")||e.has("utm_medium")||e.has("utm_content")||e.has("utm_term")||e.has("src")||e.has("sck")){const n={utm_source:e.get("utm_source"),utm_campaign:e.get("utm_campaign"),utm_medium:e.get("utm_medium"),utm_content:e.get("utm_content"),utm_term:e.get("utm_term"),src:e.get("src"),sck:e.get("sck"),timestamp:Date.now()};localStorage.setItem(Mu,JSON.stringify(n))}return Lu()}function Lu(){const e={utm_source:null,utm_campaign:null,utm_medium:null,utm_content:null,utm_term:null,src:null,sck:null};if(typeof window>"u")return e;try{const t=localStorage.getItem(Mu);if(!t)return e;const n=JSON.parse(t),r=F6*60*60*1e3;if(Date.now()-n.timestamp>r)return localStorage.removeItem(Mu),e;const{timestamp:s,...a}=n;return a}catch{return e}}function $6(){typeof window>"u"||localStorage.removeItem(Mu)}function B6(e){const t=Lu(),n=new URL(e,window.location.origin);for(const[r,s]of Object.entries(t))s&&n.searchParams.set(r,s);return n.pathname+n.search}function U6(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(h){try{d(r.next(h))}catch(f){o(f)}}function c(h){try{d(r.throw(h))}catch(f){o(f)}}function d(h){h.done?a(h.value):s(h.value).then(l,c)}d((r=r.apply(e,t||[])).next())})}const z6=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);class gg extends Error{constructor(t,n="FunctionsError",r){super(t),this.name=n,this.context=r}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class V6 extends gg{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class Qy extends gg{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class Yy extends gg{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var ym;(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"})(ym||(ym={}));class H6{constructor(t,{headers:n={},customFetch:r,region:s=ym.Any}={}){this.url=t,this.headers=n,this.region=s,this.fetch=z6(r)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return U6(this,arguments,void 0,function*(n,r={}){var s;let a,o;try{const{headers:l,method:c,body:d,signal:h,timeout:f}=r;let p={},{region:m}=r;m||(m=this.region);const y=new URL(`${this.url}/${n}`);m&&m!=="any"&&(p["x-region"]=m,y.searchParams.set("forceFunctionRegion",m));let g;d&&(l&&!Object.prototype.hasOwnProperty.call(l,"Content-Type")||!l)?typeof Blob<"u"&&d instanceof Blob||d instanceof ArrayBuffer?(p["Content-Type"]="application/octet-stream",g=d):typeof d=="string"?(p["Content-Type"]="text/plain",g=d):typeof FormData<"u"&&d instanceof FormData?g=d:(p["Content-Type"]="application/json",g=JSON.stringify(d)):d&&typeof d!="string"&&!(typeof Blob<"u"&&d instanceof Blob)&&!(d instanceof ArrayBuffer)&&!(typeof FormData<"u"&&d instanceof FormData)?g=JSON.stringify(d):g=d;let S=h;f&&(o=new AbortController,a=setTimeout(()=>o.abort(),f),h?(S=o.signal,h.addEventListener("abort",()=>o.abort())):S=o.signal);const w=yield this.fetch(y.toString(),{method:c||"POST",headers:Object.assign(Object.assign(Object.assign({},p),this.headers),l),body:g,signal:S}).catch(j=>{throw new V6(j)}),v=w.headers.get("x-relay-error");if(v&&v==="true")throw new Qy(w);if(!w.ok)throw new Yy(w);let x=((s=w.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),k;return x==="application/json"?k=yield w.json():x==="application/octet-stream"||x==="application/pdf"?k=yield w.blob():x==="text/event-stream"?k=w:x==="multipart/form-data"?k=yield w.formData():k=yield w.text(),{data:k,error:null,response:w}}catch(l){return{data:null,error:l,response:l instanceof Yy||l instanceof Qy?l.context:void 0}}finally{a&&clearTimeout(a)}})}}const oS=3,Zy=e=>Math.min(1e3*2**e,3e4),q6=[520,503],iS=["GET","HEAD","OPTIONS"];var G6=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function ex(e,t){return new Promise(n=>{if(t!=null&&t.aborted){n();return}const r=setTimeout(()=>{t==null||t.removeEventListener("abort",s),n()},e);function s(){clearTimeout(r),n()}t==null||t.addEventListener("abort",s)})}function W6(e,t,n,r){return!(!r||n>=oS||!iS.includes(e)||!q6.includes(t))}var K6=class{constructor(e){var t,n,r,s,a;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=(n=e.isMaybeSingle)!==null&&n!==void 0?n:!1,this.shouldStripNulls=(r=e.shouldStripNulls)!==null&&r!==void 0?r:!1,this.urlLengthLimit=(s=e.urlLengthLimit)!==null&&s!==void 0?s:8e3,this.retryEnabled=(a=e.retry)!==null&&a!==void 0?a:!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 n=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 r=this.fetch;let a=(async()=>{let o=0;for(;;){const d=new Headers(n.headers);o>0&&d.set("X-Retry-Count",String(o));let h;try{h=await r(n.url.toString(),{method:n.method,headers:d,body:JSON.stringify(n.body,(f,p)=>typeof p=="bigint"?p.toString():p),signal:n.signal})}catch(f){if((f==null?void 0:f.name)==="AbortError"||(f==null?void 0:f.code)==="ABORT_ERR"||!iS.includes(n.method))throw f;if(n.retryEnabled&&o{var l;let c="",d="",h="";const f=o==null?void 0:o.cause;if(f){var p,m,y,g;const v=(p=f==null?void 0:f.message)!==null&&p!==void 0?p:"",x=(m=f==null?void 0:f.code)!==null&&m!==void 0?m:"";c=`${(y=o==null?void 0:o.name)!==null&&y!==void 0?y:"FetchError"}: ${o==null?void 0:o.message}`,c+=` Caused by: ${(g=f==null?void 0:f.name)!==null&&g!==void 0?g:"Error"}: ${v}`,x&&(c+=` (${x})`),f!=null&&f.stack&&(c+=` ${f.stack}`)}else{var S;c=(S=o==null?void 0:o.stack)!==null&&S!==void 0?S:""}const w=this.url.toString().length;return(o==null?void 0:o.name)==="AbortError"||(o==null?void 0:o.code)==="ABORT_ERR"?(h="",d="Request was aborted (timeout or manual cancellation)",w>this.urlLengthLimit&&(d+=`. Note: Your request URL is ${w} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((f==null?void 0:f.name)==="HeadersOverflowError"||(f==null?void 0:f.code)==="UND_ERR_HEADERS_OVERFLOW")&&(h="",d="HTTP headers exceeded server limits (typically 16KB)",w>this.urlLengthLimit&&(d+=`. Your request URL is ${w} 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:d,code:h},data:null,count:null,status:0,statusText:""}})),a.then(e,t)}async processResponse(e){var t=this;let n=null,r=null,s=null,a=e.status,o=e.statusText;if(e.ok){var l,c;if(t.method!=="HEAD"){var d;const p=await e.text();p===""||(t.headers.get("Accept")==="text/csv"||t.headers.get("Accept")&&(!((d=t.headers.get("Accept"))===null||d===void 0)&&d.includes("application/vnd.pgrst.plan+text"))?r=p:r=JSON.parse(p))}const h=(l=t.headers.get("Prefer"))===null||l===void 0?void 0:l.match(/count=(exact|planned|estimated)/),f=(c=e.headers.get("content-range"))===null||c===void 0?void 0:c.split("/");h&&f&&f.length>1&&(s=parseInt(f[1])),t.isMaybeSingle&&Array.isArray(r)&&(r.length>1?(n={code:"PGRST116",details:`Results contain ${r.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},r=null,s=null,a=406,o="Not Acceptable"):r.length===1?r=r[0]:r=null)}else{const h=await e.text();try{n=JSON.parse(h),Array.isArray(n)&&e.status===404&&(r=[],n=null,a=200,o="OK")}catch{e.status===404&&h===""?(a=204,o="No Content"):n={message:h}}if(n&&t.shouldThrowOnError)throw new G6(n)}return{success:n===null,error:n,data:r,count:s,status:a,statusText:o}}returns(){return this}overrideTypes(){return this}},X6=class extends K6{select(e){let t=!1;const n=(e??"*").split("").map(r=>/\s/.test(r)&&!t?"":(r==='"'&&(t=!t),r)).join("");return this.url.searchParams.set("select",n),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:n,foreignTable:r,referencedTable:s=r}={}){const a=s?`${s}.order`:"order",o=this.url.searchParams.get(a);return this.url.searchParams.set(a,`${o?`${o},`:""}${e}.${t?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:n=t}={}){const r=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(r,`${e}`),this}range(e,t,{foreignTable:n,referencedTable:r=n}={}){const s=typeof r>"u"?"offset":`${r}.offset`,a=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(s,`${e}`),this.url.searchParams.set(a,`${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:n=!1,buffers:r=!1,wal:s=!1,format:a="text"}={}){var o;const l=[e?"analyze":null,t?"verbose":null,n?"settings":null,r?"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+${a}; for="${c}"; options=${l};`),a==="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 tx=new RegExp("[,()]");var Da=class extends X6{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){const n=Array.from(new Set(t)).map(r=>typeof r=="string"&&tx.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(e,`in.(${n})`),this}notIn(e,t){const n=Array.from(new Set(t)).map(r=>typeof r=="string"&&tx.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(e,`not.in.(${n})`),this}contains(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t=="string"?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:n,type:r}={}){let s="";r==="plain"?s="pl":r==="phrase"?s="ph":r==="websearch"&&(s="w");const a=n===void 0?"":`(${n})`;return this.url.searchParams.append(e,`${s}fts${a}.${t}`),this}match(e){return Object.entries(e).filter(([t,n])=>n!==void 0).forEach(([t,n])=>{this.url.searchParams.append(t,`eq.${n}`)}),this}not(e,t,n){return this.url.searchParams.append(e,`not.${t}.${n}`),this}or(e,{foreignTable:t,referencedTable:n=t}={}){const r=n?`${n}.or`:"or";return this.url.searchParams.append(r,`(${e})`),this}filter(e,t,n){return this.url.searchParams.append(e,`${t}.${n}`),this}},J6=class{constructor(e,{headers:t={},schema:n,fetch:r,urlLengthLimit:s=8e3,retry:a}){this.url=e,this.headers=new Headers(t),this.schema=n,this.fetch=r,this.urlLengthLimit=s,this.retry=a}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){const{head:n=!1,count:r}=t??{},s=n?"HEAD":"GET";let a=!1;const o=(e??"*").split("").map(d=>/\s/.test(d)&&!a?"":(d==='"'&&(a=!a),d)).join(""),{url:l,headers:c}=this.cloneRequestState();return l.searchParams.set("select",o),r&&c.append("Prefer",`count=${r}`),new Da({method:s,url:l,headers:c,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(e,{count:t,defaultToNull:n=!0}={}){var r;const s="POST",{url:a,headers:o}=this.cloneRequestState();if(t&&o.append("Prefer",`count=${t}`),n||o.append("Prefer","missing=default"),Array.isArray(e)){const l=e.reduce((c,d)=>c.concat(Object.keys(d)),[]);if(l.length>0){const c=[...new Set(l)].map(d=>`"${d}"`);a.searchParams.set("columns",c.join(","))}}return new Da({method:s,url:a,headers:o,schema:this.schema,body:e,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(e,{onConflict:t,ignoreDuplicates:n=!1,count:r,defaultToNull:s=!0}={}){var a;const o="POST",{url:l,headers:c}=this.cloneRequestState();if(c.append("Prefer",`resolution=${n?"ignore":"merge"}-duplicates`),t!==void 0&&l.searchParams.set("on_conflict",t),r&&c.append("Prefer",`count=${r}`),s||c.append("Prefer","missing=default"),Array.isArray(e)){const d=e.reduce((h,f)=>h.concat(Object.keys(f)),[]);if(d.length>0){const h=[...new Set(d)].map(f=>`"${f}"`);l.searchParams.set("columns",h.join(","))}}return new Da({method:o,url:l,headers:c,schema:this.schema,body:e,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(e,{count:t}={}){var n;const r="PATCH",{url:s,headers:a}=this.cloneRequestState();return t&&a.append("Prefer",`count=${t}`),new Da({method:r,url:s,headers:a,schema:this.schema,body:e,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:e}={}){var t;const n="DELETE",{url:r,headers:s}=this.cloneRequestState();return e&&s.append("Prefer",`count=${e}`),new Da({method:n,url:r,headers:s,schema:this.schema,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function dl(e){"@babel/helpers - typeof";return dl=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},dl(e)}function Q6(e,t){if(dl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(dl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Y6(e){var t=Q6(e,"string");return dl(t)=="symbol"?t:t+""}function Z6(e,t,n){return(t=Y6(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function dc(e){for(var t=1;t0?this.fetch=(d,h)=>{const f=new AbortController,p=setTimeout(()=>f.abort(),a),m=h==null?void 0:h.signal;if(m){if(m.aborted)return clearTimeout(p),c(d,h);const y=()=>{clearTimeout(p),f.abort()};return m.addEventListener("abort",y,{once:!0}),c(d,dc(dc({},h),{},{signal:f.signal})).finally(()=>{clearTimeout(p),m.removeEventListener("abort",y)})}return c(d,dc(dc({},h),{},{signal:f.signal})).finally(()=>clearTimeout(p))}: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 J6(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 lS(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(t,n={},{head:r=!1,get:s=!1,count:a}={}){var o;let l;const c=new URL(`${this.url}/rpc/${t}`);let d;const h=m=>m!==null&&typeof m=="object"&&(!Array.isArray(m)||m.some(h)),f=r&&Object.values(n).some(h);f?(l="POST",d=n):r||s?(l=r?"HEAD":"GET",Object.entries(n).filter(([m,y])=>y!==void 0).map(([m,y])=>[m,Array.isArray(y)?`{${y.join(",")}}`:`${y}`]).forEach(([m,y])=>{c.searchParams.append(m,y)})):(l="POST",d=n);const p=new Headers(this.headers);return f?p.set("Prefer",a?`count=${a},return=minimal`:"return=minimal"):a&&p.set("Prefer",`count=${a}`),new Da({method:l,url:c,headers:p,schema:this.schemaName,body:d,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class t3{constructor(){}static detectEnvironment(){var t;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((t=navigator.userAgent)===null||t===void 0)&&t.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const n=globalThis.process;if(n){const r=n.versions;if(r&&r.node){const s=r.node,a=parseInt(s.replace(/^v/,"").split(".")[0]);return a>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${a} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${a} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option: import ws from "ws" new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const t=this.detectEnvironment();if(t.constructor)return t.constructor;let n=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(n+=` Suggested solution: ${t.workaround}`),new Error(n)}static isWebSocketSupported(){try{const t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}}const n3="2.104.0",r3=`realtime-js/${n3}`,s3="1.0.0",cS="2.0.0",a3=cS,o3=1e4,i3=100,cs={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},uS={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave",access_token:"access_token"},xm={connecting:"connecting",open:"open",closing:"closing",closed:"closed"};class l3{constructor(t){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=t??[]}encode(t,n){if(t.event===this.BROADCAST_EVENT&&!(t.payload instanceof ArrayBuffer)&&typeof t.payload.event=="string")return n(this._binaryEncodeUserBroadcastPush(t));let r=[t.join_ref,t.ref,t.topic,t.event,t.payload];return n(JSON.stringify(r))}_binaryEncodeUserBroadcastPush(t){var n;return this._isArrayBuffer((n=t.payload)===null||n===void 0?void 0:n.payload)?this._encodeBinaryUserBroadcastPush(t):this._encodeJsonUserBroadcastPush(t)}_encodeBinaryUserBroadcastPush(t){var n,r;const s=(r=(n=t.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:new ArrayBuffer(0);return this._encodeUserBroadcastPush(t,this.BINARY_ENCODING,s)}_encodeJsonUserBroadcastPush(t){var n,r;const s=(r=(n=t.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:{},o=new TextEncoder().encode(JSON.stringify(s)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,o)}_encodeUserBroadcastPush(t,n,r){var s,a;const o=t.topic,l=(s=t.ref)!==null&&s!==void 0?s:"",c=(a=t.join_ref)!==null&&a!==void 0?a:"",d=t.payload.event,h=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},f=Object.keys(h).length===0?"":JSON.stringify(h);if(c.length>255)throw new Error(`joinRef length ${c.length} exceeds maximum of 255`);if(l.length>255)throw new Error(`ref length ${l.length} exceeds maximum of 255`);if(o.length>255)throw new Error(`topic length ${o.length} exceeds maximum of 255`);if(d.length>255)throw new Error(`userEvent length ${d.length} exceeds maximum of 255`);if(f.length>255)throw new Error(`metadata length ${f.length} exceeds maximum of 255`);const p=this.USER_BROADCAST_PUSH_META_LENGTH+c.length+l.length+o.length+d.length+f.length,m=new ArrayBuffer(this.HEADER_LENGTH+p);let y=new DataView(m),g=0;y.setUint8(g++,this.KINDS.userBroadcastPush),y.setUint8(g++,c.length),y.setUint8(g++,l.length),y.setUint8(g++,o.length),y.setUint8(g++,d.length),y.setUint8(g++,f.length),y.setUint8(g++,n),Array.from(c,w=>y.setUint8(g++,w.charCodeAt(0))),Array.from(l,w=>y.setUint8(g++,w.charCodeAt(0))),Array.from(o,w=>y.setUint8(g++,w.charCodeAt(0))),Array.from(d,w=>y.setUint8(g++,w.charCodeAt(0))),Array.from(f,w=>y.setUint8(g++,w.charCodeAt(0)));var S=new Uint8Array(m.byteLength+r.byteLength);return S.set(new Uint8Array(m),0),S.set(new Uint8Array(r),m.byteLength),S.buffer}decode(t,n){if(this._isArrayBuffer(t)){let r=this._binaryDecode(t);return n(r)}if(typeof t=="string"){const r=JSON.parse(t),[s,a,o,l,c]=r;return n({join_ref:s,ref:a,topic:o,event:l,payload:c})}return n({})}_binaryDecode(t){const n=new DataView(t),r=n.getUint8(0),s=new TextDecoder;switch(r){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(t,n,s)}}_decodeUserBroadcast(t,n,r){const s=n.getUint8(1),a=n.getUint8(2),o=n.getUint8(3),l=n.getUint8(4);let c=this.HEADER_LENGTH+4;const d=r.decode(t.slice(c,c+s));c=c+s;const h=r.decode(t.slice(c,c+a));c=c+a;const f=r.decode(t.slice(c,c+o));c=c+o;const p=t.slice(c,t.byteLength),m=l===this.JSON_ENCODING?JSON.parse(r.decode(p)):p,y={type:this.BROADCAST_EVENT,event:h,payload:m};return o>0&&(y.meta=JSON.parse(f)),{join_ref:null,ref:null,topic:d,event:this.BROADCAST_EVENT,payload:y}}_isArrayBuffer(t){var n;return t instanceof ArrayBuffer||((n=t==null?void 0:t.constructor)===null||n===void 0?void 0:n.name)==="ArrayBuffer"}_pick(t,n){return!t||typeof t!="object"?{}:Object.fromEntries(Object.entries(t).filter(([r])=>n.includes(r)))}}var Te;(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"})(Te||(Te={}));const rx=(e,t,n={})=>{var r;const s=(r=n.skipTypes)!==null&&r!==void 0?r:[];return t?Object.keys(t).reduce((a,o)=>(a[o]=c3(o,e,t,s),a),{}):{}},c3=(e,t,n,r)=>{const s=t.find(l=>l.name===e),a=s==null?void 0:s.type,o=n[e];return a&&!r.includes(a)?dS(a,o):vm(o)},dS=(e,t)=>{if(e.charAt(0)==="_"){const n=e.slice(1,e.length);return f3(t,n)}switch(e){case Te.bool:return u3(t);case Te.float4:case Te.float8:case Te.int2:case Te.int4:case Te.int8:case Te.numeric:case Te.oid:return d3(t);case Te.json:case Te.jsonb:return h3(t);case Te.timestamp:return m3(t);case Te.abstime:case Te.date:case Te.daterange:case Te.int4range:case Te.int8range:case Te.money:case Te.reltime:case Te.text:case Te.time:case Te.timestamptz:case Te.timetz:case Te.tsrange:case Te.tstzrange:return vm(t);default:return vm(t)}},vm=e=>e,u3=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},d3=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},h3=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},f3=(e,t)=>{if(typeof e!="string")return e;const n=e.length-1,r=e[n];if(e[0]==="{"&&r==="}"){let a;const o=e.slice(1,n);try{a=JSON.parse("["+o+"]")}catch{a=o?o.split(","):[]}return a.map(l=>dS(t,l))}return e},m3=e=>typeof e=="string"?e.replace(" ","T"):e,hS=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 Ri=e=>typeof e=="function"?e:function(){return e},p3=typeof self<"u"?self:null,Fa=typeof window<"u"?window:null,ir=p3||Fa||globalThis,g3="2.0.0",y3=1e4,x3=1e3,dr={connecting:0,open:1,closing:2,closed:3},Dt={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},Ir={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},bm={longpoll:"longpoll",websocket:"websocket"},v3={complete:4},wm="base64url.bearer.phx.",hc=class{constructor(e,t,n,r){this.channel=e,this.event=t,this.payload=n||function(){return{}},this.receivedResp=null,this.timeout=r,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:n}){this.recHooks.filter(r=>r.status===e).forEach(r=>r.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})}},fS=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))}},b3=class{constructor(e,t,n){this.state=Dt.closed,this.topic=e,this.params=Ri(t||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new hc(this,Ir.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new fS(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=Dt.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(r=>r.send()),this.pushBuffer=[]}),this.joinPush.receive("error",r=>{this.state=Dt.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,r),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=Dt.closed,this.socket.remove(this)}),this.onError(r=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,r),this.isJoining()&&this.joinPush.reset(),this.state=Dt.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new hc(this,Ir.leave,Ri({}),this.timeout).send(),this.state=Dt.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(Ir.reply,(r,s)=>{this.trigger(this.replyEventName(s),r)})}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}teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Dt.closed,this.bindings=[]}onClose(e){this.on(Ir.close,e)}onError(e){return this.on(Ir.error,t=>e(t))}on(e,t){let n=this.bindingRef++;return this.bindings.push({event:e,ref:n,callback:t}),n}off(e,t){this.bindings=this.bindings.filter(n=>!(n.event===e&&(typeof t>"u"||t===n.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,n=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 r=new hc(this,e,function(){return t},n);return this.canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=Dt.leaving;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(Ir.close,"leave")},n=new hc(this,Ir.leave,Ri({}),e);return n.receive("ok",()=>t()).receive("timeout",()=>t()),n.send(),this.canPush()||n.trigger("ok",{}),n}onMessage(e,t,n){return t}filterBindings(e,t,n){return!0}isMember(e,t,n,r){return this.topic!==e?!1:r&&r!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:n,joinRef:r}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=Dt.joining,this.joinPush.resend(e))}trigger(e,t,n,r){let s=this.onMessage(e,t,n,r);if(t&&!s)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let a=this.bindings.filter(o=>o.event===e&&this.filterBindings(o,t,n));for(let o=0;oc.abort(),s),l.signal=c.signal),ir.fetch(t,l).then(d=>d.text()).then(d=>this.parseJSON(d)).then(d=>o&&o(d)).catch(d=>{d.name==="AbortError"&&a?a():o&&o(null)}),c}static xdomainRequest(e,t,n,r,s,a,o){return e.timeout=s,e.open(t,n),e.onload=()=>{let l=this.parseJSON(e.responseText);o&&o(l)},a&&(e.ontimeout=a),e.onprogress=()=>{},e.send(r),e}static xhrRequest(e,t,n,r,s,a,o,l){e.open(t,n,!0),e.timeout=a;for(let[c,d]of Object.entries(r))e.setRequestHeader(c,d);return e.onerror=()=>l&&l(null),e.onreadystatechange=()=>{if(e.readyState===v3.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 n=[];for(var r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;let s=t?`${t}[${r}]`:r,a=e[r];typeof a=="object"?n.push(this.serialize(a,s)):n.push(encodeURIComponent(s)+"="+encodeURIComponent(a))}return n.join("&")}static appendParams(e,t){if(Object.keys(t).length===0)return e;let n=e.match(/\?/)?"&":"?";return`${e}${n}${this.serialize(t)}`}},w3=e=>{let t="",n=new Uint8Array(e),r=n.byteLength;for(let s=0;sthis.poll(),0)}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+bm.websocket),"$1/"+bm.longpoll)}endpointURL(){return Du.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,n){this.close(e,t,n),this.readyState=dr.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===dr.open||this.readyState===dr.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:n,token:r,messages:s}=t;if(n===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=r}else n=0;switch(n){case 200:s.forEach(a=>{setTimeout(()=>this.onmessage({data:a}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=dr.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 ${n}`)}})}send(e){typeof e!="string"&&(e=w3(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(e){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},e.join(` `),()=>this.onerror("timeout"),t=>{this.awaitingBatchAck=!1,!t||t.status!==200?(this.onerror(t&&t.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(e,t,n){for(let s of this.reqs)s.abort();this.readyState=dr.closed;let r=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:n});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",r)):this.onclose(r)}ajax(e,t,n,r,s){let a,o=()=>{this.reqs.delete(a),r()};a=Du.request(e,this.endpointURL(),t,n,this.timeout,o,l=>{this.reqs.delete(a),this.isActive()&&s(l)}),this.reqs.add(a)}},S3=class vi{constructor(t,n={}){let r=n.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=t,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(r.state,s=>{let{onJoin:a,onLeave:o,onSync:l}=this.caller;this.joinRef=this.channel.joinRef(),this.state=vi.syncState(this.state,s,a,o),this.pendingDiffs.forEach(c=>{this.state=vi.syncDiff(this.state,c,a,o)}),this.pendingDiffs=[],l()}),this.channel.on(r.diff,s=>{let{onJoin:a,onLeave:o,onSync:l}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(s):(this.state=vi.syncDiff(this.state,s,a,o),l())})}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}list(t){return vi.list(this.state,t)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(t,n,r,s){let a=this.clone(t),o={},l={};return this.map(a,(c,d)=>{n[c]||(l[c]=d)}),this.map(n,(c,d)=>{let h=a[c];if(h){let f=d.metas.map(g=>g.phx_ref),p=h.metas.map(g=>g.phx_ref),m=d.metas.filter(g=>p.indexOf(g.phx_ref)<0),y=h.metas.filter(g=>f.indexOf(g.phx_ref)<0);m.length>0&&(o[c]=d,o[c].metas=m),y.length>0&&(l[c]=this.clone(h),l[c].metas=y)}else o[c]=d}),this.syncDiff(a,{joins:o,leaves:l},r,s)}static syncDiff(t,n,r,s){let{joins:a,leaves:o}=this.clone(n);return r||(r=function(){}),s||(s=function(){}),this.map(a,(l,c)=>{let d=t[l];if(t[l]=this.clone(c),d){let h=t[l].metas.map(p=>p.phx_ref),f=d.metas.filter(p=>h.indexOf(p.phx_ref)<0);t[l].metas.unshift(...f)}r(l,d,c)}),this.map(o,(l,c)=>{let d=t[l];if(!d)return;let h=c.metas.map(f=>f.phx_ref);d.metas=d.metas.filter(f=>h.indexOf(f.phx_ref)<0),s(l,d,c),d.metas.length===0&&delete t[l]}),t}static list(t,n){return n||(n=function(r,s){return s}),this.map(t,(r,s)=>n(r,s))}static map(t,n){return Object.getOwnPropertyNames(t).map(r=>n(r,t[r]))}static clone(t){return JSON.parse(JSON.stringify(t))}},fc={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 n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(n))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[n,r,s,a,o]=JSON.parse(e);return t({join_ref:n,ref:r,topic:s,event:a,payload:o})}},binaryEncode(e){let{join_ref:t,ref:n,event:r,topic:s,payload:a}=e,o=this.META_LENGTH+t.length+n.length+s.length+r.length,l=new ArrayBuffer(this.HEADER_LENGTH+o),c=new DataView(l),d=0;c.setUint8(d++,this.KINDS.push),c.setUint8(d++,t.length),c.setUint8(d++,n.length),c.setUint8(d++,s.length),c.setUint8(d++,r.length),Array.from(t,f=>c.setUint8(d++,f.charCodeAt(0))),Array.from(n,f=>c.setUint8(d++,f.charCodeAt(0))),Array.from(s,f=>c.setUint8(d++,f.charCodeAt(0))),Array.from(r,f=>c.setUint8(d++,f.charCodeAt(0)));var h=new Uint8Array(l.byteLength+a.byteLength);return h.set(new Uint8Array(l),0),h.set(new Uint8Array(a),l.byteLength),h.buffer},binaryDecode(e){let t=new DataView(e),n=t.getUint8(0),r=new TextDecoder;switch(n){case this.KINDS.push:return this.decodePush(e,t,r);case this.KINDS.reply:return this.decodeReply(e,t,r);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,r)}},decodePush(e,t,n){let r=t.getUint8(1),s=t.getUint8(2),a=t.getUint8(3),o=this.HEADER_LENGTH+this.META_LENGTH-1,l=n.decode(e.slice(o,o+r));o=o+r;let c=n.decode(e.slice(o,o+s));o=o+s;let d=n.decode(e.slice(o,o+a));o=o+a;let h=e.slice(o,e.byteLength);return{join_ref:l,ref:null,topic:c,event:d,payload:h}},decodeReply(e,t,n){let r=t.getUint8(1),s=t.getUint8(2),a=t.getUint8(3),o=t.getUint8(4),l=this.HEADER_LENGTH+this.META_LENGTH,c=n.decode(e.slice(l,l+r));l=l+r;let d=n.decode(e.slice(l,l+s));l=l+s;let h=n.decode(e.slice(l,l+a));l=l+a;let f=n.decode(e.slice(l,l+o));l=l+o;let p=e.slice(l,e.byteLength),m={status:f,response:p};return{join_ref:c,ref:d,topic:h,event:Ir.reply,payload:m}},decodeBroadcast(e,t,n){let r=t.getUint8(1),s=t.getUint8(2),a=this.HEADER_LENGTH+2,o=n.decode(e.slice(a,a+r));a=a+r;let l=n.decode(e.slice(a,a+s));a=a+s;let c=e.slice(a,e.byteLength);return{join_ref:null,ref:null,topic:o,event:l,payload:c}}},k3=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||y3,this.transport=t.transport||ir.WebSocket||Ea,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=t.sessionStorage||ir&&ir.sessionStorage,this.establishedConnections=0,this.defaultEncoder=fc.encode.bind(fc),this.defaultDecoder=fc.decode.bind(fc),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!==Ea?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let n=null;Fa&&Fa.addEventListener&&(Fa.addEventListener("pagehide",r=>{this.conn&&(this.disconnect(),n=this.connectClock)}),Fa.addEventListener("pageshow",r=>{n===this.connectClock&&(n=null,this.connect())}),Fa.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=r=>t.rejoinAfterMs?t.rejoinAfterMs(r):[1e3,2e3,5e3][r-1]||1e4,this.reconnectAfterMs=r=>t.reconnectAfterMs?t.reconnectAfterMs(r):[10,50,100,150,200,250,500,1e3,2e3][r-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(r,s,a)=>{console.log(`${r}: ${s}`,a)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=Ri(t.params||{}),this.endPoint=`${e}/${bm.websocket}`,this.vsn=t.vsn||g3,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new fS(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{t.beforeReconnect&&await t.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=t.authToken}getLongPollTransport(){return Ea}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=Du.appendParams(Du.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,n){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,e&&e()},t,n)}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=Ri(e)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==Ea?this.connectWithFallback(Ea,this.longPollFallbackMs):this.transportConnect())}log(e,t,n){this.logger&&this.logger(e,t,n)}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(),n=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let r=this.onMessage(s=>{s.ref===t&&(this.off([r]),e(Date.now()-n))});return!0}transportName(e){switch(e){case Ea:return"LongPoll";default:return e.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let e;this.authToken&&(e=["phoenix",`${wm}${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 n=!1,r=!0,s,a,o=this.transportName(e),l=c=>{this.log("transport",`falling back to ${o}...`,c),this.off([s,a]),r=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${o}`))return l("memorized");this.fallbackTimer=setTimeout(l,t),a=this.onError(c=>{this.log("transport","error",c),r&&!n&&(clearTimeout(this.fallbackTimer),l(c))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(n=!0,!r){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(),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),x3,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(e,t,n){if(!this.conn)return e&&e();const r=this.conn;this.waitForBufferDone(r,()=>{t?r.close(t,n||""):r.close(),this.waitForSocketClosed(r,()=>{this.conn===r&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e()})})}waitForBufferDone(e,t,n=1){if(n===5||!e.bufferedAmount){t();return}setTimeout(()=>{this.waitForBufferDone(e,t,n+1)},150*n)}waitForSocketClosed(e,t,n=1){if(n===5||e.readyState===dr.closed){t();return}setTimeout(()=>{this.waitForSocketClosed(e,t,n+1)},150*n)}onConnClose(e){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",e)}onConnError(e){this.hasLogger()&&this.log("transport",e);let t=this.transport,n=this.establishedConnections;this.triggerStateCallbacks("error",e,t,n),(t===this.transport||n>0)&&this.triggerChanError()}triggerChanError(){this.channels.forEach(e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger(Ir.error)})}connectionState(){switch(this.conn&&this.conn.readyState){case dr.connecting:return"connecting";case dr.open:return"open";case dr.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(([n])=>e.indexOf(n)===-1)}channel(e,t={}){let n=new b3(e,t,this);return this.channels.push(n),n}push(e){if(this.hasLogger()){let{topic:t,event:n,payload:r,ref:s,join_ref:a}=e;this.log("push",`${t} ${n} (${a}, ${s})`,r)}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:n,event:r,payload:s,ref:a,join_ref:o}=t;if(a&&a===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||""} ${n} ${r} ${a&&"("+a+")"||""}`.trim(),s);for(let l=0;l{try{r(...t)}catch(s){this.log("error",`error in ${e} callback`,s)}})}catch(n){this.log("error",`error triggering ${e} callbacks`,n)}}leaveOpenTopic(e){let t=this.channels.find(n=>n.topic===e&&(n.isJoined()||n.isJoining()));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave())}};class Ii{constructor(t,n){const r=j3(n);this.presence=new S3(t.getChannel(),r),this.presence.onJoin((s,a,o)=>{const l=Ii.onJoinPayload(s,a,o);t.getChannel().trigger("presence",l)}),this.presence.onLeave((s,a,o)=>{const l=Ii.onLeavePayload(s,a,o);t.getChannel().trigger("presence",l)}),this.presence.onSync(()=>{t.getChannel().trigger("presence",{event:"sync"})})}get state(){return Ii.transformState(this.presence.state)}static transformState(t){return t=C3(t),Object.getOwnPropertyNames(t).reduce((n,r)=>{const s=t[r];return n[r]=qc(s),n},{})}static onJoinPayload(t,n,r){const s=sx(n),a=qc(r);return{event:"join",key:t,currentPresences:s,newPresences:a}}static onLeavePayload(t,n,r){const s=sx(n),a=qc(r);return{event:"leave",key:t,currentPresences:s,leftPresences:a}}}function qc(e){return e.metas.map(t=>(t.presence_ref=t.phx_ref,delete t.phx_ref,delete t.phx_ref_prev,t))}function C3(e){return JSON.parse(JSON.stringify(e))}function j3(e){return(e==null?void 0:e.events)&&{events:e.events}}function sx(e){return e!=null&&e.metas?qc(e):[]}var ax;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(ax||(ax={}));class E3{get state(){return this.presenceAdapter.state}constructor(t,n){this.channel=t,this.presenceAdapter=new Ii(this.channel.channelAdapter,n)}}class N3{constructor(t,n,r){const s=_3(r);this.channel=t.getSocket().channel(n,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,n){return this.channel.on(t,n)}off(t,n){this.channel.off(t,n)}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,n,r){let s;try{s=this.channel.push(t,n,r)}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>i3){const a=this.channel.pushBuffer.shift();a.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${a.event}`,a.payload())}return s}updateJoinPayload(t){const n=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},n),t)}canPush(){return this.socket.isConnected()&&this.state===cs.joined}isJoined(){return this.state===cs.joined}isJoining(){return this.state===cs.joining}isClosed(){return this.state===cs.closed}isLeaving(){return this.state===cs.leaving}updateFilterBindings(t){this.channel.filterBindings=t}updatePayloadTransform(t){this.channel.onMessage=t}getChannel(){return this.channel}}function _3(e){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},e.config)}}var ox;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(ox||(ox={}));var Za;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(Za||(Za={}));var Or;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(Or||(Or={}));class Oi{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,n={config:{}},r){var s,a;if(this.topic=t,this.params=n,this.socket=r,this.bindings={},this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},n.config),this.channelAdapter=new N3(this.socket.socketAdapter,t,this.params),this.presence=new E3(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=hS(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((a=(s=this.params.config)===null||s===void 0?void 0:s.broadcast)===null||a===void 0)&&a.replay))throw new Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(t,n=this.timeout){var r,s,a;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:o,presence:l,private:c}}=this.params,d=(s=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(m=>m.filter))!==null&&s!==void 0?s:[],h=!!this.bindings[Za.PRESENCE]&&this.bindings[Za.PRESENCE].length>0||((a=this.params.config.presence)===null||a===void 0?void 0:a.enabled)===!0,f={},p={broadcast:o,presence:Object.assign(Object.assign({},l),{enabled:h}),postgres_changes:d,private:c};this.socket.accessTokenValue&&(f.access_token=this.socket.accessTokenValue),this._onError(m=>{t==null||t(Or.CHANNEL_ERROR,m)}),this._onClose(()=>t==null?void 0:t(Or.CLOSED)),this.updateJoinPayload(Object.assign({config:p},f)),this._updateFilterMessage(),this.channelAdapter.subscribe(n).receive("ok",async({postgres_changes:m})=>{if(this.socket._isManualToken()||this.socket.setAuth(),m===void 0){t==null||t(Or.SUBSCRIBED);return}this._updatePostgresBindings(m,t)}).receive("error",m=>{this.state=cs.errored,t==null||t(Or.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(m).join(", ")||"error")))}).receive("timeout",()=>{t==null||t(Or.TIMED_OUT)})}return this}_updatePostgresBindings(t,n){var r;const s=this.bindings.postgres_changes,a=(r=s==null?void 0:s.length)!==null&&r!==void 0?r:0,o=[];for(let l=0;l{var o,l,c;const d=this.channelAdapter.push(t.type,t,n.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)&&a("ok"),d.receive("ok",()=>a("ok")),d.receive("error",()=>a("error")),d.receive("timeout",()=>a("timed out"))})}updateJoinPayload(t){this.channelAdapter.updateJoinPayload(t)}async unsubscribe(t=this.timeout){return new Promise(n=>{this.channelAdapter.unsubscribe(t).receive("ok",()=>n("ok")).receive("timeout",()=>n("timed out")).receive("error",()=>n("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(t,n,r){const s=new AbortController,a=setTimeout(()=>s.abort(),r),o=await this.socket.fetch(t,Object.assign(Object.assign({},n),{signal:s.signal}));return clearTimeout(a),o}_on(t,n,r){const s=t.toLocaleLowerCase(),a=this.channelAdapter.on(t,r),o={type:s,filter:n,callback:r,ref:a};return this.bindings[s]?this.bindings[s].push(o):this.bindings[s]=[o],this._updateFilterMessage(),this}_onClose(t){this.channelAdapter.onClose(t)}_onError(t){this.channelAdapter.onError(t)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((t,n,r)=>{var s,a,o,l,c,d,h;const f=t.event.toLocaleLowerCase();if(this._notThisChannelEvent(f,r))return!1;const p=(s=this.bindings[f])===null||s===void 0?void 0:s.find(m=>m.ref===t.ref);if(!p)return!0;if(["broadcast","presence","postgres_changes"].includes(f))if("id"in p){const m=p.id,y=(a=p.filter)===null||a===void 0?void 0:a.event;return m&&((o=n.ids)===null||o===void 0?void 0:o.includes(m))&&(y==="*"||(y==null?void 0:y.toLocaleLowerCase())===((l=n.data)===null||l===void 0?void 0:l.type.toLocaleLowerCase()))}else{const m=(d=(c=p==null?void 0:p.filter)===null||c===void 0?void 0:c.event)===null||d===void 0?void 0:d.toLocaleLowerCase();return m==="*"||m===((h=n==null?void 0:n.event)===null||h===void 0?void 0:h.toLocaleLowerCase())}else return p.type.toLocaleLowerCase()===f})}_notThisChannelEvent(t,n){const{close:r,error:s,leave:a,join:o}=uS;return n&&[r,s,a,o].includes(t)&&n!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((t,n,r)=>{if(typeof n=="object"&&"ids"in n){const s=n.data,{schema:a,table:o,commit_timestamp:l,type:c,errors:d}=s;return Object.assign(Object.assign({},{schema:a,table:o,commit_timestamp:l,eventType:c,new:{},old:{},errors:d}),this._getPayloadRecords(s))}return n})}copyBindings(t){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const n in t.bindings)for(const r of t.bindings[n])this._on(r.type,r.filter,r.callback)}static isFilterValueEqual(t,n){return(t??void 0)===(n??void 0)}_getPayloadRecords(t){const n={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(n.new=rx(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(n.old=rx(t.columns,t.old_record)),n}}class T3{constructor(t,n){this.socket=new k3(t,n)}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,n,r,s=1e4){return new Promise(a=>{setTimeout(()=>a("timeout"),s),this.socket.disconnect(()=>{t(),a("ok")},n,r)})}push(t){this.socket.push(t)}log(t,n,r){this.socket.log(t,n,r)}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()==xm.connecting}isDisconnecting(){return this.socket.connectionState()==xm.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const P3={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},A3=[1e3,2e3,5e3,1e4],R3=1e4,I3=` addEventListener("message", (e) => { if (e.data.event === "start") { setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); } });`;class O3{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,n){var r;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 l3,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._resolveFetch=a=>a?(...o)=>a(...o):(...o)=>fetch(...o),!(!((r=n==null?void 0:n.params)===null||r===void 0)&&r.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=n.params.apikey;const s=this._initializeOptions(n);this.socketAdapter=new T3(t,s),this.httpEndpoint=hS(t),this.fetch=this._resolveFetch(n==null?void 0:n.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 n=t.message;throw n.includes("Node.js")?new Error(`${n} To use Realtime in Node.js, you need to provide a WebSocket implementation: Option 1: Use Node.js 22+ which has native WebSocket support Option 2: Install and provide the "ws" package: npm install ws import ws from "ws" const client = new RealtimeClient(url, { ...options, transport: ws })`):new Error(`WebSocket not available: ${n}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(t,n){return this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},t,n)}getChannels(){return this.channels}async removeChannel(t){const n=await t.unsubscribe();return n==="ok"&&t.teardown(),this.channels.length===0&&this.disconnect(),n}async removeAllChannels(){const t=this.channels.map(async r=>{const s=await r.unsubscribe();return r.teardown(),s}),n=await Promise.all(t);return this.disconnect(),n}log(t,n,r){this.socketAdapter.log(t,n,r)}connectionState(){return this.socketAdapter.connectionState()||xm.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(t,n={config:{}}){const r=`realtime:${t}`,s=this.getChannels().find(a=>a.topic===r);if(s)return s;{const a=new Oi(`realtime:${t}`,n,this);return this.channels.push(a),a}}push(t){this.socketAdapter.push(t)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(t){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(t)}_makeRef(){return this.socketAdapter.makeRef()}_remove(t){this.channels=this.channels.filter(n=>n.topic!==t.topic)}async _performAuth(t=null){let n,r=!1;if(t)n=t,r=!0;else if(this.accessToken)try{n=await this.accessToken()}catch(s){this.log("error","Error fetching access token from callback",s),n=this.accessTokenValue}else n=this.accessTokenValue;r?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=n&&(this.accessTokenValue=n,this.channels.forEach(s=>{const a={access_token:n,version:r3};n&&s.updateJoinPayload(a),s.joinedOnce&&s.channelAdapter.isJoined()&&s.channelAdapter.push(uS.access_token,{access_token:n})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this._isManualToken()||this.setAuth().catch(n=>{this.log("error",`Error setting auth in ${t}`,n)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(n=>{this.log("error","error waiting for auth on connect",n)}),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(n,r)=>{n=="sent"&&this._setAuthSafely(),t&&t(n,r)}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=n=>{this.log("worker","worker error",n.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=n=>{n.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(t){let n;if(t)n=t;else{const r=new Blob([I3],{type:"application/javascript"});n=URL.createObjectURL(r)}return n}_initializeOptions(t){var n,r,s,a,o,l,c,d,h;this.worker=(n=t==null?void 0:t.worker)!==null&&n!==void 0?n:!1,this.accessToken=(r=t==null?void 0:t.accessToken)!==null&&r!==void 0?r:null;const f={};f.timeout=(s=t==null?void 0:t.timeout)!==null&&s!==void 0?s:o3,f.heartbeatIntervalMs=(a=t==null?void 0:t.heartbeatIntervalMs)!==null&&a!==void 0?a:P3.HEARTBEAT_INTERVAL,f.transport=(o=t==null?void 0:t.transport)!==null&&o!==void 0?o:t3.getWebSocketConstructor(),f.params=t==null?void 0:t.params,f.logger=t==null?void 0:t.logger,f.heartbeatCallback=this._wrapHeartbeatCallback(t==null?void 0:t.heartbeatCallback),f.reconnectAfterMs=(l=t==null?void 0:t.reconnectAfterMs)!==null&&l!==void 0?l:g=>A3[g-1]||R3;let p,m;const y=(c=t==null?void 0:t.vsn)!==null&&c!==void 0?c:a3;switch(y){case s3:p=(g,S)=>S(JSON.stringify(g)),m=(g,S)=>S(JSON.parse(g));break;case cS:p=this.serializer.encode.bind(this.serializer),m=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${f.vsn}`)}if(f.vsn=y,f.encode=(d=t==null?void 0:t.encode)!==null&&d!==void 0?d:p,f.decode=(h=t==null?void 0:t.decode)!==null&&h!==void 0?h:m,f.beforeReconnect=this._reconnectAuth.bind(this),(t!=null&&t.logLevel||t!=null&&t.log_level)&&(this.logLevel=t.logLevel||t.log_level,f.params=Object.assign(Object.assign({},f.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,f.autoSendHeartbeat=!this.worker}return f}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}var hl=class extends Error{constructor(e,t){var n;super(e),this.name="IcebergError",this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown=t.icebergType==="CommitStateUnknownException"||[500,502,504].includes(t.status)&&((n=t.icebergType)==null?void 0:n.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function M3(e,t,n){const r=new URL(t,e);if(n)for(const[s,a]of Object.entries(n))a!==void 0&&r.searchParams.set(s,a);return r.toString()}async function L3(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 D3(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:n,path:r,query:s,body:a,headers:o}){const l=M3(e.baseUrl,r,s),c=await L3(e.auth),d=await t(l,{method:n,headers:{...a?{"Content-Type":"application/json"}:{},...c,...o},body:a?JSON.stringify(a):void 0}),h=await d.text(),f=(d.headers.get("content-type")||"").includes("application/json"),p=f&&h?JSON.parse(h):h;if(!d.ok){const m=f?p:void 0,y=m==null?void 0:m.error;throw new hl((y==null?void 0:y.message)??`Request failed with status ${d.status}`,{status:d.status,icebergType:y==null?void 0:y.type,icebergCode:y==null?void 0:y.code,details:m})}return{status:d.status,headers:d.headers,data:p}}}}function mc(e){return e.join("")}var F3=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:mc(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(r=>({namespace:r}))}async createNamespace(e,t){const n={namespace:e.namespace,properties:t==null?void 0:t.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:n})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${mc(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${mc(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${mc(e.namespace)}`}),!0}catch(t){if(t instanceof hl&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(n){if(n instanceof hl&&n.status===409)return;throw n}}};function Na(e){return e.join("")}var $3=class{constructor(e,t="",n){this.client=e,this.prefix=t,this.accessDelegation=n}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Na(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){const n={};return this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Na(e.namespace)}/tables`,body:t,headers:n})).data.metadata}async updateTable(e,t){const n=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Na(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":n.data["metadata-location"],metadata:n.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Na(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/${Na(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/${Na(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(n){if(n instanceof hl&&n.status===404)return!1;throw n}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(n){if(n instanceof hl&&n.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw n}}},B3=class{constructor(e){var r;let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const n=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=D3({baseUrl:n,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=(r=e.accessDelegation)==null?void 0:r.join(","),this.namespaceOps=new F3(this.client,t),this.tableOps=new $3(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)}async 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 fl(e){"@babel/helpers - typeof";return fl=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},fl(e)}function U3(e,t){if(fl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(fl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function z3(e){var t=U3(e,"string");return fl(t)=="symbol"?t:t+""}function V3(e,t,n){return(t=z3(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ix(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function ne(e){for(var t=1;te?(...t)=>e(...t):(...t)=>fetch(...t),G3=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)},km=e=>{if(Array.isArray(e))return e.map(n=>km(n));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([n,r])=>{const s=n.replace(/([-_][a-z])/gi,a=>a.toUpperCase().replace(/[-_]/g,""));t[s]=km(r)}),t},W3=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e),lx=e=>{var t;return e.msg||e.message||e.error_description||(typeof e.error=="string"?e.error:(t=e.error)===null||t===void 0?void 0:t.message)||JSON.stringify(e)},K3=async(e,t,n,r)=>{if(e!==null&&typeof e=="object"&&typeof e.json=="function"){const s=e;let a=parseInt(s.status,10);Number.isFinite(a)||(a=500),s.json().then(o=>{const l=(o==null?void 0:o.statusCode)||(o==null?void 0:o.code)||a+"";t(new Sm(lx(o),a,l,r))}).catch(()=>{const o=a+"";t(new Sm(s.statusText||`HTTP ${a} error`,a,o,r))})}else t(new mS(lx(e),e,r))},X3=(e,t,n,r)=>{const s={method:e,headers:(t==null?void 0:t.headers)||{}};if(e==="GET"||e==="HEAD"||!r)return ne(ne({},s),n);if(G3(r)){var a;const o=(t==null?void 0:t.headers)||{};let l;for(const[c,d]of Object.entries(o))c.toLowerCase()==="content-type"&&(l=d);s.headers=yg(o,"Content-Type",(a=l)!==null&&a!==void 0?a:"application/json"),s.body=JSON.stringify(r)}else s.body=r;return t!=null&&t.duplex&&(s.duplex=t.duplex),ne(ne({},s),n)};async function ui(e,t,n,r,s,a,o){return new Promise((l,c)=>{e(n,X3(t,r,s,a)).then(d=>{if(!d.ok)throw d;if(r!=null&&r.noResolveJson)return d;if(o==="vectors"){const h=d.headers.get("content-type");if(d.headers.get("content-length")==="0"||d.status===204)return{};if(!h||!h.includes("application/json"))return{}}return d.json()}).then(d=>l(d)).catch(d=>K3(d,c,r,o))})}function pS(e="storage"){return{get:async(t,n,r,s)=>ui(t,"GET",n,r,s,void 0,e),post:async(t,n,r,s,a)=>ui(t,"POST",n,s,a,r,e),put:async(t,n,r,s,a)=>ui(t,"PUT",n,s,a,r,e),head:async(t,n,r,s)=>ui(t,"HEAD",n,ne(ne({},r),{},{noResolveJson:!0}),s,void 0,e),remove:async(t,n,r,s,a)=>ui(t,"DELETE",n,s,a,r,e)}}const J3=pS("storage"),{get:ml,post:$n,put:Cm,head:Q3,remove:xg}=J3,on=pS("vectors");var Wo=class{constructor(e,t={},n,r="storage"){this.shouldThrowOnError=!1,this.url=e,this.headers=H3(t),this.fetch=q3(n),this.namespace=r}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=yg(this.headers,e,t),this}async handleOperation(e){var t=this;try{return{data:await e(),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(Td(n))return{data:null,error:n};throw n}}},Y3=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t}then(e,t){return this.execute().then(e,t)}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(Td(t))return{data:null,error:t};throw t}}};let gS;gS=Symbol.toStringTag;var Z3=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[gS]="BlobDownloadBuilder",this.promise=null}asStream(){return new Y3(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(Td(t))return{data:null,error:t};throw t}}};const e4={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},cx={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var t4=class extends Wo{constructor(e,t={},n,r){super(e,t,r,"storage"),this.bucketId=n}async uploadOrUpdate(e,t,n,r){var s=this;return s.handleOperation(async()=>{let a;const o=ne(ne({},cx),r);let l=ne(ne({},s.headers),e==="POST"&&{"x-upsert":String(o.upsert)});const c=o.metadata;if(typeof Blob<"u"&&n instanceof Blob?(a=new FormData,a.append("cacheControl",o.cacheControl),c&&a.append("metadata",s.encodeMetadata(c)),a.append("",n)):typeof FormData<"u"&&n instanceof FormData?(a=n,a.has("cacheControl")||a.append("cacheControl",o.cacheControl),c&&!a.has("metadata")&&a.append("metadata",s.encodeMetadata(c))):(a=n,l["cache-control"]=`max-age=${o.cacheControl}`,l["content-type"]=o.contentType,c&&(l["x-metadata"]=s.toBase64(s.encodeMetadata(c))),(typeof ReadableStream<"u"&&a instanceof ReadableStream||a&&typeof a=="object"&&"pipe"in a&&typeof a.pipe=="function")&&!o.duplex&&(o.duplex="half")),r!=null&&r.headers)for(const[p,m]of Object.entries(r.headers))l=yg(l,p,m);const d=s._removeEmptyFolders(t),h=s._getFinalPath(d),f=await(e=="PUT"?Cm:$n)(s.fetch,`${s.url}/object/${h}`,a,ne({headers:l},o!=null&&o.duplex?{duplex:o.duplex}:{}));return{path:d,id:f.Id,fullPath:f.Key}})}async upload(e,t,n){return this.uploadOrUpdate("POST",e,t,n)}async uploadToSignedUrl(e,t,n,r){var s=this;const a=s._removeEmptyFolders(e),o=s._getFinalPath(a),l=new URL(s.url+`/object/upload/sign/${o}`);return l.searchParams.set("token",t),s.handleOperation(async()=>{let c;const d=ne(ne({},cx),r),h=ne(ne({},s.headers),{"x-upsert":String(d.upsert)});return typeof Blob<"u"&&n instanceof Blob?(c=new FormData,c.append("cacheControl",d.cacheControl),c.append("",n)):typeof FormData<"u"&&n instanceof FormData?(c=n,c.append("cacheControl",d.cacheControl)):(c=n,h["cache-control"]=`max-age=${d.cacheControl}`,h["content-type"]=d.contentType),{path:a,fullPath:(await Cm(s.fetch,l.toString(),c,{headers:h})).Key}})}async createSignedUploadUrl(e,t){var n=this;return n.handleOperation(async()=>{let r=n._getFinalPath(e);const s=ne({},n.headers);t!=null&&t.upsert&&(s["x-upsert"]="true");const a=await $n(n.fetch,`${n.url}/object/upload/sign/${r}`,{},{headers:s}),o=new URL(n.url+a.url),l=o.searchParams.get("token");if(!l)throw new _d("No token returned by API");return{signedUrl:o.toString(),path:e,token:l}})}async update(e,t,n){return this.uploadOrUpdate("PUT",e,t,n)}async move(e,t,n){var r=this;return r.handleOperation(async()=>await $n(r.fetch,`${r.url}/object/move`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,destinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers}))}async copy(e,t,n){var r=this;return r.handleOperation(async()=>({path:(await $n(r.fetch,`${r.url}/object/copy`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,destinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers})).Key}))}async createSignedUrl(e,t,n){var r=this;return r.handleOperation(async()=>{let s=r._getFinalPath(e);const a=typeof(n==null?void 0:n.transform)=="object"&&n.transform!==null&&Object.keys(n.transform).length>0;let o=await $n(r.fetch,`${r.url}/object/sign/${s}`,ne({expiresIn:t},a?{transform:n.transform}:{}),{headers:r.headers});const l=new URLSearchParams;n!=null&&n.download&&l.set("download",n.download===!0?"":n.download),(n==null?void 0:n.cacheNonce)!=null&&l.set("cacheNonce",String(n.cacheNonce));const c=l.toString();return{signedUrl:encodeURI(`${r.url}${o.signedURL}${c?`&${c}`:""}`)}})}async createSignedUrls(e,t,n){var r=this;return r.handleOperation(async()=>{const s=await $n(r.fetch,`${r.url}/object/sign/${r.bucketId}`,{expiresIn:t,paths:e},{headers:r.headers}),a=new URLSearchParams;n!=null&&n.download&&a.set("download",n.download===!0?"":n.download),(n==null?void 0:n.cacheNonce)!=null&&a.set("cacheNonce",String(n.cacheNonce));const o=a.toString();return s.map(l=>ne(ne({},l),{},{signedUrl:l.signedURL?encodeURI(`${r.url}${l.signedURL}${o?`&${o}`:""}`):null}))})}download(e,t,n){const r=typeof(t==null?void 0:t.transform)=="object"&&t.transform!==null&&Object.keys(t.transform).length>0?"render/image/authenticated":"object",s=new URLSearchParams;t!=null&&t.transform&&this.applyTransformOptsToQuery(s,t.transform),(t==null?void 0:t.cacheNonce)!=null&&s.set("cacheNonce",String(t.cacheNonce));const a=s.toString(),o=this._getFinalPath(e),l=()=>ml(this.fetch,`${this.url}/${r}/${o}${a?`?${a}`:""}`,{headers:this.headers,noResolveJson:!0},n);return new Z3(l,this.shouldThrowOnError)}async info(e){var t=this;const n=t._getFinalPath(e);return t.handleOperation(async()=>km(await ml(t.fetch,`${t.url}/object/info/${n}`,{headers:t.headers})))}async exists(e){var t=this;const n=t._getFinalPath(e);try{return await Q3(t.fetch,`${t.url}/object/${n}`,{headers:t.headers}),{data:!0,error:null}}catch(s){if(t.shouldThrowOnError)throw s;if(Td(s)){var r;const a=s instanceof Sm?s.status:s instanceof mS?(r=s.originalError)===null||r===void 0?void 0:r.status:void 0;if(a!==void 0&&[400,404].includes(a))return{data:!1,error:s}}throw s}}getPublicUrl(e,t){const n=this._getFinalPath(e),r=new URLSearchParams;t!=null&&t.download&&r.set("download",t.download===!0?"":t.download),t!=null&&t.transform&&this.applyTransformOptsToQuery(r,t.transform),(t==null?void 0:t.cacheNonce)!=null&&r.set("cacheNonce",String(t.cacheNonce));const s=r.toString(),a=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}/${a}/public/${n}`)+(s?`?${s}`:"")}}}async remove(e){var t=this;return t.handleOperation(async()=>await xg(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async list(e,t,n){var r=this;return r.handleOperation(async()=>{const s=ne(ne(ne({},e4),t),{},{prefix:e||""});return await $n(r.fetch,`${r.url}/object/list/${r.bucketId}`,s,{headers:r.headers},n)})}async listV2(e,t){var n=this;return n.handleOperation(async()=>{const r=ne({},e);return await $n(n.fetch,`${n.url}/object/list-v2/${n.bucketId}`,r,{headers:n.headers},t)})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(e,t){return t.width&&e.set("width",t.width.toString()),t.height&&e.set("height",t.height.toString()),t.resize&&e.set("resize",t.resize),t.format&&e.set("format",t.format),t.quality&&e.set("quality",t.quality.toString()),e}};const n4="2.104.0",Ml={"X-Client-Info":`storage-js/${n4}`};var r4=class extends Wo{constructor(e,t={},n,r){const s=new URL(e);r!=null&&r.useNewHostname&&/supabase\.(co|in|red)$/.test(s.hostname)&&!s.hostname.includes("storage.supabase.")&&(s.hostname=s.hostname.replace("supabase.","storage.supabase."));const a=s.href.replace(/\/$/,""),o=ne(ne({},Ml),t);super(a,o,n,"storage")}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const n=t.listBucketOptionsToQueryString(e);return await ml(t.fetch,`${t.url}/bucket${n}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await ml(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var n=this;return n.handleOperation(async()=>await $n(n.fetch,`${n.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async updateBucket(e,t){var n=this;return n.handleOperation(async()=>await Cm(n.fetch,`${n.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await $n(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await xg(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}listBucketOptionsToQueryString(e){const t={};return e&&("limit"in e&&(t.limit=String(e.limit)),"offset"in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?"?"+new URLSearchParams(t).toString():""}},s4=class extends Wo{constructor(e,t={},n){const r=e.replace(/\/$/,""),s=ne(ne({},Ml),t);super(r,s,n,"storage")}async createBucket(e){var t=this;return t.handleOperation(async()=>await $n(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const n=new URLSearchParams;(e==null?void 0:e.limit)!==void 0&&n.set("limit",e.limit.toString()),(e==null?void 0:e.offset)!==void 0&&n.set("offset",e.offset.toString()),e!=null&&e.sortColumn&&n.set("sortColumn",e.sortColumn),e!=null&&e.sortOrder&&n.set("sortOrder",e.sortOrder),e!=null&&e.search&&n.set("search",e.search);const r=n.toString(),s=r?`${t.url}/bucket?${r}`:`${t.url}/bucket`;return await ml(t.fetch,s,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await xg(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!W3(e))throw new _d("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const n=new B3({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}),r=this.shouldThrowOnError;return new Proxy(n,{get(s,a){const o=s[a];return typeof o!="function"?o:async(...l)=>{try{return{data:await o.apply(s,l),error:null}}catch(c){if(r)throw c;return{data:null,error:c}}}}})}},a4=class extends Wo{constructor(e,t={},n){const r=e.replace(/\/$/,""),s=ne(ne({},Ml),{},{"Content-Type":"application/json"},t);super(r,s,n,"vectors")}async createIndex(e){var t=this;return t.handleOperation(async()=>await on.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var n=this;return n.handleOperation(async()=>await on.post(n.fetch,`${n.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await on.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var n=this;return n.handleOperation(async()=>await on.post(n.fetch,`${n.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers})||{})}},o4=class extends Wo{constructor(e,t={},n){const r=e.replace(/\/$/,""),s=ne(ne({},Ml),{},{"Content-Type":"application/json"},t);super(r,s,n,"vectors")}async putVectors(e){var t=this;if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return t.handleOperation(async()=>await on.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await on.post(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}))}async listVectors(e){var t=this;if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return t.handleOperation(async()=>await on.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await on.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 on.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},i4=class extends Wo{constructor(e,t={},n){const r=e.replace(/\/$/,""),s=ne(ne({},Ml),{},{"Content-Type":"application/json"},t);super(r,s,n,"vectors")}async createBucket(e){var t=this;return t.handleOperation(async()=>await on.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await on.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await on.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await on.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},l4=class extends i4{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new c4(this.url,this.headers,e,this.fetch)}async createBucket(e){var t=()=>super.createBucket,n=this;return t().call(n,e)}async getBucket(e){var t=()=>super.getBucket,n=this;return t().call(n,e)}async listBuckets(e={}){var t=()=>super.listBuckets,n=this;return t().call(n,e)}async deleteBucket(e){var t=()=>super.deleteBucket,n=this;return t().call(n,e)}},c4=class extends a4{constructor(e,t,n,r){super(e,t,r),this.vectorBucketName=n}async createIndex(e){var t=()=>super.createIndex,n=this;return t().call(n,ne(ne({},e),{},{vectorBucketName:n.vectorBucketName}))}async listIndexes(e={}){var t=()=>super.listIndexes,n=this;return t().call(n,ne(ne({},e),{},{vectorBucketName:n.vectorBucketName}))}async getIndex(e){var t=()=>super.getIndex,n=this;return t().call(n,n.vectorBucketName,e)}async deleteIndex(e){var t=()=>super.deleteIndex,n=this;return t().call(n,n.vectorBucketName,e)}index(e){return new u4(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},u4=class extends o4{constructor(e,t,n,r,s){super(e,t,s),this.vectorBucketName=n,this.indexName=r}async putVectors(e){var t=()=>super.putVectors,n=this;return t().call(n,ne(ne({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async getVectors(e){var t=()=>super.getVectors,n=this;return t().call(n,ne(ne({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,n=this;return t().call(n,ne(ne({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,n=this;return t().call(n,ne(ne({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,n=this;return t().call(n,ne(ne({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}},d4=class extends r4{constructor(e,t={},n,r){super(e,t,n,r)}from(e){return new t4(this.url,this.headers,e,this.fetch)}get vectors(){return new l4(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new s4(this.url+"/iceberg",this.headers,this.fetch)}};function Pd(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s{const e=new Array(128);for(let t=0;t=6;){const r=t.queue>>t.queuedBits-6&63;n(Fu[r]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const r=t.queue>>t.queuedBits-6&63;n(Fu[r]),t.queuedBits-=6}}function vS(e,t,n){const r=w4[e];if(r>-1)for(t.queue=t.queue<<6|r,t.queuedBits+=6;t.queuedBits>=8;)n(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(r===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function mx(e){const t=[],n=o=>{t.push(String.fromCodePoint(o))},r={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},a=o=>{C4(o,r,n)};for(let o=0;o>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 k4(e,t){for(let n=0;n55295&&r<=56319){const s=(r-55296)*1024&65535;r=(e.charCodeAt(n+1)-56320&65535|s)+65536,n+=1}S4(r,t)}}function C4(e,t,n){if(t.utf8seq===0){if(e<=127){n(e);return}for(let r=1;r<6;r+=1)if(!(e>>7-r&1)){t.utf8seq=r;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&n(t.codepoint)}}function mo(e){const t=[],n={queue:0,queuedBits:0},r=s=>{t.push(s)};for(let s=0;st.push(n)),new Uint8Array(t)}function na(e){const t=[],n={queue:0,queuedBits:0},r=s=>{t.push(s)};return e.forEach(s=>fx(s,n,r)),fx(null,n,r),t.join("")}function E4(e){return Math.round(Date.now()/1e3)+e}function N4(){return Symbol("auth-callback")}const ct=()=>typeof window<"u"&&typeof document<"u",Hs={tested:!1,writable:!1},bS=()=>{if(!ct())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Hs.tested)return Hs.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),Hs.tested=!0,Hs.writable=!0}catch{Hs.tested=!0,Hs.writable=!1}return Hs.writable};function _4(e){const t={},n=new URL(e);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEach((s,a)=>{t[a]=s})}catch{}return n.searchParams.forEach((r,s)=>{t[s]=r}),t}const wS=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),T4=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",Ba=async(e,t,n)=>{await e.setItem(t,JSON.stringify(n))},qs=async(e,t)=>{const n=await e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch{return n}},lt=async(e,t)=>{await e.removeItem(t)};class Ad{constructor(){this.promise=new Ad.promiseConstructor((t,n)=>{this.resolve=t,this.reject=n})}}Ad.promiseConstructor=Promise;function xc(e){const t=e.split(".");if(t.length!==3)throw new _m("Invalid JWT structure");for(let r=0;r{setTimeout(()=>t(null),e)})}function A4(e,t){return new Promise((r,s)=>{(async()=>{for(let a=0;a<1/0;a++)try{const o=await e(a);if(!t(a,null,o)){r(o);return}}catch(o){if(!t(a,o)){s(o);return}}})()})}function R4(e){return("0"+e.toString(16)).substr(-2)}function I4(){const t=new Uint32Array(56);if(typeof crypto>"u"){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=n.length;let s="";for(let a=0;a<56;a++)s+=n.charAt(Math.floor(Math.random()*r));return s}return crypto.getRandomValues(t),Array.from(t,R4).join("")}async function O4(e){const n=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",n),s=new Uint8Array(r);return Array.from(s).map(a=>String.fromCharCode(a)).join("")}async function M4(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;const n=await O4(e);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Ta(e,t,n=!1){const r=I4();let s=r;n&&(s+="/PASSWORD_RECOVERY"),await Ba(e,`${t}-code-verifier`,s);const a=await M4(r);return[a,r===a?"plain":"s256"]}const L4=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function D4(e){const t=e.headers.get(Em);if(!t||!t.match(L4))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function F4(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 $4(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 B4=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Pa(e){if(!B4.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Ph(){const e={};return new Proxy(e,{get:(t,n)=>{if(n==="__isUserNotAvailableProxy")return!0;if(typeof n=="symbol"){const r=n.toString();if(r==="Symbol(Symbol.toPrimitive)"||r==="Symbol(Symbol.toStringTag)"||r==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${n}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function U4(e,t){return new Proxy(e,{get:(n,r,s)=>{if(r==="__isInsecureUserWarningProxy")return!0;if(typeof r=="symbol"){const a=r.toString();if(a==="Symbol(Symbol.toPrimitive)"||a==="Symbol(Symbol.toStringTag)"||a==="Symbol(util.inspect.custom)"||a==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(n,r,s)}return!t.value&&typeof r=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),t.value=!0),Reflect.get(n,r,s)}})}function px(e){return JSON.parse(JSON.stringify(e))}const Ks=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),z4=[502,503,504,520,521,522,523,524,530];async function gx(e){var t;if(!T4(e))throw new Nm(Ks(e),0);if(z4.includes(e.status))throw new Nm(Ks(e),e.status);let n;try{n=await e.json()}catch(a){throw new Xs(Ks(a),a)}let r;const s=D4(e);if(s&&s.getTime()>=xS["2024-01-01"].timestamp&&typeof n=="object"&&n&&typeof n.code=="string"?r=n.code:typeof n=="object"&&n&&typeof n.error_code=="string"&&(r=n.error_code),r){if(r==="weak_password")throw new dx(Ks(n),e.status,((t=n.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(r==="session_not_found")throw new en}else if(typeof n=="object"&&n&&typeof n.weak_password=="object"&&n.weak_password&&Array.isArray(n.weak_password.reasons)&&n.weak_password.reasons.length&&n.weak_password.reasons.reduce((a,o)=>a&&typeof o=="string",!0))throw new dx(Ks(n),e.status,n.weak_password.reasons);throw new y4(Ks(n),e.status||500,r)}const V4=(e,t,n,r)=>{const s={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?s:(s.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),s.body=JSON.stringify(r),Object.assign(Object.assign({},s),n))};async function ee(e,t,n,r){var s;const a=Object.assign({},r==null?void 0:r.headers);a[Em]||(a[Em]=xS["2024-01-01"].name),r!=null&&r.jwt&&(a.Authorization=`Bearer ${r.jwt}`);const o=(s=r==null?void 0:r.query)!==null&&s!==void 0?s:{};r!=null&&r.redirectTo&&(o.redirect_to=r.redirectTo);const l=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",c=await H4(e,t,n+l,{headers:a,noResolveJson:r==null?void 0:r.noResolveJson},{},r==null?void 0:r.body);return r!=null&&r.xform?r==null?void 0:r.xform(c):{data:Object.assign({},c),error:null}}async function H4(e,t,n,r,s,a){const o=V4(t,r,s,a);let l;try{l=await e(n,Object.assign({},o))}catch(c){throw console.error(c),new Nm(Ks(c),0)}if(l.ok||await gx(l),r!=null&&r.noResolveJson)return l;try{return await l.json()}catch(c){await gx(c)}}function Ln(e){var t;let n=null;W4(e)&&(n=Object.assign({},e),e.expires_at||(n.expires_at=E4(e.expires_in)));const r=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:n,user:r},error:null}}function yx(e){const t=Ln(e);return!t.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((n,r)=>n&&typeof r=="string",!0)&&(t.data.weak_password=e.weak_password),t}function us(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function q4(e){return{data:e,error:null}}function G4(e){const{action_link:t,email_otp:n,hashed_token:r,redirect_to:s,verification_type:a}=e,o=Pd(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),l={action_link:t,email_otp:n,hashed_token:r,redirect_to:s,verification_type:a},c=Object.assign({},o);return{data:{properties:l,user:c},error:null}}function xx(e){return e}function W4(e){return e.access_token&&e.refresh_token&&e.expires_in}const Ah=["global","local","others"];class K4{constructor({url:t="",headers:n={},fetch:r}){this.url=t,this.headers=n,this.fetch=wS(r),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},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)}}async signOut(t,n=Ah[0]){if(Ah.indexOf(n)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Ah.join(", ")}`);try{return await ee(this.fetch,"POST",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(r){if(Q(r))return{data:null,error:r};throw r}}async inviteUserByEmail(t,n={}){try{return await ee(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:us})}catch(r){if(Q(r))return{data:{user:null},error:r};throw r}}async generateLink(t){try{const{options:n}=t,r=Pd(t,["options"]),s=Object.assign(Object.assign({},r),n);return"newEmail"in r&&(s.new_email=r==null?void 0:r.newEmail,delete s.newEmail),await ee(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:G4,redirectTo:n==null?void 0:n.redirectTo})}catch(n){if(Q(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(t){try{return await ee(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:us})}catch(n){if(Q(n))return{data:{user:null},error:n};throw n}}async listUsers(t){var n,r,s,a,o,l,c;try{const d={nextPage:null,lastPage:0,total:0},h=await ee(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=t==null?void 0:t.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(a=(s=t==null?void 0:t.perPage)===null||s===void 0?void 0:s.toString())!==null&&a!==void 0?a:""},xform:xx});if(h.error)throw h.error;const f=await h.json(),p=(o=h.headers.get("x-total-count"))!==null&&o!==void 0?o:0,m=(c=(l=h.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return m.length>0&&(m.forEach(y=>{const g=parseInt(y.split(";")[0].split("=")[1].substring(0,1)),S=JSON.parse(y.split(";")[1].split("=")[1]);d[`${S}Page`]=g}),d.total=parseInt(p)),{data:Object.assign(Object.assign({},f),d),error:null}}catch(d){if(Q(d))return{data:{users:[]},error:d};throw d}}async getUserById(t){Pa(t);try{return await ee(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:us})}catch(n){if(Q(n))return{data:{user:null},error:n};throw n}}async updateUserById(t,n){Pa(t);try{return await ee(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:n,headers:this.headers,xform:us})}catch(r){if(Q(r))return{data:{user:null},error:r};throw r}}async deleteUser(t,n=!1){Pa(t);try{return await ee(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:n},xform:us})}catch(r){if(Q(r))return{data:{user:null},error:r};throw r}}async _listFactors(t){Pa(t.userId);try{const{data:n,error:r}=await ee(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:s=>({data:{factors:s},error:null})});return{data:n,error:r}}catch(n){if(Q(n))return{data:null,error:n};throw n}}async _deleteFactor(t){Pa(t.userId),Pa(t.id);try{return{data:await ee(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(n){if(Q(n))return{data:null,error:n};throw n}}async _listOAuthClients(t){var n,r,s,a,o,l,c;try{const d={nextPage:null,lastPage:0,total:0},h=await ee(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=t==null?void 0:t.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(a=(s=t==null?void 0:t.perPage)===null||s===void 0?void 0:s.toString())!==null&&a!==void 0?a:""},xform:xx});if(h.error)throw h.error;const f=await h.json(),p=(o=h.headers.get("x-total-count"))!==null&&o!==void 0?o:0,m=(c=(l=h.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return m.length>0&&(m.forEach(y=>{const g=parseInt(y.split(";")[0].split("=")[1].substring(0,1)),S=JSON.parse(y.split(";")[1].split("=")[1]);d[`${S}Page`]=g}),d.total=parseInt(p)),{data:Object.assign(Object.assign({},f),d),error:null}}catch(d){if(Q(d))return{data:{clients:[]},error:d};throw d}}async _createOAuthClient(t){try{return await ee(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Q(n))return{data:null,error:n};throw n}}async _getOAuthClient(t){try{return await ee(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Q(n))return{data:null,error:n};throw n}}async _updateOAuthClient(t,n){try{return await ee(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Q(r))return{data:null,error:r};throw r}}async _deleteOAuthClient(t){try{return await ee(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(Q(n))return{data:null,error:n};throw n}}async _regenerateOAuthClientSecret(t){try{return await ee(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Q(n))return{data:null,error:n};throw n}}async _listCustomProviders(t){try{const n={};return t!=null&&t.type&&(n.type=t.type),await ee(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:n,xform:r=>{var s;return{data:{providers:(s=r==null?void 0:r.providers)!==null&&s!==void 0?s:[]},error:null}}})}catch(n){if(Q(n))return{data:{providers:[]},error:n};throw n}}async _createCustomProvider(t){try{return await ee(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:t,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Q(n))return{data:null,error:n};throw n}}async _getCustomProvider(t){try{return await ee(this.fetch,"GET",`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Q(n))return{data:null,error:n};throw n}}async _updateCustomProvider(t,n){try{return await ee(this.fetch,"PUT",`${this.url}/admin/custom-providers/${t}`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Q(r))return{data:null,error:r};throw r}}async _deleteCustomProvider(t){try{return await ee(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(Q(n))return{data:null,error:n};throw n}}}function vx(e={}){return{getItem:t=>e[t]||null,setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}}const sr={debug:!!(globalThis&&bS()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class SS extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class bx extends SS{}async function X4(e,t,n){sr.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const r=new globalThis.AbortController;let s;t>0&&(s=setTimeout(()=>{r.abort(),sr.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t)),await Promise.resolve();try{return await globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal},async a=>{if(a){clearTimeout(s),sr.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,a.name);try{return await n()}finally{sr.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,a.name)}}else{if(t===0)throw sr.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new bx(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(sr.debug)try{const o=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(o,null," "))}catch(o){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",o)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),clearTimeout(s),await n()}})}catch(a){if(t>0&&clearTimeout(s),(a==null?void 0:a.name)==="AbortError"&&t>0){if(r.signal.aborted)return sr.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock",e),console.warn(`@supabase/gotrue-js: Lock "${e}" was not released within ${t}ms. This may indicate an orphaned lock from a component unmount (e.g., React Strict Mode). Forcefully acquiring the lock to recover.`),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,{mode:"exclusive",steal:!0},async o=>{if(o){sr.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",e,o.name);try{return await n()}finally{sr.debug&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",e,o.name)}}else return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await n()}));throw sr.debug&&console.log("@supabase/gotrue-js: navigatorLock: lock was stolen by another request",e),new bx(`Lock "${e}" was released because another request stole it`)}throw a}}function J4(){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 kS(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function Q4(e){return parseInt(e,16)}function Y4(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,r=>r.toString(16).padStart(2,"0")).join("")}function Z4(e){var t;const{chainId:n,domain:r,expirationTime:s,issuedAt:a=new Date,nonce:o,notBefore:l,requestId:c,resources:d,scheme:h,uri:f,version:p}=e;{if(!Number.isInteger(n))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${n}`);if(!r)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(o&&o.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${o}`);if(!f)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(p!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${p}`);if(!((t=e.statement)===null||t===void 0)&&t.includes(` `))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const m=kS(e.address),y=h?`${h}://${r}`:r,g=e.statement?`${e.statement} `:"",S=`${y} wants you to sign in with your Ethereum account: ${m} ${g}`;let w=`URI: ${f} Version: ${p} Chain ID: ${n}${o?` Nonce: ${o}`:""} Issued At: ${a.toISOString()}`;if(s&&(w+=` Expiration Time: ${s.toISOString()}`),l&&(w+=` Not Before: ${l.toISOString()}`),c&&(w+=` Request ID: ${c}`),d){let v=` Resources:`;for(const x of d){if(!x||typeof x!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${x}`);v+=` - ${x}`}w+=v}return`${S} ${w}`}class Ye extends Error{constructor({message:t,code:n,cause:r,name:s}){var a;super(t,{cause:r}),this.__isWebAuthnError=!0,this.name=(a=s??(r instanceof Error?r.name:void 0))!==null&&a!==void 0?a:"Unknown Error",this.code=n}}class $u extends Ye{constructor(t,n){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:n,message:t}),this.name="WebAuthnUnknownError",this.originalError=n}}function e5({error:e,options:t}){var n,r,s;const{publicKey:a}=t;if(!a)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Ye({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((n=a.authenticatorSelection)===null||n===void 0?void 0:n.requireResidentKey)===!0)return new Ye({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&((r=a.authenticatorSelection)===null||r===void 0?void 0:r.userVerification)==="required")return new Ye({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=a.authenticatorSelection)===null||s===void 0?void 0:s.userVerification)==="required")return new Ye({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 Ye({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new Ye({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return a.pubKeyCredParams.filter(l=>l.type==="public-key").length===0?new Ye({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new Ye({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(CS(o)){if(a.rp.id!==o)return new Ye({message:`The RP ID "${a.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Ye({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(a.user.id.byteLength<1||a.user.id.byteLength>64)return new Ye({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 Ye({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 Ye({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function t5({error:e,options:t}){const{publicKey:n}=t;if(!n)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Ye({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new Ye({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const r=window.location.hostname;if(CS(r)){if(n.rpId!==r)return new Ye({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Ye({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new Ye({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 Ye({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class n5{createNewAbortSignal(){if(this.controller){const n=new Error("Cancelling existing WebAuthn API call for new one");n.name="AbortError",this.controller.abort(n)}const t=new AbortController;return this.controller=t,t.signal}cancelCeremony(){if(this.controller){const t=new Error("Manually cancelling existing WebAuthn API call");t.name="AbortError",this.controller.abort(t),this.controller=void 0}}}const r5=new n5;function s5(e){if(!e)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(e);const{challenge:t,user:n,excludeCredentials:r}=e,s=Pd(e,["challenge","user","excludeCredentials"]),a=mo(t).buffer,o=Object.assign(Object.assign({},n),{id:mo(n.id).buffer}),l=Object.assign(Object.assign({},s),{challenge:a,user:o});if(r&&r.length>0){l.excludeCredentials=new Array(r.length);for(let c=0;c0){a.allowCredentials=new Array(n.length);for(let o=0;os!==null&&typeof s=="object"&&!Array.isArray(s),n=s=>s instanceof ArrayBuffer||ArrayBuffer.isView(s),r={};for(const s of e)if(s)for(const a in s){const o=s[a];if(o!==void 0)if(Array.isArray(o))r[a]=o;else if(n(o))r[a]=o;else if(t(o)){const l=r[a];t(l)?r[a]=Bu(l,o):r[a]=Bu(o)}else r[a]=o}return r}function h5(e,t){return Bu(u5,e,t||{})}function f5(e,t){return Bu(d5,e,t||{})}class m5{constructor(t){this.client=t,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(t){return this.client.mfa.enroll(Object.assign(Object.assign({},t),{factorType:"webauthn"}))}async _challenge({factorId:t,webauthn:n,friendlyName:r,signal:s},a){var o;try{const{data:l,error:c}=await this.client.mfa.challenge({factorId:t,webauthn:n});if(!l)return{data:null,error:c};const d=s??r5.createNewAbortSignal();if(l.webauthn.type==="create"){const{user:h}=l.webauthn.credential_options.publicKey;if(!h.name){const f=r;if(f)h.name=`${h.id}:${f}`;else{const m=(await this.client.getUser()).data.user,y=((o=m==null?void 0:m.user_metadata)===null||o===void 0?void 0:o.name)||(m==null?void 0:m.email)||(m==null?void 0:m.id)||"User";h.name=`${h.id}:${y}`}}h.displayName||(h.displayName=h.name)}switch(l.webauthn.type){case"create":{const h=h5(l.webauthn.credential_options.publicKey,a==null?void 0:a.create),{data:f,error:p}=await l5({publicKey:h,signal:d});return f?{data:{factorId:t,challengeId:l.id,webauthn:{type:l.webauthn.type,credential_response:f}},error:null}:{data:null,error:p}}case"request":{const h=f5(l.webauthn.credential_options.publicKey,a==null?void 0:a.request),{data:f,error:p}=await c5(Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:h,signal:d}));return f?{data:{factorId:t,challengeId:l.id,webauthn:{type:l.webauthn.type,credential_response:f}},error:null}:{data:null,error:p}}}}catch(l){return Q(l)?{data:null,error:l}:{data:null,error:new Xs("Unexpected error in challenge",l)}}}async _verify({challengeId:t,factorId:n,webauthn:r}){return this.client.mfa.verify({factorId:n,challengeId:t,webauthn:r})}async _authenticate({factorId:t,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},a){if(!n)return{data:null,error:new pl("rpId is required for WebAuthn authentication")};try{if(!wx())return{data:null,error:new Xs("Browser does not support WebAuthn",null)};const{data:o,error:l}=await this.challenge({factorId:t,webauthn:{rpId:n,rpOrigins:r},signal:s},{request:a});if(!o)return{data:null,error:l};const{webauthn:c}=o;return this._verify({factorId:t,challengeId:o.challengeId,webauthn:{type:c.type,rpId:n,rpOrigins:r,credential_response:c.credential_response}})}catch(o){return Q(o)?{data:null,error:o}:{data:null,error:new Xs("Unexpected error in authenticate",o)}}}async _register({friendlyName:t,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},a){if(!n)return{data:null,error:new pl("rpId is required for WebAuthn registration")};try{if(!wx())return{data:null,error:new Xs("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(h=>{var f;return(f=h.data)===null||f===void 0?void 0:f.all.find(p=>p.factor_type==="webauthn"&&p.friendly_name===t&&p.status!=="unverified")}).then(h=>h?this.client.mfa.unenroll({factorId:h==null?void 0:h.id}):void 0),{data:null,error:l};const{data:c,error:d}=await this._challenge({factorId:o.id,friendlyName:o.friendly_name,webauthn:{rpId:n,rpOrigins:r},signal:s},{create:a});return c?this._verify({factorId:o.id,challengeId:c.challengeId,webauthn:{rpId:n,rpOrigins:r,type:c.webauthn.type,credential_response:c.webauthn.credential_response}}):{data:null,error:d}}catch(o){return Q(o)?{data:null,error:o}:{data:null,error:new Xs("Unexpected error in register",o)}}}}J4();const p5={url:h4,storageKey:f4,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:m4,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1};async function Sx(e,t,n){return await n()}const Aa={};class gl{get jwks(){var t,n;return(n=(t=Aa[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&n!==void 0?n:{keys:[]}}set jwks(t){Aa[this.storageKey]=Object.assign(Object.assign({},Aa[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,n;return(n=(t=Aa[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&n!==void 0?n:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){Aa[this.storageKey]=Object.assign(Object.assign({},Aa[this.storageKey]),{cachedAt:t})}constructor(t){var n,r,s;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const a=Object.assign(Object.assign({},p5),t);if(this.storageKey=a.storageKey,this.instanceID=(n=gl.nextInstanceID[this.storageKey])!==null&&n!==void 0?n:0,gl.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!a.debug,typeof a.debug=="function"&&(this.logger=a.debug),this.instanceID>0&&ct()){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=a.persistSession,this.autoRefreshToken=a.autoRefreshToken,this.admin=new K4({url:a.url,headers:a.headers,fetch:a.fetch}),this.url=a.url,this.headers=a.headers,this.fetch=wS(a.fetch),this.lock=a.lock||Sx,this.detectSessionInUrl=a.detectSessionInUrl,this.flowType=a.flowType,this.hasCustomAuthorizationHeader=a.hasCustomAuthorizationHeader,this.throwOnError=a.throwOnError,this.lockAcquireTimeout=a.lockAcquireTimeout,a.lock?this.lock=a.lock:this.persistSession&&ct()&&(!((r=globalThis==null?void 0:globalThis.navigator)===null||r===void 0)&&r.locks)?this.lock=X4:this.lock=Sx,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 m5(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.persistSession?(a.storage?this.storage=a.storage:bS()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=vx(this.memoryStorage)),a.userStorage&&(this.userStorage=a.userStorage)):(this.memoryStorage={},this.storage=vx(this.memoryStorage)),ct()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(o){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",o)}(s=this.broadcastChannel)===null||s===void 0||s.addEventListener("message",async o=>{this._debug("received broadcast notification from other tab or client",o);try{await this._notifyAllSubscribers(o.data.event,o.data.session,!1)}catch(l){this._debug("#broadcastChannel","error",l)}})}a.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} (${yS}) ${new Date().toISOString()}`}_debug(...t){return this.logDebugMessages&&this.logger(this._logPrefix(),...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{let n={},r="none";if(ct()&&(n=_4(window.location.href),this._isImplicitGrantCallback(n)?r="implicit":await this._isPKCECallback(n)&&(r="pkce")),ct()&&this.detectSessionInUrl&&r!=="none"){const{data:s,error:a}=await this._getSessionFromURL(n,r);if(a){if(this._debug("#_initialize()","error detecting session from URL",a),v4(a)){const c=(t=a.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:a}}return{error:a}}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(n){return Q(n)?this._returnResult({error:n}):this._returnResult({error:new Xs("Unexpected error during initialization",n)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var n,r,s;try{const a=await ee(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(r=(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:(s=t==null?void 0:t.options)===null||s===void 0?void 0:s.captchaToken}},xform:Ln}),{data:o,error:l}=a;if(l||!o)return this._returnResult({data:{user:null,session:null},error:l});const c=o.session,d=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:d,session:c},error:null})}catch(a){if(Q(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signUp(t){var n,r,s;try{let a;if("email"in t){const{email:h,password:f,options:p}=t;let m=null,y=null;this.flowType==="pkce"&&([m,y]=await Ta(this.storage,this.storageKey)),a=await ee(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:p==null?void 0:p.emailRedirectTo,body:{email:h,password:f,data:(n=p==null?void 0:p.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:p==null?void 0:p.captchaToken},code_challenge:m,code_challenge_method:y},xform:Ln})}else if("phone"in t){const{phone:h,password:f,options:p}=t;a=await ee(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:h,password:f,data:(r=p==null?void 0:p.data)!==null&&r!==void 0?r:{},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:Ln})}else throw new gc("You must provide either an email or phone number and a password");const{data:o,error:l}=a;if(l||!o)return await lt(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:l});const c=o.session,d=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:d,session:c},error:null})}catch(a){if(await lt(this.storage,`${this.storageKey}-code-verifier`),Q(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signInWithPassword(t){try{let n;if("email"in t){const{email:a,password:o,options:l}=t;n=await ee(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:a,password:o,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:yx})}else if("phone"in t){const{phone:a,password:o,options:l}=t;n=await ee(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:a,password:o,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:yx})}else throw new gc("You must provide either an email or phone number and a password");const{data:r,error:s}=n;if(s)return this._returnResult({data:{user:null,session:null},error:s});if(!r||!r.session||!r.user){const a=new _a;return this._returnResult({data:{user:null,session:null},error:a})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:s})}catch(n){if(Q(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOAuth(t){var n,r,s,a;return await this._handleProviderSignIn(t.provider,{redirectTo:(n=t.options)===null||n===void 0?void 0:n.redirectTo,scopes:(r=t.options)===null||r===void 0?void 0:r.scopes,queryParams:(s=t.options)===null||s===void 0?void 0:s.queryParams,skipBrowserRedirect:(a=t.options)===null||a===void 0?void 0:a.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){const{chain:n}=t;switch(n){case"ethereum":return await this.signInWithEthereum(t);case"solana":return await this.signInWithSolana(t);default:throw new Error(`@supabase/auth-js: Unsupported chain "${n}"`)}}async signInWithEthereum(t){var n,r,s,a,o,l,c,d,h,f,p;let m,y;if("message"in t)m=t.message,y=t.signature;else{const{chain:g,wallet:S,statement:w,options:v}=t;let x;if(ct())if(typeof S=="object")x=S;else{const _=window;if("ethereum"in _&&typeof _.ethereum=="object"&&"request"in _.ethereum&&typeof _.ethereum.request=="function")x=_.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 S!="object"||!(v!=null&&v.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");x=S}const k=new URL((n=v==null?void 0:v.url)!==null&&n!==void 0?n:window.location.href),j=await x.request({method:"eth_requestAccounts"}).then(_=>_).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!j||j.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const C=kS(j[0]);let T=(r=v==null?void 0:v.signInWithEthereum)===null||r===void 0?void 0:r.chainId;if(!T){const _=await x.request({method:"eth_chainId"});T=Q4(_)}const P={domain:k.host,address:C,statement:w,uri:k.href,version:"1",chainId:T,nonce:(s=v==null?void 0:v.signInWithEthereum)===null||s===void 0?void 0:s.nonce,issuedAt:(o=(a=v==null?void 0:v.signInWithEthereum)===null||a===void 0?void 0:a.issuedAt)!==null&&o!==void 0?o:new Date,expirationTime:(l=v==null?void 0:v.signInWithEthereum)===null||l===void 0?void 0:l.expirationTime,notBefore:(c=v==null?void 0:v.signInWithEthereum)===null||c===void 0?void 0:c.notBefore,requestId:(d=v==null?void 0:v.signInWithEthereum)===null||d===void 0?void 0:d.requestId,resources:(h=v==null?void 0:v.signInWithEthereum)===null||h===void 0?void 0:h.resources};m=Z4(P),y=await x.request({method:"personal_sign",params:[Y4(m),C]})}try{const{data:g,error:S}=await ee(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:m,signature:y},!((f=t.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(p=t.options)===null||p===void 0?void 0:p.captchaToken}}:null),xform:Ln});if(S)throw S;if(!g||!g.session||!g.user){const w=new _a;return this._returnResult({data:{user:null,session:null},error:w})}return g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("SIGNED_IN",g.session)),this._returnResult({data:Object.assign({},g),error:S})}catch(g){if(Q(g))return this._returnResult({data:{user:null,session:null},error:g});throw g}}async signInWithSolana(t){var n,r,s,a,o,l,c,d,h,f,p,m;let y,g;if("message"in t)y=t.message,g=t.signature;else{const{chain:S,wallet:w,statement:v,options:x}=t;let k;if(ct())if(typeof w=="object")k=w;else{const C=window;if("solana"in C&&typeof C.solana=="object"&&("signIn"in C.solana&&typeof C.solana.signIn=="function"||"signMessage"in C.solana&&typeof C.solana.signMessage=="function"))k=C.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof w!="object"||!(x!=null&&x.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");k=w}const j=new URL((n=x==null?void 0:x.url)!==null&&n!==void 0?n:window.location.href);if("signIn"in k&&k.signIn){const C=await k.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},x==null?void 0:x.signInWithSolana),{version:"1",domain:j.host,uri:j.href}),v?{statement:v}:null));let T;if(Array.isArray(C)&&C[0]&&typeof C[0]=="object")T=C[0];else if(C&&typeof C=="object"&&"signedMessage"in C&&"signature"in C)T=C;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in T&&"signature"in T&&(typeof T.signedMessage=="string"||T.signedMessage instanceof Uint8Array)&&T.signature instanceof Uint8Array)y=typeof T.signedMessage=="string"?T.signedMessage:new TextDecoder().decode(T.signedMessage),g=T.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in k)||typeof k.signMessage!="function"||!("publicKey"in k)||typeof k!="object"||!k.publicKey||!("toBase58"in k.publicKey)||typeof k.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");y=[`${j.host} wants you to sign in with your Solana account:`,k.publicKey.toBase58(),...v?["",v,""]:[""],"Version: 1",`URI: ${j.href}`,`Issued At: ${(s=(r=x==null?void 0:x.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&s!==void 0?s:new Date().toISOString()}`,...!((a=x==null?void 0:x.signInWithSolana)===null||a===void 0)&&a.notBefore?[`Not Before: ${x.signInWithSolana.notBefore}`]:[],...!((o=x==null?void 0:x.signInWithSolana)===null||o===void 0)&&o.expirationTime?[`Expiration Time: ${x.signInWithSolana.expirationTime}`]:[],...!((l=x==null?void 0:x.signInWithSolana)===null||l===void 0)&&l.chainId?[`Chain ID: ${x.signInWithSolana.chainId}`]:[],...!((c=x==null?void 0:x.signInWithSolana)===null||c===void 0)&&c.nonce?[`Nonce: ${x.signInWithSolana.nonce}`]:[],...!((d=x==null?void 0:x.signInWithSolana)===null||d===void 0)&&d.requestId?[`Request ID: ${x.signInWithSolana.requestId}`]:[],...!((f=(h=x==null?void 0:x.signInWithSolana)===null||h===void 0?void 0:h.resources)===null||f===void 0)&&f.length?["Resources",...x.signInWithSolana.resources.map(T=>`- ${T}`)]:[]].join(` `);const C=await k.signMessage(new TextEncoder().encode(y),"utf8");if(!C||!(C instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");g=C}}try{const{data:S,error:w}=await ee(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:y,signature:na(g)},!((p=t.options)===null||p===void 0)&&p.captchaToken?{gotrue_meta_security:{captcha_token:(m=t.options)===null||m===void 0?void 0:m.captchaToken}}:null),xform:Ln});if(w)throw w;if(!S||!S.session||!S.user){const v=new _a;return this._returnResult({data:{user:null,session:null},error:v})}return S.session&&(await this._saveSession(S.session),await this._notifyAllSubscribers("SIGNED_IN",S.session)),this._returnResult({data:Object.assign({},S),error:w})}catch(S){if(Q(S))return this._returnResult({data:{user:null,session:null},error:S});throw S}}async _exchangeCodeForSession(t){const n=await qs(this.storage,`${this.storageKey}-code-verifier`),[r,s]=(n??"").split("/");try{if(!r&&this.flowType==="pkce")throw new b4;const{data:a,error:o}=await ee(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:r},xform:Ln});if(await lt(this.storage,`${this.storageKey}-code-verifier`),o)throw o;if(!a||!a.session||!a.user){const l=new _a;return this._returnResult({data:{user:null,session:null,redirectType:null},error:l})}return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",a.session)),this._returnResult({data:Object.assign(Object.assign({},a),{redirectType:s??null}),error:o})}catch(a){if(await lt(this.storage,`${this.storageKey}-code-verifier`),Q(a))return this._returnResult({data:{user:null,session:null,redirectType:null},error:a});throw a}}async signInWithIdToken(t){try{const{options:n,provider:r,token:s,access_token:a,nonce:o}=t,l=await ee(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:s,access_token:a,nonce:o,gotrue_meta_security:{captcha_token:n==null?void 0:n.captchaToken}},xform:Ln}),{data:c,error:d}=l;if(d)return this._returnResult({data:{user:null,session:null},error:d});if(!c||!c.session||!c.user){const h=new _a;return this._returnResult({data:{user:null,session:null},error:h})}return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),this._returnResult({data:c,error:d})}catch(n){if(Q(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOtp(t){var n,r,s,a,o;try{if("email"in t){const{email:l,options:c}=t;let d=null,h=null;this.flowType==="pkce"&&([d,h]=await Ta(this.storage,this.storageKey));const{error:f}=await ee(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:l,data:(n=c==null?void 0:c.data)!==null&&n!==void 0?n:{},create_user:(r=c==null?void 0:c.shouldCreateUser)!==null&&r!==void 0?r:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},code_challenge:d,code_challenge_method:h},redirectTo:c==null?void 0:c.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:f})}if("phone"in t){const{phone:l,options:c}=t,{data:d,error:h}=await ee(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:l,data:(s=c==null?void 0:c.data)!==null&&s!==void 0?s:{},create_user:(a=c==null?void 0:c.shouldCreateUser)!==null&&a!==void 0?a:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},channel:(o=c==null?void 0:c.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 gc("You must provide either an email or phone number.")}catch(l){if(await lt(this.storage,`${this.storageKey}-code-verifier`),Q(l))return this._returnResult({data:{user:null,session:null},error:l});throw l}}async verifyOtp(t){var n,r;try{let s,a;"options"in t&&(s=(n=t.options)===null||n===void 0?void 0:n.redirectTo,a=(r=t.options)===null||r===void 0?void 0:r.captchaToken);const{data:o,error:l}=await ee(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:a}}),redirectTo:s,xform:Ln});if(l)throw l;if(!o)throw new Error("An error occurred on token verification.");const c=o.session,d=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:d,session:c},error:null})}catch(s){if(Q(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithSSO(t){var n,r,s,a,o;try{let l=null,c=null;this.flowType==="pkce"&&([l,c]=await Ta(this.storage,this.storageKey));const d=await ee(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(r=(n=t.options)===null||n===void 0?void 0:n.redirectTo)!==null&&r!==void 0?r:void 0}),!((s=t==null?void 0:t.options)===null||s===void 0)&&s.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:l,code_challenge_method:c}),headers:this.headers,xform:q4});return!((a=d.data)===null||a===void 0)&&a.url&&ct()&&!(!((o=t.options)===null||o===void 0)&&o.skipBrowserRedirect)&&window.location.assign(d.data.url),this._returnResult(d)}catch(l){if(await lt(this.storage,`${this.storageKey}-code-verifier`),Q(l))return this._returnResult({data:null,error:l});throw l}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;if(r)throw r;if(!n)throw new en;const{error:s}=await ee(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:n.access_token});return this._returnResult({data:{user:null,session:null},error:s})})}catch(t){if(Q(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async resend(t){try{const n=`${this.url}/resend`;if("email"in t){const{email:r,type:s,options:a}=t,{error:o}=await ee(this.fetch,"POST",n,{headers:this.headers,body:{email:r,type:s,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},redirectTo:a==null?void 0:a.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:o})}else if("phone"in t){const{phone:r,type:s,options:a}=t,{data:o,error:l}=await ee(this.fetch,"POST",n,{headers:this.headers,body:{phone:r,type:s,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:o==null?void 0:o.message_id},error:l})}throw new gc("You must provide either an email or phone number and a type")}catch(n){if(Q(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async n=>n))}async _acquireLock(t,n){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),s=(async()=>(await r,await n()))();return this.pendingInLock.push((async()=>{try{await s}catch{}})()),s}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const r=n();for(this.pendingInLock.push((async()=>{try{await r}catch{}})()),await r;this.pendingInLock.length;){const s=[...this.pendingInLock];await Promise.all(s),this.pendingInLock.splice(0,s.length)}return await r}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(t){this._debug("#_useSession","begin");try{const n=await this.__loadSession();return await t(n)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let t=null;const n=await qs(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",n),n!==null&&(this._isValidSession(n)?t=n:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!t)return{data:{session:null},error:null};const r=t.expires_at?t.expires_at*1e3-Date.now()<_h:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",t.expires_at),!r){if(this.userStorage){const o=await qs(this.userStorage,this.storageKey+"-user");o!=null&&o.user?t.user=o.user:t.user=Ph()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){const o={value:this.suppressGetSessionWarning};t.user=U4(t.user,o),o.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}const{data:s,error:a}=await this._callRefreshToken(t.refresh_token);return a?this._returnResult({data:{session:null},error:a}):this._returnResult({data:{session:s},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(t){if(t)return await this._getUser(t);await this.initializePromise;const n=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return n.data.user&&(this.suppressGetSessionWarning=!0),n}async _getUser(t){try{return t?await ee(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:us}):await this._useSession(async n=>{var r,s,a;const{data:o,error:l}=n;if(l)throw l;return!(!((r=o.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new en}:await ee(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(a=(s=o.session)===null||s===void 0?void 0:s.access_token)!==null&&a!==void 0?a:void 0,xform:us})})}catch(n){if(Q(n))return pc(n)&&(await this._removeSession(),await lt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:n});throw n}}async updateUser(t,n={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(t,n))}async _updateUser(t,n={}){try{return await this._useSession(async r=>{const{data:s,error:a}=r;if(a)throw a;if(!s.session)throw new en;const o=s.session;let l=null,c=null;this.flowType==="pkce"&&t.email!=null&&([l,c]=await Ta(this.storage,this.storageKey));const{data:d,error:h}=await ee(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:n==null?void 0:n.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:l,code_challenge_method:c}),jwt:o.access_token,xform:us});if(h)throw h;return o.user=d.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),this._returnResult({data:{user:o.user},error:null})})}catch(r){if(await lt(this.storage,`${this.storageKey}-code-verifier`),Q(r))return this._returnResult({data:{user:null},error:r});throw r}}async setSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new en;const n=Date.now()/1e3;let r=n,s=!0,a=null;const{payload:o}=xc(t.access_token);if(o.exp&&(r=o.exp,s=r<=n),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};a=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});a={access_token:t.access_token,refresh_token:t.refresh_token,user:l.user,token_type:"bearer",expires_in:r-n,expires_at:r},await this._saveSession(a),await this._notifyAllSubscribers("SIGNED_IN",a)}return this._returnResult({data:{user:a.user,session:a},error:null})}catch(n){if(Q(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async n=>{var r;if(!t){const{data:o,error:l}=n;if(l)throw l;t=(r=o.session)!==null&&r!==void 0?r:void 0}if(!(t!=null&&t.refresh_token))throw new en;const{data:s,error:a}=await this._callRefreshToken(t.refresh_token);return a?this._returnResult({data:{user:null,session:null},error:a}):s?this._returnResult({data:{user:s.user,session:s},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(n){if(Q(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async _getSessionFromURL(t,n){try{if(!ct())throw new yc("No browser detected.");if(t.error||t.error_description||t.error_code)throw new yc(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(n){case"implicit":if(this.flowType==="pkce")throw new ux("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new yc("Not a valid implicit grant flow url.");break;default:}if(n==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new ux("No code detected.");const{data:v,error:x}=await this._exchangeCodeForSession(t.code);if(x)throw x;const k=new URL(window.location.href);return k.searchParams.delete("code"),window.history.replaceState(window.history.state,"",k.toString()),{data:{session:v.session,redirectType:null},error:null}}const{provider_token:r,provider_refresh_token:s,access_token:a,refresh_token:o,expires_in:l,expires_at:c,token_type:d}=t;if(!a||!l||!o||!d)throw new yc("No session defined in URL");const h=Math.round(Date.now()/1e3),f=parseInt(l);let p=h+f;c&&(p=parseInt(c));const m=p-h;m*1e3<=$a&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${m}s, should have been closer to ${f}s`);const y=p-f;h-y>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",y,p,h):h-y<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",y,p,h);const{data:g,error:S}=await this._getUser(a);if(S)throw S;const w={provider_token:r,provider_refresh_token:s,access_token:a,expires_in:f,expires_at:p,refresh_token:o,token_type:d,user:g.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:w,redirectType:t.type},error:null})}catch(r){if(Q(r))return this._returnResult({data:{session:null,redirectType:null},error:r});throw r}}_isImplicitGrantCallback(t){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),t):!!(t.access_token||t.error_description)}async _isPKCECallback(t){const n=await qs(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&n)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async n=>{var r;const{data:s,error:a}=n;if(a&&!pc(a))return this._returnResult({error:a});const o=(r=s.session)===null||r===void 0?void 0:r.access_token;if(o){const{error:l}=await this.admin.signOut(o,t);if(l&&!(x4(l)&&(l.status===404||l.status===401||l.status===403)||pc(l)))return this._returnResult({error:l})}return t!=="others"&&(await this._removeSession(),await lt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){const n=N4(),r={id:n,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",n),this.stateChangeEmitters.delete(n)}};return this._debug("#onAuthStateChange()","registered callback with id",n),this.stateChangeEmitters.set(n,r),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(n)})))(),{data:{subscription:r}}}async _emitInitialSession(t){return await this._useSession(async n=>{var r,s;try{const{data:{session:a},error:o}=n;if(o)throw o;await((r=this.stateChangeEmitters.get(t))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",a)),this._debug("INITIAL_SESSION","callback id",t,"session",a)}catch(a){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",a),pc(a)?console.warn(a):console.error(a)}})}async resetPasswordForEmail(t,n={}){let r=null,s=null;this.flowType==="pkce"&&([r,s]=await Ta(this.storage,this.storageKey,!0));try{return await ee(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:r,code_challenge_method:s,gotrue_meta_security:{captcha_token:n.captchaToken}},headers:this.headers,redirectTo:n.redirectTo})}catch(a){if(await lt(this.storage,`${this.storageKey}-code-verifier`),Q(a))return this._returnResult({data:null,error:a});throw a}}async getUserIdentities(){var t;try{const{data:n,error:r}=await this.getUser();if(r)throw r;return this._returnResult({data:{identities:(t=n.user.identities)!==null&&t!==void 0?t:[]},error:null})}catch(n){if(Q(n))return this._returnResult({data:null,error:n});throw n}}async linkIdentity(t){return"token"in t?this.linkIdentityIdToken(t):this.linkIdentityOAuth(t)}async linkIdentityOAuth(t){var n;try{const{data:r,error:s}=await this._useSession(async a=>{var o,l,c,d,h;const{data:f,error:p}=a;if(p)throw p;const m=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(o=t.options)===null||o===void 0?void 0:o.redirectTo,scopes:(l=t.options)===null||l===void 0?void 0:l.scopes,queryParams:(c=t.options)===null||c===void 0?void 0:c.queryParams,skipBrowserRedirect:!0});return await ee(this.fetch,"GET",m,{headers:this.headers,jwt:(h=(d=f.session)===null||d===void 0?void 0:d.access_token)!==null&&h!==void 0?h:void 0})});if(s)throw s;return ct()&&!(!((n=t.options)===null||n===void 0)&&n.skipBrowserRedirect)&&window.location.assign(r==null?void 0:r.url),this._returnResult({data:{provider:t.provider,url:r==null?void 0:r.url},error:null})}catch(r){if(Q(r))return this._returnResult({data:{provider:t.provider,url:null},error:r});throw r}}async linkIdentityIdToken(t){return await this._useSession(async n=>{var r;try{const{error:s,data:{session:a}}=n;if(s)throw s;const{options:o,provider:l,token:c,access_token:d,nonce:h}=t,f=await ee(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(r=a==null?void 0:a.access_token)!==null&&r!==void 0?r:void 0,body:{provider:l,id_token:c,access_token:d,nonce:h,link_identity:!0,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:Ln}),{data:p,error:m}=f;return m?this._returnResult({data:{user:null,session:null},error:m}):!p||!p.session||!p.user?this._returnResult({data:{user:null,session:null},error:new _a}):(p.session&&(await this._saveSession(p.session),await this._notifyAllSubscribers("USER_UPDATED",p.session)),this._returnResult({data:p,error:m}))}catch(s){if(await lt(this.storage,`${this.storageKey}-code-verifier`),Q(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}})}async unlinkIdentity(t){try{return await this._useSession(async n=>{var r,s;const{data:a,error:o}=n;if(o)throw o;return await ee(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(s=(r=a.session)===null||r===void 0?void 0:r.access_token)!==null&&s!==void 0?s:void 0})})}catch(n){if(Q(n))return this._returnResult({data:null,error:n});throw n}}async _refreshAccessToken(t){const n=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(n,"begin");try{const r=Date.now();return await A4(async s=>(s>0&&await P4(200*Math.pow(2,s-1)),this._debug(n,"refreshing attempt",s),await ee(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:Ln})),(s,a)=>{const o=200*Math.pow(2,s);return a&&Th(a)&&Date.now()+o-r<$a})}catch(r){if(this._debug(n,"error",r),Q(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}finally{this._debug(n,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,n){const r=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:n.redirectTo,scopes:n.scopes,queryParams:n.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",n,"url",r),ct()&&!n.skipBrowserRedirect&&window.location.assign(r),{data:{provider:t,url:r},error:null}}async _recoverAndRefresh(){var t,n;const r="#_recoverAndRefresh()";this._debug(r,"begin");try{const s=await qs(this.storage,this.storageKey);if(s&&this.userStorage){let o=await qs(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!o&&(o={user:s.user},await Ba(this.userStorage,this.storageKey+"-user",o)),s.user=(t=o==null?void 0:o.user)!==null&&t!==void 0?t:Ph()}else if(s&&!s.user&&!s.user){const o=await qs(this.storage,this.storageKey+"-user");o&&(o!=null&&o.user)?(s.user=o.user,await lt(this.storage,this.storageKey+"-user"),await Ba(this.storage,this.storageKey,s)):s.user=Ph()}if(this._debug(r,"session from storage",s),!this._isValidSession(s)){this._debug(r,"session is not valid"),s!==null&&await this._removeSession();return}const a=((n=s.expires_at)!==null&&n!==void 0?n:1/0)*1e3-Date.now()<_h;if(this._debug(r,`session has${a?"":" not"} expired with margin of ${_h}s`),a){if(this.autoRefreshToken&&s.refresh_token){const{error:o}=await this._callRefreshToken(s.refresh_token);o&&(console.error(o),Th(o)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",o),await this._removeSession()))}}else if(s.user&&s.user.__isUserNotAvailableProxy===!0)try{const{data:o,error: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(r,"could not get user data, skipping SIGNED_IN notification")}catch(o){console.error("Error getting user data:",o),this._debug(r,"error getting user data, skipping SIGNED_IN notification",o)}else await this._notifyAllSubscribers("SIGNED_IN",s)}catch(s){this._debug(r,"error",s),console.error(s);return}finally{this._debug(r,"end")}}async _callRefreshToken(t){var n,r;if(!t)throw new en;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const s=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(s,"begin");try{this.refreshingDeferred=new Ad;const{data:a,error:o}=await this._refreshAccessToken(t);if(o)throw o;if(!a.session)throw new en;await this._saveSession(a.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",a.session);const l={data:a.session,error:null};return this.refreshingDeferred.resolve(l),l}catch(a){if(this._debug(s,"error",a),Q(a)){const o={data:null,error:a};return Th(a)||await this._removeSession(),(n=this.refreshingDeferred)===null||n===void 0||n.resolve(o),o}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(a),a}finally{this.refreshingDeferred=null,this._debug(s,"end")}}async _notifyAllSubscribers(t,n,r=!0){const s=`#_notifyAllSubscribers(${t})`;this._debug(s,"begin",n,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:t,session:n});const a=[],o=Array.from(this.stateChangeEmitters.values()).map(async l=>{try{await l.callback(t,n)}catch(c){a.push(c)}});if(await Promise.all(o),a.length>0){for(let l=0;lthis._autoRefreshTokenTick(),$a);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t);const n=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=n,n&&typeof n=="object"&&typeof n.unref=="function"?n.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(n)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t);const n=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,n&&clearTimeout(n)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const t=Date.now();try{return await this._useSession(async n=>{const{data:{session:r}}=n;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const s=Math.floor((r.expires_at*1e3-t)/$a);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${$a}ms, refresh threshold is ${jm} ticks`),s<=jm&&await this._callRefreshToken(r.refresh_token)})}catch(n){console.error("Auto refresh tick failed with error. This is likely a transient error.",n)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t.isAcquireTimeout||t instanceof SS)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!ct()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(t){this._debug("#visibilityChangedCallback","error",t)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const n=`#_onVisibilityChanged(${t})`;this._debug(n,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(n,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(t,n,r){const s=[`provider=${encodeURIComponent(n)}`];if(r!=null&&r.redirectTo&&s.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r!=null&&r.scopes&&s.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const[a,o]=await Ta(this.storage,this.storageKey),l=new URLSearchParams({code_challenge:`${encodeURIComponent(a)}`,code_challenge_method:`${encodeURIComponent(o)}`});s.push(l.toString())}if(r!=null&&r.queryParams){const a=new URLSearchParams(r.queryParams);s.push(a.toString())}return r!=null&&r.skipBrowserRedirect&&s.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${t}?${s.join("&")}`}async _unenroll(t){try{return await this._useSession(async n=>{var r;const{data:s,error:a}=n;return a?this._returnResult({data:null,error:a}):await ee(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(Q(n))return this._returnResult({data:null,error:n});throw n}}async _enroll(t){try{return await this._useSession(async n=>{var r,s;const{data:a,error:o}=n;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:d}=await ee(this.fetch,"POST",`${this.url}/factors`,{body:l,headers:this.headers,jwt:(r=a==null?void 0:a.session)===null||r===void 0?void 0:r.access_token});return d?this._returnResult({data:null,error:d}):(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(n){if(Q(n))return this._returnResult({data:null,error:n});throw n}}async _verify(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async n=>{var r;const{data:s,error:a}=n;if(a)return this._returnResult({data:null,error:a});const o=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?o5(t.webauthn.credential_response):i5(t.webauthn.credential_response)})}:{code:t.code}),{data:l,error:c}=await ee(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:o,headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token});return c?this._returnResult({data:null,error:c}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+l.expires_in},l)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",l),this._returnResult({data:l,error:c}))})}catch(n){if(Q(n))return this._returnResult({data:null,error:n});throw n}})}async _challenge(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async n=>{var r;const{data:s,error:a}=n;if(a)return this._returnResult({data:null,error:a});const o=await ee(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token});if(o.error)return o;const{data:l}=o;if(l.type!=="webauthn")return{data:l,error:null};switch(l.webauthn.type){case"create":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:s5(l.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:a5(l.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(n){if(Q(n))return this._returnResult({data:null,error:n});throw n}})}async _challengeAndVerify(t){const{data:n,error:r}=await this._challenge({factorId:t.factorId});return r?this._returnResult({data:null,error:r}):await this._verify({factorId:t.factorId,challengeId:n.id,code:t.code})}async _listFactors(){var t;const{data:{user:n},error:r}=await this.getUser();if(r)return{data:null,error:r};const s={all:[],phone:[],totp:[],webauthn:[]};for(const a of(t=n==null?void 0:n.factors)!==null&&t!==void 0?t:[])s.all.push(a),a.status==="verified"&&s[a.factor_type].push(a);return{data:s,error:null}}async _getAuthenticatorAssuranceLevel(t){var n,r,s,a;if(t)try{const{payload:m}=xc(t);let y=null;m.aal&&(y=m.aal);let g=y;const{data:{user:S},error:w}=await this.getUser(t);if(w)return this._returnResult({data:null,error:w});((r=(n=S==null?void 0:S.factors)===null||n===void 0?void 0:n.filter(k=>k.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(g="aal2");const x=m.amr||[];return{data:{currentLevel:y,nextLevel:g,currentAuthenticationMethods:x},error:null}}catch(m){if(Q(m))return this._returnResult({data:null,error:m});throw m}const{data:{session:o},error:l}=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}=xc(o.access_token);let d=null;c.aal&&(d=c.aal);let h=d;((a=(s=o.user.factors)===null||s===void 0?void 0:s.filter(m=>m.status==="verified"))!==null&&a!==void 0?a:[]).length>0&&(h="aal2");const p=c.amr||[];return{data:{currentLevel:d,nextLevel:h,currentAuthenticationMethods:p},error:null}}async _getAuthorizationDetails(t){try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;return s?this._returnResult({data:null,error:s}):r?await ee(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:r.access_token,xform:a=>({data:a,error:null})}):this._returnResult({data:null,error:new en})})}catch(n){if(Q(n))return this._returnResult({data:null,error:n});throw n}}async _approveAuthorization(t,n){try{return await this._useSession(async r=>{const{data:{session:s},error:a}=r;if(a)return this._returnResult({data:null,error:a});if(!s)return this._returnResult({data:null,error:new en});const o=await ee(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&&ct()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(r){if(Q(r))return this._returnResult({data:null,error:r});throw r}}async _denyAuthorization(t,n){try{return await this._useSession(async r=>{const{data:{session:s},error:a}=r;if(a)return this._returnResult({data:null,error:a});if(!s)return this._returnResult({data:null,error:new en});const o=await ee(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&&ct()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(r){if(Q(r))return this._returnResult({data:null,error:r});throw r}}async _listOAuthGrants(){try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;return r?this._returnResult({data:null,error:r}):n?await ee(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new en})})}catch(t){if(Q(t))return this._returnResult({data:null,error:t});throw t}}async _revokeOAuthGrant(t){try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;return s?this._returnResult({data:null,error:s}):r?(await ee(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,query:{client_id:t.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new en})})}catch(n){if(Q(n))return this._returnResult({data:null,error:n});throw n}}async fetchJwk(t,n={keys:[]}){let r=n.keys.find(l=>l.kid===t);if(r)return r;const s=Date.now();if(r=this.jwks.keys.find(l=>l.kid===t),r&&this.jwks_cached_at+g4>s)return r;const{data:a,error:o}=await ee(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(o)throw o;return!a.keys||a.keys.length===0||(this.jwks=a,this.jwks_cached_at=s,r=a.keys.find(l=>l.kid===t),!r)?null:r}async getClaims(t,n={}){try{let r=t;if(!r){const{data:m,error:y}=await this.getSession();if(y||!m.session)return this._returnResult({data:null,error:y});r=m.session.access_token}const{header:s,payload:a,signature:o,raw:{header:l,payload:c}}=xc(r);n!=null&&n.allowExpired||F4(a.exp);const d=!s.alg||s.alg.startsWith("HS")||!s.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(s.kid,n!=null&&n.keys?{keys:n.keys}:n==null?void 0:n.jwks);if(!d){const{error:m}=await this.getUser(r);if(m)throw m;return{data:{claims:a,header:s,signature:o},error:null}}const h=$4(s.alg),f=await crypto.subtle.importKey("jwk",d,h,!0,["verify"]);if(!await crypto.subtle.verify(h,f,o,j4(`${l}.${c}`)))throw new _m("Invalid JWT signature");return{data:{claims:a,header:s,signature:o},error:null}}catch(r){if(Q(r))return this._returnResult({data:null,error:r});throw r}}}gl.nextInstanceID={};const g5=gl,y5="2.104.0";let bi="";typeof Deno<"u"?bi="deno":typeof document<"u"?bi="web":typeof navigator<"u"&&navigator.product==="ReactNative"?bi="react-native":bi="node";const x5={"X-Client-Info":`supabase-js-${bi}/${y5}`},v5={headers:x5},b5={schema:"public"},w5={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},S5={};function yl(e){"@babel/helpers - typeof";return yl=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},yl(e)}function k5(e,t){if(yl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(yl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function C5(e){var t=k5(e,"string");return yl(t)=="symbol"?t:t+""}function j5(e,t,n){return(t=C5(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function qe(e){for(var t=1;te?(...t)=>e(...t):(...t)=>fetch(...t),N5=()=>Headers,_5=(e,t,n)=>{const r=E5(n),s=N5();return async(a,o)=>{var l;const c=(l=await t())!==null&&l!==void 0?l:e;let d=new s(o==null?void 0:o.headers);return d.has("apikey")||d.set("apikey",e),d.has("Authorization")||d.set("Authorization",`Bearer ${c}`),r(a,qe(qe({},o),{},{headers:d}))}};function T5(e){return e.endsWith("/")?e:e+"/"}function P5(e,t){var n,r;const{db:s,auth:a,realtime:o,global:l}=e,{db:c,auth:d,realtime:h,global:f}=t,p={db:qe(qe({},c),s),auth:qe(qe({},d),a),realtime:qe(qe({},h),o),storage:{},global:qe(qe(qe({},f),l),{},{headers:qe(qe({},(n=f==null?void 0:f.headers)!==null&&n!==void 0?n:{}),(r=l==null?void 0:l.headers)!==null&&r!==void 0?r:{})}),accessToken:async()=>""};return e.accessToken?p.accessToken=e.accessToken:delete p.accessToken,p}function A5(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(T5(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var R5=class extends g5{constructor(e){super(e)}},I5=class{constructor(e,t,n){var r,s;this.supabaseUrl=e,this.supabaseKey=t;const a=A5(e);if(!t)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",a),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",a),this.storageUrl=new URL("storage/v1",a),this.functionsUrl=new URL("functions/v1",a);const o=`sb-${a.hostname.split(".")[0]}-auth-token`,l={db:b5,realtime:S5,auth:qe(qe({},w5),{},{storageKey:o}),global:v5},c=P5(n??{},l);if(this.storageKey=(r=c.auth.storageKey)!==null&&r!==void 0?r:"",this.headers=(s=c.global.headers)!==null&&s!==void 0?s:{},c.accessToken)this.accessToken=c.accessToken,this.auth=new Proxy({},{get:(h,f)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(f)} is not possible`)}});else{var d;this.auth=this._initSupabaseAuthClient((d=c.auth)!==null&&d!==void 0?d:{},this.headers,c.global.fetch)}this.fetch=_5(t,this._getAccessToken.bind(this),c.global.fetch),this.realtime=this._initRealtimeClient(qe({headers:this.headers,accessToken:this._getAccessToken.bind(this)},c.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(h=>this.realtime.setAuth(h)).catch(h=>console.warn("Failed to set initial Realtime auth token:",h)),this.rest=new e3(new URL("rest/v1",a).href,{headers:this.headers,schema:c.db.schema,fetch:this.fetch,timeout:c.db.timeout,urlLengthLimit:c.db.urlLengthLimit}),this.storage=new d4(this.storageUrl.href,this.headers,this.fetch,n==null?void 0:n.storage),c.accessToken||this._listenForAuthEvents()}get functions(){return new H6(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,n)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e=this,t,n;if(e.accessToken)return await e.accessToken();const{data:r}=await e.auth.getSession();return(t=(n=r.session)===null||n===void 0?void 0:n.access_token)!==null&&t!==void 0?t:e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:s,storageKey:a,flowType:o,lock:l,debug:c,throwOnError:d},h,f){const p={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new R5({url:this.authUrl.href,headers:qe(qe({},p),h),storageKey:a,autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:s,flowType:o,lock:l,debug:c,throwOnError:d,fetch:f,hasCustomAuthorizationHeader:Object.keys(this.headers).some(m=>m.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new O3(this.realtimeUrl.href,qe(qe({},e),{},{params:qe(qe({},{apikey:this.supabaseKey}),e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",t==null?void 0:t.access_token)})}_handleTokenChanged(e,t,n){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const O5=(e,t,n)=>new I5(e,t,n);function M5(){if(typeof window<"u")return!1;const e=globalThis.process;if(!e)return!1;const t=e.version;if(t==null)return!1;const n=t.match(/^v(\d+)\./);return n?parseInt(n[1],10)<=18:!1}M5()&&console.warn("⚠️ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const L5="https://fklcoarnnuwiaeshpdaa.supabase.co",D5="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImZrbGNvYXJubnV3aWFlc2hwZGFhIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzY4NzQ3NTcsImV4cCI6MjA5MjQ1MDc1N30.D_N9pi2Ndoq-0VO6RmscLI5B_I2Q_aUTl7aYB_j-xR0",tt=O5(L5,D5,{auth:{storage:localStorage,persistSession:!0,autoRefreshToken:!0}});function Rd(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function F5(){if(typeof document>"u")return{fbp:null,fbc:null};const e=document.cookie.split(";").reduce((t,n)=>{const[r,s]=n.trim().split("=");return t[r]=s,t},{});return{fbp:e._fbp||null,fbc:e._fbc||null}}function jS(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function Rh(e){if(!(!e||e.trim()===""))return jS(e.trim().toLowerCase())}function Cx(e){if(!(!e||e.trim()===""))return e.trim().toLowerCase()}function $5(e){if(!(!e||e.trim()===""))return jS(e.trim().toLowerCase()).replace(/\s+/g,"")}function B5(e){if(!e)return;const t=e.replace(/\D/g,"");if(t.length!==0)return t.length===10||t.length===11?`55${t}`:t}function U5(e){if(!e)return;const t=e.replace(/\D/g,"");return t.length>0?t:void 0}function Ll(e){const t={},n=Rh(e.email);n&&(t.em=n);const r=B5(e.phone);r&&(t.ph=r);const s=Cx(e.firstName);s&&(t.fn=s);const a=Cx(e.lastName);a&&(t.ln=a);const o=$5(e.city);o&&(t.ct=o);const l=Rh(e.state);l&&(t.st=l);const c=U5(e.zipCode);return c&&(t.zp=c),t.country=Rh(e.country)||"br",Object.keys(t).length>0?t:void 0}function ES(e){if(typeof window>"u"||!window.fbq)return;const t=Ll(e);t&&window.fbq("init","1198424312101245",t)}function z5(){typeof window<"u"&&window.fbq&&window.fbq("track","PageView")}function V5(e){typeof window<"u"&&window.fbq&&window.fbq("track","ViewContent",{value:e.value,currency:e.currency||"BRL",content_ids:["tapete-bandeja-premium"],content_name:e.content_name||"Tapete Bandeja Premium",content_type:"product"})}function H5(e){if(typeof window<"u"&&window.fbq){const t=Rd(),n={value:e.value,currency:"BRL",content_ids:["tapete-bandeja-premium"],content_name:"Tapete Bandeja Premium",content_type:"product",num_items:1};if(e.userData){const r=Ll(e.userData);r&&Object.assign(n,r)}window.fbq("track","InitiateCheckout",n,{eventID:t})}}function q5(e){if(typeof window<"u"&&window.fbq){const t=Rd(),n={value:e.value,currency:"BRL",content_ids:["tapete-bandeja-premium"],content_name:"Tapete Bandeja Premium",content_type:"product"};if(e.userData){const r=Ll(e.userData);r&&Object.assign(n,r)}window.fbq("track","AddPaymentInfo",n,{eventID:t})}}function G5(e){if(typeof window<"u"&&window.fbq){const t=Rd(),n={value:e.value||0,currency:"BRL",content_name:"Tapete Bandeja Premium"};if(e.userData){const r=Ll(e.userData);r&&Object.assign(n,r)}window.fbq("track","Lead",n,{eventID:t})}}async function W5(e){const t=e.event_id||Rd(),{fbp:n,fbc:r}=F5();if(typeof window<"u"&&window.fbq){const s={email:e.email,phone:e.phone,firstName:e.firstName,lastName:e.lastName,city:e.city,state:e.state,zipCode:e.zipCode,country:"br"},a={value:e.value,currency:"BRL",content_ids:["tapete-bandeja-premium"],content_name:"Tapete Bandeja Premium",content_type:"product",num_items:1,order_id:e.order_id},o=Ll(s);o&&Object.assign(a,o),a.external_id=e.order_id,window.fbq("track","Purchase",a,{eventID:t})}try{await tt.functions.invoke("meta-purchase-event",{body:{order_id:e.order_id,event_id:t,value:e.value,email:e.email,phone:e.phone,first_name:e.firstName,last_name:e.lastName,city:e.city,state:e.state,zip_code:e.zipCode,country:"br",fbp:n||void 0,fbc:r||void 0,client_user_agent:navigator.userAgent,event_source_url:window.location.href}})}catch(s){console.error("Meta CAPI error:",s)}return{success:!0,event_id:t}}const K5="modulepreload",X5=function(e){return"/"+e},jx={},NS=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));s=Promise.allSettled(n.map(c=>{if(c=X5(c),c in jx)return;jx[c]=!0;const d=c.endsWith(".css"),h=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${h}`))return;const f=document.createElement("link");if(f.rel=d?"stylesheet":K5,d||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),d)return new Promise((p,m)=>{f.addEventListener("load",p),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${c}`)))})}))}function a(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return s.then(o=>{for(const l of o||[])l.status==="rejected"&&a(l.reason);return t().catch(a)})},Ih=[{icon:dn,text:"Frete grátis para todo o Brasil em pedidos acima de R$ 99"},{icon:jr,text:"Garantia de 1 ano + 7 dias para devolução"},{icon:wr,text:"+12.400 clientes avaliaram com 4,9 ★ no Reclame Aqui"},{icon:ls,text:"Pagamento 100% seguro · Site verificado SSL"},{icon:C_,text:"Empresa brasileira · CNPJ ativo desde 2019"},{icon:Q_,text:"Mais de 38.000 carros já protegidos pelos nossos tapetes"}],En=()=>{const[e,t]=b.useState(0),[n,r]=b.useState(!0);b.useEffect(()=>{const l=setInterval(()=>{r(!1),setTimeout(()=>{t(c=>(c+1)%Ih.length),r(!0)},300)},3800);return()=>clearInterval(l)},[]);const s=Ih[e],a=s.icon,o=[{icon:jr,label:"Compra Protegida",sub:"Site SSL · Empresa verificada"},{icon:dn,label:"Frete Grátis Brasil",sub:"Acima de R$ 99 · Sedex disponível"},{icon:wr,label:"4,9 ★ no Reclame Aqui",sub:"+12.400 avaliações reais"}];return i.jsx("div",{className:"bg-gradient-to-r from-foreground via-foreground to-foreground/95 border-b border-foreground/40",children:i.jsxs("div",{className:"max-w-7xl mx-auto px-4",children:[i.jsxs("div",{className:"md:hidden py-2",children:[i.jsxs("div",{className:`flex items-center justify-center gap-2 transition-opacity duration-300 ${n?"opacity-100":"opacity-0"}`,children:[i.jsx(a,{className:"w-3.5 h-3.5 text-background shrink-0"}),i.jsx("p",{className:"text-center text-background text-[10.5px] font-bold uppercase tracking-[0.12em] leading-tight",children:s.text})]}),i.jsx("div",{className:"flex items-center justify-center gap-1 mt-1.5",children:Ih.map((l,c)=>i.jsx("span",{className:`h-0.5 rounded-full transition-all duration-300 ${c===e?"w-4 bg-background":"w-1 bg-background/30"}`},c))})]}),i.jsx("div",{className:"hidden md:grid grid-cols-3 gap-8 py-2.5",children:o.map((l,c)=>{const d=l.icon;return i.jsxs("div",{className:"flex items-center justify-center gap-2.5",children:[i.jsx(d,{className:"w-4 h-4 text-background shrink-0",strokeWidth:2.2}),i.jsxs("div",{className:"flex flex-col leading-tight",children:[i.jsx("span",{className:"text-background text-[11px] font-bold uppercase tracking-[0.14em]",children:l.label}),i.jsx("span",{className:"text-background/60 text-[9.5px] font-medium tracking-wide",children:l.sub})]})]},c)})})]})})},Ex=[{icon:dn,label:"Frete Grátis Brasil"},{icon:$r,label:"Garantia 1 Ano"},{icon:wr,label:"4.9/5 (3847+ avaliações)",fill:!0}],J5=()=>{const[e,t]=b.useState(0),[n,r]=b.useState(!0);b.useEffect(()=>{const o=setInterval(()=>{r(!1),setTimeout(()=>{t(l=>(l+1)%Ex.length),r(!0)},300)},3500);return()=>clearInterval(o)},[]);const s=Ex[e],a=s.icon;return i.jsx("section",{className:"bg-foreground border-y border-background/10",children:i.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-2.5 flex justify-center items-center",children:i.jsxs("div",{className:`flex items-center gap-1.5 text-background/70 transition-opacity duration-300 ${n?"opacity-100":"opacity-0"}`,children:[i.jsx(a,{className:`w-3.5 h-3.5 ${s.fill?"fill-current text-yellow-400":""}`}),i.jsx("span",{className:"uppercase tracking-wider text-[10px] sm:text-xs font-semibold",children:s.label})]})})})},Id="/assets/logo-opt-Il16F6AJ.png",vc=[{to:"/produto/kit-tapete-bandeja-premium",label:"Kit Completo",desc:"Interno + Porta-Malas"},{to:"/produto/kit-basico-tapetes-internos",label:"Kit Básico",desc:"3 tapetes internos"},{to:"/produto/tapete-bandeja-premium-avulso",label:"Tapete Avulso",desc:"Unidade individual"},{to:"/produto/tapete-porta-malas-premium",label:"Porta-Malas",desc:"Proteção do bagageiro"}],Nx=[{to:"/faq",label:"Perguntas Frequentes",icon:Wb},{to:"/rastreio",label:"Rastrear Pedido",icon:tg},{to:"/politica-de-troca",label:"Política de Troca",icon:jr},{to:"/politica-de-envio",label:"Política de Envio",icon:dn}],Nn=()=>{const[e,t]=b.useState(!1),[n,r]=b.useState(!1),[s,a]=b.useState(!1),[o,l]=b.useState(!1),c=Xt(),d=h=>c.pathname===h;return i.jsxs(i.Fragment,{children:[i.jsxs("nav",{className:"sticky top-0 z-50 bg-background shadow-sm border-b border-border",children:[i.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6",children:[i.jsxs("div",{className:"relative flex items-center justify-between h-16 gap-4",children:[i.jsx("button",{className:"md:hidden text-foreground shrink-0",onClick:()=>t(!e),"aria-label":"Abrir menu",children:e?i.jsx(Sr,{className:"w-6 h-6"}):i.jsx(F_,{className:"w-6 h-6"})}),i.jsxs("div",{className:"hidden md:flex items-center gap-6 flex-1",children:[i.jsxs("div",{className:"relative",onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:[i.jsxs(se,{to:"/produtos",className:`flex items-center gap-1 text-[13px] font-semibold uppercase tracking-[0.15em] transition-colors ${d("/produtos")?"text-foreground":"text-foreground/70 hover:text-foreground"}`,children:["Produtos",i.jsx(Ur,{className:`w-3.5 h-3.5 transition-transform ${n?"rotate-180":""}`})]}),n&&i.jsx("div",{className:"absolute top-full left-0 pt-3 w-72",children:i.jsxs("div",{className:"bg-background border border-border rounded-md shadow-lg overflow-hidden",children:[vc.map(h=>i.jsxs(se,{to:h.to,className:"flex flex-col px-4 py-3 hover:bg-muted transition-colors border-b border-border/40 last:border-0",children:[i.jsx("span",{className:"text-sm font-semibold text-foreground",children:h.label}),i.jsx("span",{className:"text-xs text-muted-foreground mt-0.5",children:h.desc})]},h.to)),i.jsx(se,{to:"/produtos",className:"block px-4 py-2.5 text-xs font-semibold uppercase tracking-wider text-primary hover:bg-muted transition-colors bg-muted/50",children:"Ver todos os produtos →"})]})})]}),i.jsx(se,{to:"/sobre",className:`text-[13px] font-semibold uppercase tracking-[0.15em] transition-colors ${d("/sobre")?"text-foreground":"text-foreground/70 hover:text-foreground"}`,children:"Sobre"}),i.jsxs("div",{className:"relative",onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[i.jsxs("button",{className:"flex items-center gap-1 text-[13px] font-semibold uppercase tracking-[0.15em] text-foreground/70 hover:text-foreground transition-colors",children:["Ajuda",i.jsx(Ur,{className:`w-3.5 h-3.5 transition-transform ${s?"rotate-180":""}`})]}),s&&i.jsx("div",{className:"absolute top-full left-0 pt-3 w-64",children:i.jsx("div",{className:"bg-background border border-border rounded-md shadow-lg overflow-hidden",children:Nx.map(h=>{const f=h.icon;return i.jsxs(se,{to:h.to,className:"flex items-center gap-3 px-4 py-3 hover:bg-muted transition-colors border-b border-border/40 last:border-0",children:[i.jsx(f,{className:"w-4 h-4 text-muted-foreground"}),i.jsx("span",{className:"text-sm font-medium text-foreground",children:h.label})]},h.to)})})})]})]}),i.jsx(se,{to:"/",className:"flex items-center justify-center shrink-0 absolute left-1/2 -translate-x-1/2 md:static md:translate-x-0",children:i.jsx("img",{src:Id,alt:"AlphaCars",className:"h-10 object-contain"})}),i.jsxs("div",{className:"hidden md:flex items-center gap-5 flex-1 justify-end",children:[i.jsxs("a",{href:"tel:+5511999999999",className:"flex items-center gap-2 text-foreground/70 hover:text-foreground transition-colors","aria-label":"Atendimento",children:[i.jsx(ju,{className:"w-4 h-4"}),i.jsx("span",{className:"text-[12px] font-semibold uppercase tracking-wider",children:"Atendimento"})]}),i.jsxs(se,{to:"/rastreio",className:"flex items-center gap-2 text-foreground/70 hover:text-foreground transition-colors","aria-label":"Rastrear pedido",children:[i.jsx(tg,{className:"w-4 h-4"}),i.jsx("span",{className:"text-[12px] font-semibold uppercase tracking-wider",children:"Rastreio"})]}),i.jsx("button",{onClick:()=>l(!o),className:"text-foreground/70 hover:text-foreground transition-colors","aria-label":"Pesquisar",children:i.jsx(Ai,{className:"w-[18px] h-[18px]"})}),i.jsx(se,{to:"/checkout",className:"relative text-foreground/70 hover:text-foreground transition-colors","aria-label":"Carrinho",children:i.jsx(wy,{className:"w-[18px] h-[18px]"})})]}),i.jsxs("div",{className:"flex md:hidden items-center gap-4 shrink-0",children:[i.jsx("button",{onClick:()=>l(!o),className:"text-foreground/70","aria-label":"Pesquisar",children:i.jsx(Ai,{className:"w-5 h-5"})}),i.jsx(se,{to:"/checkout",className:"text-foreground/70","aria-label":"Carrinho",children:i.jsx(wy,{className:"w-5 h-5"})})]})]}),o&&i.jsx("div",{className:"py-3 border-t border-border",children:i.jsxs("form",{onSubmit:h=>{h.preventDefault(),l(!1),window.location.href="/produtos"},className:"flex items-center gap-2 max-w-3xl mx-auto",children:[i.jsx(Ai,{className:"w-4 h-4 text-muted-foreground shrink-0"}),i.jsx("input",{type:"text",autoFocus:!0,placeholder:"Buscar tapetes, kits, modelos...",className:"flex-1 bg-transparent border-none outline-none text-sm text-foreground placeholder:text-muted-foreground"}),i.jsx("button",{type:"button",onClick:()=>l(!1),className:"text-muted-foreground hover:text-foreground transition-colors","aria-label":"Fechar busca",children:i.jsx(Sr,{className:"w-4 h-4"})})]})})]}),i.jsx("div",{className:"hidden md:block border-t border-border/60 bg-muted/30",children:i.jsx("div",{className:"max-w-7xl mx-auto px-6",children:i.jsxs("div",{className:"flex items-center justify-center gap-7 h-10",children:[vc.map(h=>i.jsx(se,{to:h.to,className:"text-[11px] font-semibold uppercase tracking-[0.12em] text-foreground/60 hover:text-foreground transition-colors",children:h.label},h.to)),i.jsx("span",{className:"text-foreground/20",children:"•"}),i.jsx(se,{to:"/produtos",className:"text-[11px] font-semibold uppercase tracking-[0.12em] text-primary hover:text-primary/80 transition-colors",children:"Ofertas até 75% OFF"})]})})}),i.jsx("div",{className:"md:hidden border-t border-border/60 bg-muted/30",children:i.jsxs("div",{className:"flex items-center gap-4 overflow-x-auto px-4 h-9 scrollbar-none",children:[vc.map(h=>i.jsx(se,{to:h.to,className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-foreground/70 hover:text-foreground transition-colors whitespace-nowrap",children:h.label},h.to)),i.jsx(se,{to:"/produtos",className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-primary whitespace-nowrap",children:"75% OFF →"})]})}),i.jsx("div",{className:"md:hidden border-t border-border/60 bg-background",children:i.jsxs("div",{className:"grid grid-cols-3 px-2 py-2 text-center divide-x divide-border/60",children:[i.jsxs("div",{className:"flex flex-col items-center gap-0.5 px-1",children:[i.jsx(dn,{className:"w-3.5 h-3.5 text-foreground"}),i.jsx("span",{className:"text-[9.5px] font-semibold uppercase tracking-wider text-foreground/80 leading-tight",children:"Frete Grátis"})]}),i.jsxs("div",{className:"flex flex-col items-center gap-0.5 px-1",children:[i.jsx(jr,{className:"w-3.5 h-3.5 text-foreground"}),i.jsx("span",{className:"text-[9.5px] font-semibold uppercase tracking-wider text-foreground/80 leading-tight",children:"Troca Grátis"})]}),i.jsxs("div",{className:"flex flex-col items-center gap-0.5 px-1",children:[i.jsx(Wb,{className:"w-3.5 h-3.5 text-foreground"}),i.jsx("span",{className:"text-[9.5px] font-semibold uppercase tracking-wider text-foreground/80 leading-tight",children:"Suporte 24h"})]})]})})]}),e&&i.jsx("div",{className:"md:hidden fixed inset-0 z-40 bg-background/95 backdrop-blur-sm pt-16 overflow-y-auto",children:i.jsxs("div",{className:"px-6 py-4 flex flex-col gap-1",children:[i.jsx("p",{className:"text-[10px] font-bold uppercase tracking-widest text-muted-foreground pt-3 pb-1",children:"Produtos"}),vc.map(h=>i.jsxs(se,{to:h.to,onClick:()=>t(!1),className:"flex flex-col py-3 border-b border-border/40",children:[i.jsx("span",{className:"text-sm font-semibold text-foreground",children:h.label}),i.jsx("span",{className:"text-xs text-muted-foreground mt-0.5",children:h.desc})]},h.to)),i.jsx("p",{className:"text-[10px] font-bold uppercase tracking-widest text-muted-foreground pt-5 pb-1",children:"Institucional"}),i.jsx(se,{to:"/sobre",onClick:()=>t(!1),className:"text-sm font-semibold text-foreground py-3 border-b border-border/40",children:"Sobre nós"}),i.jsx(se,{to:"/contato",onClick:()=>t(!1),className:"text-sm font-semibold text-foreground py-3 border-b border-border/40",children:"Contato"}),i.jsx("p",{className:"text-[10px] font-bold uppercase tracking-widest text-muted-foreground pt-5 pb-1",children:"Ajuda"}),Nx.map(h=>{const f=h.icon;return i.jsxs(se,{to:h.to,onClick:()=>t(!1),className:"flex items-center gap-3 py-3 border-b border-border/40",children:[i.jsx(f,{className:"w-4 h-4 text-muted-foreground"}),i.jsx("span",{className:"text-sm font-medium text-foreground",children:h.label})]},h.to)}),i.jsxs("a",{href:"tel:+5511999999999",className:"flex items-center gap-3 py-3 mt-4 rounded-md bg-primary text-primary-foreground justify-center font-semibold text-sm",children:[i.jsx(ju,{className:"w-4 h-4"}),"Falar com atendimento"]})]})})]})},xl=[{id:"1",name:"Kit Tapetes Interno + Porta-Malas",slug:"kit-completo-interno-porta-malas",price:147.53,originalPrice:457.03,image:"/images/halvor-kit-principal.webp",badge:"66% OFF",rating:4.9,reviewCount:1924,category:"Kits Completos",description:"Proteção completa interior + porta-malas. Traseiro inteiriço c/ proteção central. Mantém o carro com aparência de novo. 🎁 Brinde exclusivo do kit completo.",kitPrices:{basico:{price:98.73,originalPrice:397.03},completo:{price:147.53,originalPrice:457.03}}},{id:"2",name:"Kit Tapetes Interno - Sem Porta-Malas",slug:"kit-basico-tapetes-internos",price:98.73,originalPrice:397.03,image:"/images/halvor-kit-basico.webp",badge:"75% OFF",rating:4.8,reviewCount:2156,category:"Kits Básicos",description:"3 tapetes internos sob medida para seu veículo. Evita sujeira, lama e desgaste. Material premium com borda elevada."},{id:"3",name:"Tapete Bandeja Premium - Avulso",slug:"tapete-bandeja-premium-avulso",price:109.9,originalPrice:299.9,image:"/images/halvor-kit-basico.webp",badge:"63% OFF",rating:4.7,reviewCount:1523,category:"Tapetes Avulsos",description:"Kit interno (3 tapetes) sob medida para seu veículo. Borda elevada, material premium e alta durabilidade."},{id:"4",name:"Tapete Porta-Malas Premium",slug:"tapete-porta-malas-premium",price:89.9,originalPrice:219.9,image:"/images/halvor-tapete-3.webp",badge:"59% OFF",rating:4.8,reviewCount:1289,category:"Porta-Malas",description:"Tapete porta-malas sob medida com borda elevada. Proteção total contra sujeira, líquidos e desgaste. Encaixe perfeito no seu veículo.",isNew:!0},{id:"5",name:"Kit Tapete Bandeja Premium",slug:"kit-tapete-bandeja-premium",price:98.73,originalPrice:397.03,image:"/images/halvor-kit-basico.webp",badge:"69% OFF",rating:4.9,reviewCount:3124,category:"Kits Completos",description:"Kit tapete bandeja premium sob medida para seu veículo. Traseiro inteiriço com proteção central. Material premium com borda elevada.",kitPrices:{basico:{price:98.73,originalPrice:397.03},completo:{price:147.53,originalPrice:457.03}}}],Is=e=>`R$ ${e.toFixed(2).replace(".",",")}`,Q5="/assets/hero-banner-DvAV8Ffm.jpg",Y5=b.lazy(()=>NS(()=>Promise.resolve().then(()=>nI),void 0)),Z5=b.lazy(()=>NS(()=>Promise.resolve().then(()=>q9),void 0)),eI=()=>{b.useEffect(()=>{Nd()},[]);const e=xl.slice(0,4);return i.jsxs("div",{className:"min-h-screen bg-background",children:[i.jsx(En,{}),i.jsx(Nn,{}),i.jsxs("section",{className:"relative w-full h-[75vh] sm:h-[85vh] min-h-[500px] overflow-hidden",children:[i.jsx("img",{src:Q5,alt:"Tapete Bandeja Premium",className:"w-full h-full object-cover"}),i.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/80 via-black/30 to-transparent"}),i.jsx("div",{className:"absolute inset-0 flex items-end pb-16 sm:pb-24 justify-center",children:i.jsxs("div",{className:"text-center px-4 max-w-2xl",children:[i.jsxs("h1",{className:"text-4xl sm:text-6xl md:text-7xl font-extrabold text-white leading-[1.05] mb-6 uppercase tracking-tight",children:["Proteção Total",i.jsx("br",{}),"Para Seu Carro"]}),i.jsx("p",{className:"text-white/60 text-sm sm:text-base mb-8 max-w-md mx-auto",children:"Tapetes bandeja premium 100% sob medida. O melhor tapete do mercado."}),i.jsx(se,{to:"/produto/kit-completo-interno-porta-malas",className:"inline-flex items-center justify-center gap-2 bg-white text-black px-10 py-4 font-bold uppercase tracking-widest text-sm hover:bg-white/90 transition-all",children:"Ver Produtos"})]})})]}),i.jsx(J5,{}),i.jsx("section",{className:"bg-background py-16 sm:py-24",children:i.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6",children:[i.jsxs("div",{className:"text-center mb-12",children:[i.jsx("h2",{className:"text-3xl sm:text-4xl md:text-5xl font-extrabold text-foreground uppercase tracking-tight",children:"Nossos Produtos"}),i.jsx("p",{className:"text-muted-foreground mt-3 text-sm sm:text-base",children:"Proteção premium sob medida para o seu veículo"})]}),i.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3 sm:gap-5",children:e.map(t=>i.jsxs(se,{to:`/produto/${t.slug}`,className:"group relative bg-secondary rounded-lg overflow-hidden hover:shadow-xl transition-all duration-300",children:[t.badge&&i.jsx("span",{className:"absolute top-3 left-3 z-10 bg-foreground text-background text-[10px] sm:text-xs font-bold px-2.5 py-1 rounded-sm uppercase",children:t.badge}),i.jsx("div",{className:"aspect-square overflow-hidden bg-muted",children:i.jsx("img",{src:t.image,alt:t.name,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500",loading:"lazy"})}),i.jsxs("div",{className:"p-3 sm:p-4",children:[i.jsx("h3",{className:"text-xs sm:text-sm font-bold text-foreground leading-tight line-clamp-2 mb-2",children:t.name}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-sm sm:text-base font-extrabold text-foreground",children:Is(t.price)}),i.jsx("span",{className:"text-xs line-through text-muted-foreground",children:Is(t.originalPrice)})]})]})]},t.id))}),i.jsx("div",{className:"text-center mt-10",children:i.jsxs(se,{to:"/produtos",className:"inline-flex items-center gap-2 bg-foreground text-background px-8 py-3.5 font-bold uppercase tracking-widest text-sm hover:opacity-90 transition-all",children:["Ver Todos",i.jsx(Su,{className:"w-4 h-4"})]})})]})}),i.jsx("section",{className:"bg-foreground text-background",children:i.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-16 sm:py-24",children:i.jsxs("div",{className:"grid md:grid-cols-2 gap-10 sm:gap-16 items-center",children:[i.jsxs("div",{className:"order-2 md:order-1",children:[i.jsx("p",{className:"text-xs uppercase tracking-[0.3em] text-background/40 mb-3 font-semibold",children:"Kit Mais Vendido"}),i.jsxs("h2",{className:"text-3xl sm:text-4xl md:text-5xl font-extrabold text-background leading-[1.1] mb-5 uppercase tracking-tight",children:["Kit Completo",i.jsx("br",{}),"Interno + Porta-Malas"]}),i.jsx("p",{className:"text-background/50 text-sm sm:text-base mb-8 leading-relaxed",children:"Proteção completa para o interior e porta-malas do seu veículo. Tapetes bandeja premium 100% sob medida, com borda elevada que retém líquidos e sujeira."}),i.jsx("div",{className:"grid grid-cols-2 gap-4 mb-8",children:[{icon:ng,text:"100% sob medida"},{icon:eg,text:"Impermeável"},{icon:Jb,text:"Fácil limpeza"},{icon:$r,text:"Garantia 1 ano"}].map(t=>i.jsxs("div",{className:"flex items-center gap-2.5 text-sm text-background/70",children:[i.jsx(t.icon,{className:"w-4 h-4 text-background/40 flex-shrink-0"}),i.jsx("span",{children:t.text})]},t.text))}),i.jsx("ul",{className:"space-y-2.5 mb-8",children:["Tapetes dianteiros (motorista + passageiro)","Tapete traseiro inteiriço com proteção central","Tapete porta-malas sob medida","🎁 Brinde exclusivo do kit completo"].map(t=>i.jsxs("li",{className:"flex items-start gap-2.5 text-sm text-background/60",children:[i.jsx(Vt,{className:"w-4 h-4 text-background/40 mt-0.5 flex-shrink-0"}),i.jsx("span",{children:t})]},t))}),i.jsxs("div",{className:"flex flex-wrap items-center gap-4 mb-8",children:[i.jsx("span",{className:"text-3xl sm:text-4xl font-extrabold text-background",children:"R$ 147,51"}),i.jsx("span",{className:"text-base line-through text-background/30",children:"R$ 457,03"}),i.jsx("span",{className:"bg-background text-foreground text-xs font-bold px-3 py-1 uppercase",children:"-68%"})]}),i.jsxs(se,{to:"/produto/kit-completo-interno-porta-malas",className:"inline-flex items-center justify-center gap-2 bg-background text-foreground px-10 py-4 font-bold uppercase tracking-widest text-sm hover:bg-background/90 transition-all w-full sm:w-auto",children:["Comprar Agora",i.jsx(Su,{className:"w-4 h-4"})]})]}),i.jsx("div",{className:"order-1 md:order-2",children:i.jsx("img",{src:"/images/kit-completo-hero.webp",alt:"Kit Completo Interno + Porta-Malas",className:"w-full rounded-lg",loading:"lazy"})})]})})}),i.jsx(b.Suspense,{fallback:i.jsx("div",{className:"h-40"}),children:i.jsx(Z5,{})}),i.jsx("section",{className:"bg-foreground text-background",children:i.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-16 sm:py-24 text-center",children:[i.jsx("h2",{className:"text-3xl sm:text-4xl font-extrabold mb-4 uppercase tracking-tight",children:"Fique por Dentro"}),i.jsx("p",{className:"text-background/40 mb-8 max-w-md mx-auto text-sm",children:"Cadastre-se para receber promoções exclusivas e lançamentos em primeira mão."}),i.jsxs("form",{className:"flex flex-col sm:flex-row gap-3 max-w-md mx-auto",onSubmit:t=>t.preventDefault(),children:[i.jsx("input",{type:"email",placeholder:"Seu melhor e-mail",className:"flex-1 px-5 py-3.5 bg-background/10 border border-background/20 text-background placeholder:text-background/30 text-sm focus:outline-none focus:border-background/50 transition-colors"}),i.jsx("button",{type:"submit",className:"px-8 py-3.5 bg-background text-foreground font-bold text-sm uppercase tracking-widest hover:bg-background/90 transition-all",children:"Cadastrar"})]})]})}),i.jsx(b.Suspense,{fallback:i.jsx("div",{className:"h-20"}),children:i.jsx(Y5,{})})]})},tI="/assets/logo-dark-opt-BMVahsZX.png",_n=()=>i.jsx("footer",{className:"bg-foreground text-background",children:i.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-12 sm:py-16",children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-10",children:[i.jsxs("div",{className:"md:col-span-1",children:[i.jsx("img",{src:tI,alt:"AlphaCars",className:"h-14 object-contain mb-4"}),i.jsx("p",{className:"text-sm text-background/50 leading-relaxed",children:"O melhor tapete bandeja do mercado. 100% sob medida para seu veículo com garantia de 1 ano."}),i.jsxs("div",{className:"flex gap-3 mt-6",children:[i.jsx("a",{href:"#",className:"w-9 h-9 rounded-full bg-background/10 flex items-center justify-center text-background/50 hover:bg-background/20 hover:text-background transition-all",children:i.jsx(R_,{className:"w-4 h-4"})}),i.jsx("a",{href:"#",className:"w-9 h-9 rounded-full bg-background/10 flex items-center justify-center text-background/50 hover:bg-background/20 hover:text-background transition-all",children:i.jsx(J_,{className:"w-4 h-4"})}),i.jsx("a",{href:"#",className:"w-9 h-9 rounded-full bg-background/10 flex items-center justify-center text-background/50 hover:bg-background/20 hover:text-background transition-all",children:i.jsx(ku,{className:"w-4 h-4"})})]})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-heading font-bold text-xs uppercase tracking-[0.2em] mb-5 text-background/40",children:"Loja"}),i.jsxs("div",{className:"flex flex-col gap-2.5",children:[i.jsx(se,{to:"/produtos",className:"text-sm text-background/60 hover:text-background transition-colors",children:"Todos os Produtos"}),i.jsx(se,{to:"/produtos",className:"text-sm text-background/60 hover:text-background transition-colors",children:"Kits Completos"}),i.jsx(se,{to:"/produtos",className:"text-sm text-background/60 hover:text-background transition-colors",children:"Kits Básicos"}),i.jsx(se,{to:"/produtos",className:"text-sm text-background/60 hover:text-background transition-colors",children:"Tapetes Avulsos"}),i.jsx(se,{to:"/produtos",className:"text-sm text-background/60 hover:text-background transition-colors",children:"Porta-Malas"})]})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-heading font-bold text-xs uppercase tracking-[0.2em] mb-5 text-background/40",children:"Ajuda"}),i.jsxs("div",{className:"flex flex-col gap-2.5",children:[i.jsx(se,{to:"/faq",className:"text-sm text-background/60 hover:text-background transition-colors",children:"Perguntas Frequentes"}),i.jsx(se,{to:"/contato",className:"text-sm text-background/60 hover:text-background transition-colors",children:"Contato"}),i.jsx(se,{to:"/sobre",className:"text-sm text-background/60 hover:text-background transition-colors",children:"Sobre Nós"}),i.jsx(se,{to:"/trocas-e-devolucoes",className:"text-sm text-background/60 hover:text-background transition-colors",children:"Trocas e Devoluções"}),i.jsx(se,{to:"/politica-de-envio",className:"text-sm text-background/60 hover:text-background transition-colors",children:"Política de Envio"}),i.jsx(se,{to:"/politica-de-reembolso",className:"text-sm text-background/60 hover:text-background transition-colors",children:"Política de Reembolso"}),i.jsx(se,{to:"/termos-de-uso",className:"text-sm text-background/60 hover:text-background transition-colors",children:"Termos de Uso"}),i.jsx(se,{to:"/politica-de-privacidade",className:"text-sm text-background/60 hover:text-background transition-colors",children:"Política de Privacidade"})]})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-heading font-bold text-xs uppercase tracking-[0.2em] mb-5 text-background/40",children:"Contato"}),i.jsxs("div",{className:"flex flex-col gap-3",children:[i.jsxs("div",{className:"flex items-center gap-2.5 text-sm text-background/60",children:[i.jsx(ku,{className:"w-4 h-4 flex-shrink-0"}),i.jsx("span",{children:"contato@alphacars.com.br"})]}),i.jsxs("a",{href:"https://wa.me/5531987421056",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2.5 text-sm text-background/60 hover:text-background transition-colors",children:[i.jsx(ju,{className:"w-4 h-4 flex-shrink-0"}),i.jsx("span",{children:"(31) 98742-1056 (WhatsApp)"})]}),i.jsxs("div",{className:"flex items-center gap-2.5 text-sm text-background/60",children:[i.jsx(Al,{className:"w-4 h-4 flex-shrink-0"}),i.jsx("span",{children:"Rua da Bahia, 1148 - Centro, Belo Horizonte - MG, 30160-011"})]})]})]})]}),i.jsxs("div",{className:"border-t border-background/10 mt-12 pt-8 flex flex-col md:flex-row justify-between items-center gap-4",children:[i.jsxs("div",{className:"text-center md:text-left",children:[i.jsx("p",{className:"text-xs text-background/30",children:"© 2026 AlphaCars. Todos os direitos reservados."}),i.jsx("p",{className:"text-[10px] text-background/20 mt-1",children:"CNPJ: 52.318.947/0001-63 — AlphaCars Comércio Digital LTDA"})]}),i.jsx("div",{className:"flex gap-2",children:["Pix","Visa","Mastercard","Elo","Boleto"].map(e=>i.jsx("span",{className:"text-[10px] px-2.5 py-1 border border-background/10 rounded-md text-background/40 font-medium",children:e},e))})]})]})}),nI=Object.freeze(Object.defineProperty({__proto__:null,default:_n},Symbol.toStringTag,{value:"Module"})),rI=({product:e})=>(Math.round((1-e.price/e.originalPrice)*100),i.jsxs(se,{to:`/produto/${e.slug}`,className:"group block",children:[i.jsxs("div",{className:"relative aspect-square overflow-hidden rounded-xl bg-secondary mb-3",children:[i.jsx("img",{src:e.image,alt:e.name,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500"}),e.badge&&i.jsx("span",{className:"absolute top-2.5 left-2.5 bg-sale-badge text-sale-badge-foreground text-[10px] sm:text-xs font-bold px-2 sm:px-2.5 py-0.5 sm:py-1 rounded-full shadow-sm",children:e.badge}),e.isNew&&i.jsx("span",{className:"absolute top-2.5 right-2.5 bg-foreground text-background text-[10px] sm:text-xs font-bold px-2 sm:px-2.5 py-0.5 sm:py-1 rounded-full",children:"NOVO"})]}),i.jsx("h3",{className:"font-semibold text-foreground group-hover:opacity-80 transition-opacity line-clamp-2 mb-1.5 text-xs sm:text-sm leading-snug",children:e.name}),i.jsxs("div",{className:"flex items-center gap-0.5 mb-1.5",children:[Array.from({length:5}).map((t,n)=>i.jsx(wr,{className:`w-3 sm:w-3.5 h-3 sm:h-3.5 ${n{const[e,t]=b.useState("Todos"),n=e==="Todos"?xl:xl.filter(r=>r.category===e);return i.jsxs("div",{className:"min-h-screen bg-background",children:[i.jsx(En,{}),i.jsx(Nn,{}),i.jsxs("section",{className:"max-w-7xl mx-auto px-6 py-12",children:[i.jsx("h1",{className:"text-4xl font-bold text-foreground mb-2",children:"Nossos Produtos"}),i.jsx("p",{className:"text-muted-foreground mb-8",children:"Tapetes bandeja premium 100% sob medida para seu veículo."}),i.jsx("div",{className:"flex gap-2 mb-10 overflow-x-auto pb-2",children:sI.map(r=>i.jsx("button",{onClick:()=>t(r),className:`px-5 py-2 rounded-full text-sm font-medium transition-all whitespace-nowrap ${e===r?"bg-foreground text-background":"bg-secondary text-foreground hover:bg-border"}`,children:r},r))}),i.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-6",children:n.map(r=>i.jsx(rI,{product:r},r.id))}),n.length===0&&i.jsx("div",{className:"text-center py-20",children:i.jsx("p",{className:"text-muted-foreground text-lg",children:"Nenhum produto encontrado nesta categoria."})})]}),i.jsx(_n,{})]})},oI=["/images/halvor-tapete-1.webp","/images/halvor-tapete-2.webp","/images/halvor-tapete-4.webp"],Tm={Preto:"/images/kit-completo-hero.webp",Cinza:"/images/tapete-cinza.webp",Branco:"/images/tapete-branco.webp"},Pm={Preto:"/images/halvor-kit-basico.webp",Cinza:"/images/tapete-cinza-basico.webp",Branco:"/images/tapete-branco-basico.webp"};function iI(e,t){const n=e==="Kit Completo";return[n?Tm[t]||Tm.Preto:Pm[t]||Pm.Preto,...n?oI:["/images/halvor-tapete-3.webp","/images/halvor-tapete-1.webp","/images/halvor-tapete-4.webp"]]}typeof window<"u"&&[...Object.values(Tm),...Object.values(Pm)].forEach(e=>{const t=new Image;t.src=e});const lI=({selectedColor:e,selectedColorOption:t="Preto"})=>{const[n,r]=b.useState(0),s=iI(e,t);return b.useEffect(()=>{r(0)},[e,t]),i.jsxs("div",{className:"flex flex-col gap-3 w-full min-w-0",children:[i.jsx("div",{className:"aspect-square overflow-hidden rounded-lg bg-secondary w-full",children:i.jsx("img",{src:s[n],alt:"Imagem do produto",className:"w-full h-full object-cover",loading:"eager"})}),i.jsx("div",{className:"flex gap-2 overflow-x-auto pb-2 w-full",children:s.map((a,o)=>i.jsx("button",{onClick:()=>r(o),className:`flex-shrink-0 w-20 h-20 rounded-md overflow-hidden border-2 transition-all ${n===o?"border-foreground":"border-transparent opacity-60 hover:opacity-100"}`,children:i.jsx("img",{src:a,alt:`Miniatura ${o+1}`,className:"w-full h-full object-cover",loading:"eager"})},`${a}-${o}`))})]})},cI=({rating:e,count:t})=>{const n=Math.floor(e),r=e%1>=.5;return i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsxs("div",{className:"flex items-center gap-0.5",children:[Array.from({length:n}).map((s,a)=>i.jsx(wr,{className:"w-5 h-5 fill-star text-star"},a)),r&&i.jsx(W_,{className:"w-5 h-5 fill-star text-star"})]}),i.jsxs("span",{className:"text-sm text-muted-foreground",children:["(",t," Avaliações)"]})]})},uI=({product:e,onQuantityChange:t,kitPrices:n,defaultKit:r="completo"})=>{const[s,a]=b.useState(r),o=p=>{a(p),t==null||t(p==="basico"?1:2)},l=(n==null?void 0:n.basico.price)??98.73,c=(n==null?void 0:n.basico.originalPrice)??397.03,d=(n==null?void 0:n.completo.price)??147.53,h=(n==null?void 0:n.completo.originalPrice)??457.03,f=[{key:"completo",label:"Kit Tapetes Interno + Porta Mala",price:d,originalPrice:h,badge:"Mais vendido",badgeStyle:"bg-foreground text-background border border-foreground/20",items:["4 peças completas (dianteiros, traseiro e porta-malas)","Traseiro inteiriço c/ proteção central","Mantém o carro com aparência de novo","🎁 Brinde exclusivo do kit completo"]},{key:"basico",label:"Kit Tapetes Interno - Sem Porta Mala",price:l,originalPrice:c,badge:"🔥 Melhor preço",badgeStyle:"bg-background text-foreground border border-foreground/20 shadow-sm",items:["3 tapetes internos sob medida (sem porta-malas)","Evita sujeira, lama e desgaste","Mantém o carro com aparência de novo"]}];return i.jsx("div",{className:"space-y-3",children:f.map(p=>{const m=s===p.key;return i.jsxs("div",{onClick:()=>o(p.key),className:`w-full p-4 rounded-xl border-2 transition-all relative cursor-pointer ${m?"border-foreground bg-secondary/50 shadow-sm":"border-border hover:border-foreground/30"}`,children:[p.badge&&i.jsx("span",{className:`absolute -top-3 right-4 text-[10px] font-bold uppercase tracking-wide px-3 py-1 rounded-full shadow-sm ${p.badgeStyle}`,children:p.badge}),i.jsxs("div",{className:"flex items-start justify-between gap-3",children:[i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx("div",{className:`mt-0.5 w-5 h-5 rounded-full border-2 flex items-center justify-center flex-shrink-0 transition-colors ${m?"border-foreground bg-foreground":"border-border"}`,children:m&&i.jsx(Vt,{className:"w-3 h-3 text-background"})}),i.jsx("p",{className:"font-semibold text-foreground text-sm leading-snug",children:p.label})]}),i.jsxs("div",{className:"text-right flex-shrink-0",children:[i.jsx("p",{className:"font-extrabold text-foreground text-base",children:Is(p.price)}),i.jsx("p",{className:"text-[11px] line-through text-muted-foreground",children:Is(p.originalPrice)})]})]}),i.jsx("ul",{className:"text-xs text-muted-foreground space-y-1.5 mt-3 ml-8",children:p.items.map((y,g)=>i.jsxs("li",{className:"flex items-start gap-1.5",children:[i.jsx(Vt,{className:"w-3.5 h-3.5 text-foreground flex-shrink-0 mt-0.5"}),i.jsx("span",{children:y})]},g))})]},p.key)})})};var Od="Collapsible",[dI,_S]=wa(Od),[hI,vg]=dI(Od),TS=b.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:a,onOpenChange:o,...l}=e,[c,d]=Bo({prop:r,defaultProp:s??!1,onChange:o,caller:Od});return i.jsx(hI,{scope:n,disabled:a,contentId:ho(),open:c,onOpenToggle:b.useCallback(()=>d(h=>!h),[d]),children:i.jsx(_e.div,{"data-state":kg(c),"data-disabled":a?"":void 0,...l,ref:t})})});TS.displayName=Od;var PS="CollapsibleTrigger",bg=b.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,s=vg(PS,n);return i.jsx(_e.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":kg(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:t,onClick:Ae(e.onClick,s.onOpenToggle)})});bg.displayName=PS;var wg="CollapsibleContent",Sg=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=vg(wg,e.__scopeCollapsible);return i.jsx(Sa,{present:n||s.open,children:({present:a})=>i.jsx(fI,{...r,ref:t,present:a})})});Sg.displayName=wg;var fI=b.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:s,...a}=e,o=vg(wg,n),[l,c]=b.useState(r),d=b.useRef(null),h=mt(t,d),f=b.useRef(0),p=f.current,m=b.useRef(0),y=m.current,g=o.open||l,S=b.useRef(g),w=b.useRef(void 0);return b.useEffect(()=>{const v=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(v)},[]),br(()=>{const v=d.current;if(v){w.current=w.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const x=v.getBoundingClientRect();f.current=x.height,m.current=x.width,S.current||(v.style.transitionDuration=w.current.transitionDuration,v.style.animationName=w.current.animationName),c(r)}},[o.open,r]),i.jsx(_e.div,{"data-state":kg(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!g,...a,ref:h,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...e.style},children:g&&s})});function kg(e){return e?"open":"closed"}var AS=TS,mI=bg,pI=Sg,gI=b.createContext(void 0);function yI(e){const t=b.useContext(gI);return e||t||"ltr"}var Xn="Accordion",xI=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Cg,vI,bI]=xb(Xn),[Md,KB]=wa(Xn,[bI,_S]),jg=_S(),RS=U.forwardRef((e,t)=>{const{type:n,...r}=e,s=r,a=r;return i.jsx(Cg.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?i.jsx(CI,{...a,ref:t}):i.jsx(kI,{...s,ref:t})})});RS.displayName=Xn;var[IS,wI]=Md(Xn),[OS,SI]=Md(Xn,{collapsible:!1}),kI=U.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},collapsible:a=!1,...o}=e,[l,c]=Bo({prop:n,defaultProp:r??"",onChange:s,caller:Xn});return i.jsx(IS,{scope:e.__scopeAccordion,value:U.useMemo(()=>l?[l]:[],[l]),onItemOpen:c,onItemClose:U.useCallback(()=>a&&c(""),[a,c]),children:i.jsx(OS,{scope:e.__scopeAccordion,collapsible:a,children:i.jsx(MS,{...o,ref:t})})})}),CI=U.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...a}=e,[o,l]=Bo({prop:n,defaultProp:r??[],onChange:s,caller:Xn}),c=U.useCallback(h=>l((f=[])=>[...f,h]),[l]),d=U.useCallback(h=>l((f=[])=>f.filter(p=>p!==h)),[l]);return i.jsx(IS,{scope:e.__scopeAccordion,value:o,onItemOpen:c,onItemClose:d,children:i.jsx(OS,{scope:e.__scopeAccordion,collapsible:!0,children:i.jsx(MS,{...a,ref:t})})})}),[jI,Ld]=Md(Xn),MS=U.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:s,orientation:a="vertical",...o}=e,l=U.useRef(null),c=mt(l,t),d=vI(n),f=yI(s)==="ltr",p=Ae(e.onKeyDown,m=>{var P;if(!xI.includes(m.key))return;const y=m.target,g=d().filter(_=>{var R;return!((R=_.ref.current)!=null&&R.disabled)}),S=g.findIndex(_=>_.ref.current===y),w=g.length;if(S===-1)return;m.preventDefault();let v=S;const x=0,k=w-1,j=()=>{v=S+1,v>k&&(v=x)},C=()=>{v=S-1,v{const{__scopeAccordion:n,value:r,...s}=e,a=Ld(Uu,n),o=wI(Uu,n),l=jg(n),c=ho(),d=r&&o.value.includes(r)||!1,h=a.disabled||e.disabled;return i.jsx(EI,{scope:n,open:d,disabled:h,triggerId:c,children:i.jsx(AS,{"data-orientation":a.orientation,"data-state":zS(d),...l,...s,ref:t,disabled:h,open:d,onOpenChange:f=>{f?o.onItemOpen(r):o.onItemClose(r)}})})});LS.displayName=Uu;var DS="AccordionHeader",FS=U.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=Ld(Xn,n),a=Eg(DS,n);return i.jsx(_e.h3,{"data-orientation":s.orientation,"data-state":zS(a.open),"data-disabled":a.disabled?"":void 0,...r,ref:t})});FS.displayName=DS;var Am="AccordionTrigger",$S=U.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=Ld(Xn,n),a=Eg(Am,n),o=SI(Am,n),l=jg(n);return i.jsx(Cg.ItemSlot,{scope:n,children:i.jsx(mI,{"aria-disabled":a.open&&!o.collapsible||void 0,"data-orientation":s.orientation,id:a.triggerId,...l,...r,ref:t})})});$S.displayName=Am;var BS="AccordionContent",US=U.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=Ld(Xn,n),a=Eg(BS,n),o=jg(n);return i.jsx(pI,{role:"region","aria-labelledby":a.triggerId,"data-orientation":s.orientation,...o,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});US.displayName=BS;function zS(e){return e?"open":"closed"}var NI=RS,_I=LS,TI=FS,VS=$S,HS=US;const qS=NI,eo=b.forwardRef(({className:e,...t},n)=>i.jsx(_I,{ref:n,className:Z("border-b",e),...t}));eo.displayName="AccordionItem";const to=b.forwardRef(({className:e,children:t,...n},r)=>i.jsx(TI,{className:"flex",children:i.jsxs(VS,{ref:r,className:Z("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,i.jsx(Ur,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));to.displayName=VS.displayName;const no=b.forwardRef(({className:e,children:t,...n},r)=>i.jsx(HS,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:i.jsx("div",{className:Z("pb-4 pt-0",e),children:t})}));no.displayName=HS.displayName;const PI=()=>i.jsxs(qS,{type:"single",collapsible:!0,className:"w-full",children:[i.jsxs(eo,{value:"description",children:[i.jsx(to,{className:"text-base font-semibold",children:"Descrição do Produto"}),i.jsxs(no,{className:"text-sm text-muted-foreground leading-relaxed space-y-3",children:[i.jsx("p",{children:"Tapete bandeja premium fabricado com borracha de altíssima qualidade e durabilidade. 100% sob medida para o seu veículo, com encaixe perfeito e sem folgas."}),i.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[i.jsx("li",{children:"Borracha premium com espessura de 7mm"}),i.jsx("li",{children:"Borda elevada de 5cm que retém líquidos e sujeira"}),i.jsx("li",{children:"Base pinada antiderrapante"}),i.jsx("li",{children:"Sistema de fixação com ilhós original de fábrica"}),i.jsx("li",{children:"100% impermeável — protege o assoalho original"}),i.jsx("li",{children:"Resistente a raios UV, não deforma e não resseca"}),i.jsx("li",{children:"Limpeza ultra fácil: basta remover e lavar com água"})]})]})]}),i.jsxs(eo,{value:"shipping",children:[i.jsx(to,{className:"text-base font-semibold",children:"Envio"}),i.jsxs(no,{className:"text-sm text-muted-foreground leading-relaxed space-y-2",children:[i.jsxs("p",{children:[i.jsx("strong",{className:"text-foreground",children:"Frete Grátis"})," para todo o Brasil."]}),i.jsx("p",{children:"Prazo de entrega: 7 a 15 dias úteis dependendo da sua região."}),i.jsx("p",{children:"Todos os tapetes são fabricados sob medida após a confirmação do pedido e enviados com embalagem reforçada."})]})]}),i.jsxs(eo,{value:"guarantee",children:[i.jsx(to,{className:"text-base font-semibold",children:"Garantia e Devolução"}),i.jsxs(no,{className:"text-sm text-muted-foreground leading-relaxed space-y-2",children:[i.jsxs("p",{children:[i.jsx("strong",{className:"text-foreground",children:"Garantia de 1 ano"})," contra defeitos de fabricação."]}),i.jsx("p",{children:"Caso o tapete não sirva perfeitamente no seu veículo, refazemos sem custo adicional."}),i.jsxs("p",{children:[i.jsx("strong",{className:"text-foreground",children:"Devolução em até 30 dias"})," sem burocracia — satisfação garantida ou seu dinheiro de volta."]})]})]}),i.jsxs(eo,{value:"materials",children:[i.jsx(to,{className:"text-base font-semibold",children:"Especificações Técnicas"}),i.jsx(no,{className:"text-sm text-muted-foreground leading-relaxed",children:i.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[i.jsx("li",{children:"Material: Borracha premium de alta performance"}),i.jsx("li",{children:"Espessura: 7mm"}),i.jsx("li",{children:"Borda elevada: 5cm"}),i.jsx("li",{children:"Fixação: Ilhós metálicos reforçados (padrão original)"}),i.jsx("li",{children:"Base: Sistema pinado antiderrapante"}),i.jsx("li",{children:"Impermeabilidade: 100%"}),i.jsx("li",{children:"Proteção UV: Sim"}),i.jsx("li",{children:"Instalação: Menos de 1 minuto, sem ferramentas"})]})})]})]});function Fs(e){return Array.isArray?Array.isArray(e):WS(e)==="[object Array]"}function AI(e){if(typeof e=="string")return e;if(typeof e=="bigint")return e.toString();const t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Rm(e){return e==null?"":AI(e)}function _t(e){return typeof e=="string"}function Gc(e){return typeof e=="number"}function RI(e){return e===!0||e===!1||II(e)&&WS(e)=="[object Boolean]"}function GS(e){return typeof e=="object"}function II(e){return GS(e)&&e!==null}function Ut(e){return e!=null}function bc(e){return!e.trim().length}function WS(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const OI="Incorrect 'index' type",MI=e=>`Invalid value for key ${e}`,LI=e=>`Pattern length exceeds max of ${e}.`,DI=e=>`Missing ${e} property in key`,FI=e=>`Property 'weight' in key '${e}' must be a positive integer`,_x=Object.prototype.hasOwnProperty;class $I{constructor(t){this._keys=[],this._keyMap={};let n=0;t.forEach(r=>{const s=KS(r);this._keys.push(s),this._keyMap[s.id]=s,n+=s.weight}),this._keys.forEach(r=>{r.weight/=n})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function KS(e){let t=null,n=null,r=null,s=1,a=null;if(_t(e)||Fs(e))r=e,t=Tx(e),n=Im(e);else{if(!_x.call(e,"name"))throw new Error(DI("name"));const o=e.name;if(r=o,_x.call(e,"weight")&&(s=e.weight,s<=0))throw new Error(FI(o));t=Tx(o),n=Im(o),a=e.getFn}return{path:t,id:n,weight:s,src:r,getFn:a}}function Tx(e){return Fs(e)?e:e.split(".")}function Im(e){return Fs(e)?e.join("."):e}function BI(e,t){const n=[];let r=!1;const s=(a,o,l,c)=>{if(Ut(a))if(!o[l])n.push(c!==void 0?{v:a,i:c}:a);else{const d=o[l],h=a[d];if(!Ut(h))return;if(l===o.length-1&&(_t(h)||Gc(h)||RI(h)||typeof h=="bigint"))n.push(c!==void 0?{v:Rm(h),i:c}:Rm(h));else if(Fs(h)){r=!0;for(let f=0,p=h.length;fe.score===t.score?e.idx{this._keysMap[n.id]=r})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,_t(this.docs[0])?this.docs.forEach((t,n)=>{this._addString(t,n)}):this.docs.forEach((t,n)=>{this._addObject(t,n)}),this.norm.clear())}add(t){const n=this.size();_t(t)?this._addString(t,n):this._addObject(t,n)}removeAt(t){this.records.splice(t,1);for(let n=t,r=this.size();n=0;n-=1)this.records.splice(t[n],1);for(let n=0,r=this.records.length;n{const o=s.getFn?s.getFn(t):this.getFn(t,s.path);if(Ut(o)){if(Fs(o)){const l=[];for(let c=0,d=o.length;cn),records:this.records}}}function XS(e,t,{getFn:n=ae.getFn,fieldNormWeight:r=ae.fieldNormWeight}={}){const s=new Ng({getFn:n,fieldNormWeight:r});return s.setKeys(e.map(KS)),s.setSources(t),s.create(),s}function WI(e,{getFn:t=ae.getFn,fieldNormWeight:n=ae.fieldNormWeight}={}){const{keys:r,records:s}=e,a=new Ng({getFn:t,fieldNormWeight:n});return a.setKeys(r),a.setIndexRecords(s),a}function KI(e=[],t=ae.minMatchCharLength){const n=[];let r=-1,s=-1,a=0;for(let o=e.length;a=t&&n.push([r,s]),r=-1)}return e[a-1]&&a-r>=t&&n.push([r,a-1]),n}const Js=32;function XI(e,t,n,{location:r=ae.location,distance:s=ae.distance,threshold:a=ae.threshold,findAllMatches:o=ae.findAllMatches,minMatchCharLength:l=ae.minMatchCharLength,includeMatches:c=ae.includeMatches,ignoreLocation:d=ae.ignoreLocation}={}){if(t.length>Js)throw new Error(LI(Js));const h=t.length,f=e.length,p=Math.max(0,Math.min(r,f));let m=a,y=p;const g=(P,_)=>{const R=P/h;if(d)return R;const I=Math.abs(p-_);return s?R+I/s:I?1:R},S=l>1||c,w=S?Array(f):[];let v;for(;(v=e.indexOf(t,y))>-1;){const P=g(0,v);if(m=Math.min(P,m),y=v+h,S){let _=0;for(;_=I;F-=1){const G=F-1,W=n[e[G]];if(S&&(w[G]=+!!W),z[F]=(z[F+1]<<1|1)&W,P&&(z[F]|=(x[F+1]|x[F])<<1|1|x[F+1]),z[F]&C&&(k=g(P,G),k<=m)){if(m=k,y=G,y<=p)break;I=Math.max(1,2*p-y)}}if(g(P+1,p)>m)break;x=z}const T={isMatch:y>=0,score:Math.max(.001,k)};if(S){const P=KI(w,l);P.length?c&&(T.indices=P):T.isMatch=!1}return T}function JI(e){const t={};for(let n=0,r=e.length;nn[0]-r[0]||n[1]-r[1]);const t=[e[0]];for(let n=1,r=e.length;ne.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"").replace(QI,t=>JS[t]):e=>e;class Tg{constructor(t,{location:n=ae.location,threshold:r=ae.threshold,distance:s=ae.distance,includeMatches:a=ae.includeMatches,findAllMatches:o=ae.findAllMatches,minMatchCharLength:l=ae.minMatchCharLength,isCaseSensitive:c=ae.isCaseSensitive,ignoreDiacritics:d=ae.ignoreDiacritics,ignoreLocation:h=ae.ignoreLocation}={}){if(this.options={location:n,threshold:r,distance:s,includeMatches:a,findAllMatches:o,minMatchCharLength:l,isCaseSensitive:c,ignoreDiacritics:d,ignoreLocation:h},t=c?t:t.toLowerCase(),t=d?vl(t):t,this.pattern=t,this.chunks=[],!this.pattern.length)return;const f=(m,y)=>{this.chunks.push({pattern:m,alphabet:JI(m),startIndex:y})},p=this.pattern.length;if(p>Js){let m=0;const y=p%Js,g=p-y;for(;m{const{isMatch:v,score:x,indices:k}=XI(t,g,S,{location:a+w,distance:o,threshold:l,findAllMatches:c,minMatchCharLength:d,includeMatches:s,ignoreLocation:h});v&&(m=!0),p+=x,v&&k&&f.push(...k)});const y={isMatch:m,score:m?p/this.chunks.length:1};return m&&s&&(y.indices=_g(f)),y}}class $s{constructor(t){this.pattern=t}static isMultiMatch(t){return Px(t,this.multiRegex)}static isSingleMatch(t){return Px(t,this.singleRegex)}search(t){return{isMatch:!1,score:1}}}function Px(e,t){const n=e.match(t);return n?n[1]:null}class YI extends $s{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const n=t===this.pattern;return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class ZI extends $s{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const r=t.indexOf(this.pattern)===-1;return{isMatch:r,score:r?0:1,indices:[0,t.length-1]}}}class eO extends $s{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const n=t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class tO extends $s{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const n=!t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class nO extends $s{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const n=t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class rO extends $s{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const n=!t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class QS extends $s{constructor(t,{location:n=ae.location,threshold:r=ae.threshold,distance:s=ae.distance,includeMatches:a=ae.includeMatches,findAllMatches:o=ae.findAllMatches,minMatchCharLength:l=ae.minMatchCharLength,isCaseSensitive:c=ae.isCaseSensitive,ignoreDiacritics:d=ae.ignoreDiacritics,ignoreLocation:h=ae.ignoreLocation}={}){super(t),this._bitapSearch=new Tg(t,{location:n,threshold:r,distance:s,includeMatches:a,findAllMatches:o,minMatchCharLength:l,isCaseSensitive:c,ignoreDiacritics:d,ignoreLocation:h})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class YS extends $s{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let n=0,r;const s=[],a=this.pattern.length;for(;(r=t.indexOf(this.pattern,n))>-1;)n=r+a,s.push([r,n-1]);const o=!!s.length;return{isMatch:o,score:o?0:1,indices:s}}}const Om=[YI,YS,eO,tO,rO,nO,ZI,QS],Ax=Om.length,sO="\0",aO="|";function oO(e){const t=[],n=e.length;let r=0;for(;r=n)break;let s=r;for(;s=n||e[a]===" "){s++;break}if(e[a]==="$"&&(a+1>=n||e[a+1]===" ")){s+=2;break}}s++}t.push(e.substring(r,s)),r=s}else{for(;s{const s=r.replace(/\u0000/g,"|"),a=oO(s.trim()).filter(l=>l&&!!l.trim()),o=[];for(let l=0,c=a.length;l!!(e[Vu.AND]||e[Vu.OR]),uO=e=>!!e[Lm.PATH],dO=e=>!Fs(e)&&GS(e)&&!Dm(e),Rx=e=>({[Vu.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function ZS(e,t,{auto:n=!0}={}){const r=s=>{if(_t(s)){const c={keyId:null,pattern:s};return n&&(c.searcher=zu(s,t)),c}const a=Object.keys(s),o=uO(s);if(!o&&a.length>1&&!Dm(s))return r(Rx(s));if(dO(s)){const c=o?s[Lm.PATH]:a[0],d=o?s[Lm.PATTERN]:s[c];if(!_t(d))throw new Error(MI(c));const h={keyId:Im(c),pattern:d};return n&&(h.searcher=zu(d,t)),h}const l={children:[],operator:a[0]};return a.forEach(c=>{const d=s[c];Fs(d)&&d.forEach(h=>{l.children.push(r(h))})}),l};return Dm(e)||(e=Rx(e)),r(e)}function Fm(e,{ignoreFieldNorm:t=ae.ignoreFieldNorm}){let n=1;return e.forEach(({key:r,norm:s,score:a})=>{const o=r?r.weight:null;n*=Math.pow(a===0&&o?Number.EPSILON:a,(o||1)*(t?1:s))}),n}function hO(e,{ignoreFieldNorm:t=ae.ignoreFieldNorm}){e.forEach(n=>{n.score=Fm(n.matches,{ignoreFieldNorm:t})})}class fO{constructor(t){this.limit=t,this.heap=[]}get size(){return this.heap.length}shouldInsert(t){return this.size0;){const r=t-1>>1;if(n[t].score<=n[r].score)break;const s=n[t];n[t]=n[r],n[r]=s,t=r}}_sinkDown(t){const n=this.heap,r=n.length;let s=t;do{t=s;const a=2*t+1,o=2*t+2;if(an[s].score&&(s=a),on[s].score&&(s=o),s!==t){const l=n[t];n[t]=n[s],n[s]=l}}while(s!==t)}}function mO(e,t){const n=e.matches;t.matches=[],Ut(n)&&n.forEach(r=>{if(!Ut(r.indices)||!r.indices.length)return;const{indices:s,value:a}=r,o={indices:s,value:a};r.key&&(o.key=r.key.src),r.idx>-1&&(o.refIndex=r.idx),t.matches.push(o)})}function pO(e,t){t.score=e.score}function gO(e,t,{includeMatches:n=ae.includeMatches,includeScore:r=ae.includeScore}={}){const s=[];return n&&s.push(mO),r&&s.push(pO),e.map(a=>{const{idx:o}=a,l={item:t[o],refIndex:o};return s.length&&s.forEach(c=>{c(a,l)}),l})}const yO=/\b\w+\b/g;function $m({isCaseSensitive:e=!1,ignoreDiacritics:t=!1}={}){return{tokenize(n){return e||(n=n.toLowerCase()),t&&(n=vl(n)),n.match(yO)||[]}}}function xO(e,t,n){const r=new Map,s=new Map;let a=0;function o(l,c,d,h){const f=n.tokenize(l);if(!f.length)return;a++;const p=new Map;for(const m of f)p.set(m,(p.get(m)||0)+1);for(const[m,y]of p){const g={docIdx:c,keyIdx:d,subIdx:h,tf:y};let S=r.get(m);S||(S=[],r.set(m,S)),S.push(g),s.set(m,(s.get(m)||0)+1)}}for(const l of e){const{i:c,v:d,$:h}=l;if(d!==void 0){o(d,c,-1,-1);continue}if(h)for(let f=0;fo.docIdx!==t),a=r.length-s.length;a>0&&(e.fieldCount-=a,e.df.set(n,(e.df.get(n)||0)-a),s.length===0?(e.terms.delete(n),e.df.delete(n)):e.terms.set(n,s))}}class Bs{constructor(t,n,r){this.options={...ae,...n},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new $I(this.options.keys),this._docs=t,this._myIndex=null,this._invertedIndex=null,this.setCollection(t,r),this._lastQuery=null,this._lastSearcher=null}_getSearcher(t){if(this._lastQuery===t)return this._lastSearcher;const n=this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options,r=zu(t,n);return this._lastQuery=t,this._lastSearcher=r,r}setCollection(t,n){if(this._docs=t,n&&!(n instanceof Ng))throw new Error(OI);if(this._myIndex=n||XS(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const r=$m({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});this._invertedIndex=xO(this._myIndex.records,this._myIndex.keys.length,r)}}add(t){if(Ut(t)&&(this._docs.push(t),this._myIndex.add(t),this._invertedIndex)){const n=this._myIndex.records[this._myIndex.records.length-1],r=$m({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});vO(this._invertedIndex,n,this._myIndex.keys.length,r)}}remove(t=()=>!1){const n=[],r=[];for(let s=0,a=this._docs.length;s=0;s-=1)this._docs.splice(r[s],1);this._myIndex.removeAll(r)}return n}removeAt(t){this._invertedIndex&&Ix(this._invertedIndex,t);const n=this._docs.splice(t,1)[0];return this._myIndex.removeAt(t),n}getIndex(){return this._myIndex}search(t,n){const{limit:r=-1}=n||{},{includeMatches:s,includeScore:a,shouldSort:o,sortFn:l,ignoreFieldNorm:c}=this.options;if(_t(t)&&!t.trim()){let f=this._docs.map((p,m)=>({item:p,refIndex:m}));return Gc(r)&&r>-1&&(f=f.slice(0,r)),f}const d=Gc(r)&&r>0&&_t(t);let h;if(d){const f=new fO(r);_t(this._docs[0])?this._searchStringList(t,{heap:f,ignoreFieldNorm:c}):this._searchObjectList(t,{heap:f,ignoreFieldNorm:c}),h=f.extractSorted(l)}else h=_t(t)?_t(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t),hO(h,{ignoreFieldNorm:c}),o&&h.sort(l),Gc(r)&&r>-1&&(h=h.slice(0,r));return gO(h,this._docs,{includeMatches:s,includeScore:a})}_searchStringList(t,{heap:n,ignoreFieldNorm:r}={}){const s=this._getSearcher(t),{records:a}=this._myIndex,o=n?null:[];return a.forEach(({v:l,i:c,n:d})=>{if(!Ut(l))return;const{isMatch:h,score:f,indices:p}=s.searchIn(l);if(h){const m={item:l,idx:c,matches:[{score:f,value:l,norm:d,indices:p}]};n?(m.score=Fm(m.matches,{ignoreFieldNorm:r}),n.shouldInsert(m.score)&&n.insert(m)):o.push(m)}}),o}_searchLogical(t){const n=ZS(t,this.options),r=(l,c,d)=>{if(!("children"in l)){const{keyId:m,searcher:y}=l;let g;return m===null?(g=[],this._myIndex.keys.forEach((S,w)=>{g.push(...this._findMatches({key:S,value:c[w],searcher:y}))})):g=this._findMatches({key:this._keyStore.get(m),value:this._myIndex.getValueForItemAtKeyId(c,m),searcher:y}),g&&g.length?[{idx:d,item:c,matches:g}]:[]}const{children:h,operator:f}=l,p=[];for(let m=0,y=h.length;m{if(Ut(l)){const d=r(n,l,c);d.length&&(a.has(c)||(a.set(c,{idx:c,item:l,matches:[]}),o.push(a.get(c))),d.forEach(({matches:h})=>{a.get(c).matches.push(...h)}))}}),o}_searchObjectList(t,{heap:n,ignoreFieldNorm:r}={}){const s=this._getSearcher(t),{keys:a,records:o}=this._myIndex,l=n?null:[];return o.forEach(({$:c,i:d})=>{if(!Ut(c))return;const h=[];let f=!1,p=!1;if(a.forEach((m,y)=>{const g=this._findMatches({key:m,value:c[y],searcher:s});g.length?(h.push(...g),g[0].hasInverse&&(p=!0)):f=!0}),!(p&&f)&&h.length){const m={idx:d,item:c,matches:h};n?(m.score=Fm(m.matches,{ignoreFieldNorm:r}),n.shouldInsert(m.score)&&n.insert(m)):l.push(m)}}),l}_findMatches({key:t,value:n,searcher:r}){if(!Ut(n))return[];const s=[];if(Fs(n))n.forEach(({v:a,i:o,n:l})=>{if(!Ut(a))return;const{isMatch:c,score:d,indices:h,hasInverse:f}=r.searchIn(a);c&&s.push({score:d,key:t,value:a,idx:o,norm:l,indices:h,hasInverse:f})});else{const{v:a,n:o}=n,{isMatch:l,score:c,indices:d,hasInverse:h}=r.searchIn(a);l&&s.push({score:c,key:t,value:a,norm:o,indices:d,hasInverse:h})}return s}}class bO{static condition(t,n){return n.useTokenSearch}constructor(t,n){this.options=n,this.analyzer=$m({isCaseSensitive:n.isCaseSensitive,ignoreDiacritics:n.ignoreDiacritics});const r=this.analyzer.tokenize(t),s=n._invertedIndex,{df:a,fieldCount:o}=s;this.termSearchers=[],this.idfWeights=[];for(const l of r){this.termSearchers.push(new Tg(l,{location:n.location,threshold:n.threshold,distance:n.distance,includeMatches:n.includeMatches,findAllMatches:n.findAllMatches,minMatchCharLength:n.minMatchCharLength,isCaseSensitive:n.isCaseSensitive,ignoreDiacritics:n.ignoreDiacritics,ignoreLocation:!0}));const c=a.get(l)||0,d=Math.log(1+(o-c+.5)/(c+.5));this.idfWeights.push(d)}}searchIn(t){if(!this.termSearchers.length)return{isMatch:!1,score:1};const n=[];let r=0,s=0,a=0;for(let c=0;c0?1-r/s:0,l={isMatch:!0,score:Math.max(.001,o)};return this.options.includeMatches&&n.length&&(l.indices=_g(n)),l}}Bs.version="7.3.0";Bs.createIndex=XS;Bs.parseIndex=WI;Bs.config=ae;Bs.match=function(e,t,n){return zu(e,{...ae,...n}).searchIn(t)};Bs.parseQuery=ZS;Pg(cO);Pg(bO);Bs.use=function(...e){e.forEach(t=>Pg(t))};function u(e,t){const n=[];for(let r=t;r>=e;r--)n.push(r);return n}const Ag=[{name:"Chevrolet",models:[{name:"Onix Hatch",years:u(2013,2026)},{name:"Onix Plus Sedan",years:u(2020,2026)},{name:"Onix Turbo",years:u(2020,2026)},{name:"Onix RS Turbo",years:u(2022,2026)},{name:"Onix Premier",years:u(2020,2026)},{name:"Onix Premier 2",years:u(2020,2026)},{name:"Tracker",years:u(2021,2026)},{name:"Tracker Turbo",years:u(2021,2026)},{name:"Tracker RS Turbo",years:u(2024,2026)},{name:"Tracker (1ª geração)",years:u(2013,2016)},{name:"S10 Cabine Dupla",years:u(1995,2026)},{name:"S10 Cabine Simples",years:u(2012,2026)},{name:"S10 High Country",years:u(2016,2026)},{name:"S10 LTZ",years:u(2012,2026)},{name:"S10 LT",years:u(2012,2026)},{name:"S10 Advantage",years:u(2005,2011)},{name:"S10 Executive",years:u(2003,2011)},{name:"S10 Colina",years:u(2005,2011)},{name:"S10 Rodeio",years:u(2006,2011)},{name:"S10 Blazer",years:u(1996,2011)},{name:"Spin",years:u(2013,2026)},{name:"Spin Activ",years:u(2015,2026)},{name:"Cruze Sedan",years:u(2012,2026)},{name:"Cruze Hatch / Sport6",years:u(2012,2024)},{name:"Cruze Turbo",years:u(2017,2026)},{name:"Equinox",years:u(2018,2026)},{name:"Equinox Turbo",years:u(2018,2026)},{name:"Equinox RS",years:u(2022,2026)},{name:"Montana (antiga)",years:u(2004,2011)},{name:"Montana (nova)",years:u(2023,2026)},{name:"Montana Turbo",years:u(2023,2026)},{name:"Trailblazer",years:u(2013,2024)},{name:"Trax",years:u(2024,2026)},{name:"Trax Activ",years:u(2024,2026)},{name:"Bolt EV",years:u(2022,2026)},{name:"Prisma",years:u(2007,2019)},{name:"Prisma Joy",years:u(2017,2019)},{name:"Prisma LTZ",years:u(2013,2019)},{name:"Cobalt",years:u(2012,2019)},{name:"Cobalt LTZ",years:u(2013,2019)},{name:"Joy Hatch",years:u(2020,2022)},{name:"Joy Plus Sedan",years:u(2020,2022)},{name:"Celta",years:u(2e3,2015)},{name:"Celta Spirit",years:u(2006,2012)},{name:"Celta Life",years:u(2004,2011)},{name:"Classic / Corsa Classic",years:u(2003,2016)},{name:"Corsa Sedan",years:u(1995,2012)},{name:"Corsa Hatch",years:u(1994,2012)},{name:"Corsa Wind",years:u(1994,2002)},{name:"Corsa Wagon",years:u(1997,2002)},{name:"Corsa Pick-up",years:u(1995,2003)},{name:"Corsa Super",years:u(1996,1999)},{name:"Corsa GSi",years:u(1995,1996)},{name:"Astra Sedan",years:u(1999,2011)},{name:"Astra Hatch",years:u(1999,2011)},{name:"Astra SW (Perua)",years:u(1995,2011)},{name:"Astra Advantage",years:u(2005,2011)},{name:"Astra SS",years:u(2006,2007)},{name:"Astra CD",years:u(1999,2003)},{name:"Vectra Sedan",years:u(1994,2011)},{name:"Vectra Hatch / GT / GTX",years:u(2008,2011)},{name:"Vectra CD",years:u(1994,1996)},{name:"Vectra GLS",years:u(1997,2005)},{name:"Vectra Expression",years:u(2005,2011)},{name:"Vectra Elite",years:u(2006,2011)},{name:"Meriva",years:u(2003,2012)},{name:"Meriva Joy",years:u(2006,2012)},{name:"Meriva SS",years:u(2007,2009)},{name:"Zafira",years:u(2001,2012)},{name:"Zafira Elite",years:u(2005,2012)},{name:"Captiva",years:u(2008,2017)},{name:"Captiva Sport",years:u(2008,2015)},{name:"Agile",years:u(2010,2014)},{name:"Agile LTZ",years:u(2010,2014)},{name:"Malibu",years:u(2010,2015)},{name:"Omega",years:u(1993,2011)},{name:"Omega CD",years:u(1993,2004)},{name:"Omega Suprema",years:u(1993,1998)},{name:"Omega Fittipaldi",years:u(2005,2007)},{name:"Blazer",years:u(1996,2011)},{name:"Blazer DLX",years:u(1996,2e3)},{name:"Blazer Advantage",years:u(2005,2011)},{name:"Camaro SS",years:u(2011,2024)},{name:"Camaro ZL1",years:u(2018,2024)},{name:"Kadett",years:u(1989,1998)},{name:"Kadett GSi",years:u(1991,1998)},{name:"Kadett SL/e",years:u(1989,1998)},{name:"Kadett Ipanema",years:u(1990,1998)},{name:"Monza",years:u(1982,1996)},{name:"Monza Classic",years:u(1986,1996)},{name:"Monza SL/e",years:u(1982,1991)},{name:"Monza 500 EF",years:u(1990,1993)},{name:"Monza GLS",years:u(1991,1996)},{name:"Monza Club",years:u(1993,1996)},{name:"Chevette Sedan",years:u(1973,1993)},{name:"Chevette Hatch",years:u(1980,1993)},{name:"Chevette Marajó",years:u(1980,1989)},{name:"Chevette DL",years:u(1992,1993)},{name:"Chevette Junior",years:u(1992,1993)},{name:"Chevette S/R",years:u(1981,1982)},{name:"Chevette GP",years:u(1976,1978)},{name:"Opala Sedan",years:u(1969,1992)},{name:"Opala Coupé",years:u(1969,1992)},{name:"Opala Diplomata",years:u(1979,1992)},{name:"Opala Caravan",years:u(1975,1992)},{name:"Opala Comodoro",years:u(1975,1992)},{name:"Opala SS",years:u(1971,1980)},{name:"Opala Gran Luxo",years:u(1969,1979)},{name:"D20",years:u(1985,1996)},{name:"D20 Custom",years:u(1985,1996)},{name:"D20 Custom S",years:u(1991,1996)},{name:"D10",years:u(1979,1985)},{name:"A20",years:u(1985,1996)},{name:"C20",years:u(1985,1996)},{name:"C20 Custom",years:u(1993,1996)},{name:"Bonanza",years:u(1989,1994)},{name:"Veraneio",years:u(1964,1994)},{name:"Veraneio Custom",years:u(1987,1994)},{name:"Suburban",years:u(1985,1996)},{name:"Silverado",years:u(1997,2002)},{name:"Silverado DLX",years:u(1997,2002)},{name:"Ipanema",years:u(1990,1998)},{name:"Ipanema GLS",years:u(1992,1998)},{name:"Tigra",years:u(1998,2e3)},{name:"Calibra",years:u(1994,1997)},{name:"Calibra Turbo",years:u(1994,1995)}]},{name:"Volkswagen",models:[{name:"Tera SUV",years:u(2025,2026)},{name:"Tera Comfortline",years:u(2025,2026)},{name:"Tera Highline",years:u(2025,2026)},{name:"Polo Hatch",years:u(2018,2026)},{name:"Polo Track",years:u(2023,2026)},{name:"Polo GTS",years:u(2020,2026)},{name:"Polo Comfortline",years:u(2018,2026)},{name:"Polo Highline",years:u(2018,2026)},{name:"Polo TSi Turbo",years:u(2018,2026)},{name:"Virtus Sedan",years:u(2018,2026)},{name:"Virtus GTS",years:u(2020,2026)},{name:"Virtus Comfortline",years:u(2018,2026)},{name:"Virtus Highline",years:u(2018,2026)},{name:"T-Cross",years:u(2019,2026)},{name:"T-Cross Comfortline",years:u(2019,2026)},{name:"T-Cross Highline",years:u(2019,2026)},{name:"T-Cross Sense",years:u(2021,2026)},{name:"Nivus",years:u(2021,2026)},{name:"Nivus Highline",years:u(2021,2026)},{name:"Taos",years:u(2021,2026)},{name:"Taos Comfortline",years:u(2021,2026)},{name:"Taos Highline",years:u(2021,2026)},{name:"Jetta",years:u(2007,2026)},{name:"Jetta TSi",years:u(2011,2026)},{name:"Jetta GLI",years:u(2019,2026)},{name:"Tiguan",years:u(2009,2026)},{name:"Tiguan Allspace",years:u(2018,2026)},{name:"Tiguan R-Line",years:u(2019,2026)},{name:"Amarok V6",years:u(2018,2026)},{name:"Amarok Highline",years:u(2010,2026)},{name:"Amarok Comfortline",years:u(2012,2026)},{name:"Amarok Trendline",years:u(2010,2026)},{name:"Amarok SE",years:u(2012,2022)},{name:"Saveiro",years:u(1982,2026)},{name:"Saveiro Cross",years:u(2012,2026)},{name:"Saveiro Trendline",years:u(2014,2026)},{name:"Saveiro Robust",years:u(2017,2026)},{name:"Saveiro Trooper",years:u(2009,2013)},{name:"Saveiro Surf",years:u(2015,2017)},{name:"ID.4",years:u(2024,2026)},{name:"ID.Buzz",years:u(2025,2026)},{name:"Gol G1 Quadrado",years:u(1980,1994)},{name:"Gol G1 GTS",years:u(1987,1994)},{name:"Gol G1 GTi",years:u(1988,1994)},{name:"Gol G1 GT",years:u(1984,1986)},{name:"Gol G2 Bola",years:u(1995,1999)},{name:"Gol G2 GTi",years:u(1995,1996)},{name:"Gol G2 16v",years:u(1997,1999)},{name:"Gol G3",years:u(2e3,2005)},{name:"Gol G3 Turbo",years:u(2e3,2003)},{name:"Gol G3 Power",years:u(2002,2005)},{name:"Gol G3 Rallye",years:u(2004,2005)},{name:"Gol G4",years:u(2006,2008)},{name:"Gol G4 Power",years:u(2006,2008)},{name:"Gol G5 / Trend",years:u(2009,2012)},{name:"Gol G5 Power",years:u(2009,2012)},{name:"Gol G5 Rallye",years:u(2009,2012)},{name:"Gol G6",years:u(2013,2016)},{name:"Gol G6 Rallye",years:u(2013,2016)},{name:"Gol G7",years:u(2017,2023)},{name:"Gol Track",years:u(2023,2023)},{name:"Gol Rallye (todos)",years:u(2004,2016)},{name:"Voyage (1ª geração)",years:u(1981,1996)},{name:"Voyage CL/GL",years:u(1985,1996)},{name:"Voyage G5",years:u(2009,2012)},{name:"Voyage G6",years:u(2013,2017)},{name:"Voyage G7",years:u(2017,2023)},{name:"Fox Hatch",years:u(2004,2021)},{name:"Fox Highline",years:u(2015,2021)},{name:"Fox Pepper",years:u(2015,2017)},{name:"Fox Rock in Rio",years:u(2014,2015)},{name:"SpaceFox",years:u(2006,2018)},{name:"CrossFox",years:u(2005,2016)},{name:"Up! Hatch",years:u(2014,2021)},{name:"Up! TSi",years:u(2015,2021)},{name:"Up! Cross",years:u(2014,2021)},{name:"Up! Pepper",years:u(2018,2021)},{name:"Golf Hatch",years:u(1999,2020)},{name:"Golf GTI",years:u(2014,2020)},{name:"Golf TSi",years:u(2013,2020)},{name:"Golf Sportline",years:u(2007,2014)},{name:"Golf Variant",years:u(2015,2019)},{name:"Golf Comfortline",years:u(2014,2020)},{name:"Golf Highline",years:u(2014,2020)},{name:"Voyage Comfortline",years:u(2013,2023)},{name:"Voyage Trendline",years:u(2013,2023)},{name:"Voyage Highline",years:u(2013,2020)},{name:"Fusca 1300",years:u(1970,1986)},{name:"Fusca 1500",years:u(1970,1975)},{name:"Fusca 1600",years:u(1970,1996)},{name:"Fusca Itamar",years:u(1993,1996)},{name:"New Beetle",years:u(2007,2016)},{name:"Brasília",years:u(1973,1982)},{name:"Kombi",years:u(1957,2013)},{name:"Kombi Furgão",years:u(1997,2013)},{name:"Kombi Standard",years:u(1997,2013)},{name:"Kombi Escolar",years:u(2006,2013)},{name:"Passat TS",years:u(1974,1988)},{name:"Passat LSE",years:u(1980,1988)},{name:"Passat Pointer",years:u(1984,1988)},{name:"Passat (importado)",years:u(1999,2019)},{name:"Passat Variant",years:u(2006,2019)},{name:"Parati",years:u(1982,2013)},{name:"Parati Surf",years:u(1995,2e3)},{name:"Parati Track & Field",years:u(2005,2013)},{name:"Parati Crossover",years:u(2006,2013)},{name:"Parati 16V Turbo",years:u(1999,2003)},{name:"Santana",years:u(1984,2006)},{name:"Santana Quantum",years:u(1985,2001)},{name:"Santana 2000",years:u(1997,2006)},{name:"Santana Executivo",years:u(1997,2006)},{name:"Logus",years:u(1993,1997)},{name:"Pointer",years:u(1994,1997)},{name:"Pointer GTi",years:u(1994,1996)},{name:"Bora",years:u(2001,2011)},{name:"Polo Classic Sedan",years:u(1997,2005)},{name:"Polo Sedan (2ª ger.)",years:u(2003,2015)},{name:"Polo Hatch (2ª ger.)",years:u(2002,2015)},{name:"SP2",years:u(1972,1976)},{name:"Variant (antiga)",years:u(1969,1977)},{name:"Variant II",years:u(1978,1981)},{name:"TL",years:u(1970,1976)},{name:"Karmann Ghia",years:u(1962,1975)}]},{name:"Fiat",models:[{name:"Argo Hatch",years:u(2018,2026)},{name:"Argo Drive",years:u(2018,2026)},{name:"Argo Trekking",years:u(2019,2026)},{name:"Argo HGT",years:u(2018,2022)},{name:"Argo Turbo 200",years:u(2022,2026)},{name:"Cronos Sedan",years:u(2018,2026)},{name:"Cronos Drive",years:u(2018,2026)},{name:"Cronos Precision",years:u(2019,2026)},{name:"Pulse SUV",years:u(2022,2026)},{name:"Pulse Drive",years:u(2022,2026)},{name:"Pulse Audace",years:u(2022,2026)},{name:"Pulse Impetus",years:u(2022,2026)},{name:"Pulse Turbo 200",years:u(2022,2026)},{name:"Pulse Abarth",years:u(2023,2026)},{name:"Fastback SUV Coupé",years:u(2023,2026)},{name:"Fastback Audace",years:u(2023,2026)},{name:"Fastback Impetus",years:u(2023,2026)},{name:"Fastback Turbo 200",years:u(2023,2026)},{name:"Fastback Abarth",years:u(2023,2026)},{name:"Mobi Hatch",years:u(2016,2026)},{name:"Mobi Like",years:u(2020,2026)},{name:"Mobi Trekking",years:u(2021,2026)},{name:"Strada Cabine Simples",years:u(1999,2026)},{name:"Strada Cabine Plus",years:u(2021,2026)},{name:"Strada Cabine Dupla",years:u(2010,2026)},{name:"Strada Endurance",years:u(2021,2026)},{name:"Strada Freedom",years:u(2021,2026)},{name:"Strada Volcano",years:u(2021,2026)},{name:"Strada Ranch",years:u(2022,2026)},{name:"Strada Adventure",years:u(2004,2020)},{name:"Strada Working",years:u(2010,2020)},{name:"Strada Trekking",years:u(2009,2020)},{name:"Toro SUV Pickup",years:u(2017,2026)},{name:"Toro Freedom",years:u(2017,2026)},{name:"Toro Volcano",years:u(2017,2026)},{name:"Toro Ranch",years:u(2020,2026)},{name:"Toro Ultra",years:u(2021,2026)},{name:"Toro Turbo Diesel",years:u(2017,2026)},{name:"Ducato",years:u(2006,2026)},{name:"Fiorino",years:u(1988,2026)},{name:"Fiorino Furgão",years:u(2014,2026)},{name:"Titano",years:u(2024,2026)},{name:"Scudo",years:u(2024,2026)},{name:"500e Elétrico",years:u(2024,2026)},{name:"Uno Hatch",years:u(1984,2022)},{name:"Uno Way",years:u(2010,2017)},{name:"Uno Vivace",years:u(2011,2017)},{name:"Uno Sporting",years:u(2011,2017)},{name:"Uno Economy",years:u(2010,2014)},{name:"Uno Attractive",years:u(2011,2022)},{name:"Uno Mille",years:u(1990,2013)},{name:"Uno Mille Fire",years:u(2002,2013)},{name:"Uno Mille EP",years:u(1994,2002)},{name:"Uno Mille SX",years:u(1997,2001)},{name:"Uno Mille Smart",years:u(1999,2001)},{name:"Uno Turbo i.e.",years:u(1994,1996)},{name:"Uno CS / S",years:u(1984,1993)},{name:"Palio Hatch",years:u(1996,2017)},{name:"Palio ELX",years:u(1996,2007)},{name:"Palio EL",years:u(1996,2003)},{name:"Palio Fire",years:u(2003,2016)},{name:"Palio Attractive",years:u(2012,2017)},{name:"Palio Sporting",years:u(2012,2017)},{name:"Palio Weekend",years:u(1997,2017)},{name:"Palio Weekend Adventure",years:u(2004,2017)},{name:"Palio Weekend Trekking",years:u(2009,2017)},{name:"Siena Sedan",years:u(1998,2016)},{name:"Siena EL",years:u(2010,2016)},{name:"Siena ELX",years:u(1998,2010)},{name:"Siena HLX",years:u(2004,2010)},{name:"Siena Tetrafuel",years:u(2006,2009)},{name:"Grand Siena",years:u(2012,2021)},{name:"Grand Siena Attractive",years:u(2012,2021)},{name:"Grand Siena Essence",years:u(2012,2021)},{name:"Punto Hatch",years:u(2007,2017)},{name:"Punto Attractive",years:u(2008,2017)},{name:"Punto Essence",years:u(2011,2017)},{name:"Punto Blackmotion",years:u(2014,2017)},{name:"Punto Sporting",years:u(2008,2017)},{name:"Punto T-Jet Turbo",years:u(2008,2016)},{name:"Linea Sedan",years:u(2009,2016)},{name:"Linea Absolute",years:u(2011,2016)},{name:"Linea Essence",years:u(2011,2016)},{name:"Linea T-Jet Turbo",years:u(2010,2014)},{name:"Bravo Hatch",years:u(2011,2016)},{name:"Bravo Sporting",years:u(2012,2016)},{name:"Bravo T-Jet Turbo",years:u(2012,2015)},{name:"Idea Hatch",years:u(2005,2016)},{name:"Idea Adventure",years:u(2007,2016)},{name:"Idea Sporting",years:u(2011,2016)},{name:"Doblò",years:u(2002,2018)},{name:"Doblò Adventure",years:u(2006,2016)},{name:"Doblò Essence",years:u(2013,2018)},{name:"Freemont SUV",years:u(2012,2016)},{name:"Freemont Precision",years:u(2013,2016)},{name:"500 Hatch",years:u(2012,2016)},{name:"500 Cabrio",years:u(2013,2016)},{name:"500 Sport Air",years:u(2012,2014)},{name:"147",years:u(1976,1986)},{name:"147 Rallye",years:u(1978,1983)},{name:"Elba",years:u(1986,1996)},{name:"Elba Weekend",years:u(1986,1996)},{name:"Elba CSL",years:u(1990,1996)},{name:"Prêmio",years:u(1985,1996)},{name:"Prêmio CS / CSL",years:u(1985,1996)},{name:"Prêmio S",years:u(1988,1995)},{name:"Tempra Sedan",years:u(1992,1999)},{name:"Tempra SW",years:u(1994,1999)},{name:"Tempra Turbo",years:u(1994,1998)},{name:"Tempra Stile",years:u(1996,1999)},{name:"Tempra HLX",years:u(1996,1999)},{name:"Tipo",years:u(1993,1997)},{name:"Tipo SLX",years:u(1995,1997)},{name:"Marea Sedan",years:u(1999,2007)},{name:"Marea Weekend",years:u(1999,2007)},{name:"Marea Turbo",years:u(1999,2003)},{name:"Marea HLX",years:u(1999,2007)},{name:"Marea ELX",years:u(1999,2005)},{name:"Stilo Hatch",years:u(2003,2011)},{name:"Stilo Sporting",years:u(2006,2011)},{name:"Stilo Dualogic",years:u(2006,2011)},{name:"Stilo Connect",years:u(2007,2011)},{name:"Brava HGT",years:u(1999,2003)},{name:"Brava SX",years:u(1999,2003)},{name:"Brava ELX",years:u(2e3,2003)},{name:"Coupé",years:u(1996,2001)},{name:"Coupé Turbo",years:u(1996,2e3)},{name:"Panorama",years:u(1981,1986)},{name:"Spazio",years:u(1983,1985)},{name:"Oggi",years:u(1983,1985)},{name:"City",years:u(1983,1985)}]},{name:"Hyundai",models:[{name:"HB20 Hatch",years:u(2012,2026)},{name:"HB20 Comfort",years:u(2012,2026)},{name:"HB20 Comfort Plus",years:u(2013,2019)},{name:"HB20 Premium",years:u(2013,2019)},{name:"HB20 Comfort Style",years:u(2013,2019)},{name:"HB20 Vision",years:u(2020,2026)},{name:"HB20 Evolution",years:u(2020,2026)},{name:"HB20 Platinum",years:u(2020,2026)},{name:"HB20 Sport",years:u(2016,2019)},{name:"HB20 Turbo",years:u(2016,2026)},{name:"HB20S Sedan",years:u(2013,2026)},{name:"HB20S Comfort Plus",years:u(2013,2019)},{name:"HB20S Vision",years:u(2020,2026)},{name:"HB20S Evolution",years:u(2020,2026)},{name:"HB20S Platinum",years:u(2020,2026)},{name:"HB20X Crossover",years:u(2014,2022)},{name:"HB20 Adventure",years:u(2024,2026)},{name:"HB20 Unique",years:u(2024,2026)},{name:"Creta SUV",years:u(2017,2026)},{name:"Creta Attitude",years:u(2017,2021)},{name:"Creta Pulse",years:u(2017,2021)},{name:"Creta Prestige",years:u(2017,2021)},{name:"Creta Sport",years:u(2018,2021)},{name:"Creta Comfort",years:u(2022,2026)},{name:"Creta Limited",years:u(2022,2026)},{name:"Creta Ultimate",years:u(2022,2026)},{name:"Creta N Line",years:u(2022,2026)},{name:"Creta Grand (7 lug.)",years:u(2024,2026)},{name:"Tucson SUV",years:u(2006,2026)},{name:"Tucson GLS",years:u(2006,2016)},{name:"New Tucson",years:u(2022,2026)},{name:"Santa Fe SUV",years:u(2007,2026)},{name:"Santa Fe (1ª ger.)",years:u(2001,2006)},{name:"Kona SUV",years:u(2022,2026)},{name:"Kona Elétrico",years:u(2024,2026)},{name:"Inster Elétrico",years:u(2025,2026)},{name:"Ioniq 5 Elétrico",years:u(2023,2026)},{name:"Ioniq 5 N",years:u(2025,2026)},{name:"Ioniq 6 Elétrico",years:u(2024,2026)},{name:"Palisade SUV",years:u(2023,2026)},{name:"ix35 SUV",years:u(2011,2021)},{name:"Elantra Sedan",years:u(2012,2017)},{name:"Veloster Hatch",years:u(2012,2019)},{name:"Veloster Turbo",years:u(2013,2019)},{name:"i30 Hatch",years:u(2009,2018)},{name:"i30 CW",years:u(2009,2013)},{name:"Azera Sedan",years:u(2008,2020)},{name:"Vera Cruz SUV",years:u(2008,2014)},{name:"Sonata",years:u(2011,2014)},{name:"Genesis Sedan",years:u(2012,2016)},{name:"Equus Sedan",years:u(2012,2015)},{name:"Terracan SUV",years:u(2004,2007)},{name:"Galloper SUV",years:u(1998,2004)},{name:"H100",years:u(1997,2006)},{name:"HR Furgão/Chassi",years:u(2007,2022)}]},{name:"Toyota",models:[{name:"Corolla Sedan",years:u(1993,2026)},{name:"Corolla GLi",years:u(2009,2026)},{name:"Corolla XEi",years:u(2003,2026)},{name:"Corolla Altis",years:u(2015,2026)},{name:"Corolla Altis Hybrid",years:u(2020,2026)},{name:"Corolla GR-S",years:u(2021,2026)},{name:"Corolla SEG",years:u(2003,2008)},{name:"Corolla XL",years:u(1993,2002)},{name:"Corolla Cross SUV",years:u(2021,2026)},{name:"Corolla Cross XRE",years:u(2021,2026)},{name:"Corolla Cross XRX",years:u(2021,2026)},{name:"Corolla Cross Hybrid",years:u(2021,2026)},{name:"Corolla Cross GR-S",years:u(2022,2026)},{name:"Hilux Cabine Dupla",years:u(1992,2026)},{name:"Hilux Cabine Simples",years:u(2005,2026)},{name:"Hilux SRV",years:u(2002,2026)},{name:"Hilux SRX",years:u(2016,2026)},{name:"Hilux SR",years:u(2005,2026)},{name:"Hilux STD",years:u(2005,2015)},{name:"Hilux GR-S",years:u(2022,2026)},{name:"Hilux SW4 SUV",years:u(1993,2026)},{name:"Hilux SW4 SRX",years:u(2016,2026)},{name:"Hilux SW4 Diamond",years:u(2020,2026)},{name:"Hilux SW4 GR-S",years:u(2022,2026)},{name:"RAV4 SUV",years:u(2004,2026)},{name:"RAV4 Hybrid",years:u(2020,2026)},{name:"RAV4 PHEV Híbrido Plug-in",years:u(2024,2026)},{name:"Yaris Hatch",years:u(2018,2023)},{name:"Yaris Sedan",years:u(2019,2023)},{name:"Yaris XL",years:u(2019,2023)},{name:"Yaris XLS",years:u(2019,2023)},{name:"Yaris XS",years:u(2018,2023)},{name:"Yaris Cross SUV",years:u(2024,2026)},{name:"Yaris Cross Hybrid",years:u(2024,2026)},{name:"Sienna Minivan",years:u(2003,2014)},{name:"Sienna Celebration",years:u(2009,2014)},{name:"Land Cruiser 300",years:u(2022,2026)},{name:"Land Cruiser Prado",years:u(2004,2024)},{name:"Camry Sedan",years:u(2e3,2024)},{name:"Camry Hybrid",years:u(2019,2024)},{name:"Prius Hybrid",years:u(2013,2023)},{name:"Etios Hatch",years:u(2013,2021)},{name:"Etios Sedan",years:u(2013,2021)},{name:"Etios X",years:u(2013,2021)},{name:"Etios XLS",years:u(2013,2021)},{name:"Etios Cross",years:u(2014,2021)},{name:"Etios Platinum",years:u(2016,2021)},{name:"Fielder SW",years:u(2005,2014)},{name:"Bandeirante",years:u(1958,2001)},{name:"Corona",years:u(1993,1998)},{name:"Previa",years:u(1992,1999)}]},{name:"Honda",models:[{name:"Civic Sedan",years:u(1997,2026)},{name:"Civic LX",years:u(1997,2021)},{name:"Civic LXS",years:u(2007,2016)},{name:"Civic LXR",years:u(2014,2016)},{name:"Civic EX",years:u(2001,2026)},{name:"Civic EXL",years:u(2017,2026)},{name:"Civic EXR",years:u(2014,2016)},{name:"Civic Touring",years:u(2017,2026)},{name:"Civic Touring Turbo",years:u(2017,2026)},{name:"Civic Si",years:u(2007,2020)},{name:"Civic Type R",years:u(2024,2026)},{name:"City Sedan",years:u(2009,2026)},{name:"City Hatchback",years:u(2022,2026)},{name:"City DX",years:u(2009,2014)},{name:"City LX",years:u(2009,2026)},{name:"City EX",years:u(2009,2026)},{name:"City EXL",years:u(2015,2026)},{name:"City Touring",years:u(2023,2026)},{name:"HR-V SUV",years:u(2015,2026)},{name:"HR-V LX",years:u(2015,2021)},{name:"HR-V EX",years:u(2015,2026)},{name:"HR-V EXL",years:u(2015,2026)},{name:"HR-V Touring",years:u(2017,2026)},{name:"HR-V Turbo",years:u(2022,2026)},{name:"HR-V Advance",years:u(2022,2026)},{name:"ZR-V SUV",years:u(2024,2026)},{name:"CR-V SUV",years:u(2e3,2026)},{name:"CR-V Hybrid",years:u(2024,2026)},{name:"HR-V Hybrid e:HEV",years:u(2025,2026)},{name:"City Hybrid e:HEV",years:u(2025,2026)},{name:"Accord Sedan",years:u(2003,2026)},{name:"Accord Hybrid",years:u(2024,2026)},{name:"Accord (antigo)",years:u(1994,2002)},{name:"e:NP1 Elétrico",years:u(2025,2026)},{name:"Elevate SUV",years:u(2024,2026)},{name:"Fit Hatch",years:u(2004,2021)},{name:"Fit LX",years:u(2004,2021)},{name:"Fit EX",years:u(2004,2021)},{name:"Fit EXL",years:u(2015,2021)},{name:"Fit Twist",years:u(2013,2017)},{name:"WR-V SUV",years:u(2017,2021)},{name:"WR-V EX",years:u(2017,2021)},{name:"WR-V EXL",years:u(2017,2021)},{name:"CRX",years:u(1992,1997)},{name:"Prelude",years:u(1993,2001)},{name:"Legend",years:u(1994,1998)},{name:"S2000",years:u(2e3,2009)}]},{name:"Renault",models:[{name:"Kwid Hatch",years:u(2017,2026)},{name:"Kwid Intense",years:u(2017,2026)},{name:"Kwid Zen",years:u(2017,2024)},{name:"Kwid Outsider",years:u(2020,2026)},{name:"Kwid E-Tech Elétrico",years:u(2025,2026)},{name:"Duster SUV",years:u(2012,2026)},{name:"Duster Dynamique",years:u(2012,2018)},{name:"Duster Oroch Pick-up",years:u(2016,2026)},{name:"Duster Oroch Outsider",years:u(2024,2026)},{name:"Duster Iconic",years:u(2021,2026)},{name:"Kardian SUV",years:u(2024,2026)},{name:"Kardian Outsider",years:u(2025,2026)},{name:"Master Furgão",years:u(2004,2026)},{name:"Sandero Hatch",years:u(2008,2022)},{name:"Sandero Stepway",years:u(2012,2022)},{name:"Sandero RS",years:u(2015,2020)},{name:"Sandero GT Line",years:u(2018,2022)},{name:"Logan Sedan",years:u(2007,2022)},{name:"Logan Expression",years:u(2007,2014)},{name:"Logan Dynamique",years:u(2007,2014)},{name:"Stepway SUV",years:u(2019,2022)},{name:"Captur SUV",years:u(2017,2022)},{name:"Captur Intense",years:u(2017,2022)},{name:"Captur Bose",years:u(2020,2022)},{name:"Fluence Sedan",years:u(2011,2018)},{name:"Fluence Dynamique",years:u(2011,2018)},{name:"Fluence Privilège",years:u(2011,2018)},{name:"Fluence GT Turbo",years:u(2013,2016)},{name:"Megane Sedan",years:u(2001,2014)},{name:"Megane Grand Tour",years:u(2008,2014)},{name:"Megane Dynamique",years:u(2001,2012)},{name:"Clio Hatch",years:u(2e3,2016)},{name:"Clio Sedan",years:u(2001,2009)},{name:"Clio Campus",years:u(2006,2012)},{name:"Scenic",years:u(2001,2011)},{name:"Symbol Sedan",years:u(2009,2013)},{name:"Kangoo",years:u(2001,2016)},{name:"Twingo",years:u(2002,2004)},{name:"R19 Sedan",years:u(1994,1999)},{name:"R19 Hatch",years:u(1994,1998)},{name:"Laguna",years:u(1998,2006)}]},{name:"Nissan",models:[{name:"Kicks SUV",years:u(2017,2026)},{name:"Kicks S",years:u(2017,2026)},{name:"Kicks SV",years:u(2017,2026)},{name:"Kicks SL",years:u(2017,2026)},{name:"Kicks Exclusive",years:u(2022,2026)},{name:"Kicks e-Power Hybrid",years:u(2024,2026)},{name:"Versa Sedan",years:u(2012,2026)},{name:"Versa Sense",years:u(2021,2026)},{name:"Versa Advance",years:u(2021,2026)},{name:"Versa Exclusive",years:u(2021,2026)},{name:"Sentra Sedan",years:u(2001,2026)},{name:"Sentra SV",years:u(2014,2026)},{name:"Sentra SL",years:u(2014,2026)},{name:"Frontier Pick-up",years:u(1998,2026)},{name:"Frontier Attack",years:u(2017,2026)},{name:"Frontier LE",years:u(2008,2016)},{name:"Frontier XE",years:u(2002,2016)},{name:"Note Hatch",years:u(2024,2026)},{name:"Ariya Elétrico SUV",years:u(2024,2026)},{name:"Qashqai SUV",years:u(2024,2026)},{name:"March Hatch",years:u(2012,2022)},{name:"March SV",years:u(2012,2022)},{name:"March SL",years:u(2012,2022)},{name:"March Rio",years:u(2016,2016)},{name:"Tiida Hatch",years:u(2008,2014)},{name:"Tiida Sedan",years:u(2008,2014)},{name:"Livina",years:u(2009,2014)},{name:"Grand Livina",years:u(2010,2014)},{name:"X-Trail SUV",years:u(2005,2016)},{name:"Pathfinder SUV",years:u(2001,2015)},{name:"Leaf Elétrico",years:u(2019,2024)},{name:"Altima",years:u(2005,2014)},{name:"Maxima",years:u(2005,2010)},{name:"Murano SUV",years:u(2009,2015)},{name:"370Z Coupé",years:u(2010,2020)},{name:"350Z Coupé",years:u(2004,2009)},{name:"GT-R",years:u(2009,2021)},{name:"Xterra SUV",years:u(2004,2008)},{name:"D21 Pick-up",years:u(1994,2002)}]},{name:"Ford",models:[{name:"Ranger Cabine Dupla",years:u(1995,2026)},{name:"Ranger Cabine Simples",years:u(1995,2012)},{name:"Ranger XLS",years:u(2004,2026)},{name:"Ranger XLT",years:u(1995,2026)},{name:"Ranger Limited",years:u(2005,2026)},{name:"Ranger Black",years:u(2022,2026)},{name:"Ranger Raptor",years:u(2023,2026)},{name:"Ranger Wildtrak",years:u(2023,2026)},{name:"Territory SUV",years:u(2021,2026)},{name:"Territory Titanium",years:u(2021,2026)},{name:"Bronco Sport SUV",years:u(2022,2026)},{name:"Bronco Sport Wildtrak",years:u(2023,2026)},{name:"Maverick Hybrid",years:u(2022,2026)},{name:"Maverick Lariat",years:u(2022,2026)},{name:"Mustang Coupé",years:u(2011,2026)},{name:"Mustang GT",years:u(2018,2026)},{name:"Mustang Mach 1",years:u(2021,2024)},{name:"Ka Hatch",years:u(1997,2021)},{name:"Ka+ Sedan",years:u(2015,2021)},{name:"Ka SE",years:u(2019,2021)},{name:"Ka SEL",years:u(2019,2021)},{name:"Ka Freestyle",years:u(2019,2021)},{name:"EcoSport SUV",years:u(2004,2022)},{name:"EcoSport XLT",years:u(2004,2012)},{name:"EcoSport Freestyle",years:u(2009,2022)},{name:"EcoSport Titanium",years:u(2013,2022)},{name:"EcoSport SE",years:u(2013,2022)},{name:"EcoSport Storm",years:u(2018,2022)},{name:"Fiesta Hatch",years:u(1996,2019)},{name:"Fiesta Sedan",years:u(2005,2015)},{name:"Fiesta Rocam Hatch",years:u(2004,2014)},{name:"Fiesta Rocam Sedan",years:u(2004,2014)},{name:"Fiesta Titanium",years:u(2014,2019)},{name:"Fiesta SE",years:u(2014,2019)},{name:"Focus Hatch",years:u(2001,2019)},{name:"Focus Sedan",years:u(2004,2019)},{name:"Focus Titanium",years:u(2014,2019)},{name:"Focus SE",years:u(2014,2019)},{name:"Focus Fastback",years:u(2016,2019)},{name:"Fusion Sedan",years:u(2006,2019)},{name:"Fusion Hybrid",years:u(2014,2019)},{name:"Fusion Titanium",years:u(2013,2019)},{name:"Fusion SEL",years:u(2006,2013)},{name:"Fusion AWD",years:u(2013,2019)},{name:"Edge SUV",years:u(2011,2020)},{name:"Edge Limited",years:u(2011,2015)},{name:"Edge Titanium",years:u(2016,2020)},{name:"Edge ST",years:u(2019,2020)},{name:"Courier Pick-up",years:u(1997,2013)},{name:"F-250 Super Duty",years:u(1999,2012)},{name:"Escort Hatch",years:u(1983,2003)},{name:"Escort Sedan",years:u(1993,2003)},{name:"Escort XR3",years:u(1984,1995)},{name:"Escort XR3 Conversível",years:u(1987,1995)},{name:"Escort Ghia",years:u(1983,1992)},{name:"Escort Hobby",years:u(1993,1996)},{name:"Escort GL",years:u(1996,2003)},{name:"Escort GLX",years:u(1996,2003)},{name:"Escort Zetec",years:u(1997,2003)},{name:"Escort SW Perua",years:u(1997,2003)},{name:"Verona Sedan",years:u(1990,1996)},{name:"Verona GLX",years:u(1990,1996)},{name:"Versailles Sedan",years:u(1991,1996)},{name:"Versailles Ghia",years:u(1991,1996)},{name:"Royale SW",years:u(1992,1996)},{name:"Del Rey Sedan",years:u(1981,1991)},{name:"Del Rey Ghia",years:u(1982,1991)},{name:"Del Rey Belina (SW)",years:u(1981,1991)},{name:"Pampa Pick-up",years:u(1982,1997)},{name:"Corcel I",years:u(1968,1977)},{name:"Corcel II",years:u(1978,1986)},{name:"Corcel II LDO",years:u(1980,1986)},{name:"Belina I SW",years:u(1970,1977)},{name:"Belina II SW",years:u(1978,1991)},{name:"Maverick (clássico) Coupé",years:u(1973,1979)},{name:"Maverick (clássico) Sedan",years:u(1973,1979)},{name:"Galaxie Sedan",years:u(1967,1983)},{name:"Galaxie LTD",years:u(1967,1983)},{name:"F-100 Pick-up",years:u(1957,1983)},{name:"F-1000 Pick-up",years:u(1979,1998)},{name:"F-4000",years:u(1979,1998)},{name:"F-350",years:u(1999,2006)},{name:"Mondeo Sedan",years:u(1997,2006)},{name:"Mondeo SW",years:u(1997,2006)}]},{name:"Jeep",models:[{name:"Renegade SUV",years:u(2016,2026)},{name:"Renegade Sport",years:u(2016,2026)},{name:"Renegade Longitude",years:u(2016,2026)},{name:"Renegade Limited",years:u(2016,2026)},{name:"Renegade Trailhawk",years:u(2016,2026)},{name:"Renegade Moab",years:u(2019,2024)},{name:"Renegade Turbo",years:u(2019,2026)},{name:"Compass SUV",years:u(2017,2026)},{name:"Compass Sport",years:u(2017,2026)},{name:"Compass Longitude",years:u(2017,2026)},{name:"Compass Limited",years:u(2017,2026)},{name:"Compass Trailhawk",years:u(2018,2026)},{name:"Compass S",years:u(2022,2026)},{name:"Compass Turbo Diesel",years:u(2017,2026)},{name:"Compass 4xe PHEV Híbrido",years:u(2024,2026)},{name:"Commander SUV",years:u(2022,2026)},{name:"Commander Limited",years:u(2022,2026)},{name:"Commander Overland",years:u(2022,2026)},{name:"Commander 4xe PHEV",years:u(2025,2026)},{name:"Wrangler",years:u(2007,2026)},{name:"Wrangler Rubicon",years:u(2019,2026)},{name:"Wrangler Sahara",years:u(2019,2026)},{name:"Wrangler 4xe PHEV",years:u(2024,2026)},{name:"Grand Cherokee SUV",years:u(2005,2026)},{name:"Grand Cherokee Limited",years:u(2005,2026)},{name:"Grand Cherokee L (7 lug.)",years:u(2022,2026)},{name:"Grand Cherokee Overland",years:u(2011,2026)},{name:"Cherokee SUV",years:u(2005,2020)},{name:"Cherokee Sport (antigo)",years:u(1997,2001)},{name:"Liberty",years:u(2003,2007)}]},{name:"Mitsubishi",models:[{name:"L200 Triton Pick-up",years:u(2008,2026)},{name:"L200 Triton Sport",years:u(2017,2026)},{name:"L200 Triton Savana",years:u(2024,2026)},{name:"L200 Triton Outdoor",years:u(2021,2026)},{name:"L200 Triton HPE",years:u(2008,2016)},{name:"L200 Triton HLS",years:u(2013,2016)},{name:"L200 (antiga)",years:u(1995,2012)},{name:"L200 Outdoor (antiga)",years:u(2005,2012)},{name:"L200 GL / GLS",years:u(1995,2012)},{name:"Outlander SUV",years:u(2008,2026)},{name:"Outlander HPE-S",years:u(2018,2026)},{name:"Outlander PHEV Híbrido Plug-in",years:u(2024,2026)},{name:"Outlander Sport",years:u(2012,2022)},{name:"Eclipse Cross SUV",years:u(2019,2026)},{name:"Eclipse Cross HPE-S",years:u(2019,2026)},{name:"Eclipse Cross PHEV Híbrido",years:u(2024,2026)},{name:"ASX SUV",years:u(2011,2023)},{name:"Pajero Sport SUV",years:u(2e3,2024)},{name:"Pajero Sport HPE",years:u(2007,2024)},{name:"Pajero Sport HPE-S",years:u(2019,2024)},{name:"Pajero Full SUV",years:u(1994,2021)},{name:"Pajero Full HPE",years:u(2007,2021)},{name:"Pajero Dakar",years:u(2010,2019)},{name:"Pajero IO",years:u(1999,2004)},{name:"Pajero TR4",years:u(2003,2015)},{name:"Lancer Sedan",years:u(2007,2019)},{name:"Lancer GT",years:u(2014,2019)},{name:"Lancer Evolution",years:u(2007,2016)},{name:"Lancer Evolution X Turbo",years:u(2008,2016)},{name:"Airtrek SUV",years:u(2003,2007)},{name:"Airtrek Turbo",years:u(2005,2007)},{name:"Grandis",years:u(2005,2009)},{name:"Eclipse Coupé",years:u(1995,2006)},{name:"Eclipse GS Turbo",years:u(1995,2e3)},{name:"Space Wagon",years:u(1994,2e3)},{name:"L300",years:u(1990,2002)}]},{name:"Peugeot",models:[{name:"208 Hatch",years:u(2014,2026)},{name:"208 Active",years:u(2014,2026)},{name:"208 Allure",years:u(2014,2026)},{name:"208 Griffe",years:u(2014,2020)},{name:"208 GT",years:u(2021,2026)},{name:"208 Style",years:u(2021,2026)},{name:"e-208 Elétrico",years:u(2024,2026)},{name:"2008 SUV",years:u(2016,2026)},{name:"2008 Allure",years:u(2016,2026)},{name:"2008 Griffe",years:u(2016,2020)},{name:"2008 GT",years:u(2021,2026)},{name:"e-2008 Elétrico",years:u(2024,2026)},{name:"3008 SUV",years:u(2018,2024)},{name:"3008 Griffe Pack",years:u(2018,2024)},{name:"3008 GT",years:u(2018,2024)},{name:"5008 SUV (7 lug.)",years:u(2019,2024)},{name:"308 Hatch",years:u(2007,2019)},{name:"308 Allure",years:u(2012,2019)},{name:"308 CC Conversível",years:u(2010,2015)},{name:"408 Sedan",years:u(2012,2019)},{name:"408 Griffe",years:u(2012,2019)},{name:"207 Hatch",years:u(2008,2015)},{name:"207 Passion Sedan",years:u(2008,2015)},{name:"207 SW Perua",years:u(2009,2015)},{name:"207 Escapade",years:u(2009,2013)},{name:"207 XR/XS",years:u(2008,2013)},{name:"206 Hatch",years:u(1999,2010)},{name:"206 SW",years:u(2005,2008)},{name:"206 Escapade",years:u(2006,2008)},{name:"206 Soleil",years:u(1999,2003)},{name:"206 Rallye",years:u(2001,2003)},{name:"307 Hatch",years:u(2002,2012)},{name:"307 Sedan",years:u(2004,2010)},{name:"307 SW Perua",years:u(2004,2012)},{name:"307 CC Conversível",years:u(2004,2009)},{name:"307 Feline",years:u(2005,2012)},{name:"307 Griffe",years:u(2007,2012)},{name:"407 Sedan",years:u(2005,2012)},{name:"607 Sedan",years:u(2002,2008)},{name:"Partner Furgão",years:u(2002,2020)},{name:"Hoggar Pick-up",years:u(2010,2014)},{name:"106 Hatch",years:u(1994,2001)},{name:"306 Hatch",years:u(1994,2002)},{name:"306 Sedan",years:u(1995,2002)},{name:"306 SW",years:u(1997,2002)},{name:"405 Sedan",years:u(1993,1999)},{name:"504 Pick-up",years:u(1980,1999)},{name:"505 Sedan",years:u(1986,1996)}]},{name:"Citroën",models:[{name:"C3 Hatch",years:u(2003,2026)},{name:"C3 Aircross SUV",years:u(2019,2026)},{name:"C3 You!",years:u(2023,2026)},{name:"C3 Live",years:u(2023,2026)},{name:"C3 Feel",years:u(2023,2026)},{name:"C5 Aircross SUV",years:u(2023,2026)},{name:"Jumpy Furgão",years:u(2018,2026)},{name:"ë-C3 Elétrico",years:u(2025,2026)},{name:"C4 Cactus SUV",years:u(2018,2023)},{name:"C4 Cactus Feel",years:u(2018,2023)},{name:"C4 Cactus Shine",years:u(2018,2023)},{name:"C4 Lounge Sedan",years:u(2014,2019)},{name:"C3 Picasso",years:u(2011,2015)},{name:"C3 XR",years:u(2014,2016)},{name:"Aircross SUV",years:u(2011,2020)},{name:"Aircross GLX",years:u(2011,2015)},{name:"Aircross Exclusive",years:u(2011,2020)},{name:"C4 Pallas Sedan",years:u(2007,2013)},{name:"C4 Hatch",years:u(2007,2013)},{name:"C4 VTR",years:u(2007,2009)},{name:"Xsara Picasso",years:u(2001,2012)},{name:"Xsara Hatch",years:u(1998,2004)},{name:"Xsara Break Perua",years:u(1998,2004)},{name:"C5 Sedan",years:u(2002,2012)},{name:"C5 Break Perua",years:u(2005,2009)},{name:"Berlingo Furgão",years:u(2002,2017)},{name:"C8 Minivan",years:u(2003,2008)},{name:"ZX Hatch",years:u(1993,1998)},{name:"AX Hatch",years:u(1993,1997)}]},{name:"Kia",models:[{name:"Sportage SUV",years:u(2005,2026)},{name:"Sportage EX",years:u(2005,2026)},{name:"Sportage LX",years:u(2005,2016)},{name:"Sportage HEV Hybrid",years:u(2025,2026)},{name:"Seltos SUV",years:u(2024,2026)},{name:"Stonic SUV",years:u(2024,2026)},{name:"EV6 Elétrico",years:u(2023,2026)},{name:"EV5 SUV Elétrico",years:u(2025,2026)},{name:"EV9 SUV Elétrico (7 lug.)",years:u(2024,2026)},{name:"Niro Hybrid",years:u(2023,2026)},{name:"Niro EV Elétrico",years:u(2024,2026)},{name:"Cerato Sedan",years:u(2005,2024)},{name:"Cerato Koup Coupé",years:u(2010,2014)},{name:"Cerato SX",years:u(2009,2024)},{name:"Sorento SUV",years:u(2005,2024)},{name:"Sorento EX",years:u(2005,2024)},{name:"Soul Hatch",years:u(2010,2021)},{name:"Picanto Hatch",years:u(2007,2019)},{name:"Carnival Minivan",years:u(2002,2024)},{name:"Cadenza Sedan",years:u(2012,2020)},{name:"Optima Sedan",years:u(2012,2019)},{name:"Mohave SUV",years:u(2009,2015)},{name:"Bongo Furgão",years:u(2006,2024)},{name:"Stinger Coupé",years:u(2018,2023)},{name:"Stinger GT Turbo",years:u(2018,2023)},{name:"Magentis Sedan",years:u(2007,2011)},{name:"Carens Minivan",years:u(2007,2015)},{name:"Rio Hatch",years:u(2012,2017)},{name:"Clarus Sedan",years:u(1997,2001)},{name:"Sephia Sedan",years:u(1995,2001)}]},{name:"BMW",models:[{name:"Série 1 Hatch (118i/120i)",years:u(2005,2026)},{name:"Série 1 M135i Turbo",years:u(2020,2026)},{name:"Série 2 Active Tourer",years:u(2015,2026)},{name:"Série 2 Gran Coupé",years:u(2020,2026)},{name:"Série 3 Sedan (320i/330i)",years:u(2e3,2026)},{name:"Série 3 Touring",years:u(2013,2026)},{name:"Série 3 M340i Turbo",years:u(2020,2026)},{name:"Série 4 Gran Coupé",years:u(2015,2026)},{name:"Série 5 Sedan (520i/530i)",years:u(2004,2026)},{name:"Série 7 Sedan (740i/750i)",years:u(2009,2026)},{name:"X1 SUV",years:u(2010,2026)},{name:"X2 SUV Coupé",years:u(2018,2026)},{name:"X3 SUV",years:u(2004,2026)},{name:"X4 SUV Coupé",years:u(2015,2026)},{name:"X5 SUV",years:u(2002,2026)},{name:"X6 SUV Coupé",years:u(2009,2026)},{name:"X7 SUV (7 lug.)",years:u(2020,2026)},{name:"Z4 Roadster",years:u(2004,2026)},{name:"iX1 Elétrico",years:u(2024,2026)},{name:"iX3 Elétrico",years:u(2023,2026)},{name:"i4 Elétrico",years:u(2022,2026)},{name:"iX Elétrico",years:u(2022,2026)},{name:"M3 Sedan",years:u(2005,2026)},{name:"M4 Coupé",years:u(2015,2026)},{name:"M5 Sedan",years:u(2006,2024)},{name:"M2 Coupé",years:u(2016,2026)},{name:"Série 6 Gran Turismo",years:u(2018,2024)},{name:"Série 8 Gran Coupé",years:u(2019,2024)},{name:"Z3 Roadster",years:u(1997,2003)}]},{name:"Mercedes-Benz",models:[{name:"Classe A Hatch (A200/A250)",years:u(2e3,2026)},{name:"Classe A Sedan",years:u(2019,2026)},{name:"AMG A35 Turbo",years:u(2020,2026)},{name:"AMG A45 S Turbo",years:u(2020,2024)},{name:"Classe B",years:u(2006,2019)},{name:"Classe C Sedan (C180/C200/C300)",years:u(2e3,2026)},{name:"Classe C Estate SW",years:u(2015,2026)},{name:"AMG C43 Turbo",years:u(2017,2026)},{name:"AMG C63 Turbo",years:u(2008,2024)},{name:"Classe C (W202)",years:u(1994,2e3)},{name:"Classe E Sedan (E300/E350)",years:u(2003,2026)},{name:"Classe E Coupé",years:u(2010,2024)},{name:"Classe S Sedan",years:u(2006,2026)},{name:"CLA Coupé (CLA180/CLA200)",years:u(2014,2026)},{name:"CLA Shooting Brake",years:u(2016,2026)},{name:"AMG CLA 35 Turbo",years:u(2020,2026)},{name:"CLC",years:u(2009,2011)},{name:"CLK",years:u(2003,2009)},{name:"CLS Sedan",years:u(2005,2020)},{name:"GLA SUV (GLA200/GLA250)",years:u(2015,2026)},{name:"AMG GLA 35 Turbo",years:u(2021,2026)},{name:"GLB SUV (GLB200/GLB250)",years:u(2020,2026)},{name:"GLC SUV (GLC200/GLC300)",years:u(2016,2026)},{name:"GLC Coupé",years:u(2017,2026)},{name:"AMG GLC 43 Turbo",years:u(2017,2026)},{name:"GLE SUV",years:u(2016,2026)},{name:"GLE Coupé",years:u(2016,2026)},{name:"GLK SUV",years:u(2009,2015)},{name:"GLS SUV (7 lug.)",years:u(2020,2026)},{name:"GL SUV",years:u(2007,2015)},{name:"ML SUV",years:u(1999,2015)},{name:"SLK Roadster",years:u(2e3,2016)},{name:"SLC Roadster",years:u(2017,2020)},{name:"SL Roadster",years:u(2003,2024)},{name:"AMG GT Coupé",years:u(2016,2026)},{name:"EQA Elétrico SUV",years:u(2023,2026)},{name:"EQB Elétrico SUV",years:u(2023,2026)},{name:"EQE Elétrico",years:u(2024,2026)},{name:"EQS Elétrico",years:u(2023,2026)},{name:"Sprinter Van",years:u(1997,2026)},{name:"Vito Van",years:u(2004,2026)}]},{name:"Audi",models:[{name:"A1 Hatch",years:u(2011,2023)},{name:"A3 Sedan",years:u(2014,2026)},{name:"A3 Sportback Hatch",years:u(2e3,2026)},{name:"S3 Sedan Turbo",years:u(2014,2026)},{name:"RS 3 Sedan Turbo",years:u(2016,2026)},{name:"A4 Sedan",years:u(2002,2024)},{name:"A4 Avant SW",years:u(2002,2024)},{name:"A5 Sportback",years:u(2010,2026)},{name:"A5 Coupé",years:u(2008,2020)},{name:"RS 5 Coupé Turbo",years:u(2011,2024)},{name:"A6 Sedan",years:u(2005,2024)},{name:"A6 Avant SW",years:u(2005,2020)},{name:"RS 6 Avant Turbo",years:u(2020,2024)},{name:"A7 Sportback",years:u(2011,2024)},{name:"A8 Sedan",years:u(2006,2024)},{name:"Q3 SUV",years:u(2013,2026)},{name:"Q3 Sportback SUV Coupé",years:u(2020,2026)},{name:"RS Q3 Turbo",years:u(2020,2026)},{name:"Q5 SUV",years:u(2009,2026)},{name:"Q5 Sportback SUV Coupé",years:u(2021,2026)},{name:"Q7 SUV (7 lug.)",years:u(2006,2026)},{name:"Q8 SUV Coupé",years:u(2019,2026)},{name:"Q8 e-tron Elétrico",years:u(2024,2026)},{name:"TT Coupé",years:u(2e3,2022)},{name:"TT RS Coupé Turbo",years:u(2010,2022)},{name:"R8 Coupé",years:u(2008,2022)},{name:"e-tron SUV Elétrico",years:u(2020,2024)},{name:"e-tron GT Elétrico",years:u(2022,2026)}]},{name:"Volvo",models:[{name:"XC40 SUV",years:u(2018,2026)},{name:"XC40 Recharge Elétrico",years:u(2022,2026)},{name:"XC60 SUV",years:u(2009,2026)},{name:"XC60 Recharge PHEV",years:u(2023,2026)},{name:"XC90 SUV (7 lug.)",years:u(2004,2026)},{name:"XC90 Recharge PHEV",years:u(2023,2026)},{name:"S60 Sedan",years:u(2002,2026)},{name:"S60 Recharge PHEV",years:u(2023,2026)},{name:"S90 Sedan",years:u(2017,2024)},{name:"V40 Hatch",years:u(2013,2019)},{name:"V60 SW",years:u(2011,2024)},{name:"C30 Hatch",years:u(2007,2013)},{name:"C40 Recharge Elétrico",years:u(2022,2026)},{name:"EX30 Elétrico",years:u(2024,2026)},{name:"EX90 Elétrico",years:u(2025,2026)},{name:"S40 Sedan",years:u(2004,2012)},{name:"V50 SW",years:u(2005,2012)},{name:"XC70 SW",years:u(2004,2016)},{name:"S80 Sedan",years:u(2003,2016)},{name:"V70 SW",years:u(2001,2010)},{name:"850 Sedan/SW",years:u(1994,1997)},{name:"850 Turbo",years:u(1994,1997)}]},{name:"Land Rover",models:[{name:"Defender SUV",years:u(2020,2026)},{name:"Defender 90 (3 portas)",years:u(2020,2026)},{name:"Defender 110 (5 portas)",years:u(2020,2026)},{name:"Defender 130 (7 lug.)",years:u(2023,2026)},{name:"Defender (clássico)",years:u(1993,2012)},{name:"Discovery SUV",years:u(1999,2026)},{name:"Discovery 3",years:u(2005,2009)},{name:"Discovery 4",years:u(2010,2016)},{name:"Discovery Sport SUV",years:u(2015,2026)},{name:"Range Rover Evoque SUV",years:u(2012,2026)},{name:"Range Rover Velar SUV",years:u(2018,2026)},{name:"Range Rover Sport SUV",years:u(2006,2026)},{name:"Range Rover SUV",years:u(2002,2026)},{name:"Freelander 2 SUV",years:u(2007,2015)},{name:"Freelander SUV",years:u(2002,2006)}]},{name:"Porsche",models:[{name:"Cayenne SUV",years:u(2003,2026)},{name:"Cayenne Coupé",years:u(2020,2026)},{name:"Cayenne Turbo",years:u(2003,2026)},{name:"Cayenne S",years:u(2003,2026)},{name:"Macan SUV",years:u(2015,2026)},{name:"Macan S",years:u(2015,2024)},{name:"Macan Turbo",years:u(2015,2024)},{name:"Macan Elétrico",years:u(2025,2026)},{name:"911 Carrera",years:u(1999,2026)},{name:"911 Carrera S",years:u(1999,2026)},{name:"911 Turbo",years:u(2001,2026)},{name:"911 Turbo S",years:u(2001,2026)},{name:"911 GT3",years:u(2007,2026)},{name:"911 GT3 RS",years:u(2007,2026)},{name:"911 Targa",years:u(2007,2026)},{name:"Panamera Sedan",years:u(2010,2026)},{name:"Panamera Turbo",years:u(2010,2026)},{name:"Taycan Elétrico",years:u(2021,2026)},{name:"Taycan Cross Turismo",years:u(2022,2026)},{name:"718 Boxster Roadster",years:u(2017,2026)},{name:"718 Cayman Coupé",years:u(2017,2026)},{name:"Boxster (986/987)",years:u(1997,2016)},{name:"Cayman (987)",years:u(2006,2016)}]},{name:"Caoa Chery",models:[{name:"Tiggo 2 SUV",years:u(2018,2024)},{name:"Tiggo 3X SUV",years:u(2020,2024)},{name:"Tiggo 4 SUV",years:u(2019,2023)},{name:"Tiggo 4 Pro SUV",years:u(2024,2026)},{name:"Tiggo 5X SUV",years:u(2019,2026)},{name:"Tiggo 5X Pro SUV",years:u(2023,2026)},{name:"Tiggo 7 SUV",years:u(2020,2026)},{name:"Tiggo 7 Pro SUV",years:u(2022,2026)},{name:"Tiggo 7 Pro Turbo",years:u(2022,2026)},{name:"Tiggo 7 PHEV Híbrido Plug-in",years:u(2025,2026)},{name:"Tiggo 8 SUV (7 lug.)",years:u(2021,2026)},{name:"Tiggo 8 Pro SUV",years:u(2022,2026)},{name:"Tiggo 8 PHEV Híbrido Plug-in",years:u(2025,2026)},{name:"Tiggo 5X PHEV Híbrido Plug-in",years:u(2025,2026)},{name:"Arrizo 6 Sedan",years:u(2020,2024)},{name:"Arrizo 6 Pro Sedan",years:u(2023,2026)},{name:"Arrizo 6 Pro Turbo",years:u(2023,2026)},{name:"iCar Elétrico",years:u(2024,2026)},{name:"Celer Sedan",years:u(2015,2018)},{name:"QQ Hatch",years:u(2012,2017)},{name:"Face Hatch",years:u(2010,2014)},{name:"S18 Sedan",years:u(2012,2015)},{name:"Cielo Sedan",years:u(2012,2015)}]},{name:"RAM",models:[{name:"Rampage Pick-up",years:u(2024,2026)},{name:"Rampage Rebel",years:u(2024,2026)},{name:"Rampage Laramie",years:u(2024,2026)},{name:"Rampage R/T",years:u(2024,2026)},{name:"Rampage Turbo Diesel",years:u(2024,2026)},{name:"1500 Pick-up",years:u(2012,2026)},{name:"1500 Rebel",years:u(2019,2026)},{name:"1500 Laramie",years:u(2019,2026)},{name:"2500 Pick-up",years:u(2012,2026)},{name:"2500 Laramie",years:u(2012,2026)},{name:"3500",years:u(2020,2026)},{name:"Classic",years:u(2020,2024)}]},{name:"GWM",models:[{name:"Haval H6 SUV",years:u(2022,2026)},{name:"Haval H6 GT SUV Coupé",years:u(2023,2026)},{name:"Haval H6 HEV Hybrid",years:u(2023,2026)},{name:"Haval H6 PHEV Híbrido",years:u(2024,2026)},{name:"Haval H6 Ultra",years:u(2025,2026)},{name:"Haval Jolion SUV",years:u(2024,2026)},{name:"Haval H9 SUV PHEV",years:u(2025,2026)},{name:"Ora 03 Elétrico",years:u(2023,2026)},{name:"Ora 03 GT Elétrico",years:u(2024,2026)},{name:"Ora 07 Elétrico",years:u(2024,2026)},{name:"Poer Pick-up",years:u(2024,2026)},{name:"Tank 300 SUV",years:u(2025,2026)},{name:"Tank 500 SUV PHEV",years:u(2025,2026)},{name:"Wey 03 SUV PHEV",years:u(2025,2026)},{name:"Wey 05 SUV PHEV",years:u(2025,2026)}]},{name:"BYD",models:[{name:"Dolphin Hatch Elétrico",years:u(2023,2026)},{name:"Dolphin Mini Elétrico",years:u(2024,2026)},{name:"Dolphin Plus Elétrico",years:u(2025,2026)},{name:"EX2 SUV Elétrico",years:u(2025,2026)},{name:"EX2 Pro SUV Elétrico",years:u(2025,2026)},{name:"Song Plus SUV Híbrido",years:u(2023,2026)},{name:"Song Plus Premium DM-i Híbrido",years:u(2024,2026)},{name:"Song Pro SUV",years:u(2024,2026)},{name:"Song Pro DM-i Híbrido",years:u(2025,2026)},{name:"Yuan Plus SUV Elétrico",years:u(2023,2026)},{name:"Yuan Pro SUV Elétrico",years:u(2025,2026)},{name:"Seal Sedan Elétrico",years:u(2024,2026)},{name:"Seal U SUV Elétrico",years:u(2025,2026)},{name:"Sealion 6 SUV Híbrido",years:u(2025,2026)},{name:"Sealion 7 SUV Elétrico",years:u(2025,2026)},{name:"Tan SUV",years:u(2023,2026)},{name:"King SUV",years:u(2024,2026)},{name:"King DM-i Híbrido",years:u(2024,2026)},{name:"Han Sedan Elétrico",years:u(2024,2026)},{name:"Shark Pick-up Híbrida",years:u(2025,2026)},{name:"Atto 3 SUV Elétrico",years:u(2023,2026)},{name:"Destroyer 05",years:u(2024,2026)}]},{name:"Subaru",models:[{name:"Forester SUV",years:u(2002,2026)},{name:"Forester XT Turbo",years:u(2005,2018)},{name:"XV / Crosstrek SUV",years:u(2012,2026)},{name:"Outback SW/SUV",years:u(2001,2026)},{name:"Impreza Sedan",years:u(2e3,2024)},{name:"Impreza Hatch",years:u(2007,2024)},{name:"Impreza WRX Turbo",years:u(2002,2014)},{name:"WRX Sedan Turbo",years:u(2008,2024)},{name:"WRX STI Turbo",years:u(2008,2020)},{name:"Legacy Sedan",years:u(2001,2020)},{name:"Legacy SW",years:u(2001,2009)},{name:"Legacy Turbo",years:u(2005,2015)},{name:"Tribeca SUV",years:u(2008,2014)},{name:"Solterra Elétrico SUV",years:u(2024,2026)},{name:"SVX",years:u(1994,1997)}]},{name:"Suzuki",models:[{name:"Jimny SUV",years:u(1993,2026)},{name:"Jimny Sierra SUV",years:u(2019,2026)},{name:"Vitara SUV",years:u(1993,2024)},{name:"Vitara Turbo",years:u(2018,2024)},{name:"Grand Vitara SUV",years:u(1999,2016)},{name:"S-Cross SUV",years:u(2016,2024)},{name:"Swift Hatch",years:u(2006,2019)},{name:"Swift Sport Hatch",years:u(2007,2019)},{name:"SX4 Hatch/SUV",years:u(2009,2015)},{name:"Baleno Sedan",years:u(1999,2005)},{name:"Samurai SUV",years:u(1993,1999)}]},{name:"MINI",models:[{name:"Cooper Hatch",years:u(2002,2026)},{name:"Cooper S Turbo",years:u(2002,2026)},{name:"Countryman SUV",years:u(2011,2026)},{name:"Countryman S Turbo",years:u(2011,2026)},{name:"Countryman SE Hybrid",years:u(2020,2026)},{name:"Clubman SW",years:u(2008,2024)},{name:"Cooper SE Elétrico",years:u(2022,2026)},{name:"Paceman SUV Coupé",years:u(2013,2016)},{name:"Cabrio Conversível",years:u(2005,2023)},{name:"John Cooper Works Turbo",years:u(2009,2026)}]},{name:"Lexus",models:[{name:"NX 250/350 SUV",years:u(2015,2026)},{name:"UX 250h SUV Hybrid",years:u(2019,2026)},{name:"RX 350/450h SUV",years:u(2005,2026)},{name:"ES 300h Sedan Hybrid",years:u(2013,2026)},{name:"IS 300 Sedan",years:u(2006,2023)},{name:"LX 600 SUV",years:u(2022,2026)},{name:"RZ 450e Elétrico",years:u(2024,2026)},{name:"CT 200h Hatch Hybrid",years:u(2012,2018)},{name:"GS 300/350 Sedan",years:u(2006,2020)},{name:"LS 460/500h Sedan",years:u(2007,2024)},{name:"LC 500 Coupé",years:u(2018,2024)},{name:"GX 460 SUV",years:u(2010,2024)}]},{name:"JAC",models:[{name:"T40 Plus SUV",years:u(2018,2024)},{name:"T50 SUV",years:u(2019,2024)},{name:"T60 SUV",years:u(2019,2024)},{name:"T80 SUV",years:u(2019,2024)},{name:"J3 Hatch",years:u(2012,2016)},{name:"J3 Turin Sedan",years:u(2012,2016)},{name:"J5 Sedan",years:u(2012,2016)},{name:"J6 SUV",years:u(2011,2015)},{name:"J6 Diamond",years:u(2013,2015)},{name:"J2 Hatch",years:u(2012,2017)},{name:"iEV40 Elétrico",years:u(2020,2024)},{name:"iEV60 Elétrico",years:u(2022,2024)},{name:"E-JS1 Elétrico",years:u(2023,2026)},{name:"Hunter Pick-up",years:u(2024,2026)}]},{name:"Dodge",models:[{name:"Journey SUV",years:u(2009,2020)},{name:"Durango SUV",years:u(2012,2020)},{name:"Charger Sedan",years:u(2012,2019)},{name:"Challenger Coupé",years:u(2012,2019)},{name:"Dakota Pick-up",years:u(1998,2012)},{name:"Ram 2500 Pick-up",years:u(2005,2011)},{name:"Ram 1500 Pick-up",years:u(2005,2011)},{name:"Viper Coupé",years:u(2003,2010)},{name:"Caliber Hatch",years:u(2007,2012)},{name:"Avenger Sedan",years:u(2008,2014)}]},{name:"Chrysler",models:[{name:"300C Sedan",years:u(2006,2019)},{name:"Town & Country Minivan",years:u(2005,2016)},{name:"PT Cruiser Hatch",years:u(2001,2010)},{name:"Neon Sedan",years:u(1997,2005)},{name:"Stratus Sedan",years:u(1997,2006)},{name:"Grand Caravan Minivan",years:u(2003,2012)}]},{name:"Lifan",models:[{name:"X60 SUV",years:u(2013,2021)},{name:"X80 SUV",years:u(2018,2020)},{name:"530 Sedan",years:u(2013,2019)},{name:"620 Sedan",years:u(2010,2015)},{name:"320 Hatch",years:u(2010,2013)}]},{name:"Changan",models:[{name:"CS35 Plus SUV",years:u(2022,2026)},{name:"CS55 Plus SUV",years:u(2022,2026)},{name:"CS75 Plus SUV",years:u(2023,2026)},{name:"Hunter Pick-up",years:u(2024,2026)},{name:"Alsvin Sedan",years:u(2024,2026)},{name:"Uni-T SUV",years:u(2024,2026)},{name:"Uni-V Hatch",years:u(2025,2026)}]},{name:"Neta",models:[{name:"X SUV Elétrico",years:u(2025,2026)},{name:"Aya Hatch Elétrico",years:u(2025,2026)}]},{name:"Omoda",models:[{name:"E5 SUV Elétrico",years:u(2025,2026)},{name:"C5 SUV",years:u(2025,2026)}]},{name:"Zeekr",models:[{name:"X SUV Elétrico",years:u(2025,2026)},{name:"001 Sedan Elétrico",years:u(2025,2026)}]},{name:"Troller",models:[{name:"T4 SUV",years:u(2001,2021)},{name:"Pantanal SUV",years:u(2007,2014)}]},{name:"Iveco",models:[{name:"Daily Furgão",years:u(2e3,2026)},{name:"Daily 35-150",years:u(2018,2026)},{name:"Daily 70C17",years:u(2016,2026)},{name:"Daily City",years:u(2022,2026)}]},{name:"Alfa Romeo",models:[{name:"Giulietta Hatch",years:u(2014,2019)},{name:"Stelvio SUV",years:u(2019,2024)},{name:"Giulia Sedan",years:u(2017,2024)},{name:"Mito Hatch",years:u(2010,2015)},{name:"159 Sedan",years:u(2007,2012)},{name:"156 Sedan",years:u(1999,2006)},{name:"147 Hatch",years:u(2003,2010)},{name:"166 Sedan",years:u(1999,2005)},{name:"Spider Conversível",years:u(1999,2006)},{name:"145 Hatch",years:u(1996,2001)},{name:"Brera Coupé",years:u(2007,2010)}]},{name:"Jaguar",models:[{name:"F-Pace SUV",years:u(2017,2026)},{name:"E-Pace SUV",years:u(2018,2024)},{name:"I-Pace SUV Elétrico",years:u(2019,2024)},{name:"XE Sedan",years:u(2016,2024)},{name:"XF Sedan",years:u(2009,2024)},{name:"XJ Sedan",years:u(2004,2019)},{name:"F-Type Coupé/Conversível",years:u(2014,2024)},{name:"X-Type Sedan",years:u(2002,2009)},{name:"S-Type Sedan",years:u(1999,2007)}]},{name:"Maserati",models:[{name:"Grecale SUV",years:u(2023,2026)},{name:"Levante SUV",years:u(2017,2024)},{name:"Ghibli Sedan",years:u(2014,2024)},{name:"Quattroporte Sedan",years:u(2005,2024)},{name:"GranTurismo Coupé",years:u(2008,2026)},{name:"GranCabrio Conversível",years:u(2010,2020)},{name:"MC20 Coupé",years:u(2023,2026)}]},{name:"Ferrari",models:[{name:"Portofino Conversível",years:u(2018,2024)},{name:"Roma Coupé",years:u(2021,2026)},{name:"296 GTB Coupé",years:u(2022,2026)},{name:"SF90 Stradale",years:u(2021,2026)},{name:"812 GTS",years:u(2020,2024)},{name:"F8 Tributo Coupé",years:u(2020,2024)},{name:"488 GTB",years:u(2016,2020)},{name:"California T",years:u(2014,2018)},{name:"458 Italia",years:u(2011,2015)},{name:"Purosangue SUV",years:u(2024,2026)}]},{name:"Lamborghini",models:[{name:"Urus SUV",years:u(2019,2026)},{name:"Urus S",years:u(2023,2026)},{name:"Huracán Coupé",years:u(2015,2024)},{name:"Revuelto Coupé",years:u(2024,2026)},{name:"Aventador Coupé",years:u(2012,2023)},{name:"Gallardo",years:u(2004,2014)},{name:"Temerario",years:u(2025,2026)}]},{name:"Bentley",models:[{name:"Bentayga SUV",years:u(2017,2026)},{name:"Continental GT Coupé",years:u(2005,2026)},{name:"Flying Spur Sedan",years:u(2006,2026)}]},{name:"Rolls-Royce",models:[{name:"Ghost Sedan",years:u(2011,2026)},{name:"Wraith Coupé",years:u(2014,2023)},{name:"Cullinan SUV",years:u(2019,2026)},{name:"Phantom Sedan",years:u(2004,2026)},{name:"Spectre Elétrico Coupé",years:u(2024,2026)}]},{name:"McLaren",models:[{name:"720S Coupé",years:u(2018,2024)},{name:"Artura Coupé Hybrid",years:u(2023,2026)},{name:"GT Coupé",years:u(2020,2024)},{name:"570S Coupé",years:u(2016,2021)},{name:"650S Coupé",years:u(2015,2017)},{name:"750S Coupé",years:u(2024,2026)}]},{name:"Aston Martin",models:[{name:"DB11 Coupé",years:u(2017,2024)},{name:"DB12 Coupé",years:u(2024,2026)},{name:"DBX SUV",years:u(2021,2026)},{name:"Vantage Coupé",years:u(2006,2026)},{name:"DBS Superleggera",years:u(2019,2024)}]},{name:"Infiniti",models:[{name:"FX35/FX37 SUV",years:u(2008,2017)},{name:"QX50 SUV",years:u(2016,2020)},{name:"QX60 SUV",years:u(2013,2020)},{name:"QX70 SUV",years:u(2014,2018)},{name:"QX80 SUV",years:u(2014,2020)},{name:"Q50 Sedan",years:u(2014,2020)},{name:"G37 Sedan",years:u(2009,2013)},{name:"G25 Sedan",years:u(2012,2013)},{name:"EX35 SUV",years:u(2009,2013)}]},{name:"Lincoln",models:[{name:"Town Car Sedan",years:u(2003,2011)},{name:"MKC SUV",years:u(2015,2019)},{name:"MKX SUV",years:u(2007,2018)},{name:"MKZ Sedan",years:u(2014,2020)},{name:"Navigator SUV",years:u(2007,2020)}]},{name:"Cadillac",models:[{name:"CTS Sedan",years:u(2005,2019)},{name:"ATS Sedan",years:u(2014,2019)},{name:"SRX SUV",years:u(2007,2016)},{name:"XT5 SUV",years:u(2017,2020)},{name:"Escalade SUV",years:u(2007,2020)},{name:"XTS Sedan",years:u(2013,2019)}]},{name:"Acura",models:[{name:"MDX SUV",years:u(2003,2016)},{name:"RDX SUV",years:u(2007,2016)},{name:"TL Sedan",years:u(2004,2014)},{name:"TSX Sedan",years:u(2006,2014)},{name:"Integra Coupé",years:u(1994,2001)},{name:"Legend Sedan",years:u(1994,1998)}]},{name:"Smart",models:[{name:"ForTwo Hatch",years:u(2009,2019)},{name:"ForFour Hatch",years:u(2015,2019)},{name:"#1 SUV Elétrico",years:u(2024,2026)},{name:"#3 SUV Coupé Elétrico",years:u(2025,2026)}]},{name:"Seat",models:[{name:"Ibiza Hatch",years:u(1997,2009)},{name:"Cordoba Sedan",years:u(1997,2009)},{name:"Leon Hatch",years:u(2001,2009)},{name:"Toledo Sedan",years:u(2e3,2006)},{name:"Alhambra Minivan",years:u(2002,2005)}]},{name:"Ssangyong",models:[{name:"Tivoli SUV",years:u(2018,2022)},{name:"Korando SUV",years:u(2005,2022)},{name:"Rexton SUV",years:u(2004,2022)},{name:"Actyon SUV",years:u(2007,2018)},{name:"Actyon Sports Pick-up",years:u(2007,2018)},{name:"Kyron SUV",years:u(2007,2015)},{name:"Musso SUV",years:u(1999,2006)}]},{name:"Effa",models:[{name:"M100 Hatch",years:u(2009,2016)},{name:"Towner Van",years:u(2009,2014)},{name:"Start Hatch",years:u(2013,2016)},{name:"Cargo Furgão",years:u(2010,2016)}]},{name:"Hafei",models:[{name:"Towner Van",years:u(2006,2011)},{name:"Lobo Hatch",years:u(2008,2011)},{name:"Ruiyi",years:u(2008,2010)},{name:"Zhongyi",years:u(2007,2010)}]},{name:"Geely",models:[{name:"EC7 Sedan",years:u(2012,2016)},{name:"GC2 Hatch",years:u(2014,2016)}]},{name:"Rely",models:[{name:"Van",years:u(2013,2016)},{name:"Pick-up",years:u(2013,2016)}]},{name:"Shineray",models:[{name:"T20 Pick-up",years:u(2015,2021)},{name:"T22 Pick-up",years:u(2016,2020)},{name:"T22S Pick-up",years:u(2018,2020)},{name:"T30/T32 Pick-up",years:u(2019,2021)},{name:"A9 Hatch",years:u(2013,2016)}]},{name:"Mahindra",models:[{name:"Scorpio SUV",years:u(2008,2015)},{name:"SUV",years:u(2009,2014)},{name:"Pick-up",years:u(2007,2014)}]},{name:"Tata",models:[{name:"Xenon Pick-up",years:u(2012,2016)},{name:"Vista Hatch",years:u(2010,2014)},{name:"Aria SUV",years:u(2011,2013)}]},{name:"Foton",models:[{name:"Tunland Pick-up",years:u(2013,2020)},{name:"Toano Van",years:u(2016,2020)},{name:"Gratour Van",years:u(2018,2020)}]},{name:"Jinbei",models:[{name:"Topic Van",years:u(2012,2018)},{name:"SY Van",years:u(2011,2015)}]},{name:"BAIC",models:[{name:"X55 SUV",years:u(2019,2022)},{name:"X35 SUV",years:u(2019,2021)}]},{name:"Soueast",models:[{name:"DX3 SUV",years:u(2019,2021)},{name:"DX7 SUV",years:u(2019,2021)}]},{name:"Puma (brasileira)",models:[{name:"GT Coupé",years:u(1968,1985)},{name:"GTE Coupé",years:u(1970,1985)},{name:"GTB Coupé",years:u(1974,1985)},{name:"AM1 SUV",years:u(1981,1987)},{name:"AM2 SUV",years:u(1981,1987)},{name:"AM4 SUV",years:u(1981,1987)}]},{name:"Gurgel",models:[{name:"X-12 SUV",years:u(1979,1995)},{name:"BR-800 Hatch",years:u(1989,1991)},{name:"Carajás SUV",years:u(1984,1995)},{name:"Tocantins SUV",years:u(1990,1993)},{name:"Supermini Hatch",years:u(1993,1995)}]},{name:"Lobini",models:[{name:"H1 Roadster",years:u(2003,2010)}]},{name:"Lada",models:[{name:"Niva SUV",years:u(1990,1997)},{name:"Laika Sedan",years:u(1990,1997)},{name:"Samara Hatch",years:u(1993,1997)}]},{name:"Daihatsu",models:[{name:"Terios SUV",years:u(1998,2006)},{name:"Cuore Hatch",years:u(1996,2001)},{name:"Charade Hatch",years:u(1992,2e3)},{name:"Feroza SUV",years:u(1993,1999)}]},{name:"Asia Motors",models:[{name:"Towner Van",years:u(1993,1997)},{name:"Topic Van",years:u(1993,1998)},{name:"Rocsta SUV",years:u(1993,1997)}]},{name:"Daewoo",models:[{name:"Lanos Hatch",years:u(1999,2002)},{name:"Nubira Sedan",years:u(1998,2003)},{name:"Leganza Sedan",years:u(1998,2002)},{name:"Espero Sedan",years:u(1994,1998)},{name:"Tico Hatch",years:u(1994,1998)},{name:"Super Salon Sedan",years:u(1994,1997)}]},{name:"Isuzu",models:[{name:"Trooper SUV",years:u(1993,2002)},{name:"Rodeo SUV",years:u(1995,2002)},{name:"Amigo SUV",years:u(1998,2e3)}]},{name:"Mazda",models:[{name:"CX-5 SUV",years:u(2014,2020)},{name:"CX-3 SUV",years:u(2016,2020)},{name:"CX-30 SUV",years:u(2020,2022)},{name:"Mazda3 Hatch/Sedan",years:u(2010,2022)},{name:"Mazda6 Sedan",years:u(2006,2018)},{name:"MX-5 Miata Roadster",years:u(2007,2020)},{name:"626 Sedan",years:u(1993,2002)},{name:"323 Hatch",years:u(1993,1998)},{name:"Protegé Sedan",years:u(1999,2003)},{name:"B2500/B2600 Pick-up",years:u(1995,2006)},{name:"MPV Minivan",years:u(2002,2008)}]},{name:"Tesla",models:[{name:"Model 3 Sedan Elétrico",years:u(2019,2026)},{name:"Model Y SUV Elétrico",years:u(2021,2026)},{name:"Model S Sedan Elétrico",years:u(2015,2024)},{name:"Model X SUV Elétrico",years:u(2017,2024)},{name:"Cybertruck Elétrico",years:u(2025,2026)}]},{name:"Rivian",models:[{name:"R1T Pick-up Elétrico",years:u(2024,2026)},{name:"R1S SUV Elétrico",years:u(2024,2026)}]},{name:"Polestar",models:[{name:"2 Sedan Elétrico",years:u(2022,2026)},{name:"3 SUV Elétrico",years:u(2025,2026)}]},{name:"Genesis",models:[{name:"G70 Sedan",years:u(2022,2026)},{name:"G80 Sedan",years:u(2022,2026)},{name:"GV60 SUV Elétrico",years:u(2023,2026)},{name:"GV70 SUV",years:u(2022,2026)},{name:"GV80 SUV",years:u(2022,2026)}]},{name:"Cupra",models:[{name:"Formentor SUV",years:u(2024,2026)},{name:"Born Hatch Elétrico",years:u(2025,2026)}]},{name:"Maxus",models:[{name:"eDeliver 3 Van Elétrico",years:u(2025,2026)},{name:"T60 Pick-up",years:u(2020,2022)},{name:"T90 EV Pick-up Elétrico",years:u(2025,2026)}]},{name:"MG",models:[{name:"ZS EV SUV Elétrico",years:u(2023,2026)},{name:"MG4 Hatch Elétrico",years:u(2024,2026)},{name:"HS SUV",years:u(2024,2026)}]},{name:"Leapmotor",models:[{name:"C10 SUV Elétrico",years:u(2025,2026)},{name:"T03 Hatch Elétrico",years:u(2025,2026)}]},{name:"XPeng",models:[{name:"G6 SUV Elétrico",years:u(2025,2026)}]},{name:"Li Auto",models:[{name:"L7 SUV Híbrido",years:u(2025,2026)},{name:"L9 SUV Híbrido",years:u(2025,2026)}]},{name:"NIO",models:[{name:"ET5 Sedan Elétrico",years:u(2025,2026)},{name:"ES6 SUV Elétrico",years:u(2025,2026)}]},{name:"Jaecoo",models:[{name:"J7 SUV",years:u(2025,2026)},{name:"J7 PHEV Híbrido Plug-in",years:u(2025,2026)},{name:"J5 SUV",years:u(2026,2026)},{name:"J8 SUV PHEV",years:u(2026,2026)}]},{name:"GAC",models:[{name:"Aion Y SUV Elétrico",years:u(2025,2026)},{name:"Aion ES Sedan Elétrico",years:u(2025,2026)},{name:"Aion V SUV Elétrico",years:u(2026,2026)},{name:"Emkoo SUV",years:u(2026,2026)}]},{name:"Forthing",models:[{name:"U-Tour SUV",years:u(2025,2026)},{name:"T5 EVO SUV",years:u(2025,2026)}]},{name:"Avatr",models:[{name:"11 SUV Elétrico",years:u(2026,2026)},{name:"12 Sedan Elétrico",years:u(2026,2026)}]},{name:"Dongfeng",models:[{name:"Box Hatch Elétrico",years:u(2025,2026)},{name:"Voyah Free SUV PHEV",years:u(2025,2026)},{name:"Voyah Dream Minivan PHEV",years:u(2025,2026)}]},{name:"Chery",models:[{name:"Tiggo 7 Pro Max Drive PHEV",years:u(2025,2026)},{name:"Tiggo 8 Pro Max Drive PHEV",years:u(2025,2026)},{name:"Arrizo 8 PHEV",years:u(2026,2026)}]}].sort((e,t)=>e.name.localeCompare(t.name)),Ox=["Fiat","Volkswagen","Chevrolet","Hyundai","Toyota","Honda","Jeep","Renault","Nissan","Ford","Caoa Chery","BYD","GWM","Kia","Mitsubishi","Peugeot","Citroën","RAM","BMW","Mercedes-Benz","Audi","Volvo","Land Rover","Porsche","Subaru","Suzuki","MINI","Lexus","JAC","Dodge","Chrysler","Troller","Changan","Lifan","Neta","Omoda","Zeekr","Iveco","Alfa Romeo","Jaguar","Maserati","Ferrari","Lamborghini","Bentley","Rolls-Royce","McLaren","Aston Martin","Infiniti"],wO={Fiat:["Argo","Mobi","Strada","Pulse","Fastback","Cronos","Toro","Uno","Palio","Siena","Uno Mille","Punto","Marea","Fiorino","Titano"],Volkswagen:["Polo","T-Cross","Virtus","Nivus","Gol G7","Gol G6","Gol G5 / Trend","Gol G4","Gol G3","Gol G2 Bola","Gol G1 Quadrado","Saveiro G7","Saveiro G6","Fox","Voyage","Taos","Tiguan","Jetta","Golf","Santana","Fusca","Kombi","Passat"],Chevrolet:["Onix Hatch","Onix Plus Sedan","Tracker","S10 Cabine Dupla","S10 High Country","S10 LTZ","S10 LT","S10 Cabine Simples","Cruze Sedan","Montana (nova)","Spin","Equinox","Celta","Prisma","Corsa Hatch","Corsa Sedan","Classic / Corsa Classic","Cobalt","Astra Sedan","Vectra Sedan","Opala","Chevette","Monza","Kadett"],Hyundai:["HB20 Hatch","HB20S Sedan","HB20X Crossover","Creta SUV","HB20 Vision","HB20 Evolution","HB20 Platinum","HB20 Comfort","HB20 Turbo","Tucson","ix35","Santa Fe"],Toyota:["Corolla Sedan","Corolla Cross","Hilux Cabine Dupla","SW4","Yaris Hatch","Yaris Sedan","Etios Hatch","Etios Sedan","RAV4","Camry"],Honda:["Civic Sedan","HR-V","City Sedan","CR-V","Fit","WR-V","ZR-V","Accord"],Jeep:["Renegade","Compass","Commander"],Renault:["Kwid","Sandero","Logan","Duster","Captur","Oroch"],Nissan:["Kicks","Versa","March","Sentra","Frontier"],Ford:["Ka Hatch","Ka Sedan / Ka+","EcoSport","Ranger","Territory","Fiesta Hatch","Focus Hatch","Escort","Del Rey","Maverick"]},Mx=[...Ag].sort((e,t)=>{const n=Ox.indexOf(e.name),r=Ox.indexOf(t.name);return(n===-1?999:n)-(r===-1?999:r)}),SO=e=>{const t=wO[e.name];return t?[...e.models].sort((n,r)=>{const s=t.indexOf(n.name),a=t.indexOf(r.name);return(s===-1?999:s)-(a===-1?999:a)}):e.models},kO=()=>{const[e]=b.useState(()=>Math.floor(Math.random()*6)+2);return e},ek={"Gol G1 Quadrado":["gol quadrado","golzinho","gol quadradinho"],"Gol G1 GTS":["gol gts"],"Gol G1 GTi":["gol gti"],"Gol G2 Bola":["gol bola","gol bolinha"],"Gol G3":["gol g3","gol 3"],"Gol G4":["gol g4","gol 4"],"Gol G5 / Trend":["gol g5","gol trend","gol 5"],"Gol G6":["gol g6","gol 6"],"Gol G7":["gol g7","gol 7"],"Parati Quadrada":["parati quadrada","parati quadrado"],"Parati G2 Bola":["parati bola"],"Saveiro Quadrada":["saveiro quadrada","saveiro quadrado"],"Saveiro G2 Bola":["saveiro bola"],"Voyage Quadrado":["voyage quadrado"],Fusca:["fusca","fuscao","beetle"],Brasília:["brasilia"],Variant:["variant","variante"],Kombi:["kombi","vw kombi","perua kombi"],SP2:["sp2"],"Corsa Sedan":["corsinha sedan"],"Corsa Hatch":["corsinha hatch","corsinha"],"Classic / Corsa Classic":["corsa classic","classic"],Celta:["celtinha"],Prisma:["prisminha"],Chevette:["chevette","chevetinho"],Opala:["opala","opalao"],"Opala Coupe":["opala coupe"],"Opala Diplomata":["opala diplomata","diplomata"],"Opala Caravan":["caravan","caravana"],"Chevrolet 400":["chevrolet 400"],Monza:["monza","monzinha"],Kadett:["kadett","kadettinho"],"Kadett GSi":["kadett gsi"],Uno:["uno","uninho","uno mille"],"Uno Mille":["mille","uno mille"],"Uno Turbo":["uno turbo"],"Uno Way":["uno way"],Fiorino:["fiorino","fiorino furgao"],147:["147","fiat 147"],Palio:["palio","palinho"],"Palio Fire":["palio fire"],"Palio Weekend":["palio weekend"],Siena:["siena","sieninha"],Strada:["strada","stradinha"],Marea:["marea"],"Marea Turbo":["marea turbo"],Tipo:["tipo","fiat tipo"],Tempra:["tempra","fiat tempra"],"Tempra Turbo":["tempra turbo"],Elba:["elba","fiat elba"],Premio:["premio","fiat premio"],Gol:["gol"],Voyage:["voyage"],Parati:["parati"],Saveiro:["saveiro"],Fox:["fox","foxzinho"],SpaceFox:["spacefox","space fox"],CrossFox:["crossfox","cross fox"],Polo:["polo"],Virtus:["virtus"],"T-Cross":["tcross","t cross"],Nivus:["nivus"],Taos:["taos"],Tiguan:["tiguan"],Jetta:["jetta"],Golf:["golf","golfinho"],"Golf GTI":["golf gti"],Passat:["passat"],Santana:["santana","santanao"],"Santana Quantum":["quantum"],Logus:["logus"],Pointer:["pointer"],Escort:["escort","escortzinho"],"Escort XR3":["xr3","escort xr3"],Verona:["verona"],"Del Rey":["del rey","delrey"],Pampa:["pampa"],Corcel:["corcel"],"Corcel II":["corcel 2","corcel ii"],Maverick:["maverick ford"],Belina:["belina"],"Ka Hatch":["ka","ford ka"],"Ka Sedan / Ka+":["ka+","ka plus","ka sedan"],EcoSport:["ecosport"],"Fiesta Hatch":["fiesta","fiestinha"],"Fiesta Sedan":["fiesta sedan"],"Focus Hatch":["focus"],"Focus Sedan":["focus sedan"],Ranger:["ranger"],"Civic Sedan":["civic"],"Civic Turbo":["civic turbo"],"City Sedan":["city","honda city"],Fit:["fit","honda fit"],"HR-V":["hrv","hr-v"],"CR-V":["crv","cr-v"],"WR-V":["wrv","wr-v"],"ZR-V":["zrv","zr-v"],Accord:["accord"],"Corolla Sedan":["corolla"],"Corolla Cross":["corolla cross"],"Yaris Hatch":["yaris"],"Yaris Sedan":["yaris sedan"],"Etios Hatch":["etios"],"Etios Sedan":["etios sedan"],"Hilux Cabine Dupla":["hilux"],SW4:["sw4"],RAV4:["rav4"],Camry:["camry"],"HB20 Hatch":["hb20","hb 20","hb20 hatch"],"HB20 Comfort":["hb20 comfort","hb20"],"HB20 Comfort Plus":["hb20 comfort plus","hb20"],"HB20 Premium":["hb20 premium","hb20"],"HB20 Vision":["hb20 vision","hb20"],"HB20 Evolution":["hb20 evolution","hb20"],"HB20 Platinum":["hb20 platinum","hb20"],"HB20 Sport":["hb20 sport","hb20"],"HB20 Turbo":["hb20 turbo","hb20"],"HB20S Sedan":["hb20s","hb20 sedan","hb 20 sedan"],"HB20S Comfort Plus":["hb20s comfort","hb20 sedan"],"HB20S Vision":["hb20s vision","hb20 sedan"],"HB20S Evolution":["hb20s evolution","hb20 sedan"],"HB20S Platinum":["hb20s platinum","hb20 sedan"],"HB20X Crossover":["hb20x","hb 20x","hb20 x","hb20x crossover"],"HB20 Adventure":["hb20 adventure"],"HB20 Unique":["hb20 unique"],"Creta SUV":["creta","hyundai creta"],"Creta Attitude":["creta attitude"],Tucson:["tucson"],ix35:["ix35"],"Santa Fe":["santa fe"],Kicks:["kicks"],March:["march"],Versa:["versa"],Sentra:["sentra"],Frontier:["frontier"],Kwid:["kwid"],Sandero:["sandero"],Logan:["logan"],Duster:["duster"],Captur:["captur"],Oroch:["oroch"],C3:["c3","citroen c3"],"C4 Cactus":["cactus","c4 cactus"],Aircross:["aircross"],Renegade:["renegade"],Compass:["compass"],Commander:["commander"],Toro:["toro"],Argo:["argo"],Cronos:["cronos"],Mobi:["mobi"],Fastback:["fastback"],Pulse:["pulse"],Titano:["titano"],"Onix Hatch":["onix"],"Onix Plus Sedan":["onix sedan","onix plus"],Tracker:["tracker"],"S10 Cabine Dupla":["s10","s 10","s10 cd","s10 cabine dupla"],"S10 Cabine Simples":["s10 cs","s10 cabine simples","s10"],"S10 High Country":["s10 high country","s10 hc","s10"],"S10 LTZ":["s10 ltz","s10"],"S10 LT":["s10 lt","s10"],"S10 Advantage":["s10 advantage","s10"],"S10 Executive":["s10 executive","s10"],"S10 Colina":["s10 colina","s10"],"S10 Rodeio":["s10 rodeio","s10"],"S10 Blazer":["s10 blazer","blazer"],"Cruze Sedan":["cruze"],Equinox:["equinox"],"Montana (nova)":["montana nova"],"Montana (antiga)":["montana antiga"],Trailblazer:["trailblazer"],"Prisma Joy":["prisma joy"],Cobalt:["cobalt"],"Astra Sedan":["astra"],"Vectra Sedan":["vectra"],Omega:["omega"],Blazer:["blazer"],Zafira:["zafira"],Meriva:["meriva"],Captiva:["captiva"],Agile:["agile"],Spin:["spin"],Malibu:["malibu"]},Rg=e=>e.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,""),CO=Ag.flatMap(e=>e.models.flatMap(t=>{const r=(ek[t.name]||[]).join(" ");return t.years.map(s=>({brand:e.name,model:t.name,year:s,label:`${e.name} ${t.name} ${s}`,searchKey:Rg(`${e.name} ${t.name} ${s} ${r}`)}))})),jO=Ag.flatMap(e=>e.models.map(t=>{const n=ek[t.name]||[];return{brand:e.name,model:t.name,years:t.years,searchText:Rg(`${e.name} ${t.name} ${n.join(" ")}`)}})),EO=new Bs(jO,{keys:["searchText"],threshold:.38,ignoreLocation:!0,minMatchCharLength:2,includeScore:!0}),NO=({onVehicleChange:e})=>{const[t,n]=b.useState(""),[r,s]=b.useState(""),[a,o]=b.useState(""),[l,c]=b.useState(!1),d=kO(),[h,f]=b.useState(null),p=b.useRef(null),[m,y]=b.useState(!1),[g,S]=b.useState(""),w=b.useRef(null),v=b.useRef(null),x=Mx.find(_=>_.name===t),k=x?SO(x):[],j=k.find(_=>_.name===r);b.useEffect(()=>{s(""),o(""),c(!1),f(null)},[t]),b.useEffect(()=>{o(""),c(!1),f(null)},[r]),b.useEffect(()=>{c(!1),f(null)},[a]),b.useEffect(()=>{if(a&&r&&t){f("loading");const _=setTimeout(()=>{f("done"),c(!0),e(`${t} ${r} ${a}`)},1400);return()=>clearTimeout(_)}},[a,r,t,e]),b.useEffect(()=>{const _=R=>{v.current&&!v.current.contains(R.target)&&y(!1)};return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[]);const C=b.useMemo(()=>{if(!g||g.length<2)return[];const _=Rg(g),R=_.split(/\s+/).filter(Boolean),I=CO.filter(z=>R.every(D=>z.searchKey.includes(D)));return I.length>0?I.slice(0,30):EO.search(_).slice(0,8).flatMap(({item:z})=>z.years.map(D=>({brand:z.brand,model:z.model,year:D,label:`${z.brand} ${z.model} ${D}`,searchKey:""}))).slice(0,30)},[g]),T=b.useRef(new Set);b.useEffect(()=>{const _=g.trim();if(_.length<2||C.length>0)return;const R=_.toLowerCase();if(T.current.has(R))return;const I=setTimeout(()=>{T.current.has(R)||(T.current.add(R),tt.from("vehicle_search_misses").insert({query:_,user_agent:typeof navigator<"u"?navigator.userAgent:null}).then(({error:A})=>{A&&T.current.delete(R)}))},1200);return()=>clearTimeout(I)},[g,C.length]);const P=_=>{n(_.brand),s(_.model),o(_.year.toString()),S(""),y(!1)};return i.jsxs("div",{className:"space-y-3","data-vehicle-selector":!0,children:[i.jsxs("p",{className:"text-sm font-semibold text-foreground flex items-center gap-2 uppercase tracking-wide",children:[i.jsx(E_,{className:"w-4 h-4"}),"Selecione seu veículo"]}),i.jsxs("div",{className:"relative",children:[i.jsxs("select",{value:t,onChange:_=>n(_.target.value),className:"w-full border border-border rounded-md px-4 py-2.5 text-sm bg-background text-foreground appearance-none cursor-pointer focus:ring-1 focus:ring-foreground focus:border-foreground transition-colors",children:[i.jsx("option",{value:"",children:"Marca do veículo"}),Mx.map(_=>i.jsx("option",{value:_.name,children:_.name},_.name))]}),i.jsx(Ur,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground pointer-events-none"})]}),t&&i.jsxs("div",{className:"relative animate-in fade-in slide-in-from-top-2 duration-200",children:[i.jsxs("select",{value:r,onChange:_=>s(_.target.value),className:"w-full border border-border rounded-md px-4 py-2.5 text-sm bg-background text-foreground appearance-none cursor-pointer focus:ring-1 focus:ring-foreground focus:border-foreground transition-colors",children:[i.jsx("option",{value:"",children:"Modelo"}),k.map(_=>i.jsx("option",{value:_.name,children:_.name},_.name))]}),i.jsx(Ur,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground pointer-events-none"})]}),r&&i.jsxs("div",{className:"relative animate-in fade-in slide-in-from-top-2 duration-200",children:[i.jsxs("select",{value:a,onChange:_=>o(_.target.value),className:"w-full border border-border rounded-md px-4 py-2.5 text-sm bg-background text-foreground appearance-none cursor-pointer focus:ring-1 focus:ring-foreground focus:border-foreground transition-colors",children:[i.jsx("option",{value:"",children:"Ano"}),j==null?void 0:j.years.map(_=>i.jsx("option",{value:_.toString(),children:_},_))]}),i.jsx(Ur,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground pointer-events-none"})]}),h==="loading"&&i.jsxs("div",{className:"rounded-lg border border-border p-4 animate-in fade-in duration-200",children:[i.jsx("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-2",children:"Verificando disponibilidade..."}),i.jsx("div",{className:"w-full h-1.5 bg-secondary rounded-full overflow-hidden",children:i.jsx("div",{ref:p,className:"h-full bg-foreground rounded-full",style:{animation:"loadBar 1.2s ease-in-out forwards"}})}),i.jsx("style",{children:"@keyframes loadBar { 0% { width: 0% } 60% { width: 75% } 100% { width: 100% } }"})]}),l&&h==="done"&&i.jsx("div",{className:"rounded-lg border-2 border-foreground bg-foreground text-background p-4 animate-in fade-in zoom-in-95 duration-300",children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx("div",{className:"flex-shrink-0 w-10 h-10 rounded-full bg-background/10 flex items-center justify-center",children:i.jsx(jr,{className:"w-5 h-5 text-background"})}),i.jsxs("div",{className:"flex-1",children:[i.jsx("p",{className:"font-bold text-sm tracking-wide",children:"DISPONÍVEL PARA SEU VEÍCULO ✓"}),i.jsxs("p",{className:"text-sm mt-1 text-background/80",children:["Tapete sob medida para"," ",i.jsxs("strong",{className:"text-background font-extrabold",children:[t," ",r," ",a]})]}),i.jsxs("div",{className:"flex items-center gap-3 mt-2 text-xs text-background/60",children:[i.jsx("span",{children:"✓ Encaixe perfeito"}),i.jsx("span",{children:"✓ Fixação original"}),i.jsx("span",{children:"✓ Garantia 1 ano"})]}),i.jsxs("p",{className:"text-xs mt-2 text-background font-semibold animate-pulse",children:["⚠️ Apenas ",d," peças disponíveis"]})]})]})}),!l&&i.jsxs("div",{className:"pt-2 border-t border-border",ref:v,children:[i.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Não encontrou seu veículo? Busque aqui:"}),i.jsxs("div",{className:"relative",children:[i.jsxs("div",{className:"flex items-center gap-2 border border-border rounded-md px-3 py-2 bg-background focus-within:ring-1 focus-within:ring-foreground focus-within:border-foreground transition-colors",children:[i.jsx(Ai,{className:"w-4 h-4 text-muted-foreground shrink-0"}),i.jsx("input",{ref:w,type:"text",value:g,onChange:_=>{S(_.target.value),y(!0)},onFocus:()=>y(!0),placeholder:"Ex: Civic 2020, Gol G5, Corolla...",className:"flex-1 bg-transparent outline-none text-sm placeholder:text-muted-foreground"}),g&&i.jsx(Sr,{className:"w-4 h-4 text-muted-foreground cursor-pointer shrink-0",onClick:()=>{S(""),y(!1)}})]}),m&&g.length>=2&&i.jsx("div",{className:"absolute z-50 w-full mt-1 bg-background border border-border rounded-md shadow-lg max-h-52 overflow-y-auto",children:C.length===0?i.jsx("div",{className:"px-4 py-3 text-sm text-muted-foreground text-center",children:"Nenhum veículo encontrado"}):C.map((_,R)=>i.jsxs("button",{type:"button",onClick:()=>P(_),className:"w-full text-left px-4 py-2.5 text-sm hover:bg-secondary transition-colors",children:[i.jsx("span",{className:"font-medium",children:_.brand})," ",i.jsx("span",{children:_.model})," ",i.jsx("span",{className:"text-muted-foreground",children:_.year})]},`${_.brand}-${_.model}-${_.year}-${R}`))})]})]})]})};var Oh="focusScope.autoFocusOnMount",Mh="focusScope.autoFocusOnUnmount",Lx={bubbles:!1,cancelable:!0},_O="FocusScope",tk=b.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...o}=e,[l,c]=b.useState(null),d=vr(s),h=vr(a),f=b.useRef(null),p=mt(t,g=>c(g)),m=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(r){let g=function(x){if(m.paused||!l)return;const k=x.target;l.contains(k)?f.current=k:rs(f.current,{select:!0})},S=function(x){if(m.paused||!l)return;const k=x.relatedTarget;k!==null&&(l.contains(k)||rs(f.current,{select:!0}))},w=function(x){if(document.activeElement===document.body)for(const j of x)j.removedNodes.length>0&&rs(l)};document.addEventListener("focusin",g),document.addEventListener("focusout",S);const v=new MutationObserver(w);return l&&v.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",S),v.disconnect()}}},[r,l,m.paused]),b.useEffect(()=>{if(l){Fx.add(m);const g=document.activeElement;if(!l.contains(g)){const w=new CustomEvent(Oh,Lx);l.addEventListener(Oh,d),l.dispatchEvent(w),w.defaultPrevented||(TO(OO(nk(l)),{select:!0}),document.activeElement===g&&rs(l))}return()=>{l.removeEventListener(Oh,d),setTimeout(()=>{const w=new CustomEvent(Mh,Lx);l.addEventListener(Mh,h),l.dispatchEvent(w),w.defaultPrevented||rs(g??document.body,{select:!0}),l.removeEventListener(Mh,h),Fx.remove(m)},0)}}},[l,d,h,m]);const y=b.useCallback(g=>{if(!n&&!r||m.paused)return;const S=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,w=document.activeElement;if(S&&w){const v=g.currentTarget,[x,k]=PO(v);x&&k?!g.shiftKey&&w===k?(g.preventDefault(),n&&rs(x,{select:!0})):g.shiftKey&&w===x&&(g.preventDefault(),n&&rs(k,{select:!0})):w===v&&g.preventDefault()}},[n,r,m.paused]);return i.jsx(_e.div,{tabIndex:-1,...o,ref:p,onKeyDown:y})});tk.displayName=_O;function TO(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(rs(r,{select:t}),document.activeElement!==n)return}function PO(e){const t=nk(e),n=Dx(t,e),r=Dx(t.reverse(),e);return[n,r]}function nk(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Dx(e,t){for(const n of e)if(!AO(n,{upTo:t}))return n}function AO(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 RO(e){return e instanceof HTMLInputElement&&"select"in e}function rs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&RO(e)&&t&&e.select()}}var Fx=IO();function IO(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=$x(e,t),e.unshift(t)},remove(t){var n;e=$x(e,t),(n=e[0])==null||n.resume()}}}function $x(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function OO(e){return e.filter(t=>t.tagName!=="A")}var Lh=0;function MO(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Bx()),document.body.insertAdjacentElement("beforeend",e[1]??Bx()),Lh++,()=>{Lh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Lh--}},[])}function Bx(){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 fr=function(){return fr=Object.assign||function(t){for(var n,r=1,s=arguments.length;r"u")return YO;var t=ZO(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},t9=ok(),po="data-scroll-locked",n9=function(e,t,n,r){var s=e.left,a=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),` .`.concat(DO,` { overflow: hidden `).concat(r,`; padding-right: `).concat(l,"px ").concat(r,`; } body[`).concat(po,`] { overflow: hidden `).concat(r,`; overscroll-behavior: contain; `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` padding-left: `.concat(s,`px; padding-top: `).concat(a,`px; padding-right: `).concat(o,`px; margin-left:0; margin-top:0; margin-right: `).concat(l,"px ").concat(r,`; `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),` } .`).concat(Wc,` { right: `).concat(l,"px ").concat(r,`; } .`).concat(Kc,` { margin-right: `).concat(l,"px ").concat(r,`; } .`).concat(Wc," .").concat(Wc,` { right: 0 `).concat(r,`; } .`).concat(Kc," .").concat(Kc,` { margin-right: 0 `).concat(r,`; } body[`).concat(po,`] { `).concat(FO,": ").concat(l,`px; } `)},zx=function(){var e=parseInt(document.body.getAttribute(po)||"0",10);return isFinite(e)?e:0},r9=function(){b.useEffect(function(){return document.body.setAttribute(po,(zx()+1).toString()),function(){var e=zx()-1;e<=0?document.body.removeAttribute(po):document.body.setAttribute(po,e.toString())}},[])},s9=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;r9();var a=b.useMemo(function(){return e9(s)},[s]);return b.createElement(t9,{styles:n9(a,!t,s,n?"":"!important")})},Bm=!1;if(typeof window<"u")try{var wc=Object.defineProperty({},"passive",{get:function(){return Bm=!0,!0}});window.addEventListener("test",wc,wc),window.removeEventListener("test",wc,wc)}catch{Bm=!1}var Ra=Bm?{passive:!1}:!1,a9=function(e){return e.tagName==="TEXTAREA"},ik=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!a9(e)&&n[t]==="visible")},o9=function(e){return ik(e,"overflowY")},i9=function(e){return ik(e,"overflowX")},Vx=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=lk(e,r);if(s){var a=ck(e,r),o=a[1],l=a[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},l9=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},c9=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},lk=function(e,t){return e==="v"?o9(t):i9(t)},ck=function(e,t){return e==="v"?l9(t):c9(t)},u9=function(e,t){return e==="h"&&t==="rtl"?-1:1},d9=function(e,t,n,r,s){var a=u9(e,window.getComputedStyle(t).direction),o=a*r,l=n.target,c=t.contains(l),d=!1,h=o>0,f=0,p=0;do{if(!l)break;var m=ck(e,l),y=m[0],g=m[1],S=m[2],w=g-S-a*y;(y||w)&&lk(e,l)&&(f+=w,p+=y);var v=l.parentNode;l=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(h&&(Math.abs(f)<1||!s)||!h&&(Math.abs(p)<1||!s))&&(d=!0),d},Sc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Hx=function(e){return[e.deltaX,e.deltaY]},qx=function(e){return e&&"current"in e?e.current:e},h9=function(e,t){return e[0]===t[0]&&e[1]===t[1]},f9=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} `)},m9=0,Ia=[];function p9(e){var t=b.useRef([]),n=b.useRef([0,0]),r=b.useRef(),s=b.useState(m9++)[0],a=b.useState(ok)[0],o=b.useRef(e);b.useEffect(function(){o.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var g=LO([e.lockRef.current],(e.shards||[]).map(qx),!0).filter(Boolean);return g.forEach(function(S){return S.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),g.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=b.useCallback(function(g,S){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!o.current.allowPinchZoom;var w=Sc(g),v=n.current,x="deltaX"in g?g.deltaX:v[0]-w[0],k="deltaY"in g?g.deltaY:v[1]-w[1],j,C=g.target,T=Math.abs(x)>Math.abs(k)?"h":"v";if("touches"in g&&T==="h"&&C.type==="range")return!1;var P=Vx(T,C);if(!P)return!0;if(P?j=T:(j=T==="v"?"h":"v",P=Vx(T,C)),!P)return!1;if(!r.current&&"changedTouches"in g&&(x||k)&&(r.current=j),!j)return!0;var _=r.current||j;return d9(_,S,g,_==="h"?x:k,!0)},[]),c=b.useCallback(function(g){var S=g;if(!(!Ia.length||Ia[Ia.length-1]!==a)){var w="deltaY"in S?Hx(S):Sc(S),v=t.current.filter(function(j){return j.name===S.type&&(j.target===S.target||S.target===j.shadowParent)&&h9(j.delta,w)})[0];if(v&&v.should){S.cancelable&&S.preventDefault();return}if(!v){var x=(o.current.shards||[]).map(qx).filter(Boolean).filter(function(j){return j.contains(S.target)}),k=x.length>0?l(S,x[0]):!o.current.noIsolation;k&&S.cancelable&&S.preventDefault()}}},[]),d=b.useCallback(function(g,S,w,v){var x={name:g,delta:S,target:w,should:v,shadowParent:g9(w)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(k){return k!==x})},1)},[]),h=b.useCallback(function(g){n.current=Sc(g),r.current=void 0},[]),f=b.useCallback(function(g){d(g.type,Hx(g),g.target,l(g,e.lockRef.current))},[]),p=b.useCallback(function(g){d(g.type,Sc(g),g.target,l(g,e.lockRef.current))},[]);b.useEffect(function(){return Ia.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",c,Ra),document.addEventListener("touchmove",c,Ra),document.addEventListener("touchstart",h,Ra),function(){Ia=Ia.filter(function(g){return g!==a}),document.removeEventListener("wheel",c,Ra),document.removeEventListener("touchmove",c,Ra),document.removeEventListener("touchstart",h,Ra)}},[]);var m=e.removeScrollBar,y=e.inert;return b.createElement(b.Fragment,null,y?b.createElement(a,{styles:f9(s)}):null,m?b.createElement(s9,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function g9(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const y9=qO(ak,p9);var uk=b.forwardRef(function(e,t){return b.createElement(Dd,fr({},e,{ref:t,sideCar:y9}))});uk.classNames=Dd.classNames;var x9=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Oa=new WeakMap,kc=new WeakMap,Cc={},Bh=0,dk=function(e){return e&&(e.host||dk(e.parentNode))},v9=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=dk(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},b9=function(e,t,n,r){var s=v9(t,Array.isArray(e)?e:[e]);Cc[n]||(Cc[n]=new WeakMap);var a=Cc[n],o=[],l=new Set,c=new Set(s),d=function(f){!f||l.has(f)||(l.add(f),d(f.parentNode))};s.forEach(d);var h=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(p){if(l.has(p))h(p);else try{var m=p.getAttribute(r),y=m!==null&&m!=="false",g=(Oa.get(p)||0)+1,S=(a.get(p)||0)+1;Oa.set(p,g),a.set(p,S),o.push(p),g===1&&y&&kc.set(p,!0),S===1&&p.setAttribute(n,"true"),y||p.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",p,w)}})};return h(t),l.clear(),Bh++,function(){o.forEach(function(f){var p=Oa.get(f)-1,m=a.get(f)-1;Oa.set(f,p),a.set(f,m),p||(kc.has(f)||f.removeAttribute(r),kc.delete(f)),m||f.removeAttribute(n)}),Bh--,Bh||(Oa=new WeakMap,Oa=new WeakMap,kc=new WeakMap,Cc={})}},w9=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=x9(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live]"))),b9(r,s,n,"aria-hidden")):function(){return null}},Fd="Dialog",[hk,XB]=wa(Fd),[S9,Jn]=hk(Fd),fk=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:a,modal:o=!0}=e,l=b.useRef(null),c=b.useRef(null),[d,h]=Bo({prop:r,defaultProp:s??!1,onChange:a,caller:Fd});return i.jsx(S9,{scope:t,triggerRef:l,contentRef:c,contentId:ho(),titleId:ho(),descriptionId:ho(),open:d,onOpenChange:h,onOpenToggle:b.useCallback(()=>h(f=>!f),[h]),modal:o,children:n})};fk.displayName=Fd;var mk="DialogTrigger",pk=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Jn(mk,n),a=mt(t,s.triggerRef);return i.jsx(_e.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Mg(s.open),...r,ref:a,onClick:Ae(e.onClick,s.onOpenToggle)})});pk.displayName=mk;var Ig="DialogPortal",[k9,gk]=hk(Ig,{forceMount:void 0}),yk=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,a=Jn(Ig,t);return i.jsx(k9,{scope:t,forceMount:n,children:b.Children.map(r,o=>i.jsx(Sa,{present:n||a.open,children:i.jsx(Jp,{asChild:!0,container:s,children:o})}))})};yk.displayName=Ig;var Hu="DialogOverlay",xk=b.forwardRef((e,t)=>{const n=gk(Hu,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,a=Jn(Hu,e.__scopeDialog);return a.modal?i.jsx(Sa,{present:r||a.open,children:i.jsx(j9,{...s,ref:t})}):null});xk.displayName=Hu;var C9=tl("DialogOverlay.RemoveScroll"),j9=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Jn(Hu,n);return i.jsx(uk,{as:C9,allowPinchZoom:!0,shards:[s.contentRef],children:i.jsx(_e.div,{"data-state":Mg(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),ya="DialogContent",vk=b.forwardRef((e,t)=>{const n=gk(ya,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,a=Jn(ya,e.__scopeDialog);return i.jsx(Sa,{present:r||a.open,children:a.modal?i.jsx(E9,{...s,ref:t}):i.jsx(N9,{...s,ref:t})})});vk.displayName=ya;var E9=b.forwardRef((e,t)=>{const n=Jn(ya,e.__scopeDialog),r=b.useRef(null),s=mt(t,n.contentRef,r);return b.useEffect(()=>{const a=r.current;if(a)return w9(a)},[]),i.jsx(bk,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ae(e.onCloseAutoFocus,a=>{var o;a.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Ae(e.onPointerDownOutside,a=>{const o=a.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&a.preventDefault()}),onFocusOutside:Ae(e.onFocusOutside,a=>a.preventDefault())})}),N9=b.forwardRef((e,t)=>{const n=Jn(ya,e.__scopeDialog),r=b.useRef(!1),s=b.useRef(!1);return i.jsx(bk,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,a),a.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),a.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:a=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=a.target;((d=n.triggerRef.current)==null?void 0:d.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})}),bk=b.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:a,...o}=e,l=Jn(ya,n),c=b.useRef(null),d=mt(t,c);return MO(),i.jsxs(i.Fragment,{children:[i.jsx(tk,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:a,children:i.jsx(dd,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Mg(l.open),...o,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(_9,{titleId:l.titleId}),i.jsx(P9,{contentRef:c,descriptionId:l.descriptionId})]})]})}),Og="DialogTitle",wk=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Jn(Og,n);return i.jsx(_e.h2,{id:s.titleId,...r,ref:t})});wk.displayName=Og;var Sk="DialogDescription",kk=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Jn(Sk,n);return i.jsx(_e.p,{id:s.descriptionId,...r,ref:t})});kk.displayName=Sk;var Ck="DialogClose",jk=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Jn(Ck,n);return i.jsx(_e.button,{type:"button",...r,ref:t,onClick:Ae(e.onClick,()=>s.onOpenChange(!1))})});jk.displayName=Ck;function Mg(e){return e?"open":"closed"}var Ek="DialogTitleWarning",[JB,Nk]=_N(Ek,{contentName:ya,titleName:Og,docsSlug:"dialog"}),_9=({titleId:e})=>{const t=Nk(Ek),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return b.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},T9="DialogDescriptionWarning",P9=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Nk(T9).contentName}}.`;return b.useEffect(()=>{var a;const s=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},_k=fk,A9=pk,Tk=yk,$d=xk,Bd=vk,Ud=wk,zd=kk,Pk=jk;const Dl=_k,R9=A9,I9=Tk,Ak=b.forwardRef(({className:e,...t},n)=>i.jsx($d,{ref:n,className:Z("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}));Ak.displayName=$d.displayName;const Ko=b.forwardRef(({className:e,children:t,hideClose:n,...r},s)=>i.jsxs(I9,{children:[i.jsx(Ak,{}),i.jsxs(Bd,{ref:s,className:Z("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,!n&&i.jsxs(Pk,{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:[i.jsx(Sr,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ko.displayName=Bd.displayName;const Xo=({className:e,...t})=>i.jsx("div",{className:Z("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Xo.displayName="DialogHeader";const Lg=({className:e,...t})=>i.jsx("div",{className:Z("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Lg.displayName="DialogFooter";const Jo=b.forwardRef(({className:e,...t},n)=>i.jsx(Ud,{ref:n,className:Z("text-lg font-semibold leading-none tracking-tight",e),...t}));Jo.displayName=Ud.displayName;const Fl=b.forwardRef(({className:e,...t},n)=>i.jsx(zd,{ref:n,className:Z("text-sm text-muted-foreground",e),...t}));Fl.displayName=zd.displayName;const Gx=[{id:"A",name:"Textura A",label:"Linhas Wave",img:"/images/textura-a.webp"},{id:"B",name:"Textura B",label:"Circuit Tech",img:"/images/textura-b.webp"},{id:"C",name:"Textura C",label:"Honeycomb",img:"/images/textura-c.webp"}],O9=({open:e,onOpenChange:t,vehicle:n,color:r,kitLabel:s,onConfirm:a})=>{var y;const[o,l]=b.useState("C"),[c,d]=b.useState(null),h=n.split(" "),f=h[h.length-1],p=h[0],m=h.slice(1,-1).join(" ");return i.jsx(Dl,{open:e,onOpenChange:g=>{!g&&c||t(g)},children:i.jsxs(Ko,{hideClose:!0,className:"max-w-md p-0 gap-0 overflow-hidden max-h-[90vh] flex flex-col",onInteractOutside:g=>{c&&g.preventDefault()},onPointerDownOutside:g=>{c&&g.preventDefault()},onEscapeKeyDown:g=>{c&&(g.preventDefault(),d(null))},children:[!c&&i.jsx("button",{type:"button",onClick:()=>t(!1),className:"absolute right-4 top-4 z-10 rounded-sm opacity-70 hover:opacity-100 transition-opacity","aria-label":"Fechar",children:i.jsx(Sr,{className:"w-4 h-4"})}),i.jsxs(Xo,{className:"px-6 pt-6 pb-4 text-left",children:[i.jsx(Jo,{className:"text-2xl font-bold",children:"Revise seu pedido"}),i.jsx(Fl,{className:"text-sm text-muted-foreground",children:"Seu kit será enviado para fabricação sob medida. Confira os detalhes antes de prosseguir."})]}),i.jsxs("div",{className:"flex-1 overflow-y-auto px-6 pb-4 space-y-4",children:[i.jsxs("div",{className:"rounded-xl border border-border bg-secondary/30 p-4",children:[i.jsx("h3",{className:"font-bold text-sm mb-1",children:"Escolha a textura do seu carpete"}),i.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"Isso ajuda a garantir que você receba exatamente o acabamento que viu no anúncio."}),i.jsx("div",{className:"grid grid-cols-3 gap-2.5",children:Gx.map(g=>{const S=o===g.id;return i.jsxs("div",{className:`rounded-lg border-2 bg-background p-2 transition-all ${S?"border-primary ring-2 ring-primary/20":"border-border"}`,children:[i.jsxs("button",{type:"button",onClick:()=>l(g.id),className:"relative w-full aspect-square rounded-md overflow-hidden bg-muted",children:[i.jsx("img",{src:g.img,alt:g.name,className:"w-full h-full object-cover"}),S&&i.jsx("div",{className:"absolute top-1 right-1 w-5 h-5 rounded-full bg-primary flex items-center justify-center",children:i.jsx(Vt,{className:"w-3 h-3 text-primary-foreground",strokeWidth:3})})]}),i.jsx("p",{className:"text-xs font-bold text-center mt-1.5",children:g.name}),i.jsxs("button",{type:"button",onClick:()=>d(g.img),className:"mt-1 w-full bg-primary text-primary-foreground text-xs font-semibold py-1 rounded-md hover:bg-primary/90 transition-colors flex items-center justify-center gap-1",children:[i.jsx(Z_,{className:"w-3 h-3"})," Ver"]})]},g.id)})})]}),i.jsxs("div",{className:"rounded-xl border border-border divide-y divide-border overflow-hidden",children:[i.jsx(Ma,{label:"Marca",value:p||"—"}),i.jsx(Ma,{label:"Modelo",value:m||"—"}),i.jsx(Ma,{label:"Ano",value:f||"—"}),i.jsx(Ma,{label:"Kit",value:s}),i.jsx(Ma,{label:"Cor",value:r}),i.jsx(Ma,{label:"Textura",value:`Textura ${o}`,highlight:!0})]}),i.jsxs("p",{className:"text-center text-xs text-muted-foreground flex items-center justify-center gap-1",children:["Arraste para ver mais ",i.jsx(Ur,{className:"w-3 h-3"})]})]}),i.jsxs("div",{className:"border-t border-border bg-background px-6 py-4 space-y-2.5",children:[i.jsx("button",{type:"button",onClick:()=>t(!1),className:"w-full py-3 rounded-lg border border-border bg-background text-sm font-semibold hover:bg-secondary transition-colors",children:"Voltar e ajustar"}),i.jsx("button",{type:"button",onClick:()=>a(o),className:"w-full py-3.5 rounded-lg bg-[hsl(142,71%,45%)] text-white font-bold text-base hover:bg-[hsl(142,71%,40%)] transition-colors",children:"Ir para pagamento"}),i.jsxs("p",{className:"text-center text-xs text-muted-foreground flex items-center justify-center gap-1",children:[i.jsx(ls,{className:"w-3 h-3"})," Pagamento 100% seguro · Ambiente protegido"]})]}),c&&i.jsx("div",{className:"absolute inset-0 z-50 flex items-center justify-center p-6 bg-black/60 backdrop-blur-sm",onClick:()=>d(null),children:i.jsxs("div",{className:"relative bg-background rounded-2xl shadow-2xl p-4 pb-3 max-w-[90%]",onClick:g=>g.stopPropagation(),children:[i.jsx("img",{src:c,alt:"Textura ampliada",className:"max-w-full max-h-[60vh] object-contain mx-auto"}),i.jsxs("p",{className:"text-center text-sm font-bold mt-2",children:["Textura ",((y=Gx.find(g=>g.img===c))==null?void 0:y.id)??""]}),i.jsx("button",{type:"button",onClick:g=>{g.stopPropagation(),d(null)},className:"absolute -top-3 -right-3 z-10 w-9 h-9 rounded-full bg-foreground text-background flex items-center justify-center shadow-lg hover:scale-110 transition-transform","aria-label":"Fechar",children:i.jsx(Sr,{className:"w-4 h-4",strokeWidth:3})})]})})]})})},Ma=({label:e,value:t,highlight:n})=>i.jsxs("div",{className:"flex items-center justify-between px-4 py-3 bg-background",children:[i.jsx("span",{className:"text-sm text-muted-foreground",children:e}),i.jsx("span",{className:`text-sm font-bold text-right ${n?"text-primary":"text-foreground"}`,children:t})]}),M9=({selectedColor:e,onColorChange:t,product:n,selectedColorOption:r,onColorOptionChange:s,singleKit:a})=>{const[o,l]=b.useState(""),[c,d]=b.useState(a??"completo"),[h,f]=b.useState(!1),p=Go(),m=b.useCallback(j=>l(j),[]),y={basico:{price:n.price,originalPrice:n.originalPrice},completo:{price:n.price,originalPrice:n.originalPrice}},g=a?y:n.kitPrices||y,S=g[c],w=S.price,v=S.originalPrice,x=Math.round((1-w/v)*100),k=c==="basico"?"Kit Básico":"Kit Completo";return i.jsxs("div",{className:"flex flex-col gap-5 min-w-0",children:[i.jsx("h1",{className:"text-2xl sm:text-3xl md:text-4xl font-bold text-foreground leading-tight",children:n.name}),i.jsx(cI,{rating:n.rating,count:n.reviewCount}),i.jsxs("div",{className:"flex flex-wrap items-center gap-2 sm:gap-3",children:[i.jsx("span",{className:"text-2xl sm:text-3xl font-extrabold text-foreground",children:Is(w)}),i.jsx("span",{className:"text-base sm:text-lg line-through text-muted-foreground",children:Is(v)}),i.jsxs("span",{className:"bg-foreground text-background text-xs font-bold px-2.5 py-1 rounded-full",children:["-",x,"%"]})]}),i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsxs("span",{className:"text-sm font-medium text-foreground",children:["Cor: ",i.jsx("span",{className:"font-normal text-muted-foreground",children:r})]}),i.jsx("div",{className:"flex gap-3",children:[{name:"Preto",color:"#1a1a1a"},{name:"Cinza",color:"#6b6b6b"},{name:"Branco",color:"#f5f5f5"}].map(j=>i.jsx("button",{onClick:()=>s(j.name),className:`w-10 h-10 rounded-full border-2 transition-all ${r===j.name?"border-foreground scale-110":"border-border hover:border-muted-foreground"}`,style:{backgroundColor:j.color},title:j.name},j.name))})]}),i.jsx(NO,{onVehicleChange:m}),!a&&i.jsx(uI,{product:{...n,price:w,originalPrice:v},kitPrices:g,defaultKit:"completo",onQuantityChange:j=>{const C=j===1?"basico":"completo";d(C),t(C==="basico"?"Kit Básico":"Kit Completo")}}),!o&&i.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"☝️ Selecione seu veículo acima para liberar a compra"}),i.jsx("button",{onClick:()=>{var j;if(!o){(j=document.querySelector("[data-vehicle-selector]"))==null||j.scrollIntoView({behavior:"smooth",block:"center"});return}f(!0)},disabled:!o,className:`w-full py-4 rounded-md text-base font-bold tracking-wide transition-all ${o?"bg-foreground text-background hover:opacity-90":"bg-muted text-muted-foreground cursor-not-allowed"}`,children:o?"COMPRAR AGORA":"⬆ SELECIONE SEU VEÍCULO"}),i.jsx(O9,{open:h,onOpenChange:f,vehicle:o,color:r,kitLabel:k,onConfirm:j=>{window.scrollTo({top:0}),p(B6(`/checkout?qty=1&product=${n.id}&size=${encodeURIComponent(o)}&color=${encodeURIComponent(k)}&colorOption=${encodeURIComponent(r)}&texture=${j}`))}}),i.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-4 sm:gap-6 pt-2",children:[i.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[i.jsx($r,{className:"w-4 h-4"}),i.jsx("span",{children:"Garantia de 1 ano"})]}),i.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[i.jsx(dn,{className:"w-4 h-4"}),i.jsx("span",{children:"Frete Grátis Brasil"})]})]}),i.jsx(PI,{})]})},L9=[{icon:$r,tag:"#1 Característica",subtitle:"Base pinada antiderrapante",title:"Borracha Premium de Alta Performance",description:"Fabricado com borracha de altíssima qualidade, nosso tapete oferece durabilidade excepcional e resistência a desgaste. A base pinada garante fixação segura, evitando deslocamentos durante a condução.",bullets:["Material de qualidade automotiva","Espessura de 7mm para maior proteção","Resistente a raios UV e ressecamento","Não deforma com o tempo"],image:"/images/halvor-tapete-1.webp",reverse:!1},{icon:eg,tag:"#2 Característica",subtitle:"Praticidade no dia a dia",title:"100% Impermeável e Fácil de Limpar",description:"Bordas elevadas que contêm qualquer líquido derramado, protegendo o assoalho original do seu veículo. Limpeza simples: basta remover e lavar com água.",bullets:["Bordas elevadas de 5cm","Contém água, lama e areia","Limpa em segundos com água","Protege 100% do assoalho"],image:"/images/halvor-tapete-2.webp",reverse:!0},{icon:Rl,tag:"#3 Característica",subtitle:"Instalação perfeita e segura",title:"Ilhós de Fixação Original",description:"Sistema de fixação idêntico ao original de fábrica. Os ilhós de alta resistência garantem que o tapete permaneça sempre no lugar, proporcionando máxima segurança.",bullets:["Ilhós metálicos reforçados","Compatível com fixadores originais","Instalação em menos de 1 minuto","Não interfere nos pedais"],image:"/images/halvor-tapete-3.webp",reverse:!1},{icon:ng,tag:"#4 Característica",subtitle:"Encaixe perfeito garantido",title:"100% Sob Medida Para Seu Veículo",description:"Cada tapete é fabricado especialmente para o modelo do seu carro, utilizando moldes exclusivos que garantem cobertura total e acabamento impecável.",bullets:["Moldes exclusivos por modelo","Cobertura total do assoalho","Acabamento premium","Valoriza o interior do veículo"],image:"/images/halvor-tapete-4.webp",reverse:!0}],D9=()=>i.jsxs("section",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-10 sm:py-16",children:[i.jsxs("div",{className:"text-center mb-10 sm:mb-14",children:[i.jsx("p",{className:"text-sm font-semibold text-primary mb-2",children:"Conheça os Detalhes"}),i.jsx("h2",{className:"text-2xl sm:text-3xl font-bold text-foreground",children:"Por Que Escolher Nosso Tapete?"}),i.jsx("p",{className:"text-muted-foreground mt-2 max-w-xl mx-auto text-sm sm:text-base",children:"Cada detalhe foi pensado para oferecer a melhor proteção e praticidade para o seu veículo"})]}),i.jsx("div",{className:"space-y-12 sm:space-y-20",children:L9.map((e,t)=>{const n=e.icon;return i.jsxs("div",{className:`grid md:grid-cols-2 gap-8 sm:gap-12 items-center ${e.reverse?"md:[&>*:first-child]:order-2":""}`,children:[i.jsx("div",{className:"overflow-hidden rounded-xl",children:i.jsx("img",{src:e.image,alt:e.title,className:"w-full h-auto object-cover rounded-xl",loading:"lazy"})}),i.jsxs("div",{children:[i.jsx("span",{className:"inline-block text-xs font-bold text-primary bg-primary/10 px-3 py-1 rounded-full mb-3",children:e.tag}),i.jsx("p",{className:"text-sm text-muted-foreground mb-1",children:e.subtitle}),i.jsx("h3",{className:"text-xl sm:text-2xl font-bold text-foreground mb-3",children:e.title}),i.jsx("p",{className:"text-muted-foreground leading-relaxed mb-4 text-sm sm:text-base",children:e.description}),i.jsx("ul",{className:"space-y-2",children:e.bullets.map((r,s)=>i.jsxs("li",{className:"flex items-center gap-2 text-sm text-foreground",children:[i.jsx(n,{className:"w-4 h-4 text-primary flex-shrink-0"}),r]},s))})]})]},t)})})]}),F9=[{video:"/images/benefit-1.mp4",title:"Cobertura total",desc:"Protege o assoalho inteiro, sem áreas expostas."},{video:"/images/benefit-2.mp4",title:"Encaixe sob medida",desc:"Ajuste perfeito para não escorregar e não atrapalhar pedais."},{video:"/images/benefit-3.mp4",title:"Fácil de limpar",desc:"Resistente a água e sujeira. Limpeza rápida no dia a dia."}],$9=()=>{const e=b.useRef(null);return i.jsxs("section",{className:"bg-background py-10 sm:py-16",children:[i.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6",children:i.jsxs("div",{className:"text-center mb-6 sm:mb-8",children:[i.jsx("h2",{className:"text-2xl sm:text-3xl font-extrabold text-foreground",children:"O tapete mais vendido de 2026!"}),i.jsx("p",{className:"text-muted-foreground text-sm mt-1",children:"Deslize para ver os benefícios →"})]})}),i.jsx("div",{ref:e,className:"flex gap-4 overflow-x-auto snap-x snap-mandatory scroll-smooth pl-6 pr-4 sm:pl-10 sm:pr-6 pb-4",style:{scrollbarWidth:"none",msOverflowStyle:"none",WebkitOverflowScrolling:"touch"},children:F9.map((t,n)=>i.jsxs("div",{className:"flex-shrink-0 w-[75vw] sm:w-[320px] snap-start rounded-xl overflow-hidden border border-border bg-card",children:[i.jsx("div",{className:"aspect-[3/4] overflow-hidden bg-secondary",children:i.jsx("video",{src:t.video,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,className:"w-full h-full object-cover"})}),i.jsxs("div",{className:"p-4",children:[i.jsx("h3",{className:"font-bold text-foreground text-base mb-1",children:t.title}),i.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:t.desc})]})]},n))})]})},B9=[{icon:$r,title:"Altíssima Durabilidade",desc:"Material resistente que dura anos sem deformar ou ressecar"},{icon:eg,title:"100% Impermeável",desc:"Bordas elevadas de 5cm contêm líquidos e protegem o assoalho"},{icon:ng,title:"Encaixe Perfeito",desc:"Fabricado sob medida com moldes exclusivos do seu veículo"},{icon:G_,title:"Limpeza Ultra Fácil",desc:"Basta remover e lavar com água. Seca em minutos"},{icon:A_,title:"Base Antiderrapante",desc:"Sistema pinado que mantém o tapete firme no lugar"},{icon:Rl,title:"Ilhós de Fixação",desc:"Compatível com o sistema de fixação original de fábrica"},{icon:I_,title:"7mm de Espessura",desc:"Material premium com espessura ideal para máxima proteção"},{icon:M_,title:"Material Reciclado",desc:"Produzido de forma sustentável e ecologicamente responsável"}],U9=()=>i.jsx("section",{className:"bg-secondary/50 py-12 sm:py-20",children:i.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6",children:[i.jsxs("div",{className:"text-center mb-10 sm:mb-14",children:[i.jsx("p",{className:"text-xs font-heading uppercase tracking-[0.2em] text-muted-foreground mb-2",children:"Diferenciais"}),i.jsx("h2",{className:"text-2xl sm:text-3xl font-extrabold text-foreground",children:"8 Razões Para Escolher Nosso Tapete"})]}),i.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 sm:gap-5",children:B9.map((e,t)=>{const n=e.icon;return i.jsxs("div",{className:"bg-background rounded-2xl p-5 sm:p-6 text-center border border-border/60 hover:shadow-md hover:border-border transition-all group",children:[i.jsx("div",{className:"w-11 h-11 rounded-xl bg-foreground/5 group-hover:bg-foreground/10 flex items-center justify-center mx-auto mb-3 transition-colors",children:i.jsx(n,{className:"w-5 h-5 text-foreground"})}),i.jsx("h3",{className:"font-bold text-foreground text-sm mb-1",children:e.title}),i.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:e.desc})]},t)})})]})}),z9=[{video:"/images/review-video-1.mp4",quote:"Encaixe perfeito no meu carro, qualidade absurda! Recomendo demais.",name:"Ricardo Almeida",age:34,location:"São Paulo, SP",initial:"R"},{video:"/images/review-video-2.mp4",quote:"Amei! O acabamento é impecável e a borda elevada segura tudo.",name:"Mariana Souza",age:29,location:"Curitiba, PR",initial:"M"},{video:"/images/review-video-3.mp4",quote:"Material grosso e resistente, muito melhor que o tapete original.",name:"Felipe Costa",age:37,location:"Belo Horizonte, MG",initial:"F"},{video:"/images/review-video-4.mp4",quote:"Ficou lindo no meu carro! Super prático de limpar, adorei.",name:"Juliana Ferreira",age:31,location:"Rio de Janeiro, RJ",initial:"J"},{video:"/images/review-video-5.mp4",quote:"Já comprei tapete de várias marcas, esse é disparado o melhor.",name:"Thiago Oliveira",age:40,location:"Florianópolis, SC",initial:"T"},{video:"/images/review-video-6.mp4",quote:"Presente pro meu marido e ele amou! Qualidade premium de verdade.",name:"Camila Santos",age:26,location:"Porto Alegre, RS",initial:"C"}],V9=()=>i.jsxs("section",{className:"bg-background py-10 sm:py-16",children:[i.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6",children:i.jsxs("div",{className:"text-center mb-6 sm:mb-8",children:[i.jsx("h2",{className:"text-2xl sm:text-3xl font-extrabold text-foreground mb-2",children:"Avaliações em vídeo"}),i.jsx("p",{className:"text-muted-foreground text-sm",children:"Veja o que nossos clientes gravaram sobre o produto →"})]})}),i.jsx("div",{className:"flex gap-4 overflow-x-auto snap-x snap-mandatory scroll-smooth pl-6 pr-4 sm:pl-10 sm:pr-6 pb-4",style:{scrollbarWidth:"none",msOverflowStyle:"none",WebkitOverflowScrolling:"touch"},children:z9.map((e,t)=>i.jsxs("div",{className:"flex-shrink-0 w-[65vw] sm:w-[260px] snap-start rounded-xl overflow-hidden border border-border bg-card",children:[i.jsx("div",{className:"aspect-[9/16] overflow-hidden bg-secondary",children:i.jsx("video",{src:e.video,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,className:"w-full h-full object-cover"})}),i.jsxs("div",{className:"p-3",children:[i.jsx("div",{className:"flex items-center gap-0.5 mb-2",children:Array.from({length:5}).map((n,r)=>i.jsx(wr,{className:"w-3.5 h-3.5 fill-star text-star"},r))}),i.jsxs("p",{className:"text-foreground/80 text-xs leading-relaxed mb-3 line-clamp-2",children:['"',e.quote,'"']}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"w-7 h-7 rounded-full bg-foreground flex items-center justify-center text-xs font-bold text-background",children:e.initial}),i.jsxs("div",{children:[i.jsx("p",{className:"text-xs font-semibold text-foreground",children:e.name}),i.jsxs("p",{className:"text-[10px] text-muted-foreground",children:[e.age," anos • ",e.location]})]})]})]})]},t))})]}),di=[{src:"/images/store-front.jpg",alt:"Fachada da loja física AlphaCars"},{src:"/images/store-interior-1.jpg",alt:"Interior da loja AlphaCars"},{src:"/images/store-interior-2.jpg",alt:"Estoque e produtos AlphaCars"}],H9=[{value:"15.000+",label:"Clientes atendidos"},{value:"12 meses",label:"Garantia real"},{value:"48h",label:"Prazo de envio"},{value:"4.9★",label:"Avaliação média"}],Rk=()=>{const[e,t]=b.useState(0),n=b.useCallback(()=>t(s=>(s+1)%di.length),[]),r=b.useCallback(()=>t(s=>(s-1+di.length)%di.length),[]);return b.useEffect(()=>{const s=setInterval(n,4500);return()=>clearInterval(s)},[n]),i.jsx("section",{className:"bg-background py-14 sm:py-20 border-y border-border",children:i.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6",children:i.jsxs("div",{className:"grid lg:grid-cols-2 gap-10 lg:gap-14 items-center",children:[i.jsxs("div",{className:"order-2 lg:order-1",children:[i.jsx("span",{className:"block text-[11px] sm:text-xs font-bold uppercase tracking-[0.2em] text-accent mb-4",children:"Por que confiar na AlphaCars?"}),i.jsx("h2",{className:"text-2xl sm:text-3xl lg:text-4xl font-extrabold uppercase text-foreground leading-tight tracking-tight mb-5",children:"Empresa com estrutura real e compromisso com cada cliente"}),i.jsx("p",{className:"text-muted-foreground leading-relaxed text-sm sm:text-base mb-8 max-w-xl",children:"Não somos uma loja de fundo de quintal. Temos loja física, equipe dedicada e um processo de qualidade que garante o tapete certo para o seu carro."}),i.jsx("div",{className:"grid grid-cols-2 gap-x-6 gap-y-7 max-w-md",children:H9.map(s=>i.jsxs("div",{children:[i.jsx("p",{className:"text-2xl sm:text-3xl font-extrabold text-foreground leading-none",children:s.value}),i.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mt-2",children:s.label})]},s.label))})]}),i.jsxs("div",{className:"order-1 lg:order-2 relative w-full aspect-[4/3] rounded-2xl overflow-hidden group ring-2 ring-accent shadow-[0_10px_40px_-10px_hsl(var(--accent)/0.35)]",children:[di.map((s,a)=>i.jsx("img",{src:s.src,alt:s.alt,className:`absolute inset-0 w-full h-full object-cover transition-opacity duration-700 ${a===e?"opacity-100":"opacity-0"}`,loading:"lazy"},s.src)),i.jsx("button",{onClick:r,className:"absolute left-3 top-1/2 -translate-y-1/2 w-9 h-9 rounded-full bg-foreground/60 text-background flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity","aria-label":"Anterior",children:i.jsx(N_,{className:"w-5 h-5"})}),i.jsx("button",{onClick:n,className:"absolute right-3 top-1/2 -translate-y-1/2 w-9 h-9 rounded-full bg-foreground/60 text-background flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity","aria-label":"Próximo",children:i.jsx(Su,{className:"w-5 h-5"})}),i.jsx("div",{className:"absolute bottom-3 left-1/2 -translate-x-1/2 flex gap-2",children:di.map((s,a)=>i.jsx("button",{onClick:()=>t(a),className:`w-2 h-2 rounded-full transition-all ${a===e?"bg-accent scale-125":"bg-background/70"}`,"aria-label":`Imagem ${a+1}`},a))})]})]})})})},q9=Object.freeze(Object.defineProperty({__proto__:null,default:Rk},Symbol.toStringTag,{value:"Module"})),G9=[{label:"Índice de Solução",value:"94,8%",icon:Qb},{label:"Voltariam a fazer negócio",value:"92,1%",icon:z_},{label:"Reclamações respondidas",value:"100%",icon:Cu}],W9=()=>i.jsx("section",{className:"bg-[#F5F7F8] py-12 sm:py-16 border-y border-[#E1E6E9]",children:i.jsxs("div",{className:"max-w-5xl mx-auto px-4 sm:px-6",children:[i.jsxs("div",{className:"text-center mb-8",children:[i.jsxs("div",{className:"inline-flex items-center gap-2 mb-4",children:[i.jsx("span",{className:"text-2xl sm:text-3xl font-extrabold text-[#0D5D3B] tracking-tight",children:"Reclame"}),i.jsx("span",{className:"text-2xl sm:text-3xl font-extrabold text-[#7FBB3F] tracking-tight",children:"AQUI"})]}),i.jsxs("h2",{className:"text-xl sm:text-2xl md:text-3xl font-bold text-[#1A2B23] tracking-tight max-w-2xl mx-auto",children:["Avaliada como ",i.jsx("span",{className:"text-[#0D5D3B]",children:"ÓTIMO"})," pelos consumidores"]})]}),i.jsxs("div",{className:"bg-white rounded-2xl shadow-[0_4px_20px_rgba(13,93,59,0.08)] border border-[#E1E6E9] overflow-hidden max-w-3xl mx-auto",children:[i.jsxs("div",{className:"bg-[#0D5D3B] px-5 sm:px-8 py-4 flex items-center justify-between gap-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-full bg-[#7FBB3F] flex items-center justify-center",children:i.jsx(jr,{className:"w-5 h-5 text-white"})}),i.jsxs("div",{children:[i.jsx("p",{className:"text-[10px] uppercase tracking-wider text-white/70 font-semibold",children:"Selo verificado"}),i.jsx("p",{className:"text-sm sm:text-base font-bold text-white leading-tight",children:"AlphaCars · Reputação verificada"})]})]}),i.jsx("span",{className:"hidden sm:inline-flex items-center gap-1 bg-[#7FBB3F] text-white text-[11px] font-bold px-3 py-1.5 rounded-full uppercase tracking-wider",children:"ÓTIMO"})]}),i.jsxs("div",{className:"px-5 sm:px-8 py-6 flex flex-col sm:flex-row items-center justify-between gap-5 border-b border-[#E1E6E9]",children:[i.jsxs("div",{className:"flex items-center gap-5",children:[i.jsxs("div",{className:"relative w-24 h-24 rounded-full bg-gradient-to-br from-[#7FBB3F] to-[#5C9A2B] flex flex-col items-center justify-center shadow-md flex-shrink-0",children:[i.jsx("span",{className:"text-3xl font-extrabold text-white leading-none",children:"8.7"}),i.jsx("span",{className:"text-[10px] text-white/90 font-semibold uppercase tracking-wider mt-0.5",children:"de 10"})]}),i.jsxs("div",{children:[i.jsx("p",{className:"text-[#0D5D3B] text-base font-bold mb-0.5",children:"Reputação ÓTIMO"}),i.jsxs("p",{className:"text-sm text-[#5A6B63] leading-snug",children:["Baseado em ",i.jsx("span",{className:"font-bold text-[#1A2B23]",children:"1.247 reclamações"})," nos últimos 12 meses"]}),i.jsx("p",{className:"text-xs text-[#7A8985] mt-1",children:"Categoria: Acessórios Automotivos"})]})]}),i.jsxs("a",{href:"https://www.reclameaqui.com.br/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-sm font-bold text-[#0D5D3B] hover:text-[#7FBB3F] transition-colors whitespace-nowrap border-2 border-[#0D5D3B] hover:border-[#7FBB3F] px-4 py-2 rounded-lg",children:["Ver perfil ",i.jsx(Gb,{className:"w-3.5 h-3.5"})]})]}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 divide-y sm:divide-y-0 sm:divide-x divide-[#E1E6E9] bg-[#FAFBFC]",children:G9.map(e=>{const t=e.icon;return i.jsxs("div",{className:"px-5 py-5 flex flex-col items-center text-center gap-1.5",children:[i.jsx("div",{className:"w-9 h-9 rounded-full bg-[#7FBB3F]/15 flex items-center justify-center",children:i.jsx(t,{className:"w-4 h-4 text-[#0D5D3B]"})}),i.jsx("p",{className:"text-2xl font-extrabold text-[#0D5D3B] tracking-tight",children:e.value}),i.jsx("p",{className:"text-xs text-[#5A6B63] leading-tight font-medium",children:e.label})]},e.label)})})]}),i.jsxs("p",{className:"text-center text-xs text-[#7A8985] mt-5",children:["Dados públicos verificáveis · Atualizado em ",new Date().toLocaleDateString("pt-BR",{month:"long",year:"numeric"})]})]})}),K9=Uo("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),be=b.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...s},a)=>{const o=r?$o:"button";return i.jsx(o,{className:Z(K9({variant:t,size:n,className:e})),ref:a,...s})});be.displayName="Button";const Wx=[{name:"Eduardo Campos",age:31,location:"Ribeirão Preto, SP",date:"15/02/2026",text:"Chegou muito bem embalado, cada peça no saquinho. Coloquei no meu Ford Ka e o encaixe foi perfeito. Material grosso e resistente, muito acima do que eu esperava.",stars:5,variant:"Kit Completo",verified:!0,helpful:66,image:"/images/review-1-opt.jpg"},{name:"Henrique Barbosa",age:37,location:"Uberlândia, MG",date:"14/02/2026",text:"Comprei e a entrega foi rápida. Os tapetes são muito bem acabados, sem rebarbas. Encaixaram perfeitamente no meu carro.",stars:5,variant:"Kit Completo",verified:!0,helpful:53,image:"/images/review-2-opt.jpg"},{name:"Gabriel Nunes",age:29,location:"Sorocaba, SP",date:"13/02/2026",text:"Material premium de verdade! Coloquei no meu Corolla e ficou com cara de carro zero. A borda elevada segura tudo, muito prático.",stars:5,variant:"Kit Completo",verified:!0,helpful:45,image:"/images/review-3-opt.jpg"},{name:"André Teixeira",age:34,location:"Londrina, PR",date:"12/02/2026",text:"Excelente custo-benefício. Os tapetes são robustos, pesados e com acabamento impecável. Parece acessório original de fábrica.",stars:5,variant:"Kit Básico",verified:!0,helpful:41,image:"/images/review-4-opt.jpg"},{name:"Bruno Mendes",age:32,location:"Porto Alegre, RS",date:"08/02/2026",text:"O tapete é MUITO bom, coloquei no meu Civic e ficou perfeito, encaixe 100%. A borda elevada segura tudo, já derrubei café e não vazou nada. Qualidade muito acima do que eu esperava pelo preço 🔥",stars:5,variant:"Kit Completo",verified:!0,helpful:47,image:"/images/review-5-opt.jpg"},{name:"Marcelo Duarte",age:42,location:"Santos, SP",date:"11/02/2026",text:"Veio tudo certinho na caixa, bem protegido. A qualidade da borracha é notável, não tem cheiro e o encaixe é preciso.",stars:5,variant:"Kit Completo",verified:!0,helpful:37,image:"/images/review-6-opt.jpg"},{name:"Carlos Oliveira",age:35,location:"Rio de Janeiro, RJ",date:"08/02/2026",text:"Já comprei tapete de várias marcas mas esse aqui é outro nível. O material é grosso, bem resistente e o acabamento é impecável. O sistema de fixação com ilhós é show.",stars:5,variant:"Kit Básico",verified:!0,helpful:58,image:"/images/review-7-opt.jpg"},{name:"Rafael Souza",age:26,location:"Belo Horizonte, MG",date:"06/02/2026",text:"Veio rápido pra BH, 7 dias úteis. Embalagem caprichada. Coloquei no meu Onix e o encaixe é perfeito, parece que veio de fábrica. Já indiquei pra 3 amigos meus 😎",stars:5,variant:"Kit Básico",verified:!0,helpful:29}],X9=[{name:"Thiago Almeida",age:38,location:"Curitiba, PR",date:"05/02/2026",text:"Comprei o kit completo pro meu HB20 e fiquei impressionado. O acabamento é digno de loja de acessórios premium. Recomendo demais!",stars:5,variant:"Kit Completo",verified:!0,helpful:34},{name:"Felipe Cardoso",age:30,location:"Vitória, ES",date:"04/02/2026",text:"Tapete muito bom, encaixou direitinho no meu Polo. Limpeza super fácil, é só passar um pano úmido. Valeu cada centavo.",stars:5,variant:"Kit Básico",verified:!0,helpful:22},{name:"Ricardo Pereira",age:45,location:"Brasília, DF",date:"03/02/2026",text:"Já é o segundo que compro, agora pra esposa. Qualidade excelente, atendimento nota 10 e entrega no prazo. Top demais.",stars:5,variant:"Kit Completo",verified:!0,helpful:40},{name:"Lucas Ferreira",age:27,location:"Goiânia, GO",date:"02/02/2026",text:"Material muito superior aos tapetes que vinham de fábrica no meu Tracker. Antiderrapante de verdade, não escorrega.",stars:5,variant:"Kit Completo",verified:!0,helpful:31},{name:"Vinícius Lopes",age:33,location:"Recife, PE",date:"01/02/2026",text:"Chegou antes do prazo, muito bem embalado. Coloquei no Renegade e o caimento é perfeito. Cobre tudo, não fica nada exposto.",stars:5,variant:"Kit Completo",verified:!0,helpful:28},{name:"Diego Martins",age:36,location:"Florianópolis, SC",date:"30/01/2026",text:"Excelente produto. Borda alta segura água, areia e qualquer sujeira. Perfeito pra quem vai na praia como eu.",stars:5,variant:"Kit Completo",verified:!0,helpful:44},{name:"Pedro Henrique",age:28,location:"Fortaleza, CE",date:"29/01/2026",text:"Custo-benefício imbatível. Pesquisei muito antes de comprar e essa foi a melhor escolha. Material super resistente.",stars:5,variant:"Kit Básico",verified:!0,helpful:26},{name:"Gustavo Ribeiro",age:41,location:"Manaus, AM",date:"28/01/2026",text:"Mesmo morando longe, a entrega foi rápida. Tapete chegou intacto e a qualidade é excepcional. Já é o segundo carro que coloco.",stars:5,variant:"Kit Completo",verified:!0,helpful:19},{name:"Leonardo Silva",age:34,location:"Salvador, BA",date:"27/01/2026",text:"Coloquei no meu T-Cross e ficou impecável. Encaixe perfeito, não desliza nem com sapato molhado. Recomendo de olhos fechados.",stars:5,variant:"Kit Completo",verified:!0,helpful:38},{name:"Matheus Costa",age:25,location:"Campinas, SP",date:"26/01/2026",text:"Primeiro tapete personalizado que compro e superou expectativas. O ilhós metálico é um luxo, fixa firme no piso. Show de bola.",stars:5,variant:"Kit Básico",verified:!0,helpful:33}],J9=[{stars:5,pct:80},{stars:4,pct:13},{stars:3,pct:4},{stars:2,pct:2},{stars:1,pct:1}],Q9=()=>{const[e,t]=b.useState(!1),n=e?[...Wx,...X9]:Wx;return i.jsxs("section",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-10 sm:py-16",children:[i.jsxs("div",{className:"flex flex-col md:flex-row md:items-end justify-between gap-6 mb-10",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"text-2xl sm:text-3xl font-extrabold text-foreground mb-1",children:"O que nossos clientes dizem"}),i.jsx("p",{className:"text-muted-foreground",children:"Avaliações reais de compradores verificados"})]}),i.jsxs("div",{className:"flex items-center gap-6 bg-secondary rounded-xl px-5 py-4",children:[i.jsxs("div",{className:"text-center",children:[i.jsx("p",{className:"text-3xl font-extrabold text-foreground",children:"4.9"}),i.jsx("div",{className:"flex items-center gap-0.5 mt-1",children:Array.from({length:5}).map((r,s)=>i.jsx(wr,{className:"w-3.5 h-3.5 fill-star text-star"},s))}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"3.800+ avaliações"})]}),i.jsx("div",{className:"w-px h-16 bg-border"}),i.jsx("div",{className:"space-y-1",children:J9.map(r=>i.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[i.jsx("span",{className:"w-3 text-muted-foreground",children:r.stars}),i.jsx("div",{className:"w-20 sm:w-24 h-2 bg-border rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-star rounded-full",style:{width:`${r.pct}%`}})}),i.jsxs("span",{className:"w-8 text-muted-foreground",children:[r.pct,"%"]})]},r.stars))})]})]}),i.jsx("div",{className:"columns-1 md:columns-2 gap-5 space-y-5",children:n.map((r,s)=>i.jsxs("div",{className:"break-inside-avoid border border-border rounded-2xl overflow-hidden bg-card hover:shadow-lg transition-shadow duration-300",children:[r.image&&i.jsx("img",{src:r.image,alt:`Foto enviada por ${r.name}`,className:"w-full h-48 object-cover",loading:"lazy"}),i.jsxs("div",{className:"p-5",children:[i.jsx("div",{className:"flex items-center gap-1 mb-3",children:Array.from({length:5}).map((a,o)=>i.jsx(wr,{className:`w-4 h-4 ${ot(!0),className:"gap-2 font-semibold",children:["Ler mais avaliações",i.jsx(Ur,{className:"w-4 h-4"})]})})]})},Ik=()=>{const e=Xt();return b.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),i.jsx("div",{className:"flex min-h-screen items-center justify-center bg-muted",children:i.jsxs("div",{className:"text-center",children:[i.jsx("h1",{className:"mb-4 text-4xl font-bold",children:"404"}),i.jsx("p",{className:"mb-4 text-xl text-muted-foreground",children:"Oops! Page not found"}),i.jsx("a",{href:"/",className:"text-primary underline hover:text-primary/90",children:"Return to Home"})]})})},Y9=()=>{const{slug:e}=o6(),t=xl.find(l=>l.slug===e),n=e==="tapete-bandeja-premium-avulso",[r,s]=b.useState(n?"Kit Básico":"Kit Completo"),[a,o]=b.useState("Preto");return b.useEffect(()=>{Nd(),t&&V5({value:t.price,content_name:t.name})},[t]),t?i.jsxs("div",{className:"min-h-screen bg-background overflow-x-hidden",children:[i.jsx(En,{}),i.jsx(Nn,{}),i.jsx("section",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-6 sm:py-10",children:i.jsxs("div",{className:"grid md:grid-cols-2 gap-6 sm:gap-10",children:[i.jsx(lI,{selectedColor:r,selectedColorOption:a}),i.jsx(M9,{selectedColor:r,onColorChange:s,product:t,selectedColorOption:a,onColorOptionChange:o,singleKit:n?"basico":void 0})]})}),i.jsx($9,{}),i.jsx(D9,{}),i.jsx(U9,{}),i.jsx(V9,{}),i.jsx(Rk,{}),i.jsx(W9,{}),i.jsx(Q9,{}),i.jsx(_n,{})]}):i.jsx(Ik,{})},Z9=()=>i.jsxs("div",{className:"min-h-screen bg-background",children:[i.jsx(En,{}),i.jsx(Nn,{}),i.jsxs("section",{className:"max-w-3xl mx-auto px-6 py-16",children:[i.jsx("h1",{className:"text-4xl font-bold text-foreground mb-6",children:"Sobre a AlphaCars"}),i.jsxs("div",{className:"space-y-6 text-muted-foreground leading-relaxed",children:[i.jsxs("p",{children:["A ",i.jsx("strong",{className:"text-foreground",children:"AlphaCars"})," nasceu da paixão por automóveis e do desejo de oferecer a melhor proteção para o interior do seu veículo com tapetes sob medida de altíssima qualidade."]}),i.jsx("p",{children:"Cada tapete é fabricado com borracha premium de alta durabilidade, com borda elevada que retém líquidos e sujeira — garantindo proteção total para o assoalho do seu carro."}),i.jsxs("div",{className:"grid md:grid-cols-3 gap-8 py-8",children:[i.jsxs("div",{className:"text-center",children:[i.jsx("p",{className:"text-4xl font-extrabold text-foreground mb-2",children:"15K+"}),i.jsx("p",{className:"text-sm",children:"Clientes Satisfeitos"})]}),i.jsxs("div",{className:"text-center",children:[i.jsx("p",{className:"text-4xl font-extrabold text-foreground mb-2",children:"4.9"}),i.jsx("p",{className:"text-sm",children:"Nota Média"})]}),i.jsxs("div",{className:"text-center",children:[i.jsx("p",{className:"text-4xl font-extrabold text-foreground mb-2",children:"500+"}),i.jsx("p",{className:"text-sm",children:"Modelos Atendidos"})]})]}),i.jsx("h2",{className:"text-2xl font-bold text-foreground pt-4",children:"Nossa Missão"}),i.jsx("p",{children:"Oferecer o melhor tapete bandeja do mercado brasileiro. Acreditamos que proteção de qualidade deve ser acessível, sem comprometer materiais, acabamento ou precisão de encaixe."}),i.jsx("h2",{className:"text-2xl font-bold text-foreground pt-4",children:"100% Sob Medida"}),i.jsx("p",{children:"Todos os nossos tapetes são fabricados especificamente para o modelo e ano do seu veículo, garantindo encaixe perfeito e proteção completa. Atendemos mais de 500 modelos de carros."})]})]}),i.jsx(_n,{})]}),eM=[{q:"Qual o prazo de entrega?",a:"O prazo de entrega é de 7 a 15 dias úteis para todo o Brasil. Oferecemos frete grátis em todos os pedidos. Todos os tapetes são fabricados sob medida após a confirmação do pedido."},{q:"Como funciona a garantia de 1 ano?",a:"Oferecemos garantia de 1 ano contra defeitos de fabricação. Se o tapete não servir perfeitamente no seu veículo, refazemos sem custo adicional. Devolução em até 30 dias."},{q:"O tapete serve no meu carro?",a:"Sim! Fabricamos sob medida para qualquer modelo de veículo. Basta informar marca, modelo e ano na hora da compra e produziremos o tapete com encaixe perfeito."},{q:"Os tapetes são de borracha mesmo?",a:"Sim, todos os nossos tapetes são fabricados com borracha premium de alta durabilidade, com borda elevada que retém líquidos e sistema de fixação com ilhós original."},{q:"Quais formas de pagamento são aceitas?",a:"Aceitamos Pix, cartões de crédito (Visa, Mastercard, Elo), boleto bancário e parcelamento em até 12x sem juros."},{q:"Como rastrear meu pedido?",a:"Após a confirmação do envio, você receberá um e-mail e WhatsApp com o código de rastreamento."},{q:"Qual a diferença entre Kit Completo e Kit Básico?",a:"O Kit Completo inclui 3 tapetes internos sob medida + tapete porta-malas premium + aromatizador grátis. O Kit Básico inclui apenas os 3 tapetes internos sob medida."},{q:"Vocês enviam para fora do Brasil?",a:"Atualmente enviamos apenas para endereços no Brasil. Estamos trabalhando para expandir nossas entregas internacionais em breve."}],tM=()=>i.jsxs("div",{className:"min-h-screen bg-background",children:[i.jsx(En,{}),i.jsx(Nn,{}),i.jsxs("section",{className:"max-w-3xl mx-auto px-6 py-16",children:[i.jsx("h1",{className:"text-4xl font-bold text-foreground mb-2",children:"Perguntas Frequentes"}),i.jsx("p",{className:"text-muted-foreground mb-10",children:"Encontre respostas para as dúvidas mais comuns sobre nossos tapetes e serviços."}),i.jsx(qS,{type:"single",collapsible:!0,className:"w-full",children:eM.map((e,t)=>i.jsxs(eo,{value:`item-${t}`,children:[i.jsx(to,{className:"text-base font-semibold text-left",children:e.q}),i.jsx(no,{className:"text-muted-foreground leading-relaxed",children:e.a})]},t))})]}),i.jsx(_n,{})]}),nM=()=>{const[e,t]=b.useState(!1),n=r=>{r.preventDefault(),t(!0)};return i.jsxs("div",{className:"min-h-screen bg-background",children:[i.jsx(En,{}),i.jsx(Nn,{}),i.jsxs("section",{className:"max-w-5xl mx-auto px-6 py-16",children:[i.jsx("h1",{className:"text-4xl font-bold text-foreground mb-2",children:"Fale Conosco"}),i.jsx("p",{className:"text-muted-foreground mb-12",children:"Tem alguma dúvida? Envie uma mensagem e responderemos em até 24 horas."}),i.jsxs("div",{className:"grid md:grid-cols-3 gap-12",children:[i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(ku,{className:"w-5 h-5 text-foreground mt-0.5"}),i.jsxs("div",{children:[i.jsx("p",{className:"font-semibold text-foreground text-sm",children:"E-mail"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"contato@alphacars.com.br"})]})]}),i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(ju,{className:"w-5 h-5 text-foreground mt-0.5"}),i.jsxs("div",{children:[i.jsx("p",{className:"font-semibold text-foreground text-sm",children:"WhatsApp"}),i.jsx("a",{href:"https://wa.me/5531987421056",target:"_blank",rel:"noopener noreferrer",className:"text-sm text-muted-foreground hover:text-foreground transition-colors",children:"(31) 98742-1056"})]})]}),i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(Al,{className:"w-5 h-5 text-foreground mt-0.5"}),i.jsxs("div",{children:[i.jsx("p",{className:"font-semibold text-foreground text-sm",children:"Endereço"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Rua da Bahia, 1148 - Centro, Belo Horizonte - MG, 30160-011"})]})]}),i.jsx("div",{className:"pt-4",children:i.jsxs("p",{className:"text-sm text-muted-foreground",children:[i.jsx("strong",{className:"text-foreground",children:"Horário de atendimento:"}),i.jsx("br",{}),"Segunda a Sexta, 9h às 18h"]})})]}),i.jsx("div",{className:"md:col-span-2",children:e?i.jsxs("div",{className:"bg-secondary rounded-lg p-10 text-center",children:[i.jsx("div",{className:"w-16 h-16 bg-sale-badge rounded-full flex items-center justify-center mx-auto mb-4",children:i.jsx(Xb,{className:"w-7 h-7 text-sale-badge-foreground"})}),i.jsx("h3",{className:"text-xl font-bold text-foreground mb-2",children:"Mensagem enviada!"}),i.jsx("p",{className:"text-muted-foreground",children:"Responderemos em até 24 horas úteis."})]}):i.jsxs("form",{onSubmit:n,className:"space-y-5",children:[i.jsxs("div",{className:"grid md:grid-cols-2 gap-5",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-foreground mb-1.5",children:"Nome"}),i.jsx("input",{type:"text",required:!0,className:"w-full border border-border rounded-md px-4 py-2.5 text-sm bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-foreground/20",placeholder:"Seu nome completo"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-foreground mb-1.5",children:"E-mail"}),i.jsx("input",{type:"email",required:!0,className:"w-full border border-border rounded-md px-4 py-2.5 text-sm bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-foreground/20",placeholder:"seu@email.com"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-foreground mb-1.5",children:"Assunto"}),i.jsx("input",{type:"text",required:!0,className:"w-full border border-border rounded-md px-4 py-2.5 text-sm bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-foreground/20",placeholder:"Sobre o que é sua mensagem?"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-foreground mb-1.5",children:"Mensagem"}),i.jsx("textarea",{required:!0,rows:5,className:"w-full border border-border rounded-md px-4 py-2.5 text-sm bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-foreground/20 resize-none",placeholder:"Escreva sua mensagem..."})]}),i.jsx("button",{type:"submit",className:"bg-foreground text-background px-8 py-3 rounded-md font-bold text-sm hover:opacity-90 transition-opacity",children:"Enviar Mensagem"})]})})]})]}),i.jsx(_n,{})]})};var rM=Object.defineProperty,qu=Object.getOwnPropertySymbols,Ok=Object.prototype.hasOwnProperty,Mk=Object.prototype.propertyIsEnumerable,Kx=(e,t,n)=>t in e?rM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Um=(e,t)=>{for(var n in t||(t={}))Ok.call(t,n)&&Kx(e,n,t[n]);if(qu)for(var n of qu(t))Mk.call(t,n)&&Kx(e,n,t[n]);return e},zm=(e,t)=>{var n={};for(var r in e)Ok.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&qu)for(var r of qu(e))t.indexOf(r)<0&&Mk.call(e,r)&&(n[r]=e[r]);return n};/** * @license QR Code generator library (TypeScript) * Copyright (c) Project Nayuki. * SPDX-License-Identifier: MIT */var xa;(e=>{const t=class ge{constructor(c,d,h,f){if(this.version=c,this.errorCorrectionLevel=d,this.modules=[],this.isFunction=[],cge.MAX_VERSION)throw new RangeError("Version value out of range");if(f<-1||f>7)throw new RangeError("Mask value out of range");this.size=c*4+17;let p=[];for(let y=0;y7)throw new RangeError("Invalid value");let y,g;for(y=h;;y++){const x=ge.getNumDataCodewords(y,d)*8,k=o.getTotalBits(c,y);if(k<=x){g=k;break}if(y>=f)throw new RangeError("Data too long")}for(const x of[ge.Ecc.MEDIUM,ge.Ecc.QUARTILE,ge.Ecc.HIGH])m&&g<=ge.getNumDataCodewords(y,x)*8&&(d=x);let S=[];for(const x of c){n(x.mode.modeBits,4,S),n(x.numChars,x.mode.numCharCountBits(y),S);for(const k of x.getData())S.push(k)}s(S.length==g);const w=ge.getNumDataCodewords(y,d)*8;s(S.length<=w),n(0,Math.min(4,w-S.length),S),n(0,(8-S.length%8)%8,S),s(S.length%8==0);for(let x=236;S.lengthv[k>>>3]|=x<<7-(k&7)),new ge(y,d,v,p)}getModule(c,d){return 0<=c&&c>>9)*1335;const f=(d<<10|h)^21522;s(f>>>15==0);for(let p=0;p<=5;p++)this.setFunctionModule(8,p,r(f,p));this.setFunctionModule(8,7,r(f,6)),this.setFunctionModule(8,8,r(f,7)),this.setFunctionModule(7,8,r(f,8));for(let p=9;p<15;p++)this.setFunctionModule(14-p,8,r(f,p));for(let p=0;p<8;p++)this.setFunctionModule(this.size-1-p,8,r(f,p));for(let p=8;p<15;p++)this.setFunctionModule(8,this.size-15+p,r(f,p));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let c=this.version;for(let h=0;h<12;h++)c=c<<1^(c>>>11)*7973;const d=this.version<<12|c;s(d>>>18==0);for(let h=0;h<18;h++){const f=r(d,h),p=this.size-11+h%3,m=Math.floor(h/3);this.setFunctionModule(p,m,f),this.setFunctionModule(m,p,f)}}drawFinderPattern(c,d){for(let h=-4;h<=4;h++)for(let f=-4;f<=4;f++){const p=Math.max(Math.abs(f),Math.abs(h)),m=c+f,y=d+h;0<=m&&m{(x!=g-p||j>=y)&&v.push(k[x])});return s(v.length==m),v}drawCodewords(c){if(c.length!=Math.floor(ge.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let d=0;for(let h=this.size-1;h>=1;h-=2){h==6&&(h=5);for(let f=0;f>>3],7-(d&7)),d++)}}s(d==c.length*8)}applyMask(c){if(c<0||c>7)throw new RangeError("Mask value out of range");for(let d=0;d5&&c++):(this.finderPenaltyAddHistory(y,g),m||(c+=this.finderPenaltyCountPatterns(g)*ge.PENALTY_N3),m=this.modules[p][S],y=1);c+=this.finderPenaltyTerminateAndCount(m,y,g)*ge.PENALTY_N3}for(let p=0;p5&&c++):(this.finderPenaltyAddHistory(y,g),m||(c+=this.finderPenaltyCountPatterns(g)*ge.PENALTY_N3),m=this.modules[S][p],y=1);c+=this.finderPenaltyTerminateAndCount(m,y,g)*ge.PENALTY_N3}for(let p=0;pm+(y?1:0),d);const h=this.size*this.size,f=Math.ceil(Math.abs(d*20-h*10)/h)-1;return s(0<=f&&f<=9),c+=f*ge.PENALTY_N4,s(0<=c&&c<=2568888),c}getAlignmentPatternPositions(){if(this.version==1)return[];{const c=Math.floor(this.version/7)+2,d=this.version==32?26:Math.ceil((this.version*4+4)/(c*2-2))*2;let h=[6];for(let f=this.size-7;h.lengthge.MAX_VERSION)throw new RangeError("Version number out of range");let d=(16*c+128)*c+64;if(c>=2){const h=Math.floor(c/7)+2;d-=(25*h-10)*h-55,c>=7&&(d-=36)}return s(208<=d&&d<=29648),d}static getNumDataCodewords(c,d){return Math.floor(ge.getNumRawDataModules(c)/8)-ge.ECC_CODEWORDS_PER_BLOCK[d.ordinal][c]*ge.NUM_ERROR_CORRECTION_BLOCKS[d.ordinal][c]}static reedSolomonComputeDivisor(c){if(c<1||c>255)throw new RangeError("Degree out of range");let d=[];for(let f=0;f0);for(const f of c){const p=f^h.shift();h.push(0),d.forEach((m,y)=>h[y]^=ge.reedSolomonMultiply(m,p))}return h}static reedSolomonMultiply(c,d){if(c>>>8||d>>>8)throw new RangeError("Byte out of range");let h=0;for(let f=7;f>=0;f--)h=h<<1^(h>>>7)*285,h^=(d>>>f&1)*c;return s(h>>>8==0),h}finderPenaltyCountPatterns(c){const d=c[1];s(d<=this.size*3);const h=d>0&&c[2]==d&&c[3]==d*3&&c[4]==d&&c[5]==d;return(h&&c[0]>=d*4&&c[6]>=d?1:0)+(h&&c[6]>=d*4&&c[0]>=d?1:0)}finderPenaltyTerminateAndCount(c,d,h){return c&&(this.finderPenaltyAddHistory(d,h),d=0),d+=this.size,this.finderPenaltyAddHistory(d,h),this.finderPenaltyCountPatterns(h)}finderPenaltyAddHistory(c,d){d[0]==0&&(c+=this.size),d.pop(),d.unshift(c)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function n(l,c,d){if(c<0||c>31||l>>>c)throw new RangeError("Value out of range");for(let h=c-1;h>=0;h--)d.push(l>>>h&1)}function r(l,c){return(l>>>c&1)!=0}function s(l){if(!l)throw new Error("Assertion error")}const a=class Ve{constructor(c,d,h){if(this.mode=c,this.numChars=d,this.bitData=h,d<0)throw new RangeError("Invalid argument");this.bitData=h.slice()}static makeBytes(c){let d=[];for(const h of c)n(h,8,d);return new Ve(Ve.Mode.BYTE,c.length,d)}static makeNumeric(c){if(!Ve.isNumeric(c))throw new RangeError("String contains non-numeric characters");let d=[];for(let h=0;h=1<{(t=>{const n=class{constructor(s,a){this.ordinal=s,this.formatBits=a}};n.LOW=new n(0,1),n.MEDIUM=new n(1,0),n.QUARTILE=new n(2,3),n.HIGH=new n(3,2),t.Ecc=n})(e.QrCode||(e.QrCode={}))})(xa||(xa={}));(e=>{(t=>{const n=class{constructor(s,a){this.modeBits=s,this.numBitsCharCount=a}numCharCountBits(s){return this.numBitsCharCount[Math.floor((s+7)/17)]}};n.NUMERIC=new n(1,[10,12,14]),n.ALPHANUMERIC=new n(2,[9,11,13]),n.BYTE=new n(4,[8,16,16]),n.KANJI=new n(8,[8,10,12]),n.ECI=new n(7,[0,0,0]),t.Mode=n})(e.QrSegment||(e.QrSegment={}))})(xa||(xa={}));var ro=xa;/** * @license qrcode.react * Copyright (c) Paul O'Shannessy * SPDX-License-Identifier: ISC */var sM={L:ro.QrCode.Ecc.LOW,M:ro.QrCode.Ecc.MEDIUM,Q:ro.QrCode.Ecc.QUARTILE,H:ro.QrCode.Ecc.HIGH},Lk=128,Dk="L",Fk="#FFFFFF",$k="#000000",Bk=!1,Uk=1,aM=4,oM=0,iM=.1;function zk(e,t=0){const n=[];return e.forEach(function(r,s){let a=null;r.forEach(function(o,l){if(!o&&a!==null){n.push(`M${a+t} ${s+t}h${l-a}v1H${a+t}z`),a=null;return}if(l===r.length-1){if(!o)return;a===null?n.push(`M${l+t},${s+t} h1v1H${l+t}z`):n.push(`M${a+t},${s+t} h${l+1-a}v1H${a+t}z`);return}o&&a===null&&(a=l)})}),n.join("")}function Vk(e,t){return e.slice().map((n,r)=>r=t.y+t.h?n:n.map((s,a)=>a=t.x+t.w?s:!1))}function lM(e,t,n,r){if(r==null)return null;const s=e.length+n*2,a=Math.floor(t*iM),o=s/t,l=(r.width||a)*o,c=(r.height||a)*o,d=r.x==null?e.length/2-l/2:r.x*o,h=r.y==null?e.length/2-c/2:r.y*o,f=r.opacity==null?1:r.opacity;let p=null;if(r.excavate){let y=Math.floor(d),g=Math.floor(h),S=Math.ceil(l+d-y),w=Math.ceil(c+h-g);p={x:y,y:g,w:S,h:w}}const m=r.crossOrigin;return{x:d,y:h,h:c,w:l,excavation:p,opacity:f,crossOrigin:m}}function cM(e,t){return t!=null?Math.max(Math.floor(t),0):e?aM:oM}function Hk({value:e,level:t,minVersion:n,includeMargin:r,marginSize:s,imageSettings:a,size:o,boostLevel:l}){let c=U.useMemo(()=>{const y=(Array.isArray(e)?e:[e]).reduce((g,S)=>(g.push(...ro.QrSegment.makeSegments(S)),g),[]);return ro.QrCode.encodeSegments(y,sM[t],n,void 0,void 0,l)},[e,t,n,l]);const{cells:d,margin:h,numCells:f,calculatedImageSettings:p}=U.useMemo(()=>{let m=c.getModules();const y=cM(r,s),g=m.length+y*2,S=lM(m,o,y,a);return{cells:m,margin:y,numCells:g,calculatedImageSettings:S}},[c,o,a,r,s]);return{qrcode:c,margin:h,cells:d,numCells:f,calculatedImageSettings:p}}var uM=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),dM=U.forwardRef(function(t,n){const r=t,{value:s,size:a=Lk,level:o=Dk,bgColor:l=Fk,fgColor:c=$k,includeMargin:d=Bk,minVersion:h=Uk,boostLevel:f,marginSize:p,imageSettings:m}=r,g=zm(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:S}=g,w=zm(g,["style"]),v=m==null?void 0:m.src,x=U.useRef(null),k=U.useRef(null),j=U.useCallback(D=>{x.current=D,typeof n=="function"?n(D):n&&(n.current=D)},[n]),[C,T]=U.useState(!1),{margin:P,cells:_,numCells:R,calculatedImageSettings:I}=Hk({value:s,level:o,minVersion:h,boostLevel:f,includeMargin:d,marginSize:p,imageSettings:m,size:a});U.useEffect(()=>{if(x.current!=null){const D=x.current,F=D.getContext("2d");if(!F)return;let G=_;const W=k.current,M=I!=null&&W!==null&&W.complete&&W.naturalHeight!==0&&W.naturalWidth!==0;M&&I.excavation!=null&&(G=Vk(_,I.excavation));const $=window.devicePixelRatio||1;D.height=D.width=a*$;const E=a/R*$;F.scale(E,E),F.fillStyle=l,F.fillRect(0,0,R,R),F.fillStyle=c,uM?F.fill(new Path2D(zk(G,P))):_.forEach(function(Y,X){Y.forEach(function(N,te){N&&F.fillRect(te+P,X+P,1,1)})}),I&&(F.globalAlpha=I.opacity),M&&F.drawImage(W,I.x+P,I.y+P,I.w,I.h)}}),U.useEffect(()=>{T(!1)},[v]);const A=Um({height:a,width:a},S);let z=null;return v!=null&&(z=U.createElement("img",{src:v,key:v,style:{display:"none"},onLoad:()=>{T(!0)},ref:k,crossOrigin:I==null?void 0:I.crossOrigin})),U.createElement(U.Fragment,null,U.createElement("canvas",Um({style:A,height:a,width:a,ref:j,role:"img"},w)),z)});dM.displayName="QRCodeCanvas";var Dg=U.forwardRef(function(t,n){const r=t,{value:s,size:a=Lk,level:o=Dk,bgColor:l=Fk,fgColor:c=$k,includeMargin:d=Bk,minVersion:h=Uk,boostLevel:f,title:p,marginSize:m,imageSettings:y}=r,g=zm(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:S,cells:w,numCells:v,calculatedImageSettings:x}=Hk({value:s,level:o,minVersion:h,boostLevel:f,includeMargin:d,marginSize:m,imageSettings:y,size:a});let k=w,j=null;y!=null&&x!=null&&(x.excavation!=null&&(k=Vk(w,x.excavation)),j=U.createElement("image",{href:y.src,height:x.h,width:x.w,x:x.x+S,y:x.y+S,preserveAspectRatio:"none",opacity:x.opacity,crossOrigin:x.crossOrigin}));const C=zk(k,S);return U.createElement("svg",Um({height:a,width:a,viewBox:`0 0 ${v} ${v}`,ref:n,role:"img"},g),!!p&&U.createElement("title",null,p),U.createElement("path",{fill:l,d:`M0,0 h${v}v${v}H0z`,shapeRendering:"crispEdges"}),U.createElement("path",{fill:c,d:C,shapeRendering:"crispEdges"}),j)});Dg.displayName="QRCodeSVG";const dt=b.forwardRef(({className:e,type:t,...n},r)=>i.jsx("input",{type:t,className:Z("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));dt.displayName="Input";var hM="Label",qk=b.forwardRef((e,t)=>i.jsx(_e.label,{...e,ref:t,onMouseDown:n=>{var s;n.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));qk.displayName=hM;var Gk=qk;const fM=Uo("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),nn=b.forwardRef(({className:e,...t},n)=>i.jsx(Gk,{ref:n,className:Z(fM(),e),...t}));nn.displayName=Gk.displayName;const mM=({currentStep:e})=>{const t=[{label:"Dados",number:1},{label:"Pagamento",number:2},{label:"Confirmação",number:3}];return i.jsx("div",{className:"w-full py-3 px-4",children:i.jsx("div",{className:"flex items-center justify-between max-w-sm mx-auto",children:t.map((n,r)=>{const s=n.number{if(!t||!e)return;Fg(),n.current=Date.now(),Qs("pix_generated",{transaction_id:e});const a=()=>Math.floor((Date.now()-n.current)/1e3),o=window.setInterval(()=>{document.visibilityState==="visible"&&Qs("heartbeat",{transaction_id:e,event_data:{elapsed_seconds:a()}})},vM),l=()=>{if(document.visibilityState==="hidden")s.current=Date.now(),Qs("tab_blur",{transaction_id:e,event_data:{elapsed_seconds:a()}});else{const d=s.current?Date.now()-s.current:0;if(s.current=null,d>bM)Qs("returned_after_delay",{transaction_id:e,event_data:{away_seconds:Math.floor(d/1e3),elapsed_seconds:a()}});else{const h=r.current?"user_returned":"tab_focus";Qs(h,{transaction_id:e,event_data:{away_seconds:Math.floor(d/1e3),elapsed_seconds:a()}})}r.current=!0}};document.addEventListener("visibilitychange",l);const c=()=>{xM("checkout_abandoned",{transaction_id:e,event_data:{elapsed_seconds:a()}})};return window.addEventListener("pagehide",c),()=>{clearInterval(o),document.removeEventListener("visibilitychange",l),window.removeEventListener("pagehide",c)}},[e,t])}function Kk(e){try{const t=localStorage.getItem("imperiotapete_checkout");if(t){const n=JSON.parse(t),r=((n==null?void 0:n.state)||"").trim().toUpperCase();if(r&&r!=="MG")return`/upsell-icms?order=${e}`}}catch{}return`/obrigado?order=${e}`}const wM=["AC","AL","AP","AM","BA","CE","DF","ES","GO","MA","MT","MS","MG","PA","PB","PR","PE","PI","RJ","RN","RS","RO","RR","SC","SP","SE","TO"];function SM(e){const t=e.replace(/\D/g,"").slice(0,11);return t.length<=3?t:t.length<=6?`${t.slice(0,3)}.${t.slice(3)}`:t.length<=9?`${t.slice(0,3)}.${t.slice(3,6)}.${t.slice(6)}`:`${t.slice(0,3)}.${t.slice(3,6)}.${t.slice(6,9)}-${t.slice(9)}`}function Uh(e){const t=e.replace(/\D/g,"");if(t.length!==11||/^(\d)\1{10}$/.test(t))return!1;let n=0;for(let s=0;s<9;s++)n+=parseInt(t[s])*(10-s);let r=11-n%11;if(r>=10&&(r=0),r!==parseInt(t[9]))return!1;n=0;for(let s=0;s<10;s++)n+=parseInt(t[s])*(11-s);return r=11-n%11,r>=10&&(r=0),r===parseInt(t[10])}function kM(e){const t=e.replace(/\D/g,"").slice(0,11);return t.length<=2?`(${t}`:t.length<=7?`(${t.slice(0,2)}) ${t.slice(2)}`:`(${t.slice(0,2)}) ${t.slice(2,7)}-${t.slice(7)}`}function CM(e){const t=e.replace(/\D/g,"").slice(0,8);return t.length<=5?t:`${t.slice(0,5)}-${t.slice(5)}`}const jM=()=>{const e=Go(),[t]=Ed(),n=parseInt(t.get("qty")||"1"),r=t.get("size")||"",s=t.get("color")||"",a=t.get("colorOption")||"Preto",o=t.get("product")||"1",l=t.get("texture")||"",c=s.toLowerCase().includes("completo"),d=c?"Kit Interno + Porta Malas":"Kit Interno",h={Preto:"/images/kit-completo-hero.webp",Cinza:"/images/tapete-cinza.webp",Branco:"/images/tapete-branco.webp"},f={Preto:"/images/halvor-tapete-3.webp",Cinza:"/images/tapete-cinza.webp",Branco:"/images/tapete-branco.webp"},p=c?h[a]||h.Preto:f[a]||f.Preto,m=xl.find(V=>V.id===o),y=m==null?void 0:m.kitPrices,S=Math.round(c?((y==null?void 0:y.completo.price)??119.97)*100:((y==null?void 0:y.basico.price)??89.91)*100)*n;b.useEffect(()=>{Nd()},[]);const w=Lu(),v=[{img:"/images/review-1-opt.jpg",name:"Eduardo C.",text:"Encaixou perfeitamente no meu Corolla. Qualidade top, parece peça original."},{img:"/images/review-2-opt.jpg",name:"Henrique B.",text:"Já é o segundo kit que compro. Protege demais e deixa o carro com cara de novo."},{img:"/images/review-3-opt.jpg",name:"Gabriel N.",text:"Melhor custo-benefício que encontrei. Acabamento perfeito e entrega rápida."},{img:"/images/review-4-opt.jpg",name:"André T.",text:"Instalei sozinho em 5 minutos. Encaixe perfeito, minha esposa nem acreditou."},{img:"/images/review-5-opt.jpg",name:"Bruno M.",text:"Coloquei no meu Civic e ficou perfeito, encaixe 100%. Já derrubei café e não vazou nada. 🔥"},{img:"/images/review-6-opt.jpg",name:"Marcelo D.",text:"Material resistente de verdade. Depois de 6 meses tá como novo."}],[x,k]=b.useState(0);b.useEffect(()=>{const V=setInterval(()=>{k(ue=>(ue+1)%v.length)},8e3);return()=>clearInterval(V)},[]);const j=t.get("preview")==="pix",[C,T]=b.useState(j?"pix":"form"),[P,_]=b.useState(!1),[R,I]=b.useState(!1),[A,z]=b.useState(j?{qrCode:"00020126580014br.gov.bcb.pix0136mock-preview-code-pix-studio-cars-preview-12345678901234567890",qrCodeImage:"",transactionId:"PREVIEW-123"}:null);b.useState(!1);const[D,F]=b.useState("waiting"),[G,W]=b.useState(1800),M=b.useRef(null),[$,E]=b.useState(!1),[Y,X]=b.useState(""),[N,te]=b.useState(null),[ke,fe]=b.useState(null),[me,it]=b.useState("free"),[Je,pt]=b.useState(!1),[rt,Qn]=b.useState(!1),[Qt,Nr]=b.useState(!1),[Rt,_r]=b.useState(!1),[Qr,Tn]=b.useState(!1),It=b.useRef(null);Wk(A==null?void 0:A.transactionId,!j&&C==="pix"&&!!(A!=null&&A.transactionId));const Yn={TAPETE5:.05,TESTE90:.9},Pn=me==="full"?2545:me==="correios"?1760:0,Vs=N&&Yn[N]?Math.round(S*Yn[N]):0,An=(Je?990:0)+(rt?1500:0),gn=S-Vs+Pn+An,Zo=()=>{fe(null);const V=Y.trim().toUpperCase();if(!V){fe("Digite um cupom");return}Yn[V]?(te(V),X("")):fe("Cupom inválido ou expirado")},L=()=>{te(null),fe(null)},[O,re]=b.useState({name:"",email:"",cpf:"",phone:"",cep:"",address:"",number:"",complement:"",neighborhood:"",city:"",state:""}),pe=b.useRef(!1);b.useEffect(()=>{H5({value:S/100})},[]);const le=(V,ue)=>{let xe=ue;if(V==="cpf"&&(xe=SM(ue)),V==="phone"&&(xe=kM(ue)),V==="cep"&&(xe=CM(ue)),V==="state"&&(xe=ue.toUpperCase().slice(0,2)),re(Ke=>({...Ke,[V]:xe})),V==="email"&&O.name&&!pe.current){pe.current=!0;const Ke=O.name.trim().split(/\s+/);G5({value:S/100,userData:{email:ue,firstName:Ke[0],lastName:Ke.slice(1).join(" ")}})}},kt=async()=>{const V=O.cep.replace(/\D/g,"");if(V.length===8){E(!0);try{const xe=await(await fetch(`https://viacep.com.br/ws/${V}/json/`)).json();xe.erro||(re(Ke=>({...Ke,address:xe.logradouro||Ke.address,neighborhood:xe.bairro||Ke.neighborhood,city:xe.localidade||Ke.city,state:xe.uf||Ke.state})),setTimeout(()=>{var Ke;return(Ke=document.getElementById("number-input"))==null?void 0:Ke.focus()},100))}catch{}finally{E(!1)}}};b.useEffect(()=>{O.cep.replace(/\D/g,"").length===8&&kt()},[O.cep]);const yn=async V=>{if(V.preventDefault(),!Uh(O.cpf)){ve.error("CPF inválido. Verifique os números digitados e tente novamente.");return}_(!0);const ue=O.name.trim().split(/\s+/);ES({email:O.email,phone:O.phone,firstName:ue[0],lastName:ue.slice(1).join(" "),city:O.city,state:O.state,zipCode:O.cep}),q5({value:gn/100,userData:{email:O.email,phone:O.phone,firstName:ue[0],lastName:ue.slice(1).join(" "),city:O.city,state:O.state,zipCode:O.cep}});try{const{data:xe,error:Ke}=await tt.functions.invoke("create-pix-payment",{body:{amount:gn,customer:{name:O.name,email:O.email,document:O.cpf,phone:O.phone},items:[{name:"Tapete Bandeja Premium",description:"Tapete Premium AlphaCars",quantity:n,amount:gn}],shipping:{name:O.name,address:O.address,number:O.number,complement:O.complement,neighborhood:O.neighborhood,city:O.city,state:O.state,zipCode:O.cep},trackingParameters:{...w},client_user_agent:navigator.userAgent}});if(Ke)throw Ke;xe!=null&&xe.success?(z({qrCode:xe.pix.qrCode,qrCodeImage:xe.pix.qrCodeImage,transactionId:xe.transactionId}),T("pix"),window.scrollTo({top:0,behavior:"instant"}),localStorage.setItem("imperiotapete_checkout",JSON.stringify({orderId:xe.transactionId,amount:gn,email:O.email,phone:O.phone,name:O.name,cpf:O.cpf,city:O.city,state:O.state,zipCode:O.cep,timestamp:Date.now()})),localStorage.setItem("imperiotapete_pix",JSON.stringify({transactionId:xe.transactionId,qrCode:xe.pix.qrCode,qrCodeImage:xe.pix.qrCodeImage,amount:gn,name:O.name,email:O.email,phone:O.phone,cpf:O.cpf,createdAt:Date.now()})),M.current=window.setInterval(()=>{W(tr=>tr<=1?(M.current&&clearInterval(M.current),0):tr-1)},1e3)):ve.error((xe==null?void 0:xe.error)||"Erro ao criar pagamento")}catch(xe){console.error(xe),ve.error("Erro ao processar pagamento. Tente novamente.")}finally{_(!1)}},Ct=()=>{A!=null&&A.qrCode&&(navigator.clipboard.writeText(A.qrCode),I(!0),setTimeout(()=>I(!1),3e3),!j&&A.transactionId&&Qs("pix_copied",{transaction_id:A.transactionId}))},Ot=async V=>{var Ke;const ue=(Ke=V.target.files)==null?void 0:Ke[0];if(!ue)return;if(ue.size>10*1024*1024){ve.error("Arquivo muito grande",{description:"Tamanho máximo: 10MB"});return}const xe=(A==null?void 0:A.transactionId)||"preview";Nr(!0);try{const tr=ue.name.split(".").pop()||"bin",Yt=new Date(Date.now()-3*60*60*1e3),Ca=XC=>String(XC).padStart(2,"0"),ie=Ca(Yt.getUTCDate()),Ce=Ca(Yt.getUTCMonth()+1),Ne=Ca(Yt.getUTCHours()),Mt=Ca(Yt.getUTCMinutes()),Zt=`${ie}/${Ce} ${Ne}:${Mt} - ${ue.name}`,nr=`${ie}-${Ce}_${Ne}-${Mt}`,Tr=ue.name.replace(/\.[^.]+$/,"").replace(/[^\w.-]+/g,"_"),Lt=`${xe}/${nr}__${Tr}.${tr}`,{error:Rn}=await tt.storage.from("payment-receipts").upload(Lt,ue,{upsert:!1,contentType:ue.type});if(Rn)throw Rn;const{data:KC}=tt.storage.from("payment-receipts").getPublicUrl(Lt);await tt.from("payment_receipts").insert({order_id:xe,file_name:Zt,file_url:KC.publicUrl}),_r(!0),Tn(!0)}catch(tr){console.error(tr),ve.error("Erro ao enviar comprovante",{description:"Tente novamente."})}finally{Nr(!1),It.current&&(It.current.value="")}};b.useEffect(()=>{if(C!=="pix"||!(A!=null&&A.transactionId)||j)return;const V=setInterval(async()=>{try{F("checking");const{data:ue}=await tt.functions.invoke("check-pix-payment",{body:{transactionId:A.transactionId,customerData:{name:O.name,email:O.email,phone:O.phone,cpf:O.cpf},trackingParameters:w,amount:gn}});ue!=null&&ue.isPaid?(clearInterval(V),F("paid"),setTimeout(()=>e(Kk(A.transactionId)),2e3)):F("waiting")}catch{F("waiting")}},1e4);return()=>clearInterval(V)},[C,A]),b.useEffect(()=>()=>{M.current&&clearInterval(M.current)},[]),b.useEffect(()=>{if(j&&!M.current)return M.current=window.setInterval(()=>{W(V=>V<=1?(M.current&&clearInterval(M.current),0):V-1)},1e3),()=>{M.current&&(clearInterval(M.current),M.current=null)}},[j]);const Zn=V=>{const ue=Math.floor(V/60),xe=V%60;return`${ue.toString().padStart(2,"0")}:${xe.toString().padStart(2,"0")}`},$e=Math.round(c?((y==null?void 0:y.completo.originalPrice)??249.9)*100:((y==null?void 0:y.basico.originalPrice)??197)*100),er=$e-S;return i.jsxs("div",{className:"min-h-screen bg-background",children:[i.jsx("header",{className:"border-b border-border/60 bg-background py-4 sticky top-0 z-40 shadow-sm",children:i.jsxs("div",{className:"container max-w-4xl mx-auto px-4 flex items-center justify-between",children:[i.jsx(se,{to:"/produto/kit-tapete-bandeja-premium",children:i.jsx("img",{src:Id,alt:"AlphaCars",className:"h-12 sm:h-14 object-contain"})}),i.jsxs("div",{className:"flex items-center gap-2 text-xs sm:text-sm text-muted-foreground",children:[i.jsx(ls,{className:"w-4 h-4 text-foreground/40"}),i.jsx("span",{className:"font-medium",children:"Checkout Seguro"})]})]})}),i.jsxs("main",{className:"container max-w-xl mx-auto px-4 sm:px-6 py-6 sm:py-10",children:[C==="form"&&i.jsxs("div",{className:"space-y-5 animate-fade-in",children:[i.jsx(mM,{currentStep:1}),i.jsxs("div",{className:"bg-background border border-border rounded-2xl overflow-hidden",children:[i.jsxs("div",{className:"p-5 sm:p-6",children:[i.jsxs("div",{className:"flex items-start gap-4",children:[i.jsxs("div",{className:"relative",children:[i.jsx("img",{src:p,alt:"Tapete Bandeja Premium",className:"w-[88px] h-[88px] rounded-2xl object-cover border border-border flex-shrink-0"}),i.jsx("span",{className:"absolute -top-1.5 -right-1.5 bg-foreground text-background text-[10px] font-bold px-2 py-0.5 rounded-full",children:"1x"})]}),i.jsxs("div",{className:"flex-1 min-w-0 pt-0.5",children:[i.jsx("p",{className:"text-base font-bold text-foreground leading-snug",children:d}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Tapete Bandeja Premium"}),i.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 mt-2",children:[i.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] font-semibold px-2 py-0.5 rounded-full bg-secondary text-foreground border border-border",children:[i.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:a.toLowerCase()==="preto"?"#1a1a1a":a.toLowerCase()==="cinza"?"#6b6b6b":"#f5f5f5",border:"1px solid hsl(var(--border))"}}),a]}),l&&i.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] font-semibold px-2 py-0.5 rounded-full bg-secondary text-foreground border border-border",children:["✨ Textura ",l]}),r&&i.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] font-semibold px-2 py-0.5 rounded-full bg-secondary text-foreground border border-border",children:["🚗 ",r]})]}),i.jsxs("div",{className:"flex items-baseline gap-2.5 mt-2.5",children:[i.jsxs("span",{className:"text-2xl font-extrabold text-foreground tracking-tight",children:["R$ ",(S/100).toFixed(2).replace(".",",")]}),i.jsxs("span",{className:"text-sm line-through text-muted-foreground/60",children:["R$ ",($e/100).toFixed(2).replace(".",",")]})]})]})]}),i.jsxs("div",{className:"flex items-center gap-2 mt-4",children:[i.jsxs("div",{className:"flex-1 flex items-center gap-2 py-2.5 px-3 bg-sale-badge/10 rounded-xl",children:[i.jsx(Sy,{className:"w-3.5 h-3.5 text-sale-badge"}),i.jsxs("span",{className:"text-xs font-bold text-sale-badge",children:["Economia de R$ ",(er/100).toFixed(2).replace(".",",")]})]}),i.jsxs("div",{className:"flex items-center gap-2 py-2.5 px-3 bg-success/10 border border-success/30 rounded-xl",children:[i.jsx(by,{className:"w-3.5 h-3.5 text-success shrink-0"}),i.jsx("span",{className:"text-xs font-bold text-success",children:"Brinde grátis incluído!"})]})]})]}),i.jsxs("div",{className:"grid grid-cols-3 divide-x divide-border border-t border-border",children:[i.jsxs("div",{className:"flex flex-col items-center gap-1 py-3",children:[i.jsx(dn,{className:"w-4 h-4 text-muted-foreground"}),i.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground",children:"Frete Grátis"})]}),i.jsxs("div",{className:"flex flex-col items-center gap-1 py-3",children:[i.jsx($r,{className:"w-4 h-4 text-muted-foreground"}),i.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground",children:"Garantia 1 Ano"})]}),i.jsxs("div",{className:"flex flex-col items-center gap-1 py-3",children:[i.jsx(an,{className:"w-4 h-4 text-muted-foreground"}),i.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground",children:"30 Dias Troca"})]})]})]}),i.jsxs("form",{onSubmit:yn,className:"space-y-5",children:[i.jsxs("div",{className:"bg-background border border-border rounded-2xl p-5 sm:p-6",children:[i.jsxs("h2",{className:"text-sm font-bold text-foreground mb-5 flex items-center gap-2.5 uppercase tracking-wide",children:[i.jsx("span",{className:"w-7 h-7 rounded-lg bg-foreground text-background text-xs font-bold flex items-center justify-center",children:"1"}),"Seus Dados"]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx(nn,{htmlFor:"name",className:"text-sm font-medium text-foreground",children:"Nome Completo"}),i.jsx(dt,{id:"name",placeholder:"Digite seu nome completo",required:!0,value:O.name,onChange:V=>le("name",V.target.value),className:"mt-1.5 h-12 text-base rounded-xl border-border/80 focus:border-foreground"})]}),i.jsxs("div",{children:[i.jsx(nn,{htmlFor:"email",className:"text-sm font-medium text-foreground",children:"E-mail"}),i.jsx(dt,{id:"email",type:"email",placeholder:"seuemail@exemplo.com",required:!0,value:O.email,onChange:V=>le("email",V.target.value),className:"mt-1.5 h-12 text-base rounded-xl border-border/80 focus:border-foreground"})]}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx(nn,{htmlFor:"cpf",className:"text-sm font-medium text-foreground",children:"CPF"}),i.jsx(dt,{id:"cpf",placeholder:"000.000.000-00",inputMode:"numeric",required:!0,value:O.cpf,onChange:V=>le("cpf",V.target.value),className:`mt-1.5 h-12 text-base rounded-xl focus:border-foreground ${O.cpf.replace(/\D/g,"").length===11&&!Uh(O.cpf)?"border-destructive focus:border-destructive":"border-border/80"}`}),O.cpf.replace(/\D/g,"").length===11&&!Uh(O.cpf)&&i.jsx("p",{className:"mt-1 text-xs text-destructive",children:"CPF inválido. Verifique os números."})]}),i.jsxs("div",{children:[i.jsx(nn,{htmlFor:"phone",className:"text-sm font-medium text-foreground",children:"Telefone / WhatsApp"}),i.jsxs("div",{className:"relative mt-1.5",children:[i.jsxs("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 flex items-center gap-1.5 pointer-events-none select-none",children:[i.jsx("span",{className:"text-base leading-none","aria-hidden":!0,children:"🇧🇷"}),i.jsx("span",{className:"text-sm text-foreground/60 font-medium",children:"+55"}),i.jsx("span",{className:"h-5 w-px bg-border/80"})]}),i.jsx(dt,{id:"phone",placeholder:"(11) 99999-9999",inputMode:"numeric",pattern:"\\(\\d{2}\\) \\d{5}-\\d{4}",maxLength:15,required:!0,value:O.phone,onChange:V=>le("phone",V.target.value),onKeyDown:V=>{["Backspace","Delete","ArrowLeft","ArrowRight","Tab","Home","End"].includes(V.key)||V.metaKey||V.ctrlKey||/^\d$/.test(V.key)||V.preventDefault()},className:`h-12 text-base rounded-xl border-border/80 focus:border-foreground pl-[88px] ${O.phone.replace(/\D/g,"").length>0&&O.phone.replace(/\D/g,"").length<10?"border-destructive focus:border-destructive":""}`})]})]})]})]})]}),i.jsxs("div",{className:"bg-background border border-border rounded-2xl p-5 sm:p-6",children:[i.jsxs("h2",{className:"text-sm font-bold text-foreground mb-5 flex items-center gap-2.5 uppercase tracking-wide",children:[i.jsx("span",{className:"w-7 h-7 rounded-lg bg-foreground text-background text-xs font-bold flex items-center justify-center",children:"2"}),"Endereço de Entrega"]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx(nn,{htmlFor:"cep",className:"text-sm font-medium text-foreground",children:"CEP"}),i.jsxs("div",{className:"flex items-center gap-3 mt-1.5",children:[i.jsxs("div",{className:"relative",children:[i.jsx(dt,{id:"cep",placeholder:"00000-000",inputMode:"numeric",required:!0,value:O.cep,onChange:V=>le("cep",V.target.value),className:"max-w-[160px] pr-8 h-12 text-base rounded-xl border-border/80 focus:border-foreground"}),$&&i.jsx(Wt,{className:"absolute right-2.5 top-1/2 -translate-y-1/2 w-4 h-4 animate-spin text-foreground/50"})]}),i.jsxs("a",{href:"https://buscacepinter.correios.com.br/app/endereco/index.php",target:"_blank",rel:"noopener noreferrer",className:"text-sm text-foreground/60 hover:text-foreground hover:underline flex items-center gap-1 transition-colors",children:[i.jsx(Al,{className:"w-3.5 h-3.5"})," Não sei meu CEP"]})]})]}),O.cep.replace(/\D/g,"").length===8&&i.jsxs("div",{className:"space-y-4 animate-fade-in",children:[i.jsxs("div",{children:[i.jsx(nn,{htmlFor:"address",className:"text-sm font-medium text-foreground",children:"Endereço"}),i.jsx(dt,{id:"address",placeholder:"Rua, Avenida...",required:!0,value:O.address,onChange:V=>le("address",V.target.value),className:"mt-1.5 h-12 text-base rounded-xl border-border/80 focus:border-foreground"})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx(nn,{htmlFor:"number-input",className:"text-sm font-medium text-foreground",children:"Número"}),i.jsx(dt,{id:"number-input",placeholder:"123",inputMode:"numeric",required:!0,value:O.number,onChange:V=>le("number",V.target.value),className:"mt-1.5 h-12 text-base rounded-xl border-border/80 focus:border-foreground"})]}),i.jsxs("div",{children:[i.jsx(nn,{htmlFor:"complement",className:"text-sm font-medium text-foreground",children:"Complemento"}),i.jsx(dt,{id:"complement",placeholder:"Apto, Bloco...",value:O.complement,onChange:V=>le("complement",V.target.value),className:"mt-1.5 h-12 text-base rounded-xl border-border/80 focus:border-foreground"})]})]}),i.jsxs("div",{children:[i.jsx(nn,{htmlFor:"neighborhood",className:"text-sm font-medium text-foreground",children:"Bairro"}),i.jsx(dt,{id:"neighborhood",placeholder:"Seu bairro",required:!0,value:O.neighborhood,onChange:V=>le("neighborhood",V.target.value),className:"mt-1.5 h-12 text-base rounded-xl border-border/80 focus:border-foreground"})]}),i.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[i.jsxs("div",{className:"col-span-2",children:[i.jsx(nn,{htmlFor:"city",className:"text-sm font-medium text-foreground",children:"Cidade"}),i.jsx(dt,{id:"city",placeholder:"Sua cidade",required:!0,value:O.city,onChange:V=>le("city",V.target.value),className:"mt-1.5 h-12 text-base rounded-xl border-border/80 focus:border-foreground"})]}),i.jsxs("div",{children:[i.jsx(nn,{htmlFor:"state",className:"text-sm font-medium text-foreground",children:"Estado"}),i.jsxs("select",{className:"flex h-12 w-full rounded-xl border border-border/80 bg-background px-3 py-2 text-base mt-1.5 focus:border-foreground focus:outline-none",required:!0,value:O.state,onChange:V=>le("state",V.target.value),children:[i.jsx("option",{value:"",children:"UF"}),wM.map(V=>i.jsx("option",{value:V,children:V},V))]})]})]})]}),O.cep.replace(/\D/g,"").length===8&&i.jsxs("div",{className:"mt-4 pt-4 border-t border-border/60 animate-fade-in",children:[i.jsxs("p",{className:"text-sm font-bold text-foreground mb-3 flex items-center gap-2",children:[i.jsx(dn,{className:"w-4 h-4 text-foreground/50"})," Frete"]}),i.jsx("div",{className:"space-y-2.5",children:[{key:"free",label:"Frete Grátis",time:"10 a 15 dias",logo:"/images/logo-correios.svg",logoAlt:"Correios",price:"Grátis",priceClass:"text-sale-badge"},{key:"correios",label:"SEDEX - ENVIO RÁPIDO",time:"5 a 7 dias",logo:"/images/logo-correios.svg",logoAlt:"Correios",price:"R$ 17,60",priceClass:"text-foreground"},{key:"full",label:"JadLog",time:"3 a 6 dias",logo:"/images/logo-jadlog.webp",logoAlt:"JadLog",price:"R$ 25,45",priceClass:"text-foreground"}].map(V=>{const ue=me===V.key;return i.jsxs("label",{className:`flex items-center gap-3 px-4 py-3 rounded-xl border-2 cursor-pointer transition-all ${ue?"border-foreground bg-secondary/60":"border-border hover:border-foreground/30"}`,onClick:()=>it(V.key),children:[i.jsx("div",{className:`w-[18px] h-[18px] rounded-full border-2 flex items-center justify-center shrink-0 ${ue?"border-foreground":"border-border"}`,children:ue&&i.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-foreground"})}),i.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[i.jsx("span",{className:"text-[13px] font-bold text-foreground leading-tight truncate",children:V.label}),i.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[i.jsx("span",{className:"text-[11px] text-muted-foreground",children:V.time}),i.jsx("img",{src:V.logo,alt:V.logoAlt,loading:"lazy",className:`w-auto object-contain ${V.key==="full"?"h-[18px]":"h-[15px]"}`})]})]}),i.jsx("span",{className:`text-sm font-bold whitespace-nowrap ${V.priceClass}`,children:V.price})]},V.key)})})]})]})]}),i.jsxs("div",{className:"bg-background border border-border rounded-2xl overflow-hidden",children:[i.jsxs("div",{className:"p-5 sm:p-6",children:[i.jsxs("h2",{className:"text-sm font-bold text-foreground mb-5 flex items-center gap-2.5 uppercase tracking-wide",children:[i.jsx("span",{className:"w-7 h-7 rounded-lg bg-foreground text-background text-xs font-bold flex items-center justify-center",children:"3"}),"Pagamento"]}),N?i.jsx("div",{className:"mb-5 pb-4 border-b border-border/60",children:i.jsxs("div",{className:"flex items-center justify-between p-3 bg-sale-badge/10 border border-sale-badge/20 rounded-xl",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(an,{className:"w-4 h-4 text-sale-badge"}),i.jsx("span",{className:"text-sm font-bold text-sale-badge",children:N}),i.jsxs("span",{className:"text-xs text-muted-foreground",children:["(-",Math.round((Yn[N]||0)*100),"%)"]})]}),i.jsx("button",{type:"button",onClick:L,className:"text-xs text-muted-foreground hover:text-destructive hover:underline transition-colors",children:"Remover"})]})}):i.jsxs("details",{className:"mb-5 pb-4 border-b border-border/60 group",children:[i.jsxs("summary",{className:"text-sm text-muted-foreground cursor-pointer hover:text-foreground transition-colors list-none flex items-center gap-1.5",children:[i.jsx(Sy,{className:"w-3.5 h-3.5"}),i.jsx("span",{className:"underline",children:"Tem cupom?"})]}),i.jsxs("div",{className:"mt-3 flex gap-2",children:[i.jsx(dt,{placeholder:"Digite o cupom",value:Y,onChange:V=>{X(V.target.value.toUpperCase()),fe(null)},className:"flex-1 text-base uppercase h-11 rounded-xl"}),i.jsx(be,{type:"button",variant:"outline",onClick:Zo,className:"px-5 rounded-xl",children:"Aplicar"})]}),ke&&i.jsxs("p",{className:"text-sm text-destructive mt-2 flex items-center gap-1",children:[i.jsx(qb,{className:"w-3.5 h-3.5"})," ",ke]})]}),i.jsxs("div",{className:"space-y-3 mb-6",children:[i.jsxs("label",{className:`flex items-center gap-4 p-4 rounded-2xl border-2 cursor-pointer transition-all ${Je?"border-foreground bg-secondary/50 shadow-sm":"border-border hover:border-foreground/30"}`,children:[i.jsx("input",{type:"checkbox",checked:Je,onChange:V=>pt(V.target.checked),className:"accent-foreground w-5 h-5 flex-shrink-0"}),i.jsx("span",{className:"flex-1 font-semibold text-foreground text-sm",children:"🛡️ Garantia estendida +1 ano"}),i.jsx("span",{className:"font-extrabold text-foreground text-sm whitespace-nowrap",children:"+R$ 9,90"})]}),i.jsxs("label",{className:`flex items-center gap-4 p-4 rounded-2xl border-2 cursor-pointer transition-all ${rt?"border-foreground bg-secondary/50 shadow-sm":"border-border hover:border-foreground/30"}`,children:[i.jsx("input",{type:"checkbox",checked:rt,onChange:V=>Qn(V.target.checked),className:"accent-foreground w-5 h-5 flex-shrink-0"}),i.jsx("img",{src:"/images/areon-smile.webp",alt:"Areon",className:"w-10 h-10 rounded-lg object-cover flex-shrink-0"}),i.jsx("span",{className:"flex-1 font-semibold text-foreground text-sm",children:"Aromatizador Areon Vanilla"}),i.jsx("span",{className:"font-extrabold text-foreground text-sm whitespace-nowrap",children:"+R$ 15,00"})]})]}),i.jsxs("div",{className:"space-y-2.5 mb-5",children:[i.jsxs("div",{className:"flex items-center justify-between text-sm",children:[i.jsx("span",{className:"text-muted-foreground",children:"Subtotal"}),i.jsxs("span",{className:"text-foreground font-medium",children:["R$ ",(S/100).toFixed(2).replace(".",",")]})]}),i.jsxs("div",{className:"flex items-center justify-between text-sm",children:[i.jsx("span",{className:"text-muted-foreground",children:"Frete"}),Pn===0?i.jsx("span",{className:"text-sale-badge font-semibold",children:"Grátis"}):i.jsxs("span",{className:"text-foreground font-medium",children:["R$ ",(Pn/100).toFixed(2).replace(".",",")]})]}),Je&&i.jsxs("div",{className:"flex items-center justify-between text-sm",children:[i.jsx("span",{className:"text-muted-foreground",children:"Garantia estendida"}),i.jsx("span",{className:"text-foreground font-medium",children:"R$ 9,90"})]}),rt&&i.jsxs("div",{className:"flex items-center justify-between text-sm",children:[i.jsx("span",{className:"text-muted-foreground",children:"Aromatizador Areon"}),i.jsx("span",{className:"text-foreground font-medium",children:"R$ 15,00"})]}),N&&i.jsxs("div",{className:"flex items-center justify-between text-sm",children:[i.jsx("span",{className:"text-sale-badge font-medium",children:"Desconto"}),i.jsxs("span",{className:"text-sale-badge font-bold",children:["- R$ ",(Vs/100).toFixed(2).replace(".",",")]})]})]}),i.jsxs("div",{className:"flex items-center gap-2.5 p-3 bg-success/10 border border-success/30 rounded-xl mb-5",children:[i.jsx(by,{className:"w-4 h-4 text-success shrink-0"}),i.jsx("span",{className:"text-xs font-bold text-success flex-1",children:"Brinde grátis incluído!"}),i.jsx("span",{className:"text-[10px] font-bold text-success bg-success/15 px-2 py-0.5 rounded-full",children:"GRÁTIS 🎁"})]}),i.jsxs("div",{className:"flex items-center justify-between py-4 mb-5 border-y border-border/60",children:[i.jsx("span",{className:"text-base font-bold text-foreground",children:"Total"}),i.jsxs("div",{className:"text-right",children:[i.jsxs("span",{className:"text-3xl sm:text-4xl font-extrabold text-foreground tracking-tight",children:["R$ ",(gn/100).toFixed(2).replace(".",",")]}),i.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 font-medium",children:"pagamento instantâneo via PIX"})]})]}),i.jsxs(be,{type:"submit",disabled:P,className:"w-full h-[60px] text-lg font-bold transition-all duration-200 hover:opacity-90 active:scale-[0.99] bg-foreground text-background shadow-xl rounded-2xl relative overflow-hidden group",children:[i.jsx("span",{className:"absolute inset-0 w-full h-full bg-gradient-to-r from-transparent via-white/10 to-transparent -translate-x-full group-hover:translate-x-full transition-transform duration-700"}),P?i.jsxs(i.Fragment,{children:[i.jsx(Wt,{className:"w-5 h-5 mr-2.5 animate-spin"})," Processando..."]}):i.jsxs(i.Fragment,{children:[i.jsx(ls,{className:"w-5 h-5 mr-2.5"})," FINALIZAR COMPRA"]})]}),i.jsxs("div",{className:"flex items-center justify-center gap-4 mt-4",children:[i.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-muted-foreground font-medium",children:[i.jsx($r,{className:"w-3.5 h-3.5"})," Compra Segura"]}),i.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-muted-foreground font-medium",children:[i.jsx(ls,{className:"w-3.5 h-3.5"})," SSL 256-bit"]})]})]}),i.jsxs("div",{className:"border-t border-border/60 p-5 sm:p-6 bg-secondary/30 transition-all duration-500",children:[i.jsxs("div",{className:"flex flex-col gap-3 animate-fade-in",children:[i.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[i.jsx("span",{className:"text-sm font-bold text-foreground",children:v[x].name}),i.jsx("div",{className:"flex items-center gap-0.5",children:[...Array(5)].map((V,ue)=>i.jsx(wr,{className:"w-3.5 h-3.5 fill-star text-star"},ue))}),i.jsx(an,{className:"w-3 h-3 text-sale-badge"}),i.jsx("span",{className:"text-[10px] text-muted-foreground",children:"compra verificada"})]}),i.jsx("p",{className:"text-sm text-foreground leading-relaxed",children:v[x].text}),i.jsx("img",{src:v[x].img,alt:`Foto enviada por ${v[x].name}`,loading:"lazy",className:"w-full h-56 sm:h-64 rounded-lg object-cover border border-border"})]},x),i.jsx("div",{className:"flex items-center justify-center gap-1.5 mt-4",children:v.map((V,ue)=>i.jsx("div",{className:`h-1 rounded-full transition-all duration-300 ${ue===x?"w-6 bg-foreground":"w-1.5 bg-border"}`},ue))})]})]})]})]}),C==="pix"&&i.jsxs("div",{className:"max-w-lg mx-auto animate-fade-in",children:[i.jsxs("div",{className:"text-center mb-4",children:[i.jsx("h1",{className:"text-2xl font-bold text-foreground tracking-tight",children:"Finalize o pagamento"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1.5",children:"Escaneie o QR Code ou copie o código abaixo"})]}),i.jsxs("div",{className:"rounded-xl overflow-hidden",children:[i.jsxs("div",{className:"bg-foreground text-background px-4 py-3 flex items-center justify-between gap-3",children:[i.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[i.jsx(Ns,{className:`w-4 h-4 shrink-0 ${G<=300?"text-destructive animate-pulse":"text-background/70"}`}),i.jsxs("div",{className:"flex flex-col leading-tight min-w-0",children:[i.jsx("span",{className:"text-[10px] text-background/60 font-medium",children:"Pagamento expira em"}),i.jsx("span",{className:`text-lg font-bold tracking-tight tabular-nums ${G<=300?"text-destructive":"text-background"}`,children:Zn(G).replace(":"," : ")})]})]}),i.jsxs("div",{className:"text-right",children:[i.jsx("p",{className:"text-[10px] text-background/60 font-medium uppercase tracking-wider",children:"Total a pagar"}),i.jsxs("p",{className:"text-lg font-bold tracking-tight mt-0.5",children:["R$ ",(gn/100).toFixed(2).replace(".",",")]})]})]}),i.jsxs("div",{className:"bg-background",children:[i.jsx("div",{className:"px-4 pt-5 pb-4 flex justify-center",children:A!=null&&A.qrCode?i.jsx("div",{className:"bg-white p-3 rounded-xl border border-border",children:i.jsx(Dg,{value:A.qrCode,size:200,level:"M"})}):i.jsx("div",{className:"w-[224px] h-[224px] rounded-xl bg-secondary animate-pulse"})}),i.jsxs("div",{className:"px-4 flex items-center gap-3",children:[i.jsx("div",{className:"flex-1 h-px bg-border"}),i.jsx("span",{className:"text-[11px] text-muted-foreground",children:"ou copie o código abaixo"}),i.jsx("div",{className:"flex-1 h-px bg-border"})]}),i.jsxs("div",{className:"px-4 pt-3",children:[i.jsx("p",{className:"text-xs font-semibold text-foreground mb-1.5",children:"Pix copia e cola"}),(A==null?void 0:A.qrCode)&&i.jsx("div",{className:"bg-secondary/60 border border-border rounded-lg p-2.5 break-all text-[11px] text-foreground/70 font-mono select-all max-h-20 overflow-y-auto leading-relaxed",children:A.qrCode})]}),i.jsxs("div",{className:"px-4 pb-4 pt-3",children:[i.jsx(be,{onClick:Ct,disabled:!(A!=null&&A.qrCode),className:`w-full h-12 text-sm font-bold transition-all duration-300 rounded-xl tracking-wide ${R?"bg-foreground":"bg-foreground hover:opacity-90 active:scale-[0.99]"}`,children:R?i.jsxs(i.Fragment,{children:[i.jsx(Vt,{className:"w-4 h-4 mr-2"})," CÓDIGO COPIADO!"]}):i.jsxs(i.Fragment,{children:[i.jsx(nl,{className:"w-4 h-4 mr-2"})," COPIAR CÓDIGO PIX"]})}),i.jsxs("div",{className:"mt-3 flex items-center justify-center gap-2",children:[i.jsxs("span",{className:"relative flex h-2 w-2",children:[i.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-60"}),i.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-primary"})]}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Aguardando confirmação do pagamento..."})]})]})]})]}),i.jsxs("div",{className:`mt-3 rounded-xl border p-3 transition-all duration-300 ${Rt?"border-success/40 bg-success/5":"border-border bg-background"}`,children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx("div",{className:"shrink-0",children:Rt?i.jsx("div",{className:"w-6 h-6 rounded-full bg-success flex items-center justify-center animate-scale-in",children:i.jsx(Vt,{className:"w-3.5 h-3.5 text-success-foreground",strokeWidth:3})}):i.jsx(rl,{className:"w-4 h-4 text-muted-foreground"})}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("p",{className:`text-xs font-semibold leading-tight transition-colors ${Rt?"text-success":"text-foreground"}`,children:Rt?"Comprovante enviado com sucesso!":"Já pagou? Envie o comprovante"}),i.jsx("p",{className:"text-[11px] text-muted-foreground leading-snug",children:Rt?"Recebemos seu envio. Em breve confirmamos o pagamento.":"Acelere a confirmação (PNG, JPG ou PDF)."})]})]}),i.jsx("input",{ref:It,type:"file",accept:"image/*,application/pdf",className:"hidden",onChange:Ot}),i.jsx(be,{type:"button",onClick:()=>{var V;return(V=It.current)==null?void 0:V.click()},disabled:Qt,variant:"outline",size:"sm",className:`w-full h-9 mt-2.5 text-xs font-medium rounded-lg transition-all duration-300 ${Rt?"border-success/50 bg-success/10 text-success hover:bg-success/20 hover:text-success":""}`,children:Qt?i.jsxs(i.Fragment,{children:[i.jsx(Wt,{className:"w-3.5 h-3.5 mr-1.5 animate-spin"})," Enviando..."]}):Rt?i.jsxs("span",{className:"inline-flex items-center animate-fade-in",children:[i.jsx(Vt,{className:"w-3.5 h-3.5 mr-1.5",strokeWidth:3})," Enviar outro"]}):i.jsxs(i.Fragment,{children:[i.jsx(rl,{className:"w-3.5 h-3.5 mr-1.5"})," Enviar comprovante"]})})]}),i.jsx(Dl,{open:Qr,onOpenChange:Tn,children:i.jsxs(Ko,{className:"max-w-sm",children:[i.jsxs(Xo,{children:[i.jsx("div",{className:"mx-auto w-14 h-14 rounded-full bg-success/15 flex items-center justify-center mb-2",children:i.jsx(an,{className:"w-8 h-8 text-success"})}),i.jsx(Jo,{className:"text-center",children:"Comprovante recebido!"}),i.jsx(Fl,{className:"text-center",children:"Recebemos seu comprovante com sucesso. Assim que o pagamento for confirmado, você será redirecionado automaticamente."})]}),i.jsx(be,{onClick:()=>Tn(!1),className:"w-full h-11 rounded-xl mt-2",children:"Continuar aguardando"})]})}),D==="paid"&&i.jsx("div",{className:"mt-5 bg-sale-badge/10 rounded-xl p-4 text-center",children:i.jsxs("p",{className:"text-base text-sale-badge font-bold animate-pulse flex items-center justify-center gap-2",children:[i.jsx(Vt,{className:"w-5 h-5"})," Pagamento confirmado! Redirecionando..."]})}),i.jsxs("a",{href:"https://www.reclameaqui.com.br/",target:"_blank",rel:"noopener noreferrer",className:"block mt-5 bg-white border border-[#E1E6E9] rounded-xl overflow-hidden hover:shadow-md transition-shadow",children:[i.jsxs("div",{className:"px-4 pt-3 pb-2 border-b border-[#E1E6E9] flex items-center justify-between",children:[i.jsxs("span",{className:"text-sm font-extrabold tracking-tight",children:[i.jsx("span",{className:"text-[#0D5D3B]",children:"Reclame"}),i.jsx("span",{className:"text-[#7FBB3F]",children:"AQUI"})]}),i.jsx("span",{className:"text-[10px] text-[#6B7B85] font-medium",children:"Reputação verificada"})]}),i.jsxs("div",{className:"px-4 py-4 flex items-center gap-4",children:[i.jsxs("div",{className:"relative w-[88px] h-[52px] shrink-0",children:[i.jsxs("svg",{viewBox:"0 0 100 56",className:"w-full h-full",children:[i.jsx("path",{d:"M6 50 A 44 44 0 0 1 94 50",fill:"none",stroke:"#E1E6E9",strokeWidth:"8",strokeLinecap:"round"}),i.jsx("path",{d:"M6 50 A 44 44 0 0 1 94 50",fill:"none",stroke:"#7FBB3F",strokeWidth:"8",strokeLinecap:"round",strokeDasharray:"138",strokeDashoffset:"18"})]}),i.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-end pb-0.5",children:i.jsx("span",{className:"text-2xl font-extrabold text-[#0D5D3B] leading-none tabular-nums",children:"8.7"})})]}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("p",{className:"text-[10px] text-[#6B7B85] uppercase tracking-wider font-bold",children:"Reputação"}),i.jsx("p",{className:"text-base font-extrabold text-[#7FBB3F] leading-tight mt-0.5",children:"ÓTIMO"}),i.jsx("p",{className:"text-[10px] text-[#6B7B85] mt-0.5",children:"Últimos 6 meses"})]}),i.jsxs("div",{className:"shrink-0 w-12 h-12 rounded-full bg-gradient-to-br from-[#0D5D3B] to-[#0a4a2f] flex flex-col items-center justify-center text-white shadow-sm",children:[i.jsx("span",{className:"text-[8px] font-bold leading-none",children:"RA"}),i.jsx("span",{className:"text-sm font-extrabold leading-none mt-0.5",children:"1000"})]})]}),i.jsxs("div",{className:"border-t border-[#E1E6E9] px-4 py-2.5 bg-[#F5F7F8]",children:[i.jsx("p",{className:"text-[11px] text-[#0D2030] font-semibold leading-snug",children:"AlphaCars Belo Horizonte"}),i.jsx("p",{className:"text-[10px] text-[#6B7B85] leading-snug mt-0.5",children:"Rua da Bahia, 1148 · Centro · Belo Horizonte / MG"})]})]}),i.jsxs("div",{className:"mt-4 flex items-center justify-center gap-3 text-[11px] text-muted-foreground",children:[i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx($r,{className:"w-3 h-3"})," Seguro"]}),i.jsx("div",{className:"w-px h-3 bg-border"}),i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx(ls,{className:"w-3 h-3"})," Criptografado"]}),i.jsx("div",{className:"w-px h-3 bg-border"}),i.jsx("span",{children:"Banco Central"})]})]})]}),i.jsx("footer",{className:"bg-foreground text-background mt-10",children:i.jsx("div",{className:"py-8",children:i.jsx("div",{className:"container max-w-4xl mx-auto px-4",children:i.jsxs("div",{className:"flex flex-col items-center gap-5",children:[i.jsx("span",{className:"text-lg font-extrabold tracking-tight",children:"AlphaCars"}),i.jsx("div",{className:"flex items-center gap-6",children:[{icon:$r,label:"Compra Segura"},{icon:ls,label:"SSL 256-bit"},{icon:an,label:"Satisfação"},{icon:dn,label:"Entrega"}].map(V=>i.jsxs("div",{className:"flex flex-col items-center gap-1.5",children:[i.jsx(V.icon,{className:"w-5 h-5 text-background/60"}),i.jsx("span",{className:"text-[10px] text-background/50 font-medium",children:V.label})]},V.label))}),i.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-x-4 gap-y-1 text-xs text-background/40",children:[i.jsx(se,{to:"/termos-de-uso",className:"hover:text-background transition-colors",children:"Termos"}),i.jsx(se,{to:"/politica-de-privacidade",className:"hover:text-background transition-colors",children:"Privacidade"}),i.jsx(se,{to:"/trocas-e-devolucoes",className:"hover:text-background transition-colors",children:"Trocas"}),i.jsx(se,{to:"/politica-de-envio",className:"hover:text-background transition-colors",children:"Envio"}),i.jsx(se,{to:"/politica-de-reembolso",className:"hover:text-background transition-colors",children:"Reembolso"})]}),i.jsx("p",{className:"text-xs text-background/30",children:"© 2026 AlphaCars"})]})})})})]})},EM={transactionId:"PREVIEW-123456",qrCode:"00020126580014br.gov.bcb.pix0136preview-mock-code-alphacars-pix-12345678901234567890520400005303986540592.155802BR5925ALPHACARS COMERCIO LTDA6009SAO PAULO62070503***6304ABCD",amount:9215,name:"Cliente Preview",email:"preview@alphacars.com.br",phone:"11999999999",cpf:"00000000000",createdAt:Date.now()},zh=30*60*1e3,Qx=e=>(e/100).toLocaleString("pt-BR",{style:"currency",currency:"BRL"}),NM=e=>{const t=Math.floor(e/60).toString().padStart(2,"0"),n=(e%60).toString().padStart(2,"0");return`${t}:${n}`};function Yx(){const e=Go(),[t]=Ed(),n=Xt(),r=t.get("preview")==="1"||n.pathname==="/pix-preview",[s,a]=b.useState(null),[o,l]=b.useState(!1);b.useState(!1);const[c,d]=b.useState("waiting"),[h,f]=b.useState(0),[p,m]=b.useState(!1),[y,g]=b.useState(!1),S=b.useRef(null),w=b.useRef(null),v=b.useRef(null);Wk(s==null?void 0:s.transactionId,!r&&!!s),b.useEffect(()=>{if(r){a(EM),f(Math.floor(zh/1e3));return}try{const j=localStorage.getItem("imperiotapete_pix");if(!j)return;const C=JSON.parse(j),T=Date.now()-C.createdAt;if(T>zh){localStorage.removeItem("imperiotapete_pix");return}a(C),f(Math.max(0,Math.floor((zh-T)/1e3)))}catch(j){console.error(j)}},[r]),b.useEffect(()=>{if(s)return w.current=window.setInterval(()=>{f(j=>j<=1?(w.current&&clearInterval(w.current),0):j-1)},1e3),()=>{w.current&&clearInterval(w.current)}},[s]),b.useEffect(()=>{if(!s||c==="paid"||r)return;const j=async(C=!0)=>{try{const{data:T}=await tt.functions.invoke("check-pix-payment",{body:{transactionId:s.transactionId,customerData:{name:s.name,email:s.email,phone:s.phone,cpf:s.cpf},amount:s.amount}});T!=null&&T.isPaid&&(d("paid"),C||ve.success("Pagamento confirmado!"),setTimeout(()=>e(Kk(s.transactionId)),1500))}catch(T){console.error(T)}};return v.current=window.setInterval(()=>j(!0),8e3),()=>{v.current&&clearInterval(v.current)}},[s,c,e,r]);const x=()=>{s!=null&&s.qrCode&&(navigator.clipboard.writeText(s.qrCode),l(!0),ve.success("Código PIX copiado!"),setTimeout(()=>l(!1),3e3),r||Qs("pix_copied",{transaction_id:s.transactionId}))},k=async j=>{var P;const C=(P=j.target.files)==null?void 0:P[0];if(!C)return;if(C.size>10*1024*1024){ve.error("Arquivo muito grande",{description:"Máximo de 10MB."}),S.current&&(S.current.value="");return}if(r){ve.success("Comprovante enviado (preview)"),g(!0),S.current&&(S.current.value="");return}const T=(s==null?void 0:s.transactionId)||"preview";m(!0);try{const _=C.name.split(".").pop()||"bin",R=C.name.replace(/\.[^.]+$/,"").replace(/[^a-zA-Z0-9-_]+/g,"_").slice(0,60)||"comprovante",I=C.name,A=new Date().toISOString().replace(/[:.]/g,"-"),z=`${T}/${A}__${R}.${_}`,{error:D}=await tt.storage.from("payment-receipts").upload(z,C,{upsert:!1,contentType:C.type});if(D)throw D;const{data:F}=tt.storage.from("payment-receipts").getPublicUrl(z);await tt.from("payment_receipts").insert({order_id:T,file_name:I,file_url:F.publicUrl}),g(!0),ve.success("Comprovante enviado!",{description:"Recebemos seu envio. Em breve confirmamos."})}catch(_){console.error(_),ve.error("Erro ao enviar comprovante",{description:"Tente novamente."})}finally{m(!1),S.current&&(S.current.value="")}};return s?i.jsxs("div",{className:"min-h-screen bg-background",children:[i.jsx("header",{className:"border-b border-border bg-background sticky top-0 z-10",children:i.jsx("div",{className:"max-w-md mx-auto px-4 h-14 flex items-center justify-center",children:i.jsx("img",{src:Id,alt:"Logo",className:"h-9"})})}),i.jsxs("main",{className:"max-w-md mx-auto px-4 py-6 space-y-4",children:[c==="paid"?i.jsxs("div",{className:"bg-primary/10 border border-primary/30 rounded-xl p-4 flex items-center gap-3",children:[i.jsx(an,{className:"w-6 h-6 text-primary flex-shrink-0"}),i.jsxs("div",{children:[i.jsx("p",{className:"font-bold text-foreground text-sm",children:"Pagamento confirmado!"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Redirecionando..."})]})]}):i.jsxs("div",{className:"text-center pt-1 space-y-1.5",children:[i.jsx("h1",{className:"text-lg font-bold text-foreground tracking-tight leading-snug",children:"Pague o PIX para finalizar seu pedido"}),i.jsxs("p",{className:"text-xs text-muted-foreground inline-flex items-center gap-1.5",children:[i.jsx(Ns,{className:"w-3.5 h-3.5"}),"Pedido reservado por",i.jsx("span",{className:"font-mono font-bold text-foreground tabular-nums",children:NM(h)})]})]}),i.jsxs("div",{className:"bg-card border border-border rounded-2xl overflow-hidden shadow-sm",children:[i.jsxs("div",{className:"px-5 pt-6 pb-5 text-center bg-gradient-to-b from-secondary/40 to-transparent border-b border-border",children:[i.jsx("p",{className:"text-[11px] uppercase tracking-wider text-muted-foreground font-semibold",children:"Valor a pagar"}),i.jsx("p",{className:"text-4xl font-extrabold text-foreground mt-1.5 tracking-tight",children:Qx(s.amount)}),i.jsxs("p",{className:"text-[11px] text-muted-foreground mt-1.5 flex items-center justify-center gap-1",children:[i.jsx(j_,{className:"w-3 h-3"})," Pagamento via PIX · aprovação em segundos"]})]}),i.jsxs("div",{className:"px-5 pt-5 pb-5",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[i.jsx("span",{className:"w-6 h-6 rounded-full bg-foreground text-background text-xs font-bold flex items-center justify-center",children:"1"}),i.jsx("p",{className:"text-sm font-bold text-foreground",children:"Copie o código PIX"})]}),i.jsxs("div",{className:"bg-secondary/50 border border-border rounded-xl p-3 mb-3",children:[i.jsx("p",{className:"text-[11px] text-muted-foreground font-medium mb-1.5",children:"Pix copia e cola"}),i.jsx("div",{className:"break-all text-[11px] text-foreground/70 font-mono select-all max-h-16 overflow-y-auto leading-relaxed",children:s.qrCode})]}),i.jsx(be,{onClick:x,className:`w-full h-14 text-base font-bold rounded-xl shadow-sm transition-all ${o?"bg-success text-success-foreground hover:bg-success/90":""}`,children:o?i.jsxs(i.Fragment,{children:[i.jsx(Vt,{className:"w-5 h-5 mr-2",strokeWidth:3})," Código copiado!"]}):i.jsxs(i.Fragment,{children:[i.jsx(nl,{className:"w-5 h-5 mr-2"})," Copiar código PIX"]})}),o&&i.jsx("p",{className:"text-[11px] text-success font-semibold text-center mt-2 animate-fade-in",children:"Agora abra o app do seu banco e cole no PIX"})]}),i.jsxs("div",{className:"px-5 pt-4 pb-5 border-t border-border bg-secondary/20",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[i.jsx("span",{className:"w-6 h-6 rounded-full bg-foreground text-background text-xs font-bold flex items-center justify-center",children:"2"}),i.jsx("p",{className:"text-sm font-bold text-foreground",children:"Pague no app do seu banco"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-start gap-2.5 text-xs text-foreground/80",children:[i.jsx(q_,{className:"w-4 h-4 mt-0.5 shrink-0 text-foreground/60"}),i.jsxs("span",{children:["Abra seu banco e entre na área ",i.jsx("span",{className:"font-semibold",children:"PIX"})]})]}),i.jsxs("div",{className:"flex items-start gap-2.5 text-xs text-foreground/80",children:[i.jsx(nl,{className:"w-4 h-4 mt-0.5 shrink-0 text-foreground/60"}),i.jsxs("span",{children:["Escolha ",i.jsx("span",{className:"font-semibold",children:"PIX Copia e Cola"})," e cole o código"]})]}),i.jsxs("div",{className:"flex items-start gap-2.5 text-xs text-foreground/80",children:[i.jsx(an,{className:"w-4 h-4 mt-0.5 shrink-0 text-foreground/60"}),i.jsxs("span",{children:["Confirme o valor de ",i.jsx("span",{className:"font-semibold",children:Qx(s.amount)})," e finalize"]})]})]})]})]}),c!=="paid"&&i.jsxs("div",{className:`rounded-xl border p-4 transition-all ${y?"border-primary/40 bg-primary/5":"border-border bg-card"}`,children:[i.jsxs("div",{className:"flex items-start gap-2.5",children:[i.jsx("div",{className:"shrink-0 mt-0.5",children:y?i.jsx("div",{className:"w-6 h-6 rounded-full bg-primary flex items-center justify-center",children:i.jsx(Vt,{className:"w-3.5 h-3.5 text-primary-foreground",strokeWidth:3})}):i.jsx("div",{className:"w-6 h-6 rounded-full bg-secondary border border-border flex items-center justify-center",children:i.jsx(rl,{className:"w-3 h-3 text-foreground/70"})})}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("p",{className:"text-sm font-semibold text-foreground leading-tight",children:y?"Comprovante recebido!":"Já pagou? Envie o comprovante"}),i.jsx("p",{className:"text-[11px] text-muted-foreground leading-snug mt-0.5",children:y?"Em breve confirmamos seu pagamento.":"Acelera a confirmação. Aceita PNG, JPG ou PDF."})]})]}),i.jsx("input",{ref:S,type:"file",accept:"image/*,application/pdf",className:"hidden",onChange:k}),i.jsx(be,{type:"button",onClick:()=>{var j;return(j=S.current)==null?void 0:j.click()},disabled:p,variant:"outline",size:"sm",className:"w-full h-10 mt-3 text-xs font-semibold rounded-lg",children:p?i.jsxs(i.Fragment,{children:[i.jsx(Wt,{className:"w-3.5 h-3.5 mr-1.5 animate-spin"})," Enviando..."]}):y?i.jsxs(i.Fragment,{children:[i.jsx(Vt,{className:"w-3.5 h-3.5 mr-1.5",strokeWidth:3})," Enviar outro"]}):i.jsxs(i.Fragment,{children:[i.jsx(rl,{className:"w-3.5 h-3.5 mr-1.5"})," Enviar comprovante"]})})]}),i.jsxs("div",{className:"flex items-center justify-center gap-2 text-xs text-muted-foreground pt-2",children:[i.jsx(jr,{className:"w-4 h-4"}),i.jsx("span",{children:"Pagamento 100% seguro e criptografado"})]})]})]}):i.jsx("div",{className:"min-h-screen bg-background flex flex-col items-center justify-center px-4",children:i.jsxs("div",{className:"max-w-md w-full text-center space-y-4",children:[i.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Nenhum PIX ativo"}),i.jsx("p",{className:"text-muted-foreground text-sm",children:"Você ainda não gerou um código PIX ou ele expirou. Faça uma nova compra para gerar."}),i.jsx(se,{to:"/checkout",children:i.jsx(be,{className:"w-full h-12",children:"Ir para o checkout"})}),i.jsx(se,{to:"/",className:"block text-sm text-muted-foreground hover:text-foreground",children:"← Voltar para a loja"})]})})}const Vh="imperiotapete_tracked_purchases",_M=()=>{const[e]=Ed(),t=e.get("order")||"",n=b.useRef(!1),[r,s]=b.useState(!1),[a,o]=b.useState(!1),[l,c]=b.useState(!1),[d,h]=b.useState(!1),f=b.useRef(null),p=["image/jpeg","image/png","image/webp","image/heic","application/pdf"],m=b.useCallback(async v=>{if(t){if(!p.includes(v.type)){ve.error("Formato não aceito",{description:"Envie uma imagem (JPG, PNG) ou PDF."});return}if(v.size>10*1024*1024){ve.error("Arquivo muito grande",{description:"O tamanho máximo é 10MB."});return}s(!0);try{const x=v.name.split(".").pop()||"jpg",k=`${t}/${Date.now()}.${x}`,{error:j}=await tt.storage.from("payment-receipts").upload(k,v,{contentType:v.type});if(j)throw j;const{data:C}=tt.storage.from("payment-receipts").getPublicUrl(k);await tt.from("payment_receipts").insert({order_id:t,file_url:C.publicUrl,file_name:v.name}),o(!0),c(!0)}catch(x){console.error(x),ve.error("Erro ao enviar comprovante",{description:"Tente novamente."})}finally{s(!1)}}},[t]),y=v=>{var k;const x=(k=v.target.files)==null?void 0:k[0];x&&m(x)},g=v=>{var k;v.preventDefault(),h(!1);const x=(k=v.dataTransfer.files)==null?void 0:k[0];x&&m(x)},S=v=>{try{return JSON.parse(localStorage.getItem(Vh)||"[]").includes(v)}catch{return!1}},w=v=>{try{const x=JSON.parse(localStorage.getItem(Vh)||"[]");x.includes(v)||(x.push(v),x.length>50&&x.shift(),localStorage.setItem(Vh,JSON.stringify(x)))}catch{}};return b.useEffect(()=>{if(window.scrollTo({top:0}),t&&fetch("https://fklcoarnnuwiaeshpdaa.supabase.co/functions/v1/track-thank-you",{method:"POST",headers:{"Content-Type":"application/json",apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImZrbGNvYXJubnV3aWFlc2hwZGFhIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzY4NzQ3NTcsImV4cCI6MjA5MjQ1MDc1N30.D_N9pi2Ndoq-0VO6RmscLI5B_I2Q_aUTl7aYB_j-xR0"},body:JSON.stringify({orderId:t})}).catch(T=>console.warn("track-thank-you failed",T)),n.current)return;if(n.current=!0,t&&S(t)){console.log("ThankYou: Purchase already tracked for order",t,"(skipping)"),localStorage.removeItem("imperiotapete_checkout");return}const v=localStorage.getItem("imperiotapete_checkout");let x=null;if(v)try{x=JSON.parse(v)}catch{}const k=x!=null&&x.amount?Number(x.amount)/100:92.15,j=((x==null?void 0:x.name)||"").trim().split(/\s+/);x&&ES({email:x.email,phone:x.phone,firstName:j[0],lastName:j.slice(1).join(" "),city:x.city,state:x.state,zipCode:x.zipCode,country:"br"});const C=`purchase_${t}`;W5({value:k,order_id:t,event_id:C,email:x==null?void 0:x.email,phone:x==null?void 0:x.phone,firstName:j[0],lastName:j.slice(1).join(" "),city:x==null?void 0:x.city,state:x==null?void 0:x.state,zipCode:x==null?void 0:x.zipCode}),t&&w(t),localStorage.removeItem("imperiotapete_checkout"),$6()},[t]),i.jsxs("div",{className:"min-h-screen bg-background relative overflow-hidden",children:[i.jsxs("div",{className:"pointer-events-none absolute inset-0 -z-10",children:[i.jsx("div",{className:"absolute -top-32 -left-32 w-96 h-96 bg-foreground/[0.04] rounded-full blur-3xl"}),i.jsx("div",{className:"absolute -bottom-32 -right-32 w-96 h-96 bg-foreground/[0.04] rounded-full blur-3xl"})]}),i.jsxs("main",{className:"max-w-lg mx-auto px-5 pt-10 pb-16",children:[i.jsxs("div",{className:"text-center mb-8",children:[i.jsx("div",{className:"relative inline-flex",children:i.jsx("div",{className:"w-14 h-14 bg-foreground rounded-2xl flex items-center justify-center shadow-xl shadow-foreground/20 rotate-3",children:i.jsx(an,{className:"w-8 h-8 text-background",strokeWidth:2.5})})}),i.jsx("h1",{className:"text-[28px] leading-tight font-extrabold text-foreground mt-5 tracking-tight",children:"Pagamento confirmado"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-2 max-w-xs mx-auto",children:"Seu pedido foi recebido. Falta um último passo para acelerar a entrega."})]}),i.jsxs("section",{className:"bg-card rounded-3xl border border-border shadow-sm overflow-hidden",children:[i.jsxs("div",{className:"bg-foreground text-background px-5 py-3 flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Jb,{className:"w-4 h-4"}),i.jsx("span",{className:"text-xs font-bold uppercase tracking-wider",children:"Passo final"})]}),i.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] opacity-80",children:[i.jsx(Ns,{className:"w-3 h-3"}),i.jsx("span",{children:"2 min"})]})]}),i.jsx("div",{className:"p-6",children:a?i.jsxs("div",{className:"flex flex-col items-center text-center py-4",children:[i.jsx("div",{className:"w-14 h-14 rounded-full bg-foreground flex items-center justify-center mb-3",children:i.jsx(vy,{className:"w-7 h-7 text-background"})}),i.jsx("p",{className:"text-base font-bold text-foreground",children:"Comprovante recebido"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Seu pedido entrou na fila prioritária. Obrigado!"})]}):i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:"text-lg font-bold text-foreground text-center",children:"Envie o comprovante de pagamento"}),i.jsx("p",{className:"text-[13px] text-muted-foreground text-center mt-1.5 mb-5",children:"Print ou PDF do app do banco. Liberamos sua entrega imediatamente."}),i.jsx("input",{ref:f,type:"file",accept:".jpg,.jpeg,.png,.webp,.pdf",className:"hidden",onChange:y}),i.jsx("button",{type:"button",disabled:r,onClick:()=>{var v;return(v=f.current)==null?void 0:v.click()},onDragOver:v=>{v.preventDefault(),h(!0)},onDragLeave:()=>h(!1),onDrop:g,className:` w-full group relative rounded-2xl border-2 border-dashed transition-all p-8 ${d?"border-foreground bg-foreground/5":"border-border hover:border-foreground/40 hover:bg-secondary/40"} ${r?"opacity-60 cursor-wait":"cursor-pointer"} `,children:r?i.jsxs("div",{className:"flex flex-col items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 border-2 border-foreground border-t-transparent rounded-full animate-spin"}),i.jsx("p",{className:"text-sm text-foreground font-semibold",children:"Enviando comprovante..."})]}):i.jsxs("div",{className:"flex flex-col items-center gap-3",children:[i.jsx("div",{className:"w-14 h-14 rounded-2xl bg-foreground text-background flex items-center justify-center transition-transform group-hover:-translate-y-0.5 group-hover:scale-105",children:i.jsx(rl,{className:"w-6 h-6",strokeWidth:2.2})}),i.jsxs("div",{className:"text-center",children:[i.jsx("p",{className:"text-[15px] font-bold text-foreground",children:"Toque para enviar"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"ou arraste o arquivo aqui"})]})]})}),i.jsxs("div",{className:"flex items-center justify-center gap-4 mt-4 text-[11px] text-muted-foreground",children:[i.jsxs("span",{className:"inline-flex items-center gap-1",children:[i.jsx(Kb,{className:"w-3 h-3"})," JPG, PNG"]}),i.jsx("span",{className:"w-px h-3 bg-border"}),i.jsxs("span",{className:"inline-flex items-center gap-1",children:[i.jsx(md,{className:"w-3 h-3"})," PDF"]}),i.jsx("span",{className:"w-px h-3 bg-border"}),i.jsx("span",{children:"Até 10MB"})]})]})})]}),i.jsxs("section",{className:"mt-5 bg-card rounded-3xl border border-border p-5",children:[t&&i.jsxs("div",{className:"flex items-center justify-between pb-4 border-b border-border",children:[i.jsx("span",{className:"text-[11px] uppercase tracking-wider text-muted-foreground font-semibold",children:"Pedido"}),i.jsx("span",{className:"font-mono text-xs text-foreground select-all",children:t})]}),i.jsx("ul",{className:"pt-4 space-y-3",children:["E-mail de confirmação enviado","Preparação e envio em até 2 dias úteis","Código de rastreio por e-mail ao despachar"].map((v,x)=>i.jsxs("li",{className:"flex items-start gap-3 text-sm",children:[i.jsx("span",{className:"mt-0.5 w-5 h-5 rounded-full bg-secondary border border-border text-[11px] font-bold text-foreground flex items-center justify-center flex-shrink-0",children:x+1}),i.jsx("span",{className:"text-foreground/80",children:v})]},x))})]}),i.jsxs(se,{to:"/",className:"mt-6 inline-flex w-full items-center justify-center gap-2 bg-foreground text-background h-14 rounded-2xl font-bold hover:opacity-90 transition-opacity active:scale-[0.99]",children:["Continuar comprando",i.jsx(k_,{className:"w-4 h-4"})]}),i.jsxs("div",{className:"mt-5 flex items-center justify-center gap-2 text-[11px] text-muted-foreground",children:[i.jsx(jr,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"Compra protegida e dados criptografados"})]}),i.jsx(Dl,{open:l,onOpenChange:c,children:i.jsxs(Ko,{className:"max-w-sm text-center rounded-3xl",children:[i.jsxs(Xo,{children:[i.jsx("div",{className:"w-16 h-16 rounded-2xl bg-foreground flex items-center justify-center mx-auto mb-3 animate-in zoom-in duration-300",children:i.jsx(vy,{className:"w-9 h-9 text-background"})}),i.jsx(Jo,{className:"text-xl text-center",children:"Comprovante enviado!"}),i.jsx(Fl,{className:"text-center pt-2",children:"Recebemos seu comprovante. Seu pedido será priorizado e enviado o quanto antes."})]}),i.jsx(Lg,{className:"sm:justify-center pt-2",children:i.jsx(be,{onClick:()=>c(!1),className:"w-full h-12 rounded-xl",children:"Entendi, obrigado!"})})]})})]})]})},TM=.22,jc="imperiotapete_icms_pix",Hh=e=>(e/100).toLocaleString("pt-BR",{style:"currency",currency:"BRL"}),Zx=()=>{const e=Go(),[t]=Ed(),n=Xt(),r=t.get("preview")==="1"||n.pathname==="/upsell-icms-preview",s=t.get("order")||(r?"PREVIEW-123456":""),[a,o]=b.useState(null),[l,c]=b.useState(null),[d,h]=b.useState(!1),[f,p]=b.useState(!1),[m,y]=b.useState(!1),[g,S]=b.useState(!1),w=b.useRef(null);b.useEffect(()=>{if(r){o({amount:"9215",name:"Cliente Preview",email:"preview@alphacars.com.br",phone:"11999999999",cpf:"00000000000",city:"São Paulo",state:"SP",zipCode:"01310-100"});return}try{const P=localStorage.getItem("imperiotapete_checkout");P&&o(JSON.parse(P))}catch{}try{const P=localStorage.getItem(jc);if(P){const _=JSON.parse(P);_.orderId===s&&c(_)}}catch{}},[s,r]);const v=b.useMemo(()=>{const P=Number((a==null?void 0:a.amount)||0);return P?Math.round(P*TM):0},[a]),x=Number((a==null?void 0:a.amount)||0),k=async()=>{var P;if(!a||!v){ve.error("Dados do pedido não encontrados.");return}if(r){const _={transactionId:"PREVIEW-ICMS-789",qrCode:"00020126580014br.gov.bcb.pix0136preview-icms-mock-alphacars-12345678901234567890520400005303986540520.275802BR5925ALPHACARS COMERCIO LTDA6009SAO PAULO62070503***6304ABCD",amount:v,createdAt:Date.now(),orderId:s};c(_),ve.success("PIX de preview gerado");return}h(!0);try{const{data:_,error:R}=await tt.functions.invoke("create-pix-payment",{body:{amount:v,customer:{name:a.name,email:a.email,phone:a.phone,document:a.cpf},items:[{name:"Recolhimento ICMS-DIFAL (Interestadual)",quantity:1,amount:v}],kit_type:"icms_difal",vehicle_model:`ICMS upsell ref pedido ${s}`}});if(R)throw R;const I=((P=_==null?void 0:_.pix)==null?void 0:P.qrCode)||(_==null?void 0:_.qrCode),A=_==null?void 0:_.transactionId;if(!I||!A)throw new Error("Resposta inválida do gateway");const z={transactionId:A,qrCode:I,amount:v,createdAt:Date.now(),orderId:s};c(z),localStorage.setItem(jc,JSON.stringify(z))}catch(_){console.error(_),ve.error("Não foi possível gerar o PIX. Tente novamente.")}finally{h(!1)}},j=()=>{l!=null&&l.qrCode&&(navigator.clipboard.writeText(l.qrCode),p(!0),ve.success("Código PIX copiado!"),setTimeout(()=>p(!1),3e3))};b.useEffect(()=>{if(!l||m||r)return;const P=async()=>{try{const{data:_}=await tt.functions.invoke("check-pix-payment",{body:{transactionId:l.transactionId,customerData:{name:a==null?void 0:a.name,email:a==null?void 0:a.email,phone:a==null?void 0:a.phone,cpf:a==null?void 0:a.cpf},amount:l.amount}});_!=null&&_.isPaid&&(y(!0),ve.success("ICMS confirmado! Liberando envio…"),localStorage.removeItem(jc),setTimeout(()=>e(`/obrigado?order=${s}`),1500))}catch(_){console.error(_)}};return w.current=window.setInterval(P,8e3),()=>{w.current&&clearInterval(w.current)}},[l,m,a,e,s,r]);const C=async()=>{if(l){if(r){ve("Modo preview: pagamento não é verificado.");return}S(!0);try{const{data:P}=await tt.functions.invoke("check-pix-payment",{body:{transactionId:l.transactionId,customerData:{name:a==null?void 0:a.name,email:a==null?void 0:a.email,phone:a==null?void 0:a.phone,cpf:a==null?void 0:a.cpf},amount:l.amount}});P!=null&&P.isPaid?(y(!0),ve.success("ICMS confirmado!"),localStorage.removeItem(jc),setTimeout(()=>e(`/obrigado?order=${s}`),1500)):ve("Pagamento ainda não identificado",{description:"Aguarde alguns instantes após pagar e tente novamente."})}finally{S(!1)}}},T=()=>{e(`/obrigado?order=${s}`)};return s?i.jsxs("div",{className:"min-h-screen bg-background",children:[i.jsx("header",{className:"border-b border-border bg-card",children:i.jsxs("div",{className:"max-w-3xl mx-auto px-5 h-14 flex items-center justify-between",children:[i.jsx("img",{src:Id,alt:"Alphacars",className:"h-7 w-auto"}),i.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] text-muted-foreground",children:[i.jsx(ls,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"Ambiente seguro"})]})]})}),i.jsxs("main",{className:"max-w-3xl mx-auto px-5 py-8",children:[i.jsxs("div",{className:"rounded-2xl border border-amber-300 bg-amber-50 p-5 flex gap-3",children:[i.jsx("div",{className:"flex-shrink-0 w-10 h-10 rounded-xl bg-amber-100 flex items-center justify-center",children:i.jsx(X_,{className:"w-5 h-5 text-amber-700"})}),i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-bold text-amber-900",children:"Atenção: liberação fiscal pendente"}),i.jsxs("p",{className:"text-[13px] text-amber-800 mt-1 leading-relaxed",children:["Identificamos seu endereço de entrega em ",i.jsx("strong",{children:(a==null?void 0:a.state)||"outro estado"}),". Como nossa empresa está sediada em ",i.jsx("strong",{children:"Minas Gerais"}),", é necessário o recolhimento do ",i.jsx("strong",{children:"ICMS interestadual de 22%"})," sobre o valor do produto para liberação do envio pela transportadora."]})]})]}),i.jsxs("section",{className:"mt-5 bg-card rounded-3xl border border-border overflow-hidden",children:[i.jsxs("div",{className:"bg-foreground text-background px-5 py-3 flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(U_,{className:"w-4 h-4"}),i.jsx("span",{className:"text-xs font-bold uppercase tracking-wider",children:"Recolhimento ICMS — DIFAL"})]}),i.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] opacity-80",children:[i.jsx(Ns,{className:"w-3 h-3"}),i.jsx("span",{children:"Pagamento único"})]})]}),i.jsxs("div",{className:"p-6",children:[i.jsx("h1",{className:"text-xl sm:text-2xl font-extrabold text-foreground tracking-tight",children:"Liberação fiscal do seu pedido"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1.5",children:"Pagamento referente ao Diferencial de Alíquota (ICMS-DIFAL) cobrado em vendas interestaduais."}),i.jsxs("div",{className:"mt-5 rounded-2xl border border-border bg-secondary/30 p-4 space-y-2.5",children:[i.jsxs("div",{className:"flex items-center justify-between text-sm",children:[i.jsx("span",{className:"text-muted-foreground",children:"Pedido"}),i.jsx("span",{className:"font-mono text-xs text-foreground",children:s})]}),i.jsxs("div",{className:"flex items-center justify-between text-sm",children:[i.jsxs("span",{className:"text-muted-foreground inline-flex items-center gap-1.5",children:[i.jsx(Al,{className:"w-3.5 h-3.5"})," Origem"]}),i.jsx("span",{className:"text-foreground",children:"Minas Gerais (MG)"})]}),i.jsxs("div",{className:"flex items-center justify-between text-sm",children:[i.jsxs("span",{className:"text-muted-foreground inline-flex items-center gap-1.5",children:[i.jsx(dn,{className:"w-3.5 h-3.5"})," Destino"]}),i.jsxs("span",{className:"text-foreground",children:[a!=null&&a.city?`${a.city} - `:"",(a==null?void 0:a.state)||"—"]})]}),i.jsxs("div",{className:"flex items-center justify-between text-sm pt-2 border-t border-border",children:[i.jsx("span",{className:"text-muted-foreground",children:"Base de cálculo"}),i.jsx("span",{className:"text-foreground",children:Hh(x)})]}),i.jsxs("div",{className:"flex items-center justify-between text-sm",children:[i.jsx("span",{className:"text-muted-foreground",children:"Alíquota ICMS"}),i.jsx("span",{className:"text-foreground",children:"22%"})]}),i.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-border",children:[i.jsx("span",{className:"text-sm font-semibold text-foreground",children:"Total a recolher"}),i.jsx("span",{className:"text-2xl font-extrabold text-primary",children:Hh(v)})]})]}),m?i.jsxs("div",{className:"mt-6 rounded-2xl bg-emerald-50 border border-emerald-200 p-5 text-center",children:[i.jsx("div",{className:"w-12 h-12 rounded-full bg-emerald-600 flex items-center justify-center mx-auto mb-2",children:i.jsx(Vt,{className:"w-6 h-6 text-white"})}),i.jsx("p",{className:"font-bold text-emerald-900",children:"ICMS confirmado!"}),i.jsx("p",{className:"text-xs text-emerald-800 mt-1",children:"Liberando seu pedido para envio…"})]}):l?i.jsx("div",{className:"mt-6",children:i.jsxs("div",{className:"grid sm:grid-cols-[200px_1fr] gap-5 items-center",children:[i.jsx("div",{className:"flex justify-center",children:i.jsx("div",{className:"p-3 bg-white rounded-2xl border border-border",children:i.jsx(Dg,{value:l.qrCode,size:180})})}),i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Escaneie ou copie o código PIX"}),i.jsx("p",{className:"text-[12px] text-muted-foreground mt-1",children:"A confirmação é automática em poucos segundos."}),i.jsx("div",{className:"mt-3 rounded-xl bg-secondary border border-border p-2.5 text-[11px] font-mono text-foreground break-all max-h-20 overflow-y-auto",children:l.qrCode}),i.jsx(be,{onClick:j,className:"w-full mt-3 h-12 rounded-xl",variant:"default",children:f?i.jsxs(i.Fragment,{children:[i.jsx(Vt,{className:"w-4 h-4 mr-2"})," Código copiado"]}):i.jsxs(i.Fragment,{children:[i.jsx(nl,{className:"w-4 h-4 mr-2"})," Copiar código PIX"]})}),i.jsx(be,{variant:"outline",onClick:C,disabled:g,className:"w-full mt-2 h-11 rounded-xl",children:g?i.jsxs(i.Fragment,{children:[i.jsx(Wt,{className:"w-4 h-4 mr-2 animate-spin"})," Verificando…"]}):"Já paguei, verificar agora"})]})]})}):i.jsx(be,{onClick:k,disabled:d||!v,className:"w-full mt-6 h-14 rounded-2xl text-base font-bold",children:d?i.jsxs(i.Fragment,{children:[i.jsx(Wt,{className:"w-5 h-5 mr-2 animate-spin"})," Gerando PIX…"]}):i.jsxs(i.Fragment,{children:["Gerar PIX de ",Hh(v)]})}),i.jsxs("div",{className:"mt-5 grid grid-cols-3 gap-2 text-[11px] text-muted-foreground",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx(jr,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"Pagamento seguro"})]}),i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx(md,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"Nota fiscal emitida"})]}),i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx(dn,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"Envio imediato"})]})]})]})]}),i.jsxs("section",{className:"mt-5 bg-card rounded-3xl border border-border p-5",children:[i.jsx("h2",{className:"text-sm font-bold text-foreground mb-2",children:"Por que esse valor é cobrado?"}),i.jsxs("p",{className:"text-[13px] text-muted-foreground leading-relaxed",children:["Operações interestaduais entre estabelecimentos comerciais e consumidor final estão sujeitas ao recolhimento do ",i.jsx("strong",{children:"Diferencial de Alíquota (DIFAL)"}),", conforme a EC 87/2015. Como nossa sede fiscal está em Minas Gerais, esse valor é repassado integralmente ao estado de destino do produto."]}),i.jsx("p",{className:"text-[12px] text-muted-foreground mt-2",children:"Após a confirmação, sua nota fiscal será emitida com os impostos quitados e o envio liberado pela transportadora no mesmo dia útil."})]}),i.jsx("button",{onClick:T,className:"mt-6 mx-auto block text-[12px] text-muted-foreground underline underline-offset-2 hover:text-foreground transition-colors",children:"Não desejo recolher agora (envio poderá sofrer atraso)"})]})]}):i.jsx("div",{className:"min-h-screen flex items-center justify-center p-6 text-center",children:i.jsxs("div",{children:[i.jsx("p",{className:"text-muted-foreground",children:"Pedido não encontrado."}),i.jsx(se,{to:"/",className:"text-primary underline mt-3 inline-block",children:"Voltar para a loja"})]})})},PM=()=>i.jsxs("div",{className:"min-h-screen bg-background",children:[i.jsx(En,{}),i.jsx(Nn,{}),i.jsxs("main",{className:"max-w-3xl mx-auto px-6 py-12",children:[i.jsx("h1",{className:"text-3xl font-bold text-foreground mb-8",children:"Termos de Uso"}),i.jsxs("div",{className:"prose prose-sm max-w-none text-muted-foreground space-y-6",children:[i.jsxs("section",{children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"1. Aceitação dos Termos"}),i.jsx("p",{children:"Ao acessar e utilizar o site AlphaCars, você concorda com estes Termos de Uso. Caso não concorde, por favor, não utilize nossos serviços."})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"2. Cadastro e Conta"}),i.jsx("p",{children:"Para realizar compras, é necessário fornecer informações pessoais verdadeiras e completas. O usuário é responsável pela veracidade dos dados fornecidos e pela segurança de sua conta."})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"3. Produtos e Preços"}),i.jsx("p",{children:"Os preços dos produtos estão sujeitos a alterações sem aviso prévio. As imagens dos produtos são meramente ilustrativas e podem apresentar variações de cor em relação ao produto físico. Nos reservamos o direito de limitar quantidades de compra."})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"4. Pagamento"}),i.jsx("p",{children:"Aceitamos pagamento via PIX. O pedido só será processado após a confirmação do pagamento. Em caso de não confirmação, o pedido será automaticamente cancelado."})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"5. Entrega"}),i.jsx("p",{children:"Os prazos de entrega são estimados e podem variar de acordo com a região. O frete grátis está sujeito a condições específicas de cada promoção. Não nos responsabilizamos por atrasos causados pelos Correios ou transportadoras."})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"6. Propriedade Intelectual"}),i.jsx("p",{children:"Todo o conteúdo do site, incluindo textos, imagens, logos e marcas, é de propriedade exclusiva da AlphaCars. É proibida a reprodução sem autorização prévia."})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"7. Limitação de Responsabilidade"}),i.jsx("p",{children:"A AlphaCars não se responsabiliza por danos indiretos, incidentais ou consequentes decorrentes do uso do site ou da impossibilidade de uso."})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"8. Alterações nos Termos"}),i.jsx("p",{children:"Reservamo-nos o direito de alterar estes termos a qualquer momento. As alterações entrarão em vigor imediatamente após sua publicação no site."})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"9. Foro"}),i.jsx("p",{children:"Fica eleito o foro da Comarca de Porto Alegre/RS para dirimir quaisquer questões oriundas destes Termos de Uso."})]})]})]}),i.jsx(_n,{})]}),AM=()=>i.jsxs("div",{className:"min-h-screen bg-background",children:[i.jsx(En,{}),i.jsx(Nn,{}),i.jsxs("main",{className:"max-w-3xl mx-auto px-6 py-12",children:[i.jsx("h1",{className:"text-3xl font-bold text-foreground mb-8",children:"Política de Privacidade"}),i.jsxs("div",{className:"prose prose-sm max-w-none text-muted-foreground space-y-6",children:[i.jsxs("section",{children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"1. Informações Coletadas"}),i.jsx("p",{children:"Coletamos informações pessoais como nome, e-mail, CPF, telefone e endereço quando você realiza uma compra. Também coletamos dados de navegação automaticamente através de cookies e tecnologias similares."})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"2. Uso das Informações"}),i.jsx("p",{children:"Suas informações são utilizadas para: processar pedidos e pagamentos; enviar atualizações sobre o status do pedido; melhorar nossos produtos e serviços; enviar comunicações de marketing (com seu consentimento); cumprir obrigações legais."})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"3. Compartilhamento de Dados"}),i.jsx("p",{children:"Seus dados podem ser compartilhados com: processadores de pagamento (para concluir transações); transportadoras (para entrega dos produtos); plataformas de marketing (Meta) para personalização de anúncios. Não vendemos suas informações pessoais a terceiros."})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"4. Cookies e Rastreamento"}),i.jsx("p",{children:"Utilizamos cookies e pixels de rastreamento (Meta Pixel) para melhorar a experiência do usuário, analisar o tráfego do site e personalizar conteúdo e anúncios."})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"5. Segurança dos Dados"}),i.jsx("p",{children:"Adotamos medidas de segurança técnicas e organizacionais para proteger suas informações contra acesso não autorizado, perda ou destruição. Utilizamos criptografia SSL 256-bit em todas as transações."})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"6. Seus Direitos (LGPD)"}),i.jsx("p",{children:"Conforme a Lei Geral de Proteção de Dados (Lei nº 13.709/2018), você tem direito a: acessar seus dados; corrigir dados incompletos ou desatualizados; solicitar a eliminação de dados desnecessários; revogar consentimento; solicitar portabilidade dos dados. Para exercer seus direitos, entre em contato pelo e-mail contato@alphacars.com.br."})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"7. Retenção de Dados"}),i.jsx("p",{children:"Mantemos seus dados pelo tempo necessário para cumprir as finalidades descritas nesta política ou conforme exigido por lei. Dados de transações comerciais são mantidos pelo prazo legal de 5 anos."})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"8. Alterações"}),i.jsx("p",{children:"Esta política pode ser atualizada periodicamente. Recomendamos que você a revise regularmente. A data da última atualização será sempre indicada no final desta página."})]}),i.jsx("p",{className:"text-xs opacity-60 mt-8",children:"Última atualização: Fevereiro de 2026. AlphaCars."})]})]}),i.jsx(_n,{})]}),RM=()=>i.jsxs("div",{className:"min-h-screen bg-background",children:[i.jsx(En,{}),i.jsx(Nn,{}),i.jsxs("main",{className:"max-w-3xl mx-auto px-6 py-12",children:[i.jsx("h1",{className:"text-3xl font-bold text-foreground mb-8",children:"Política de Trocas e Devoluções"}),i.jsxs("div",{className:"prose prose-sm max-w-none text-muted-foreground space-y-6",children:[i.jsxs("section",{children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"1. Direito de Arrependimento"}),i.jsx("p",{children:"Conforme o Código de Defesa do Consumidor (Art. 49), você pode desistir da compra em até 7 (sete) dias corridos após o recebimento do produto, sem necessidade de justificativa. O produto deve estar em sua embalagem original, sem sinais de uso."})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"2. Trocas por Tamanho"}),i.jsx("p",{children:"Aceitamos trocas por tamanho em até 30 (trinta) dias corridos após o recebimento. O produto deve estar sem sinais de uso, com etiquetas e embalagem original. O frete de envio da troca será por conta do cliente. O frete de reenvio do novo tamanho será por nossa conta."})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"3. Produtos com Defeito"}),i.jsx("p",{children:"Produtos com defeito de fabricação podem ser trocados em até 90 (noventa) dias após o recebimento, conforme o CDC. Envie fotos do defeito para contato@alphacars.com.br. Após análise, providenciaremos a troca ou reembolso. O frete será por nossa conta."})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"4. Como Solicitar Troca ou Devolução"}),i.jsx("p",{children:"1. Entre em contato pelo e-mail contato@alphacars.com.br informando o número do pedido e o motivo da troca/devolução. 2. Aguarde as instruções de envio. 3. Envie o produto conforme orientado. 4. Após recebermos e analisarmos o produto, processaremos a troca ou reembolso em até 10 dias úteis."})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"5. Reembolso"}),i.jsx("p",{children:"O reembolso será realizado na mesma forma de pagamento utilizada na compra. Para pagamentos via PIX, o estorno será feito na conta de origem em até 10 dias úteis após a aprovação da devolução."})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"6. Produtos Não Elegíveis"}),i.jsx("p",{children:"Não aceitamos trocas ou devoluções de produtos personalizados, produtos com sinais de uso, lavagem ou alterações, e produtos sem etiquetas ou embalagem original."})]})]})]}),i.jsx(_n,{})]}),IM=()=>i.jsxs("div",{className:"min-h-screen bg-background",children:[i.jsx(En,{}),i.jsx(Nn,{}),i.jsxs("main",{className:"max-w-3xl mx-auto px-6 py-12",children:[i.jsx("h1",{className:"text-3xl font-bold text-foreground mb-8",children:"Política de Envio e Entrega"}),i.jsxs("div",{className:"prose prose-sm max-w-none text-muted-foreground space-y-6",children:[i.jsxs("section",{children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"1. Prazo de Envio"}),i.jsx("p",{children:"O envio do produto é realizado em até 3 (três) dias úteis após a confirmação do pagamento. Você receberá o código de rastreio por e-mail assim que o produto for postado."})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"2. Prazo de Entrega"}),i.jsx("p",{children:"O prazo de entrega varia de acordo com a região: Sudeste e Sul: 5 a 9 dias úteis; Nordeste e Centro-Oeste: 7 a 12 dias úteis; Norte: 10 a 15 dias úteis. Os prazos são estimados e contam a partir da data de postagem."})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"3. Frete Grátis"}),i.jsx("p",{children:"Oferecemos frete grátis para todo o Brasil em todas as compras realizadas em nosso site. O envio é feito via PAC (Correios)."})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"4. Rastreamento"}),i.jsx("p",{children:"Após o envio, você receberá um e-mail com o código de rastreio. Você pode acompanhar a entrega diretamente no site dos Correios (www.correios.com.br) ou entrando em contato conosco."})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"5. Tentativas de Entrega"}),i.jsx("p",{children:"Os Correios realizam até 3 tentativas de entrega. Caso não haja ninguém para receber, o produto ficará disponível na agência dos Correios mais próxima por até 7 dias. Após esse prazo, será devolvido ao remetente."})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"6. Endereço Incorreto"}),i.jsx("p",{children:"Certifique-se de que o endereço informado está correto e completo. A AlphaCars não se responsabiliza por entregas em endereços incorretos fornecidos pelo cliente. Caso o produto seja devolvido por esse motivo, um novo frete poderá ser cobrado para reenvio."})]})]})]}),i.jsx(_n,{})]}),OM=()=>i.jsxs("div",{className:"min-h-screen bg-background",children:[i.jsx(En,{}),i.jsx(Nn,{}),i.jsxs("main",{className:"max-w-3xl mx-auto px-6 py-12",children:[i.jsx("h1",{className:"text-3xl font-bold text-foreground mb-8",children:"Política de Reembolso"}),i.jsxs("div",{className:"prose prose-sm max-w-none text-muted-foreground space-y-6",children:[i.jsxs("section",{children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"1. Elegibilidade para Reembolso"}),i.jsx("p",{children:"Você pode solicitar reembolso nos seguintes casos: desistência da compra em até 7 dias (direito de arrependimento); produto com defeito de fabricação; produto diferente do adquirido; produto não entregue dentro do prazo máximo estimado."})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"2. Como Solicitar"}),i.jsx("p",{children:"Envie um e-mail para contato@alphacars.com.br com: número do pedido; motivo do reembolso; fotos do produto (se aplicável). Nossa equipe responderá em até 2 dias úteis."})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"3. Processamento"}),i.jsx("p",{children:"Após a aprovação da solicitação, o reembolso será processado em até 10 dias úteis. Para pagamentos via PIX, o valor será devolvido à conta de origem da transação."})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"4. Reembolso Parcial"}),i.jsx("p",{children:"Poderá ser aplicado reembolso parcial caso o produto apresente sinais de uso ou a embalagem original esteja danificada. O valor do desconto será avaliado caso a caso."})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"5. Cancelamento de Pedido"}),i.jsx("p",{children:"Pedidos podem ser cancelados com reembolso integral desde que o produto ainda não tenha sido enviado. Após o envio, aplica-se a política de devolução padrão."})]})]})]}),i.jsx(_n,{})]}),MM=()=>(b.useEffect(()=>{const e=document.createElement("script");return e.src="https://app.rastrocode.site/widget/648bebcc-0ae5-11f1-9532-0050565c05b3.js",e.async=!0,document.head.appendChild(e),()=>{try{document.head.removeChild(e)}catch{}}},[]),i.jsxs("div",{className:"min-h-screen bg-background",children:[i.jsx(En,{}),i.jsx(Nn,{}),i.jsxs("div",{className:"max-w-3xl mx-auto px-6 py-16",children:[i.jsxs("div",{className:"text-center mb-10",children:[i.jsx("div",{className:"w-16 h-16 bg-foreground rounded-full flex items-center justify-center mx-auto mb-5",children:i.jsx(dn,{className:"w-8 h-8 text-background"})}),i.jsx("h1",{className:"text-3xl font-extrabold text-foreground mb-2",children:"Rastreie seu Pedido"}),i.jsx("p",{className:"text-muted-foreground max-w-md mx-auto",children:"Digite o código de rastreio que você recebeu por e-mail para acompanhar sua entrega em tempo real."})]}),i.jsx("div",{className:"bg-secondary rounded-2xl p-6 md:p-8 mb-12",children:i.jsx("div",{id:"rastro-widget"})}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-5",children:[i.jsxs("div",{className:"bg-secondary rounded-xl p-5 text-center",children:[i.jsx(tg,{className:"w-6 h-6 mx-auto mb-3 text-foreground"}),i.jsx("h3",{className:"font-bold text-foreground text-sm mb-1",children:"Preparação"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Seu pedido é preparado e enviado em até 2 dias úteis."})]}),i.jsxs("div",{className:"bg-secondary rounded-xl p-5 text-center",children:[i.jsx(dn,{className:"w-6 h-6 mx-auto mb-3 text-foreground"}),i.jsx("h3",{className:"font-bold text-foreground text-sm mb-1",children:"Em Trânsito"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Acompanhe cada etapa da entrega pelo código de rastreio."})]}),i.jsxs("div",{className:"bg-secondary rounded-xl p-5 text-center",children:[i.jsx(Al,{className:"w-6 h-6 mx-auto mb-3 text-foreground"}),i.jsx("h3",{className:"font-bold text-foreground text-sm mb-1",children:"Entregue"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Receba seu tapete bandeja premium no conforto da sua casa."})]})]})]}),i.jsx(_n,{})]})),bl=b.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:Z("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));bl.displayName="Card";const LM=b.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:Z("flex flex-col space-y-1.5 p-6",e),...t}));LM.displayName="CardHeader";const DM=b.forwardRef(({className:e,...t},n)=>i.jsx("h3",{ref:n,className:Z("text-2xl font-semibold leading-none tracking-tight",e),...t}));DM.displayName="CardTitle";const FM=b.forwardRef(({className:e,...t},n)=>i.jsx("p",{ref:n,className:Z("text-sm text-muted-foreground",e),...t}));FM.displayName="CardDescription";const $M=b.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:Z("p-6 pt-0",e),...t}));$M.displayName="CardContent";const BM=b.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:Z("flex items-center p-6 pt-0",e),...t}));BM.displayName="CardFooter";const qh=768;function UM(){const[e,t]=b.useState(void 0);return b.useEffect(()=>{const n=window.matchMedia(`(max-width: ${qh-1}px)`),r=()=>{t(window.innerWidthn.removeEventListener("change",r)},[]),!!e}var zM="Separator",ev="horizontal",VM=["horizontal","vertical"],Xk=b.forwardRef((e,t)=>{const{decorative:n,orientation:r=ev,...s}=e,a=HM(r)?r:ev,l=n?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return i.jsx(_e.div,{"data-orientation":a,...l,...s,ref:t})});Xk.displayName=zM;function HM(e){return VM.includes(e)}var Jk=Xk;const Qk=b.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},s)=>i.jsx(Jk,{ref:s,decorative:n,orientation:t,className:Z("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));Qk.displayName=Jk.displayName;const qM=_k,GM=Tk,Yk=b.forwardRef(({className:e,...t},n)=>i.jsx($d,{className:Z("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));Yk.displayName=$d.displayName;const WM=Uo("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Zk=b.forwardRef(({side:e="right",className:t,children:n,...r},s)=>i.jsxs(GM,{children:[i.jsx(Yk,{}),i.jsxs(Bd,{ref:s,className:Z(WM({side:e}),t),...r,children:[n,i.jsxs(Pk,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-secondary hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[i.jsx(Sr,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Zk.displayName=Bd.displayName;const KM=b.forwardRef(({className:e,...t},n)=>i.jsx(Ud,{ref:n,className:Z("text-lg font-semibold text-foreground",e),...t}));KM.displayName=Ud.displayName;const XM=b.forwardRef(({className:e,...t},n)=>i.jsx(zd,{ref:n,className:Z("text-sm text-muted-foreground",e),...t}));XM.displayName=zd.displayName;function tv({className:e,...t}){return i.jsx("div",{className:Z("animate-pulse rounded-md bg-muted",e),...t})}const JM="sidebar:state",QM=60*60*24*7,YM="16rem",ZM="18rem",eL="3rem",tL="b",eC=b.createContext(null);function $l(){const e=b.useContext(eC);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const tC=b.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:s,children:a,...o},l)=>{const c=UM(),[d,h]=b.useState(!1),[f,p]=b.useState(e),m=t??f,y=b.useCallback(v=>{const x=typeof v=="function"?v(m):v;n?n(x):p(x),document.cookie=`${JM}=${x}; path=/; max-age=${QM}`},[n,m]),g=b.useCallback(()=>c?h(v=>!v):y(v=>!v),[c,y,h]);b.useEffect(()=>{const v=x=>{x.key===tL&&(x.metaKey||x.ctrlKey)&&(x.preventDefault(),g())};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[g]);const S=m?"expanded":"collapsed",w=b.useMemo(()=>({state:S,open:m,setOpen:y,isMobile:c,openMobile:d,setOpenMobile:h,toggleSidebar:g}),[S,m,y,c,d,h,g]);return i.jsx(eC.Provider,{value:w,children:i.jsx($w,{delayDuration:0,children:i.jsx("div",{style:{"--sidebar-width":YM,"--sidebar-width-icon":eL,...s},className:Z("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",r),ref:l,...o,children:a})})})});tC.displayName="SidebarProvider";const nC=b.forwardRef(({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:s,...a},o)=>{const{isMobile:l,state:c,openMobile:d,setOpenMobile:h}=$l();return n==="none"?i.jsx("div",{className:Z("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",r),ref:o,...a,children:s}):l?i.jsx(qM,{open:d,onOpenChange:h,...a,children:i.jsx(Zk,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":ZM},side:e,children:i.jsx("div",{className:"flex h-full w-full flex-col",children:s})})}):i.jsxs("div",{ref:o,className:"group peer hidden text-sidebar-foreground md:block","data-state":c,"data-collapsible":c==="collapsed"?n:"","data-variant":t,"data-side":e,children:[i.jsx("div",{className:Z("relative h-svh w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),i.jsx("div",{className:Z("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...a,children:i.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:s})})]})});nC.displayName="Sidebar";const rC=b.forwardRef(({className:e,onClick:t,...n},r)=>{const{toggleSidebar:s}=$l();return i.jsxs(be,{ref:r,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:Z("h-7 w-7",e),onClick:a=>{t==null||t(a),s()},...n,children:[i.jsx($_,{}),i.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});rC.displayName="SidebarTrigger";const nL=b.forwardRef(({className:e,...t},n)=>{const{toggleSidebar:r}=$l();return i.jsx("button",{ref:n,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:Z("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] group-data-[side=left]:-right-4 group-data-[side=right]:left-0 hover:after:bg-sidebar-border sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})});nL.displayName="SidebarRail";const rL=b.forwardRef(({className:e,...t},n)=>i.jsx("main",{ref:n,className:Z("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...t}));rL.displayName="SidebarInset";const sL=b.forwardRef(({className:e,...t},n)=>i.jsx(dt,{ref:n,"data-sidebar":"input",className:Z("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));sL.displayName="SidebarInput";const aL=b.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,"data-sidebar":"header",className:Z("flex flex-col gap-2 p-2",e),...t}));aL.displayName="SidebarHeader";const oL=b.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,"data-sidebar":"footer",className:Z("flex flex-col gap-2 p-2",e),...t}));oL.displayName="SidebarFooter";const iL=b.forwardRef(({className:e,...t},n)=>i.jsx(Qk,{ref:n,"data-sidebar":"separator",className:Z("mx-2 w-auto bg-sidebar-border",e),...t}));iL.displayName="SidebarSeparator";const sC=b.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,"data-sidebar":"content",className:Z("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));sC.displayName="SidebarContent";const aC=b.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,"data-sidebar":"group",className:Z("relative flex w-full min-w-0 flex-col p-2",e),...t}));aC.displayName="SidebarGroup";const oC=b.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const s=t?$o:"div";return i.jsx(s,{ref:r,"data-sidebar":"group-label",className:Z("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...n})});oC.displayName="SidebarGroupLabel";const lL=b.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const s=t?$o:"button";return i.jsx(s,{ref:r,"data-sidebar":"group-action",className:Z("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),...n})});lL.displayName="SidebarGroupAction";const iC=b.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,"data-sidebar":"group-content",className:Z("w-full text-sm",e),...t}));iC.displayName="SidebarGroupContent";const lC=b.forwardRef(({className:e,...t},n)=>i.jsx("ul",{ref:n,"data-sidebar":"menu",className:Z("flex w-full min-w-0 flex-col gap-1",e),...t}));lC.displayName="SidebarMenu";const cC=b.forwardRef(({className:e,...t},n)=>i.jsx("li",{ref:n,"data-sidebar":"menu-item",className:Z("group/menu-item relative",e),...t}));cC.displayName="SidebarMenuItem";const cL=Uo("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),uC=b.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:s,className:a,...o},l)=>{const c=e?$o:"button",{isMobile:d,state:h}=$l(),f=i.jsx(c,{ref:l,"data-sidebar":"menu-button","data-size":r,"data-active":t,className:Z(cL({variant:n,size:r}),a),...o});return s?(typeof s=="string"&&(s={children:s}),i.jsxs(sR,{children:[i.jsx(aR,{asChild:!0,children:f}),i.jsx(Bw,{side:"right",align:"center",hidden:h!=="collapsed"||d,...s})]})):f});uC.displayName="SidebarMenuButton";const uL=b.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},s)=>{const a=t?$o:"button";return i.jsx(a,{ref:s,"data-sidebar":"menu-action",className:Z("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform peer-hover/menu-button:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",n&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...r})});uL.displayName="SidebarMenuAction";const dL=b.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,"data-sidebar":"menu-badge",className:Z("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));dL.displayName="SidebarMenuBadge";const hL=b.forwardRef(({className:e,showIcon:t=!1,...n},r)=>{const s=b.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return i.jsxs("div",{ref:r,"data-sidebar":"menu-skeleton",className:Z("flex h-8 items-center gap-2 rounded-md px-2",e),...n,children:[t&&i.jsx(tv,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),i.jsx(tv,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":s}})]})});hL.displayName="SidebarMenuSkeleton";const fL=b.forwardRef(({className:e,...t},n)=>i.jsx("ul",{ref:n,"data-sidebar":"menu-sub",className:Z("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));fL.displayName="SidebarMenuSub";const mL=b.forwardRef(({...e},t)=>i.jsx("li",{ref:t,...e}));mL.displayName="SidebarMenuSubItem";const pL=b.forwardRef(({asChild:e=!1,size:t="md",isActive:n,className:r,...s},a)=>{const o=e?$o:"a";return i.jsx(o,{ref:a,"data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:Z("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",r),...s})});pL.displayName="SidebarMenuSubButton";const hi="admin_sales_pwd",gL="https://fklcoarnnuwiaeshpdaa.supabase.co/functions/v1/admin-list-transactions",yL="https://fklcoarnnuwiaeshpdaa.supabase.co/functions/v1/recover-transaction",xL="https://fklcoarnnuwiaeshpdaa.supabase.co/functions/v1/validate-payment",vL="https://fklcoarnnuwiaeshpdaa.supabase.co/functions/v1/admin-mark-paid",dC=b.createContext(null),Us=()=>{const e=b.useContext(dC);if(!e)throw new Error("useAdmin must be used within AdminProvider");return e};function bL({children:e}){const[t,n]=b.useState(""),[r,s]=b.useState(!1),[a,o]=b.useState(!1),[l,c]=b.useState(!1),[d,h]=b.useState(null),[f,p]=b.useState([]),[m,y]=b.useState(7),[g,S]=b.useState("");b.useEffect(()=>{const P=sessionStorage.getItem(hi);P&&(n(P),s(!0))},[]);const w=b.useCallback(async P=>{const _=sessionStorage.getItem(hi)||t;if(!_){S("Faça login novamente.");return}P?c(!0):o(!0),S("");const R=new AbortController,I=P?6e4:2e4,A=window.setTimeout(()=>R.abort(),I);try{const z=m<=1?500:m<=3?2e3:m<=7?4e3:8e3,D=await fetch(`${gL}?days=${m}&limit=${z}${P?"&refresh=1":""}`,{headers:{"x-admin-password":_,apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImZrbGNvYXJubnV3aWFlc2hwZGFhIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzY4NzQ3NTcsImV4cCI6MjA5MjQ1MDc1N30.D_N9pi2Ndoq-0VO6RmscLI5B_I2Q_aUTl7aYB_j-xR0"},signal:R.signal}),F=await D.text();let G={};try{G=F?JSON.parse(F):{}}catch{throw new Error("Resposta inválida")}if(!D.ok||!G.success){D.status===401?(sessionStorage.removeItem(hi),s(!1),ve.error("Senha incorreta")):(S(G.error||`Erro HTTP ${D.status}`),ve.error(G.error||"Erro ao carregar"));return}h(G.stats??null),p(Array.isArray(G.transactions)?G.transactions:[]),P&&ve.success("Status atualizado")}catch(z){const F=z instanceof Error&&z.name==="AbortError"?"Demorou demais. Tente novamente.":z instanceof Error?z.message:"Erro de conexão";S(F),ve.error(F)}finally{window.clearTimeout(A),o(!1),c(!1)}},[m,t]);b.useEffect(()=>{r&&w(!1)},[r,m,w]);const v=P=>{sessionStorage.setItem(hi,P),n(P),s(!0),S("")},x=()=>{sessionStorage.removeItem(hi),n(""),s(!1),h(null),p([])},k=async(P,_)=>{try{const R=await fetch(yL,{method:"POST",headers:{"Content-Type":"application/json","x-admin-password":t,apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImZrbGNvYXJubnV3aWFlc2hwZGFhIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzY4NzQ3NTcsImV4cCI6MjA5MjQ1MDc1N30.D_N9pi2Ndoq-0VO6RmscLI5B_I2Q_aUTl7aYB_j-xR0"},body:JSON.stringify({transaction_id:P,action:_})}),I=await R.json();if(!R.ok||!I.success)throw new Error(I.error||"Erro");const A={start:"Recuperação iniciada",recovered:"Marcada como recuperada",discarded:"Descartada"};ve.success(A[_]),w(!1)}catch(R){ve.error(R instanceof Error?R.message:"Erro")}},j=async(P,_)=>{try{const R=await fetch(xL,{method:"POST",headers:{"Content-Type":"application/json","x-admin-password":t,apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImZrbGNvYXJubnV3aWFlc2hwZGFhIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzY4NzQ3NTcsImV4cCI6MjA5MjQ1MDc1N30.D_N9pi2Ndoq-0VO6RmscLI5B_I2Q_aUTl7aYB_j-xR0"},body:JSON.stringify({transaction_id:P,real_payment_status:_,actor:"admin"})}),I=await R.json();if(!R.ok||!I.success)throw new Error(I.error||"Erro");ve.success(_==="confirmed_paid"?"Confirmado como pago ✓":"Marcado como não pago"),w(!1)}catch(R){ve.error(R instanceof Error?R.message:"Erro")}},C=async(P,_)=>{const R=new FormData;R.append("transactionId",P),_&&R.append("file",_);const I=await fetch(vL,{method:"POST",headers:{"x-admin-password":t,apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImZrbGNvYXJubnV3aWFlc2hwZGFhIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzY4NzQ3NTcsImV4cCI6MjA5MjQ1MDc1N30.D_N9pi2Ndoq-0VO6RmscLI5B_I2Q_aUTl7aYB_j-xR0"},body:R}),A=await I.json();if(!I.ok||!A.success)throw new Error(A.error||"Erro");return w(!1),{alreadyPaid:A.alreadyPaid}},T=b.useMemo(()=>({password:t,authed:r,loading:a,refreshing:l,errorMessage:g,stats:d,transactions:f,days:m,setDays:y,loadData:w,login:v,logout:x,handleRecovery:k,handleValidate:j,markPaid:C}),[t,r,a,l,g,d,f,m,w]);return i.jsx(dC.Provider,{value:T,children:e})}const wL=[{title:"Dashboard",url:"/admin/vendas",icon:O_,end:!0},{title:"Vendas",url:"/admin/vendas/lista",icon:L_},{title:"Oportunidades",url:"/admin/vendas/oportunidades",icon:Yb,badge:"opportunities"},{title:"Recuperações",url:"/admin/vendas/recuperacoes",icon:Rl,badge:"recovery"}];function SL(){const{state:e}=$l(),t=e==="collapsed",{transactions:n}=Us(),r=n.filter(o=>((o.status||"").toUpperCase()==="PENDING"||(o.status||"").toUpperCase()==="WAITING_PAYMENT")&&(o.payment_score??0)>=60&&(!o.real_payment_status||o.real_payment_status==="unknown")).length,s=n.filter(o=>o.recovery_status==="em_recuperacao").length,a=o=>o==="opportunities"&&r>0?r:o==="recovery"&&s>0?s:null;return i.jsx(nC,{collapsible:"icon",className:"border-r",children:i.jsxs(sC,{children:[i.jsx("div",{className:`px-4 py-5 border-b ${t?"px-2":""}`,children:t?i.jsx("div",{className:"text-2xl text-center",children:"📊"}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"text-sm font-bold tracking-tight",children:"AlphaCars · Admin"}),i.jsx("div",{className:"text-[11px] text-muted-foreground mt-0.5",children:"Painel de vendas"})]})}),i.jsxs(aC,{children:[!t&&i.jsx(oC,{children:"Navegação"}),i.jsx(iC,{children:i.jsx(lC,{children:wL.map(o=>{const l=a(o.badge);return i.jsx(cC,{children:i.jsx(uC,{asChild:!0,children:i.jsxs(O6,{to:o.url,end:o.end,className:({isActive:c})=>`flex items-center gap-3 ${c?"bg-primary/10 text-primary font-medium":"text-foreground/80 hover:bg-muted/60"}`,children:[i.jsx(o.icon,{className:"h-4 w-4 shrink-0"}),!t&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"flex-1",children:o.title}),l!==null&&i.jsx("span",{className:"ml-auto inline-flex items-center justify-center min-w-[20px] h-5 px-1.5 rounded-full bg-orange-600 text-white text-[10px] font-bold",children:l})]})]})})},o.title)})})})]})]})})}function kL(){const{days:e,setDays:t,loadData:n,refreshing:r,loading:s,logout:a}=Us(),o=Xt(),c={"/admin/vendas":"Dashboard","/admin/vendas/lista":"Todas as vendas","/admin/vendas/oportunidades":"⚡ Oportunidades de recuperação","/admin/vendas/recuperacoes":"🔧 Em recuperação"}[o.pathname]||"Admin";return i.jsxs("header",{className:"h-14 border-b bg-background flex items-center justify-between px-4 sticky top-0 z-10",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(rC,{}),i.jsx("h1",{className:"text-base font-semibold",children:c})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("select",{value:e,onChange:d=>t(Number(d.target.value)),className:"border rounded-md px-2 py-1.5 text-xs bg-background",children:[i.jsx("option",{value:1,children:"24h"}),i.jsx("option",{value:3,children:"3 dias"}),i.jsx("option",{value:7,children:"7 dias"}),i.jsx("option",{value:30,children:"30 dias"})]}),i.jsxs(be,{size:"sm",onClick:()=>n(!0),disabled:r||s,className:"h-8",children:[r?i.jsx(Wt,{className:"w-3.5 h-3.5 mr-1.5 animate-spin"}):i.jsx(V_,{className:"w-3.5 h-3.5 mr-1.5"}),"Atualizar"]}),i.jsx(be,{size:"sm",variant:"outline",onClick:a,className:"h-8",children:i.jsx(D_,{className:"w-3.5 h-3.5"})})]})]})}function CL(){const{login:e}=Us(),[t,n]=b.useState("");return i.jsx("div",{className:"min-h-screen flex items-center justify-center bg-muted px-4",children:i.jsxs(bl,{className:"p-8 w-full max-w-sm shadow-lg",children:[i.jsxs("div",{className:"text-center mb-6",children:[i.jsx("div",{className:"text-3xl mb-2",children:"📊"}),i.jsx("h1",{className:"text-xl font-bold",children:"Admin · Vendas"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Faça login para continuar"})]}),i.jsxs("form",{onSubmit:r=>{r.preventDefault(),t&&e(t)},className:"space-y-3",children:[i.jsx(dt,{type:"password",placeholder:"Senha",value:t,onChange:r=>n(r.target.value),autoFocus:!0}),i.jsx(be,{type:"submit",className:"w-full",children:"Entrar"})]}),i.jsx(se,{to:"/",className:"block mt-4 text-xs text-center text-muted-foreground hover:text-foreground",children:"← Voltar para a loja"})]})})}function jL(){const{authed:e}=Us();return e?i.jsx(tC,{children:i.jsxs("div",{className:"min-h-screen flex w-full bg-muted/30",children:[i.jsx(SL,{}),i.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[i.jsx(kL,{}),i.jsx("main",{className:"flex-1 p-4 md:p-6 overflow-x-hidden",children:i.jsx(b6,{})})]})]})}):i.jsx(CL,{})}function EL(){return i.jsx(bL,{children:i.jsx(jL,{})})}const Gh=e=>(e/100).toLocaleString("pt-BR",{style:"currency",currency:"BRL"}),NL={default:"border-border",success:"border-emerald-500/30 bg-emerald-500/5",warning:"border-amber-500/30 bg-amber-500/5",danger:"border-destructive/30 bg-destructive/5",primary:"border-primary/30 bg-primary/5"};function Mn({label:e,value:t,hint:n,icon:r,tone:s="default",href:a}){const o=i.jsx(bl,{className:`p-5 ${NL[s]} transition-shadow hover:shadow-md`,children:i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("div",{className:"text-[11px] uppercase tracking-wide text-muted-foreground font-semibold",children:e}),i.jsx("div",{className:"text-2xl font-bold mt-1.5 tabular-nums",children:t}),n&&i.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:n})]}),i.jsx("div",{className:`shrink-0 rounded-lg p-2 ${s==="default"?"bg-muted":""}`,children:i.jsx(r,{className:"w-4 h-4 text-foreground/70"})})]})});return a?i.jsx(se,{to:a,className:"block",children:o}):o}function _L(){const{stats:e,transactions:t,loading:n}=Us(),r=b.useMemo(()=>{const s=t.filter(p=>((p.status||"").toUpperCase()==="PENDING"||(p.status||"").toUpperCase()==="WAITING_PAYMENT")&&(p.payment_score??0)>=60&&(!p.real_payment_status||p.real_payment_status==="unknown")),a=s.reduce((p,m)=>p+(Number(m.amount)||0),0),o=t.filter(p=>p.recovery_status==="em_recuperacao").length,l=t.filter(p=>p.real_payment_status&&p.real_payment_status!=="unknown"),c=l.filter(p=>(p.payment_score??0)>=70),d=c.filter(p=>p.real_payment_status==="confirmed_paid").length,h=c.filter(p=>p.real_payment_status==="not_paid").length,f=c.length>0?Math.round(d/c.length*100):null;return{opps:s.length,oppsValueCents:a,inRecovery:o,validated:l.length,truePositives:d,falsePositives:h,accuracy:f}},[t]);return n&&t.length===0?i.jsx("div",{className:"flex items-center justify-center py-20",children:i.jsx(Wt,{className:"w-6 h-6 animate-spin text-muted-foreground"})}):i.jsxs("div",{className:"space-y-6 max-w-7xl",children:[i.jsxs("section",{children:[i.jsx("h2",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:"Visão geral"}),i.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[i.jsx(Mn,{label:"PIX gerados",value:(e==null?void 0:e.total)??0,hint:Gh((e==null?void 0:e.totalAmountCents)??0),icon:K_}),i.jsx(Mn,{label:"Pagas",value:(e==null?void 0:e.paid)??0,hint:Gh((e==null?void 0:e.paidAmountCents)??0),icon:an,tone:"success"}),i.jsx(Mn,{label:"Pendentes",value:(e==null?void 0:e.pending)??0,icon:qb,tone:"warning"}),i.jsx(Mn,{label:"Conversão",value:`${(e==null?void 0:e.conversionRate)??0}%`,hint:`${(e==null?void 0:e.expired)??0} outros`,icon:ky})]})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:"Recuperação de vendas"}),i.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[i.jsx(Mn,{label:"Oportunidades",value:r.opps,hint:"Score ≥60 + sem validação",icon:Yb,tone:"primary",href:"/admin/vendas/oportunidades"}),i.jsx(Mn,{label:"Valor potencial",value:Gh(r.oppsValueCents),hint:"Soma das oportunidades",icon:Y_,tone:"primary"}),i.jsx(Mn,{label:"Em recuperação",value:r.inRecovery,icon:Rl,tone:"warning",href:"/admin/vendas/recuperacoes"}),i.jsx(Mn,{label:"Precisão (score≥70)",value:r.accuracy!==null?`${r.accuracy}%`:"—",hint:r.accuracy!==null?`${r.truePositives} ✓ / ${r.falsePositives} ✗ falso+`:"Valide pra calibrar",icon:ky,tone:r.accuracy!==null&&r.accuracy>=70?"success":"default"})]})]}),i.jsxs("section",{children:[i.jsx("h2",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:"Validações manuais"}),i.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-3",children:[i.jsx(Mn,{label:"Total validadas",value:r.validated,icon:an}),i.jsx(Mn,{label:"Falsos positivos",value:r.falsePositives,hint:"Score alto, mas não pagou",icon:__,tone:r.falsePositives>0?"danger":"default"}),i.jsx(Mn,{label:"Confirmadas como pagas",value:r.truePositives,icon:an,tone:"success"})]})]})]})}const TL=Uo("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 st({className:e,variant:t,...n}){return i.jsx("div",{className:Z(TL({variant:t}),e),...n})}const PL=AS,AL=bg,RL=Sg,IL="https://fklcoarnnuwiaeshpdaa.supabase.co/functions/v1/recover-transaction",OL={checkout_started:{label:"Checkout iniciado",color:"bg-blue-100 text-blue-700"},pix_generated:{label:"PIX gerado",color:"bg-blue-100 text-blue-700"},heartbeat:{label:"Heartbeat",color:"bg-slate-100 text-slate-600"},tab_blur:{label:"Saiu da aba",color:"bg-amber-100 text-amber-700"},tab_focus:{label:"Voltou à aba",color:"bg-emerald-100 text-emerald-700"},user_returned:{label:"Retornou",color:"bg-emerald-100 text-emerald-700"},returned_after_delay:{label:"🔥 Voltou após >60s",color:"bg-red-100 text-red-700 font-bold"},pix_copied:{label:"📋 Copiou PIX",color:"bg-purple-100 text-purple-700 font-bold"},checkout_abandoned:{label:"Fechou aba",color:"bg-slate-200 text-slate-700"},thank_you_visited:{label:"✓ Visitou /obrigado",color:"bg-green-100 text-green-700 font-bold"},recovery_start:{label:"🔧 Recuperação iniciada",color:"bg-orange-100 text-orange-700"},recovery_recovered:{label:"✅ Recuperada",color:"bg-emerald-200 text-emerald-800"},recovery_discarded:{label:"🗑 Descartada",color:"bg-slate-200 text-slate-700"}},ML=e=>new Date(e).toLocaleString("pt-BR",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"});function LL({open:e,onOpenChange:t,transactionId:n,password:r}){const[s,a]=b.useState(!1),[o,l]=b.useState([]),[c,d]=b.useState("");b.useEffect(()=>{if(!e)return;let f=!1;return a(!0),d(""),fetch(`${IL}?action=timeline&transaction_id=${encodeURIComponent(n)}`,{headers:{"x-admin-password":r,apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImZrbGNvYXJubnV3aWFlc2hwZGFhIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzY4NzQ3NTcsImV4cCI6MjA5MjQ1MDc1N30.D_N9pi2Ndoq-0VO6RmscLI5B_I2Q_aUTl7aYB_j-xR0"}}).then(p=>p.json()).then(p=>{f||(p.success?l(p.events||[]):d(p.error||"Erro"))}).catch(p=>!f&&d(String(p))).finally(()=>!f&&a(!1)),()=>{f=!0}},[e,n,r]);const h=o.map((f,p)=>{const m=p>0?o[p-1]:null,y=m?new Date(f.created_at).getTime()-new Date(m.created_at).getTime():0;return{...f,deltaMs:y}});return i.jsx(Dl,{open:e,onOpenChange:t,children:i.jsxs(Ko,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[i.jsxs(Xo,{children:[i.jsx(Jo,{children:"📊 Timeline da transação"}),i.jsx("p",{className:"text-xs text-muted-foreground font-mono",children:n})]}),s&&i.jsx("div",{className:"flex items-center justify-center py-10",children:i.jsx(Wt,{className:"w-6 h-6 animate-spin text-muted-foreground"})}),c&&i.jsx("p",{className:"text-sm text-destructive",children:c}),!s&&!c&&h.length===0&&i.jsx("p",{className:"text-sm text-muted-foreground text-center py-6",children:"Sem eventos registrados."}),!s&&h.length>0&&i.jsx("div",{className:"space-y-1.5",children:h.map(f=>{const p=OL[f.event_type]||{label:f.event_type,color:"bg-slate-100 text-slate-600"},m=f.deltaMs>3e4&&f.event_type!=="checkout_started"&&f.event_type!=="pix_generated";return i.jsxs("div",{className:"flex items-start gap-2 text-xs",children:[i.jsx("span",{className:"text-muted-foreground font-mono shrink-0 w-24",children:ML(f.created_at).split(", ")[1]}),i.jsx(st,{className:`${p.color} hover:${p.color} shrink-0`,children:p.label}),f.event_data&&Object.keys(f.event_data).length>0&&i.jsx("span",{className:"text-muted-foreground truncate",children:Object.entries(f.event_data).map(([y,g])=>`${y}=${g}`).join(" · ")}),m&&i.jsxs("span",{className:"ml-auto text-orange-600 font-semibold flex items-center gap-1 shrink-0",children:[i.jsx(Ns,{className:"w-3 h-3"})," +",Math.round(f.deltaMs/1e3),"s"]})]},f.id)})})]})})}const Vm=e=>(e/100).toLocaleString("pt-BR",{style:"currency",currency:"BRL"}),Ec=e=>e?new Date(e).toLocaleString("pt-BR",{day:"2-digit",month:"2-digit",year:"2-digit",hour:"2-digit",minute:"2-digit"}):"-",Wh=e=>{const t=Math.max(0,Math.floor(e||0)),n=Math.floor(t/60),r=t%60;return n===0?`${r}s`:`${n}m ${r.toString().padStart(2,"0")}s`},DL=({status:e})=>{const t=e.toUpperCase();return t==="PAID"?i.jsx(st,{className:"bg-emerald-600 hover:bg-emerald-600 text-white",children:"Paga"}):t==="PENDING"||t==="WAITING_PAYMENT"?i.jsx(st,{variant:"secondary",children:"Pendente"}):t==="REFUSED"||t==="FAILED"||t==="EXPIRED"||t==="CANCELED"?i.jsx(st,{variant:"destructive",children:t}):i.jsx(st,{variant:"outline",children:t})},FL=({label:e,score:t})=>{const n=t??0;return e==="provable_paid"?i.jsxs(st,{className:"bg-emerald-500 hover:bg-emerald-500 text-white tabular-nums",children:["🟢 ",n]}):e==="likely_paid"?i.jsxs(st,{className:"bg-amber-500 hover:bg-amber-500 text-white tabular-nums",children:["🟡 ",n]}):i.jsxs(st,{variant:"outline",className:"text-muted-foreground tabular-nums",children:["⚪ ",n]})},$L=e=>(e||"").replace(/\D/g,"");function BL({tx:e}){const{markPaid:t}=Us(),[n,r]=b.useState(!1),[s,a]=b.useState(null),[o,l]=b.useState(!1),c=async d=>{d.preventDefault(),l(!0);try{const h=await t(e.transaction_id,s);ve.success(h.alreadyPaid?"Já estava como paga":"Marcada como paga ✅"),r(!1),a(null)}catch(h){ve.error(h instanceof Error?h.message:"Erro")}finally{l(!1)}};return i.jsxs(Dl,{open:n,onOpenChange:r,children:[i.jsx(R9,{asChild:!0,children:i.jsxs(be,{size:"sm",variant:"outline",className:"text-xs h-8",children:[i.jsx(an,{className:"w-3 h-3 mr-1"})," Marcar pago + comprovante"]})}),i.jsxs(Ko,{children:[i.jsxs(Xo,{children:[i.jsx(Jo,{children:"Confirmar pagamento manualmente"}),i.jsxs(Fl,{children:[i.jsx("strong",{children:e.customer_name||e.customer_email})," · ",Vm(e.amount),i.jsx("br",{}),i.jsx("code",{className:"text-xs",children:e.transaction_id})]})]}),i.jsxs("form",{onSubmit:c,className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx(nn,{htmlFor:"receipt",children:"Comprovante (opcional)"}),i.jsx(dt,{id:"receipt",type:"file",accept:"image/*,application/pdf",onChange:d=>{var h;return a(((h=d.target.files)==null?void 0:h[0])||null)}})]}),i.jsxs(Lg,{children:[i.jsx(be,{type:"button",variant:"ghost",onClick:()=>r(!1),children:"Cancelar"}),i.jsxs(be,{type:"submit",disabled:o,children:[o&&i.jsx(Wt,{className:"w-4 h-4 mr-2 animate-spin"}),"Confirmar como PAGO"]})]})]})]})]})}function UL({tx:e,defaultOpen:t=!1}){var D;const{handleRecovery:n,handleValidate:r,password:s}=Us(),[a,o]=b.useState(t),[l,c]=b.useState(!1),[d,h]=b.useState(!1),f=`admin:tx-read:${e.transaction_id}`,[p,m]=b.useState(()=>{try{return localStorage.getItem(f)==="1"}catch{return!1}}),y=F=>{F.stopPropagation();const G=!p;m(G);try{G?localStorage.setItem(f,"1"):localStorage.removeItem(f)}catch{}ve.success(G?"Marcada como lida ✅":"Marcada como não lida")},g=(e.status||"").toUpperCase(),S=g==="PENDING"||g==="WAITING_PAYMENT",w=!!(e.receipts&&e.receipts.length>0),v=!!e.thank_you_visited_at,x=S&&(e.score_label==="provable_paid"||e.score_label==="likely_paid"),k=S&&(w||v||x),j=$L(e.customer_phone),C=F=>F.replace(/[\u200B-\u200F\u2028-\u2029\u202A-\u202E\u2060-\u206F\uFEFF\uFFFD]/g,"").trim(),T=C(((D=e.customer_name)==null?void 0:D.split(" ")[0])||""),P=T?`Olá, ${T}!`:"Olá!",_=encodeURIComponent(C(`${P} Tudo bem? Aqui é da *AlphaCars*. Estamos entrando em contato sobre o seu pedido no valor de *${Vm(e.amount)}*, gerado via PIX em nosso site. Identificamos que o pagamento ainda não foi confirmado em nosso sistema. Caso já tenha sido efetuado, por favor nos envie o comprovante por este canal para que possamos validar e liberar o envio o quanto antes. Se precisar de uma nova chave PIX, link de pagamento ou tiver qualquer dúvida, estamos à disposição para ajudar. Atenciosamente, Equipe AlphaCars`)),R=j.length>=10?`https://wa.me/55${j}?text=${_}`:null,I=()=>{e.customer_email&&(navigator.clipboard.writeText(e.customer_email),ve.success("Email copiado"))},A=async F=>{c(!0);try{await r(e.transaction_id,F)}finally{c(!1)}},z=async F=>{c(!0);try{await n(e.transaction_id,F)}finally{c(!1)}};return i.jsx(PL,{open:a,onOpenChange:o,asChild:!0,children:i.jsxs("div",{className:`border rounded-lg overflow-hidden transition-colors ${p?"bg-emerald-50 border-emerald-300 border-l-4 border-l-emerald-500 dark:bg-emerald-950/30 dark:border-emerald-800 dark:border-l-emerald-500":`bg-card ${k?"border-l-4 border-l-destructive":""} ${e.action_required?"border-l-4 border-l-orange-500":""}`}`,children:[i.jsx(AL,{asChild:!0,children:i.jsxs("div",{className:`flex items-center gap-3 px-3 py-3 cursor-pointer select-none ${p?"hover:bg-emerald-100/60 dark:hover:bg-emerald-900/40":"hover:bg-muted/30"}`,children:[a?i.jsx(Ur,{className:"w-4 h-4 text-muted-foreground shrink-0"}):i.jsx(Su,{className:"w-4 h-4 text-muted-foreground shrink-0"}),i.jsxs("div",{className:"flex flex-col gap-0.5 min-w-0 flex-1",children:[i.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[p&&i.jsxs(st,{className:"bg-emerald-600 hover:bg-emerald-600 text-white text-[10px] gap-1 shrink-0",children:[i.jsx(xy,{className:"w-3 h-3"})," LIDA"]}),i.jsx("span",{className:"font-medium text-sm truncate",children:e.customer_name||e.customer_email||"—"}),i.jsx("span",{className:"text-xs text-muted-foreground hidden sm:inline",children:"·"}),i.jsx("span",{className:"text-xs text-muted-foreground truncate hidden sm:inline",children:e.customer_email})]}),i.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap text-[11px]",children:[i.jsx("span",{className:"text-muted-foreground",children:Ec(e.created_at)}),e.utm_source&&i.jsxs("span",{className:"text-muted-foreground",children:["· ",e.utm_source]})]})]}),i.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap justify-end shrink-0",children:[i.jsx(be,{size:"sm",variant:p?"default":"outline",onClick:y,className:`h-7 text-[10px] px-2 ${p?"bg-emerald-600 hover:bg-emerald-700 text-white":""}`,title:p?"Desmarcar como lida":"Marcar como lida",children:p?i.jsxs(i.Fragment,{children:[i.jsx(T_,{className:"w-3 h-3 mr-1"}),"Desmarcar"]}):i.jsxs(i.Fragment,{children:[i.jsx(xy,{className:"w-3 h-3 mr-1"}),"Marcar lida"]})}),e.action_required&&i.jsx(st,{className:"bg-orange-600 hover:bg-orange-600 text-white text-[10px]",children:"⚡ Ação"}),e.real_payment_status==="confirmed_paid"&&i.jsx(st,{className:"bg-green-700 hover:bg-green-700 text-white text-[10px]",children:"✓ Pago"}),e.real_payment_status==="not_paid"&&i.jsx(st,{variant:"outline",className:"text-[10px]",children:"✗ Não pago"}),e.recovery_status==="em_recuperacao"&&i.jsx(st,{className:"bg-orange-500 hover:bg-orange-500 text-white text-[10px]",children:"🔧 Recuperação"}),e.pix_copied&&i.jsx(st,{className:"bg-blue-500 hover:bg-blue-500 text-white text-[10px]",title:"Usuário copiou o código PIX",children:"📋 Copiou PIX"}),(e.time_on_page_seconds??0)>0&&i.jsxs(st,{className:"bg-black hover:bg-black text-white text-[10px] gap-1 tabular-nums font-semibold",title:`Tempo na página de PIX: ${Wh(e.time_on_page_seconds)}`,children:[i.jsx(Ns,{className:"w-3 h-3"}),Wh(e.time_on_page_seconds)]}),(e.returned_after_delay_count??0)>=1&&i.jsx(st,{className:"bg-red-500 hover:bg-red-500 text-white text-[10px]",children:"🔥 +60s"}),w?i.jsxs(st,{className:"bg-blue-600 hover:bg-blue-600 text-white text-[10px] gap-1",title:`${e.receipts.length} comprovante(s) anexado(s)`,children:[i.jsx(B_,{className:"w-3 h-3"})," Comprov. ",e.receipts.length>1?`(${e.receipts.length})`:""]}):i.jsxs(st,{variant:"outline",className:"text-[10px] text-muted-foreground gap-1",title:"Sem comprovante anexado",children:[i.jsx(P_,{className:"w-3 h-3"})," Sem comp."]}),i.jsx(FL,{label:e.score_label,score:e.payment_score}),i.jsx(DL,{status:e.status}),i.jsx("span",{className:"font-bold text-sm tabular-nums ml-2",children:Vm(e.amount)})]})]})}),i.jsx(RL,{children:i.jsxs("div",{className:"border-t bg-muted/20 px-4 py-4 space-y-4",children:[i.jsxs("div",{className:"flex flex-wrap gap-2",children:[R&&i.jsx("a",{href:R,target:"_blank",rel:"noopener noreferrer",children:i.jsxs(be,{size:"sm",className:"bg-green-600 hover:bg-green-700 text-white h-8",children:[i.jsx(Cu,{className:"w-3.5 h-3.5 mr-1.5"})," WhatsApp"]})}),e.customer_email&&i.jsxs(be,{size:"sm",variant:"outline",onClick:I,className:"h-8",children:[i.jsx(ku,{className:"w-3.5 h-3.5 mr-1.5"})," Copiar email"]}),i.jsxs(be,{size:"sm",variant:"outline",onClick:()=>{navigator.clipboard.writeText(e.transaction_id),ve.success("TX ID copiado")},className:"h-8",children:[i.jsx(nl,{className:"w-3.5 h-3.5 mr-1.5"})," Copiar TX ID"]}),i.jsxs(be,{size:"sm",variant:"ghost",onClick:()=>h(!0),className:"h-8",children:[i.jsx(S_,{className:"w-3.5 h-3.5 mr-1.5"})," Timeline"]})]}),i.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 text-xs",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-muted-foreground uppercase text-[10px] font-semibold mb-0.5",children:"Telefone"}),i.jsx("div",{className:"font-medium",children:e.customer_phone||"—"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-muted-foreground uppercase text-[10px] font-semibold mb-0.5",children:"CPF"}),i.jsx("div",{className:"font-medium",children:e.customer_document||"—"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-muted-foreground uppercase text-[10px] font-semibold mb-0.5",children:"Pago em"}),i.jsx("div",{className:"font-medium",children:Ec(e.paid_at)})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-muted-foreground uppercase text-[10px] font-semibold mb-0.5",children:"/obrigado"}),i.jsx("div",{className:v?"font-medium text-emerald-600":"text-muted-foreground",children:v?`✓ ${Ec(e.thank_you_visited_at)}`:"—"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-muted-foreground uppercase text-[10px] font-semibold mb-0.5",children:"Copiou PIX"}),i.jsx("div",{className:e.pix_copied?"font-medium text-blue-600":"text-muted-foreground",children:e.pix_copied?e.pix_copied_at?`✓ ${Ec(e.pix_copied_at)}`:"✓ Sim":"—"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-muted-foreground uppercase text-[10px] font-semibold mb-0.5",children:"Tempo no checkout"}),i.jsxs("div",{className:`font-medium tabular-nums ${(e.time_on_page_seconds??0)>0?"":"text-muted-foreground"}`,children:[i.jsx(Ns,{className:"w-3 h-3 inline mr-1"}),(e.time_on_page_seconds??0)>0?Wh(e.time_on_page_seconds):"—",(e.heartbeat_count??0)>0&&i.jsxs("span",{className:"text-[10px] text-muted-foreground ml-1",children:["(",e.heartbeat_count," hb)"]})]})]}),(e.time_to_return_after_pix??0)>0&&i.jsxs("div",{children:[i.jsx("div",{className:"text-muted-foreground uppercase text-[10px] font-semibold mb-0.5",children:"Voltou após PIX"}),i.jsxs("div",{className:`font-medium ${(e.time_to_return_after_pix??0)>=60&&(e.time_to_return_after_pix??0)<=180?"text-emerald-600":""}`,children:[i.jsx(Ns,{className:"w-3 h-3 inline mr-1"}),e.time_to_return_after_pix,"s"]})]}),(e.tab_returns??0)>0&&i.jsxs("div",{children:[i.jsx("div",{className:"text-muted-foreground uppercase text-[10px] font-semibold mb-0.5",children:"Retornos"}),i.jsxs("div",{className:"font-medium",children:[e.tab_returns,"x"]})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-muted-foreground uppercase text-[10px] font-semibold mb-0.5",children:"TX ID"}),i.jsx("div",{className:"font-mono text-[11px] break-all",children:e.transaction_id})]})]}),e.receipts&&e.receipts.length>0&&i.jsxs("div",{children:[i.jsx("div",{className:"text-muted-foreground uppercase text-[10px] font-semibold mb-1.5",children:"Comprovantes"}),i.jsx("div",{className:"flex flex-wrap gap-2",children:e.receipts.map((F,G)=>{const W=/\.pdf($|\?)/i.test(F.file_url)||/pdf/i.test(F.file_name);return i.jsxs("div",{className:"flex items-center gap-2 border rounded-md px-2.5 py-1.5 bg-background text-xs",children:[W?i.jsx(md,{className:"w-3.5 h-3.5"}):i.jsx(Kb,{className:"w-3.5 h-3.5"}),i.jsx("span",{className:"max-w-[160px] truncate",children:F.file_name}),i.jsx("a",{href:F.file_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:i.jsx(Gb,{className:"w-3 h-3"})})]},G)})})]}),i.jsxs("div",{className:"flex flex-wrap gap-2 pt-2 border-t",children:[g!=="PAID"&&(!e.real_payment_status||e.real_payment_status==="unknown")&&i.jsxs(i.Fragment,{children:[i.jsx(be,{size:"sm",disabled:l,onClick:()=>A("confirmed_paid"),className:"bg-green-700 hover:bg-green-800 text-white h-8",children:l?i.jsx(Wt,{className:"w-3 h-3 animate-spin"}):"✓ Confirmar pago"}),i.jsx(be,{size:"sm",variant:"outline",disabled:l,onClick:()=>A("not_paid"),className:"h-8",children:"✗ Não pago"})]}),e.action_required&&e.recovery_status!=="em_recuperacao"&&i.jsxs(be,{size:"sm",disabled:l,onClick:()=>z("start"),className:"bg-orange-600 hover:bg-orange-700 text-white h-8",children:[i.jsx(Rl,{className:"w-3.5 h-3.5 mr-1.5"})," Iniciar recuperação"]}),e.recovery_status==="em_recuperacao"&&i.jsxs(i.Fragment,{children:[i.jsx(be,{size:"sm",disabled:l,onClick:()=>z("recovered"),className:"bg-emerald-600 hover:bg-emerald-700 text-white h-8",children:"Marcar recuperada"}),i.jsx(be,{size:"sm",variant:"outline",disabled:l,onClick:()=>z("discarded"),className:"h-8",children:"Descartar"})]}),g!=="PAID"&&i.jsx(BL,{tx:e})]})]})}),i.jsx(LL,{open:d,onOpenChange:h,transactionId:e.transaction_id,password:s})]})})}const nv={search:"",scoreLabel:"all",status:"all",minValue:"",realStatus:"all",sortBy:"created"},zL=e=>(e/100).toLocaleString("pt-BR",{style:"currency",currency:"BRL"});function $g({preFilter:e,emptyText:t="Nenhuma transação encontrada",defaultSort:n="created",hideFilters:r=[]}){const{transactions:s,loading:a}=Us(),[o,l]=b.useState({...nv,sortBy:n}),[c,d]=b.useState(!1),h=b.useMemo(()=>{const m=o.search.trim().toLowerCase(),y=o.minValue?Math.round(parseFloat(o.minValue)*100):0;return s.filter(g=>e?e(g):!0).filter(g=>{const S=!m||[g.customer_name,g.customer_email,g.customer_phone,g.customer_document,g.transaction_id].some(C=>(C||"").toLowerCase().includes(m)),w=o.scoreLabel==="all"?!0:o.scoreLabel==="abandoned"?!g.score_label||g.score_label==="unknown"||g.score_label==="abandoned":g.score_label===o.scoreLabel,v=(g.status||"").toUpperCase(),x=o.status==="all"?!0:o.status==="pending"?v==="PENDING"||v==="WAITING_PAYMENT":o.status==="paid"?v==="PAID":o.status==="expired"?v==="EXPIRED"||v==="REFUSED"||v==="FAILED"||v==="CANCELED":!0,k=!y||(Number(g.amount)||0)>=y,j=o.realStatus==="all"?!0:o.realStatus==="unknown"?!g.real_payment_status||g.real_payment_status==="unknown":g.real_payment_status===o.realStatus;return S&&w&&x&&k&&j}).sort((g,S)=>o.sortBy==="score"?(S.payment_score??0)-(g.payment_score??0):o.sortBy==="amount"?(S.amount||0)-(g.amount||0):new Date(S.created_at).getTime()-new Date(g.created_at).getTime())},[s,o,e]),f=h.reduce((m,y)=>m+(Number(y.amount)||0),0),p=o.search||o.scoreLabel!=="all"||o.status!=="all"||o.minValue||o.realStatus!=="all";return i.jsxs("div",{className:"space-y-4 max-w-7xl",children:[i.jsxs(bl,{className:"p-4",children:[i.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[i.jsxs("div",{className:"relative flex-1 min-w-[260px]",children:[i.jsx(Ai,{className:"w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),i.jsx(dt,{type:"search",placeholder:"Buscar por nome, email, telefone, CPF, TX ID...",value:o.search,onChange:m=>l(y=>({...y,search:m.target.value})),className:"pl-9"})]}),i.jsxs("select",{value:o.sortBy,onChange:m=>l(y=>({...y,sortBy:m.target.value})),className:"border rounded-md px-3 py-2 text-sm bg-background h-10",children:[i.jsx("option",{value:"created",children:"📅 Mais recentes"}),i.jsx("option",{value:"score",children:"🎯 Maior score"}),i.jsx("option",{value:"amount",children:"💰 Maior valor"})]}),i.jsxs(be,{variant:c?"default":"outline",size:"sm",onClick:()=>d(m=>!m),className:"h-10",children:[i.jsx(H_,{className:"w-4 h-4 mr-2"})," Filtros"]}),p&&i.jsxs(be,{variant:"ghost",size:"sm",onClick:()=>l({...nv,sortBy:n}),className:"h-10",children:[i.jsx(Sr,{className:"w-4 h-4 mr-1"})," Limpar"]})]}),c&&i.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 mt-4 pt-4 border-t",children:[!r.includes("status")&&i.jsxs("div",{children:[i.jsx("label",{className:"text-[11px] uppercase font-semibold text-muted-foreground mb-1 block",children:"Status"}),i.jsxs("select",{value:o.status,onChange:m=>l(y=>({...y,status:m.target.value})),className:"w-full border rounded-md px-2 py-1.5 text-sm bg-background",children:[i.jsx("option",{value:"all",children:"Todos"}),i.jsx("option",{value:"pending",children:"Pendentes"}),i.jsx("option",{value:"paid",children:"Pagas"}),i.jsx("option",{value:"expired",children:"Expiradas/Recusadas"})]})]}),!r.includes("scoreLabel")&&i.jsxs("div",{children:[i.jsx("label",{className:"text-[11px] uppercase font-semibold text-muted-foreground mb-1 block",children:"Score"}),i.jsxs("select",{value:o.scoreLabel,onChange:m=>l(y=>({...y,scoreLabel:m.target.value})),className:"w-full border rounded-md px-2 py-1.5 text-sm bg-background",children:[i.jsx("option",{value:"all",children:"Todos"}),i.jsx("option",{value:"provable_paid",children:"🟢 Provável pago"}),i.jsx("option",{value:"likely_paid",children:"🟡 Possível pago"}),i.jsx("option",{value:"abandoned",children:"⚪ Abandonado"})]})]}),!r.includes("realStatus")&&i.jsxs("div",{children:[i.jsx("label",{className:"text-[11px] uppercase font-semibold text-muted-foreground mb-1 block",children:"Validação"}),i.jsxs("select",{value:o.realStatus,onChange:m=>l(y=>({...y,realStatus:m.target.value})),className:"w-full border rounded-md px-2 py-1.5 text-sm bg-background",children:[i.jsx("option",{value:"all",children:"Todas"}),i.jsx("option",{value:"unknown",children:"Não validadas"}),i.jsx("option",{value:"confirmed_paid",children:"✓ Confirmadas pagas"}),i.jsx("option",{value:"not_paid",children:"✗ Não pagas"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-[11px] uppercase font-semibold text-muted-foreground mb-1 block",children:"Valor mín. (R$)"}),i.jsx(dt,{type:"number",placeholder:"0,00",value:o.minValue,onChange:m=>l(y=>({...y,minValue:m.target.value})),className:"h-9"})]})]}),i.jsxs("div",{className:"flex items-center justify-between mt-3 pt-3 border-t",children:[i.jsxs("span",{className:"text-xs text-muted-foreground",children:[i.jsx("strong",{className:"text-foreground",children:h.length})," de ",s.length," transações"]}),i.jsx("span",{className:"text-xs font-semibold tabular-nums",children:zL(f)})]})]}),a&&s.length===0?i.jsx("div",{className:"flex items-center justify-center py-20",children:i.jsx(Wt,{className:"w-6 h-6 animate-spin text-muted-foreground"})}):h.length===0?i.jsxs(bl,{className:"p-10 text-center",children:[i.jsx("p",{className:"text-sm font-medium",children:t}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Tente ajustar os filtros ou o período."})]}):i.jsx("div",{className:"space-y-2",children:h.map(m=>i.jsx(UL,{tx:m},m.id))})]})}function VL(){return i.jsx($g,{})}const HL=e=>{const t=(e.status||"").toUpperCase();return(t==="PENDING"||t==="WAITING_PAYMENT")&&(e.payment_score??0)>=60&&(!e.real_payment_status||e.real_payment_status==="unknown")};function qL(){return i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"bg-orange-500/10 border border-orange-500/30 rounded-lg p-4 max-w-7xl",children:[i.jsx("p",{className:"text-sm font-medium text-foreground",children:"⚡ Vendas com alta probabilidade de pagamento sem confirmação automática"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:'Filtro: score ≥ 60 + status pendente + ainda não validadas manualmente. Use os botões "✓ Pago" ou "✗ Não pago" pra calibrar o sistema.'})]}),i.jsx($g,{preFilter:HL,emptyText:"Nenhuma oportunidade no momento ✨",defaultSort:"score"})]})}const GL=e=>e.recovery_status==="em_recuperacao";function WL(){return i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"bg-amber-500/10 border border-amber-500/30 rounded-lg p-4 max-w-7xl",children:[i.jsx("p",{className:"text-sm font-medium text-foreground",children:"🔧 Vendas em processo de recuperação"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:'Marque como "Recuperada" quando o cliente confirmar o pagamento, ou "Descartar" se não houve pagamento.'})]}),i.jsx($g,{preFilter:GL,emptyText:"Nenhuma venda em recuperação no momento",defaultSort:"score"})]})}function KL(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const XL=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,JL=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,QL={};function rv(e,t){return(QL.jsx?JL:XL).test(e)}const YL=/[ \t\n\f\r]/g;function ZL(e){return typeof e=="object"?e.type==="text"?sv(e.value):!1:sv(e)}function sv(e){return e.replace(YL,"")===""}class Bl{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Bl.prototype.normal={};Bl.prototype.property={};Bl.prototype.space=void 0;function hC(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new Bl(n,r,t)}function Hm(e){return e.toLowerCase()}class Jt{constructor(t,n){this.attribute=n,this.property=t}}Jt.prototype.attribute="";Jt.prototype.booleanish=!1;Jt.prototype.boolean=!1;Jt.prototype.commaOrSpaceSeparated=!1;Jt.prototype.commaSeparated=!1;Jt.prototype.defined=!1;Jt.prototype.mustUseProperty=!1;Jt.prototype.number=!1;Jt.prototype.overloadedBoolean=!1;Jt.prototype.property="";Jt.prototype.spaceSeparated=!1;Jt.prototype.space=void 0;let eD=0;const he=ka(),Qe=ka(),qm=ka(),q=ka(),Pe=ka(),go=ka(),tn=ka();function ka(){return 2**++eD}const Gm=Object.freeze(Object.defineProperty({__proto__:null,boolean:he,booleanish:Qe,commaOrSpaceSeparated:tn,commaSeparated:go,number:q,overloadedBoolean:qm,spaceSeparated:Pe},Symbol.toStringTag,{value:"Module"})),Kh=Object.keys(Gm);class Bg extends Jt{constructor(t,n,r,s){let a=-1;if(super(t,n),av(this,"space",s),typeof r=="number")for(;++a4&&n.slice(0,4)==="data"&&aD.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(ov,lD);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!ov.test(a)){let o=a.replace(sD,iD);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}s=Bg}return new s(r,t)}function iD(e){return"-"+e.toLowerCase()}function lD(e){return e.charAt(1).toUpperCase()}const cD=hC([fC,tD,gC,yC,xC],"html"),Ug=hC([fC,nD,gC,yC,xC],"svg");function uD(e){return e.join(" ").trim()}var zg={},iv=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,dD=/\n/g,hD=/^\s*/,fD=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,mD=/^:\s*/,pD=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,gD=/^[;\s]*/,yD=/^\s+|\s+$/g,xD=` `,lv="/",cv="*",Ys="",vD="comment",bD="declaration";function wD(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function s(y){var g=y.match(dD);g&&(n+=g.length);var S=y.lastIndexOf(xD);r=~S?y.length-S:r+y.length}function a(){var y={line:n,column:r};return function(g){return g.position=new o(y),d(),g}}function o(y){this.start=y,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function l(y){var g=new Error(t.source+":"+n+":"+r+": "+y);if(g.reason=y,g.filename=t.source,g.line=n,g.column=r,g.source=e,!t.silent)throw g}function c(y){var g=y.exec(e);if(g){var S=g[0];return s(S),e=e.slice(S.length),g}}function d(){c(hD)}function h(y){var g;for(y=y||[];g=f();)g!==!1&&y.push(g);return y}function f(){var y=a();if(!(lv!=e.charAt(0)||cv!=e.charAt(1))){for(var g=2;Ys!=e.charAt(g)&&(cv!=e.charAt(g)||lv!=e.charAt(g+1));)++g;if(g+=2,Ys===e.charAt(g-1))return l("End of comment missing");var S=e.slice(2,g-2);return r+=2,s(S),e=e.slice(g),r+=2,y({type:vD,comment:S})}}function p(){var y=a(),g=c(fD);if(g){if(f(),!c(mD))return l("property missing ':'");var S=c(pD),w=y({type:bD,property:uv(g[0].replace(iv,Ys)),value:S?uv(S[0].replace(iv,Ys)):Ys});return c(gD),w}}function m(){var y=[];h(y);for(var g;g=p();)g!==!1&&(y.push(g),h(y));return y}return d(),m()}function uv(e){return e?e.replace(yD,Ys):Ys}var SD=wD,kD=Qc&&Qc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(zg,"__esModule",{value:!0});zg.default=jD;const CD=kD(SD);function jD(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,CD.default)(e),s=typeof t=="function";return r.forEach(a=>{if(a.type!=="declaration")return;const{property:o,value:l}=a;s?t(o,l,a):l&&(n=n||{},n[o]=l)}),n}var Vd={};Object.defineProperty(Vd,"__esModule",{value:!0});Vd.camelCase=void 0;var ED=/^--[a-zA-Z0-9_-]+$/,ND=/-([a-z])/g,_D=/^[^-]+$/,TD=/^-(webkit|moz|ms|o|khtml)-/,PD=/^-(ms)-/,AD=function(e){return!e||_D.test(e)||ED.test(e)},RD=function(e,t){return t.toUpperCase()},dv=function(e,t){return"".concat(t,"-")},ID=function(e,t){return t===void 0&&(t={}),AD(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(PD,dv):e=e.replace(TD,dv),e.replace(ND,RD))};Vd.camelCase=ID;var OD=Qc&&Qc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},MD=OD(zg),LD=Vd;function Wm(e,t){var n={};return!e||typeof e!="string"||(0,MD.default)(e,function(r,s){r&&s&&(n[(0,LD.camelCase)(r,t)]=s)}),n}Wm.default=Wm;var DD=Wm;const FD=Ku(DD),vC=bC("end"),Vg=bC("start");function bC(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function $D(e){const t=Vg(e),n=vC(e);if(t&&n)return{start:t,end:n}}function Mi(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?hv(e.position):"start"in e||"end"in e?hv(e):"line"in e||"column"in e?Km(e):""}function Km(e){return fv(e&&e.line)+":"+fv(e&&e.column)}function hv(e){return Km(e&&e.start)+"-"+Km(e&&e.end)}function fv(e){return e&&typeof e=="number"?e:1}class St extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",a={},o=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?s=t:!a.cause&&t&&(o=!0,s=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?a.ruleId=r:(a.source=r.slice(0,c),a.ruleId=r.slice(c+1))}if(!a.place&&a.ancestors&&a.ancestors){const c=a.ancestors[a.ancestors.length-1];c&&(a.place=c.position)}const l=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=l?l.line:void 0,this.name=Mi(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}St.prototype.file="";St.prototype.name="";St.prototype.reason="";St.prototype.message="";St.prototype.stack="";St.prototype.column=void 0;St.prototype.line=void 0;St.prototype.ancestors=void 0;St.prototype.cause=void 0;St.prototype.fatal=void 0;St.prototype.place=void 0;St.prototype.ruleId=void 0;St.prototype.source=void 0;const Hg={}.hasOwnProperty,BD=new Map,UD=/[A-Z]/g,zD=new Set(["table","tbody","thead","tfoot","tr"]),VD=new Set(["td","th"]),wC="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function HD(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=YD(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=QD(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Ug:cD,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=SC(s,e,void 0);return a&&typeof a!="string"?a:s.create(e,s.Fragment,{children:a||void 0},void 0)}function SC(e,t,n){if(t.type==="element")return qD(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return GD(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return KD(e,t,n);if(t.type==="mdxjsEsm")return WD(e,t);if(t.type==="root")return XD(e,t,n);if(t.type==="text")return JD(e,t)}function qD(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Ug,e.schema=s),e.ancestors.push(t);const a=CC(e,t.tagName,!1),o=ZD(e,t);let l=Gg(e,t);return zD.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!ZL(c):!0})),kC(e,o,a,t),qg(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function GD(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}wl(e,t.position)}function WD(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);wl(e,t.position)}function KD(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=Ug,e.schema=s),e.ancestors.push(t);const a=t.name===null?e.Fragment:CC(e,t.name,!0),o=e8(e,t),l=Gg(e,t);return kC(e,o,a,t),qg(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function XD(e,t,n){const r={};return qg(r,Gg(e,t)),e.create(t,e.Fragment,r,n)}function JD(e,t){return t.value}function kC(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function qg(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function QD(e,t,n){return r;function r(s,a,o,l){const d=Array.isArray(o.children)?n:t;return l?d(a,o,l):d(a,o)}}function YD(e,t){return n;function n(r,s,a,o){const l=Array.isArray(a.children),c=Vg(r);return t(s,a,o,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function ZD(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&Hg.call(t.properties,s)){const a=t8(e,s,t.properties[s]);if(a){const[o,l]=a;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&VD.has(t.tagName)?r=l:n[o]=l}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function e8(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const o=a.expression;o.type;const l=o.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else wl(e,t.position);else{const s=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,a=e.evaluater.evaluateExpression(l.expression)}else wl(e,t.position);else a=r.value===null?!0:r.value;n[s]=a}return n}function Gg(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:BD;for(;++rs?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a0?(Cr(e,e.length,0,t),e):t}const gv={}.hasOwnProperty;function c8(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function yo(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const mr=zs(/[A-Za-z]/),cn=zs(/[\dA-Za-z]/),h8=zs(/[#-'*+\--9=?A-Z^-~]/);function Xm(e){return e!==null&&(e<32||e===127)}const Jm=zs(/\d/),f8=zs(/[\dA-Fa-f]/),m8=zs(/[!-/:-@[-`{-~]/);function oe(e){return e!==null&&e<-2}function Kt(e){return e!==null&&(e<0||e===32)}function je(e){return e===-2||e===-1||e===32}const p8=zs(new RegExp("\\p{P}|\\p{S}","u")),g8=zs(/\s/);function zs(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Yo(e){const t=[];let n=-1,r=0,s=0;for(;++n55295&&a<57344){const l=e.charCodeAt(n+1);a<56320&&l>56319&&l<57344?(o=String.fromCharCode(a,l),s=1):o="�"}else o=String.fromCharCode(a);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+s+1,o=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function Ie(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(c){return je(c)?(e.enter(n),l(c)):t(c)}function l(c){return je(c)&&a++o))return;const T=t.events.length;let P=T,_,R;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){if(_){R=t.events[P][1].end;break}_=!0}for(w(r),C=T;Cx;){const j=n[k];t.containerState=j[1],j[0].exit.call(t,e)}n.length=x}function v(){s.write([null]),a=void 0,s=void 0,t.containerState._closeFlow=void 0}}function w8(e,t,n){return Ie(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function xv(e){if(e===null||Kt(e)||g8(e))return 1;if(p8(e))return 2}function Kg(e,t,n){const r=[];let s=-1;for(;++s1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},p={...e[n][1].start};vv(f,-c),vv(p,c),o={type:c>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},a={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:c>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[r][1].end={...o.start},e[n][1].start={...l.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=wn(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=wn(d,[["enter",s,t],["enter",o,t],["exit",o,t],["enter",a,t]]),d=wn(d,Kg(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=wn(d,[["exit",a,t],["enter",l,t],["exit",l,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(h=2,d=wn(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):h=0,Cr(e,r-1,n-r+3,d),n=r+d.length-h-2;break}}for(n=-1;++n0&&je(C)?Ie(e,v,"linePrefix",a+1)(C):v(C)}function v(C){return C===null||oe(C)?e.check(bv,g,k)(C):(e.enter("codeFlowValue"),x(C))}function x(C){return C===null||oe(C)?(e.exit("codeFlowValue"),v(C)):(e.consume(C),x)}function k(C){return e.exit("codeFenced"),t(C)}function j(C,T,P){let _=0;return R;function R(F){return C.enter("lineEnding"),C.consume(F),C.exit("lineEnding"),I}function I(F){return C.enter("codeFencedFence"),je(F)?Ie(C,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):A(F)}function A(F){return F===l?(C.enter("codeFencedFenceSequence"),z(F)):P(F)}function z(F){return F===l?(_++,C.consume(F),z):_>=o?(C.exit("codeFencedFenceSequence"),je(F)?Ie(C,D,"whitespace")(F):D(F)):P(F)}function D(F){return F===null||oe(F)?(C.exit("codeFencedFence"),T(F)):P(F)}}}function I8(e,t,n){const r=this;return s;function s(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const Jh={name:"codeIndented",tokenize:M8},O8={partial:!0,tokenize:L8};function M8(e,t,n){const r=this;return s;function s(d){return e.enter("codeIndented"),Ie(e,a,"linePrefix",5)(d)}function a(d){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?o(d):n(d)}function o(d){return d===null?c(d):oe(d)?e.attempt(O8,o,c)(d):(e.enter("codeFlowValue"),l(d))}function l(d){return d===null||oe(d)?(e.exit("codeFlowValue"),o(d)):(e.consume(d),l)}function c(d){return e.exit("codeIndented"),t(d)}}function L8(e,t,n){const r=this;return s;function s(o){return r.parser.lazy[r.now().line]?n(o):oe(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):Ie(e,a,"linePrefix",5)(o)}function a(o){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):oe(o)?s(o):n(o)}}const D8={name:"codeText",previous:$8,resolve:F8,tokenize:B8};function F8(e){let t=e.length-4,n=3,r,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const s=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&fi(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),fi(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),fi(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function AC(e,t,n,r,s,a,o,l,c){const d=c||Number.POSITIVE_INFINITY;let h=0;return f;function f(w){return w===60?(e.enter(r),e.enter(s),e.enter(a),e.consume(w),e.exit(a),p):w===null||w===32||w===41||Xm(w)?n(w):(e.enter(r),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),g(w))}function p(w){return w===62?(e.enter(a),e.consume(w),e.exit(a),e.exit(s),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),m(w))}function m(w){return w===62?(e.exit("chunkString"),e.exit(l),p(w)):w===null||w===60||oe(w)?n(w):(e.consume(w),w===92?y:m)}function y(w){return w===60||w===62||w===92?(e.consume(w),m):m(w)}function g(w){return!h&&(w===null||w===41||Kt(w))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(r),t(w)):h999||m===null||m===91||m===93&&!c||m===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(m):m===93?(e.exit(a),e.enter(s),e.consume(m),e.exit(s),e.exit(r),t):oe(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),f(m))}function f(m){return m===null||m===91||m===93||oe(m)||l++>999?(e.exit("chunkString"),h(m)):(e.consume(m),c||(c=!je(m)),m===92?p:f)}function p(m){return m===91||m===92||m===93?(e.consume(m),l++,f):f(m)}}function IC(e,t,n,r,s,a){let o;return l;function l(p){return p===34||p===39||p===40?(e.enter(r),e.enter(s),e.consume(p),e.exit(s),o=p===40?41:p,c):n(p)}function c(p){return p===o?(e.enter(s),e.consume(p),e.exit(s),e.exit(r),t):(e.enter(a),d(p))}function d(p){return p===o?(e.exit(a),c(o)):p===null?n(p):oe(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),Ie(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(p))}function h(p){return p===o||p===null||oe(p)?(e.exit("chunkString"),d(p)):(e.consume(p),p===92?f:h)}function f(p){return p===o||p===92?(e.consume(p),h):h(p)}}function Li(e,t){let n;return r;function r(s){return oe(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):je(s)?Ie(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const K8={name:"definition",tokenize:J8},X8={partial:!0,tokenize:Q8};function J8(e,t,n){const r=this;let s;return a;function a(m){return e.enter("definition"),o(m)}function o(m){return RC.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function l(m){return s=yo(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),c):n(m)}function c(m){return Kt(m)?Li(e,d)(m):d(m)}function d(m){return AC(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function h(m){return e.attempt(X8,f,f)(m)}function f(m){return je(m)?Ie(e,p,"whitespace")(m):p(m)}function p(m){return m===null||oe(m)?(e.exit("definition"),r.parser.defined.push(s),t(m)):n(m)}}function Q8(e,t,n){return r;function r(l){return Kt(l)?Li(e,s)(l):n(l)}function s(l){return IC(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return je(l)?Ie(e,o,"whitespace")(l):o(l)}function o(l){return l===null||oe(l)?t(l):n(l)}}const Y8={name:"hardBreakEscape",tokenize:Z8};function Z8(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),s}function s(a){return oe(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const eF={name:"headingAtx",resolve:tF,tokenize:nF};function tF(e,t){let n=e.length-2,r=3,s,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Cr(e,r,n-r+1,[["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t]])),e}function nF(e,t,n){let r=0;return s;function s(h){return e.enter("atxHeading"),a(h)}function a(h){return e.enter("atxHeadingSequence"),o(h)}function o(h){return h===35&&r++<6?(e.consume(h),o):h===null||Kt(h)?(e.exit("atxHeadingSequence"),l(h)):n(h)}function l(h){return h===35?(e.enter("atxHeadingSequence"),c(h)):h===null||oe(h)?(e.exit("atxHeading"),t(h)):je(h)?Ie(e,l,"whitespace")(h):(e.enter("atxHeadingText"),d(h))}function c(h){return h===35?(e.consume(h),c):(e.exit("atxHeadingSequence"),l(h))}function d(h){return h===null||h===35||Kt(h)?(e.exit("atxHeadingText"),l(h)):(e.consume(h),d)}}const rF=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Sv=["pre","script","style","textarea"],sF={concrete:!0,name:"htmlFlow",resolveTo:iF,tokenize:lF},aF={partial:!0,tokenize:uF},oF={partial:!0,tokenize:cF};function iF(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function lF(e,t,n){const r=this;let s,a,o,l,c;return d;function d(N){return h(N)}function h(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),f}function f(N){return N===33?(e.consume(N),p):N===47?(e.consume(N),a=!0,g):N===63?(e.consume(N),s=3,r.interrupt?t:E):mr(N)?(e.consume(N),o=String.fromCharCode(N),S):n(N)}function p(N){return N===45?(e.consume(N),s=2,m):N===91?(e.consume(N),s=5,l=0,y):mr(N)?(e.consume(N),s=4,r.interrupt?t:E):n(N)}function m(N){return N===45?(e.consume(N),r.interrupt?t:E):n(N)}function y(N){const te="CDATA[";return N===te.charCodeAt(l++)?(e.consume(N),l===te.length?r.interrupt?t:A:y):n(N)}function g(N){return mr(N)?(e.consume(N),o=String.fromCharCode(N),S):n(N)}function S(N){if(N===null||N===47||N===62||Kt(N)){const te=N===47,ke=o.toLowerCase();return!te&&!a&&Sv.includes(ke)?(s=1,r.interrupt?t(N):A(N)):rF.includes(o.toLowerCase())?(s=6,te?(e.consume(N),w):r.interrupt?t(N):A(N)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(N):a?v(N):x(N))}return N===45||cn(N)?(e.consume(N),o+=String.fromCharCode(N),S):n(N)}function w(N){return N===62?(e.consume(N),r.interrupt?t:A):n(N)}function v(N){return je(N)?(e.consume(N),v):R(N)}function x(N){return N===47?(e.consume(N),R):N===58||N===95||mr(N)?(e.consume(N),k):je(N)?(e.consume(N),x):R(N)}function k(N){return N===45||N===46||N===58||N===95||cn(N)?(e.consume(N),k):j(N)}function j(N){return N===61?(e.consume(N),C):je(N)?(e.consume(N),j):x(N)}function C(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),c=N,T):je(N)?(e.consume(N),C):P(N)}function T(N){return N===c?(e.consume(N),c=null,_):N===null||oe(N)?n(N):(e.consume(N),T)}function P(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||Kt(N)?j(N):(e.consume(N),P)}function _(N){return N===47||N===62||je(N)?x(N):n(N)}function R(N){return N===62?(e.consume(N),I):n(N)}function I(N){return N===null||oe(N)?A(N):je(N)?(e.consume(N),I):n(N)}function A(N){return N===45&&s===2?(e.consume(N),G):N===60&&s===1?(e.consume(N),W):N===62&&s===4?(e.consume(N),Y):N===63&&s===3?(e.consume(N),E):N===93&&s===5?(e.consume(N),$):oe(N)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(aF,X,z)(N)):N===null||oe(N)?(e.exit("htmlFlowData"),z(N)):(e.consume(N),A)}function z(N){return e.check(oF,D,X)(N)}function D(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),F}function F(N){return N===null||oe(N)?z(N):(e.enter("htmlFlowData"),A(N))}function G(N){return N===45?(e.consume(N),E):A(N)}function W(N){return N===47?(e.consume(N),o="",M):A(N)}function M(N){if(N===62){const te=o.toLowerCase();return Sv.includes(te)?(e.consume(N),Y):A(N)}return mr(N)&&o.length<8?(e.consume(N),o+=String.fromCharCode(N),M):A(N)}function $(N){return N===93?(e.consume(N),E):A(N)}function E(N){return N===62?(e.consume(N),Y):N===45&&s===2?(e.consume(N),E):A(N)}function Y(N){return N===null||oe(N)?(e.exit("htmlFlowData"),X(N)):(e.consume(N),Y)}function X(N){return e.exit("htmlFlow"),t(N)}}function cF(e,t,n){const r=this;return s;function s(o){return oe(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):n(o)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function uF(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Hd,t,n)}}const dF={name:"htmlText",tokenize:hF};function hF(e,t,n){const r=this;let s,a,o;return l;function l(E){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(E),c}function c(E){return E===33?(e.consume(E),d):E===47?(e.consume(E),j):E===63?(e.consume(E),x):mr(E)?(e.consume(E),P):n(E)}function d(E){return E===45?(e.consume(E),h):E===91?(e.consume(E),a=0,y):mr(E)?(e.consume(E),v):n(E)}function h(E){return E===45?(e.consume(E),m):n(E)}function f(E){return E===null?n(E):E===45?(e.consume(E),p):oe(E)?(o=f,W(E)):(e.consume(E),f)}function p(E){return E===45?(e.consume(E),m):f(E)}function m(E){return E===62?G(E):E===45?p(E):f(E)}function y(E){const Y="CDATA[";return E===Y.charCodeAt(a++)?(e.consume(E),a===Y.length?g:y):n(E)}function g(E){return E===null?n(E):E===93?(e.consume(E),S):oe(E)?(o=g,W(E)):(e.consume(E),g)}function S(E){return E===93?(e.consume(E),w):g(E)}function w(E){return E===62?G(E):E===93?(e.consume(E),w):g(E)}function v(E){return E===null||E===62?G(E):oe(E)?(o=v,W(E)):(e.consume(E),v)}function x(E){return E===null?n(E):E===63?(e.consume(E),k):oe(E)?(o=x,W(E)):(e.consume(E),x)}function k(E){return E===62?G(E):x(E)}function j(E){return mr(E)?(e.consume(E),C):n(E)}function C(E){return E===45||cn(E)?(e.consume(E),C):T(E)}function T(E){return oe(E)?(o=T,W(E)):je(E)?(e.consume(E),T):G(E)}function P(E){return E===45||cn(E)?(e.consume(E),P):E===47||E===62||Kt(E)?_(E):n(E)}function _(E){return E===47?(e.consume(E),G):E===58||E===95||mr(E)?(e.consume(E),R):oe(E)?(o=_,W(E)):je(E)?(e.consume(E),_):G(E)}function R(E){return E===45||E===46||E===58||E===95||cn(E)?(e.consume(E),R):I(E)}function I(E){return E===61?(e.consume(E),A):oe(E)?(o=I,W(E)):je(E)?(e.consume(E),I):_(E)}function A(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(e.consume(E),s=E,z):oe(E)?(o=A,W(E)):je(E)?(e.consume(E),A):(e.consume(E),D)}function z(E){return E===s?(e.consume(E),s=void 0,F):E===null?n(E):oe(E)?(o=z,W(E)):(e.consume(E),z)}function D(E){return E===null||E===34||E===39||E===60||E===61||E===96?n(E):E===47||E===62||Kt(E)?_(E):(e.consume(E),D)}function F(E){return E===47||E===62||Kt(E)?_(E):n(E)}function G(E){return E===62?(e.consume(E),e.exit("htmlTextData"),e.exit("htmlText"),t):n(E)}function W(E){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),M}function M(E){return je(E)?Ie(e,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):$(E)}function $(E){return e.enter("htmlTextData"),o(E)}}const Xg={name:"labelEnd",resolveAll:gF,resolveTo:yF,tokenize:xF},fF={tokenize:vF},mF={tokenize:bF},pF={tokenize:wF};function gF(e){let t=-1;const n=[];for(;++t=3&&(d===null||oe(d))?(e.exit("thematicBreak"),t(d)):n(d)}function c(d){return d===s?(e.consume(d),r++,c):(e.exit("thematicBreakSequence"),je(d)?Ie(e,l,"whitespace")(d):l(d))}}const Ft={continuation:{tokenize:AF},exit:IF,name:"list",tokenize:PF},_F={partial:!0,tokenize:OF},TF={partial:!0,tokenize:RF};function PF(e,t,n){const r=this,s=r.events[r.events.length-1];let a=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,o=0;return l;function l(m){const y=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:Jm(m)){if(r.containerState.type||(r.containerState.type=y,e.enter(y,{_container:!0})),y==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(Xc,n,d)(m):d(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(m)}return n(m)}function c(m){return Jm(m)&&++o<10?(e.consume(m),c):(!r.interrupt||o<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),d(m)):n(m)}function d(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(Hd,r.interrupt?n:h,e.attempt(_F,p,f))}function h(m){return r.containerState.initialBlankLine=!0,a++,p(m)}function f(m){return je(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),p):n(m)}function p(m){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function AF(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Hd,s,a);function s(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ie(e,t,"listItemIndent",r.containerState.size+1)(l)}function a(l){return r.containerState.furtherBlankLines||!je(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(TF,t,o)(l))}function o(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ie(e,e.attempt(Ft,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function RF(e,t,n){const r=this;return Ie(e,s,"listItemIndent",r.containerState.size+1);function s(a){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(a):n(a)}}function IF(e){e.exit(this.containerState.type)}function OF(e,t,n){const r=this;return Ie(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(a){const o=r.events[r.events.length-1];return!je(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const kv={name:"setextUnderline",resolveTo:MF,tokenize:LF};function MF(e,t){let n=e.length,r,s,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",a?(e.splice(s,0,["enter",o,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function LF(e,t,n){const r=this;let s;return a;function a(d){let h=r.events.length,f;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){f=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),s=d,o(d)):n(d)}function o(d){return e.enter("setextHeadingLineSequence"),l(d)}function l(d){return d===s?(e.consume(d),l):(e.exit("setextHeadingLineSequence"),je(d)?Ie(e,c,"lineSuffix")(d):c(d))}function c(d){return d===null||oe(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const DF={tokenize:FF};function FF(e){const t=this,n=e.attempt(Hd,r,e.attempt(this.parser.constructs.flowInitial,s,Ie(e,e.attempt(this.parser.constructs.flow,s,e.attempt(V8,s)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const $F={resolveAll:MC()},BF=OC("string"),UF=OC("text");function OC(e){return{resolveAll:MC(e==="text"?zF:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],a=n.attempt(s,o,l);return o;function o(h){return d(h)?a(h):l(h)}function l(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),c}function c(h){return d(h)?(n.exit("data"),a(h)):(n.consume(h),c)}function d(h){if(h===null)return!0;const f=s[h];let p=-1;if(f)for(;++p-1){const l=o[0];typeof l=="string"?o[0]=l.slice(r):o.shift()}a>0&&o.push(e[s].slice(0,a))}return o}function t$(e,t){let n=-1;const r=[];let s;for(;++n0){const kt=re.tokenStack[re.tokenStack.length-1];(kt[1]||jv).call(re,void 0,kt[0])}for(O.position={start:ts(L.length>0?L[0][1].start:{line:1,column:1,offset:0}),end:ts(L.length>0?L[L.length-2][1].end:{line:1,column:1,offset:0})},le=-1;++le0&&(r.className=["language-"+s[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function p$(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function g$(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function y$(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=Yo(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let o,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,l+=1,e.footnoteCounts.set(r,l);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,c);const d={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,d),e.applyData(t,d)}function x$(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function v$(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function FC(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const s=e.all(t),a=s[0];a&&a.type==="text"?a.value="["+a.value:s.unshift({type:"text",value:"["});const o=s[s.length-1];return o&&o.type==="text"?o.value+=r:s.push({type:"text",value:r}),s}function b$(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return FC(e,t);const s={src:Yo(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const a={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,a),e.applyData(t,a)}function w$(e,t){const n={src:Yo(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function S$(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function k$(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return FC(e,t);const s={href:Yo(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const a={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function C$(e,t){const n={href:Yo(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function j$(e,t,n){const r=e.all(t),s=n?E$(n):$C(t),a={},o=[];if(typeof t.checked=="boolean"){const h=r[0];let f;h&&h.type==="element"&&h.tagName==="p"?f=h:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let l=-1;for(;++l1}function N$(e,t){const n={},r=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=Vg(t.children[1]),c=vC(t.children[t.children.length-1]);l&&c&&(o.position={start:l,end:c}),s.push(o)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,a),e.applyData(t,a)}function R$(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,l=o?o.length:t.children.length;let c=-1;const d=[];for(;++c0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return a.push(_v(t.slice(s),s>0,!1)),a.join("")}function _v(e,t,n){let r=0,s=e.length;if(t){let a=e.codePointAt(r);for(;a===Ev||a===Nv;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(s-1);for(;a===Ev||a===Nv;)s--,a=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function M$(e,t){const n={type:"text",value:O$(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function L$(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const D$={blockquote:h$,break:f$,code:m$,delete:p$,emphasis:g$,footnoteReference:y$,heading:x$,html:v$,imageReference:b$,image:w$,inlineCode:S$,linkReference:k$,link:C$,listItem:j$,list:N$,paragraph:_$,root:T$,strong:P$,table:A$,tableCell:I$,tableRow:R$,text:M$,thematicBreak:L$,toml:Nc,yaml:Nc,definition:Nc,footnoteDefinition:Nc};function Nc(){}const BC=-1,qd=0,Di=1,Gu=2,Jg=3,Qg=4,Yg=5,Zg=6,UC=7,zC=8,Tv=typeof self=="object"?self:globalThis,F$=(e,t)=>{const n=(s,a)=>(e.set(a,s),s),r=s=>{if(e.has(s))return e.get(s);const[a,o]=t[s];switch(a){case qd:case BC:return n(o,s);case Di:{const l=n([],s);for(const c of o)l.push(r(c));return l}case Gu:{const l=n({},s);for(const[c,d]of o)l[r(c)]=r(d);return l}case Jg:return n(new Date(o),s);case Qg:{const{source:l,flags:c}=o;return n(new RegExp(l,c),s)}case Yg:{const l=n(new Map,s);for(const[c,d]of o)l.set(r(c),r(d));return l}case Zg:{const l=n(new Set,s);for(const c of o)l.add(r(c));return l}case UC:{const{name:l,message:c}=o;return n(new Tv[l](c),s)}case zC:return n(BigInt(o),s);case"BigInt":return n(Object(BigInt(o)),s);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return n(new DataView(l),o)}}return n(new Tv[a](o),s)};return r},Pv=e=>F$(new Map,e)(0),La="",{toString:$$}={},{keys:B$}=Object,mi=e=>{const t=typeof e;if(t!=="object"||!e)return[qd,t];const n=$$.call(e).slice(8,-1);switch(n){case"Array":return[Di,La];case"Object":return[Gu,La];case"Date":return[Jg,La];case"RegExp":return[Qg,La];case"Map":return[Yg,La];case"Set":return[Zg,La];case"DataView":return[Di,n]}return n.includes("Array")?[Di,n]:n.includes("Error")?[UC,n]:[Gu,n]},_c=([e,t])=>e===qd&&(t==="function"||t==="symbol"),U$=(e,t,n,r)=>{const s=(o,l)=>{const c=r.push(o)-1;return n.set(l,c),c},a=o=>{if(n.has(o))return n.get(o);let[l,c]=mi(o);switch(l){case qd:{let h=o;switch(c){case"bigint":l=zC,h=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);h=null;break;case"undefined":return s([BC],o)}return s([l,h],o)}case Di:{if(c){let p=o;return c==="DataView"?p=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(p=new Uint8Array(o)),s([c,[...p]],o)}const h=[],f=s([l,h],o);for(const p of o)h.push(a(p));return f}case Gu:{if(c)switch(c){case"BigInt":return s([c,o.toString()],o);case"Boolean":case"Number":case"String":return s([c,o.valueOf()],o)}if(t&&"toJSON"in o)return a(o.toJSON());const h=[],f=s([l,h],o);for(const p of B$(o))(e||!_c(mi(o[p])))&&h.push([a(p),a(o[p])]);return f}case Jg:return s([l,o.toISOString()],o);case Qg:{const{source:h,flags:f}=o;return s([l,{source:h,flags:f}],o)}case Yg:{const h=[],f=s([l,h],o);for(const[p,m]of o)(e||!(_c(mi(p))||_c(mi(m))))&&h.push([a(p),a(m)]);return f}case Zg:{const h=[],f=s([l,h],o);for(const p of o)(e||!_c(mi(p)))&&h.push(a(p));return f}}const{message:d}=o;return s([l,{name:c,message:d}],o)};return a},Av=(e,{json:t,lossy:n}={})=>{const r=[];return U$(!(t||n),!!t,new Map,r)(e),r},Wu=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Pv(Av(e,t)):structuredClone(e):(e,t)=>Pv(Av(e,t));function z$(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function V$(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function H$(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||z$,r=e.options.footnoteBackLabel||V$,s=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c0&&y.push({type:"text",value:" "});let v=typeof n=="string"?n:n(c,m);typeof v=="string"&&(v={type:"text",value:v}),y.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,m),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const S=h[h.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const v=S.children[S.children.length-1];v&&v.type==="text"?v.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...y)}else h.push(...y);const w={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(h,!0)};e.patch(d,w),l.push(w)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...Wu(o),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:` `}]}}const VC=function(e){if(e==null)return K$;if(typeof e=="function")return Gd(e);if(typeof e=="object")return Array.isArray(e)?q$(e):G$(e);if(typeof e=="string")return W$(e);throw new Error("Expected function, string, or object as test")};function q$(e){const t=[];let n=-1;for(;++n":""))+")"})}return p;function p(){let m=HC,y,g,S;if((!t||a(c,d,h[h.length-1]||void 0))&&(m=Z$(n(c,h)),m[0]===Rv))return m;if("children"in c&&c.children){const w=c;if(w.children&&m[0]!==Q$)for(g=(r?w.children.length:-1)+o,S=h.concat(w);g>-1&&g0&&n.push({type:"text",value:` `}),n}function Iv(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Ov(e,t){const n=tB(e,t),r=n.one(e,void 0),s=H$(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&a.children.push({type:"text",value:` `},s),a}function oB(e,t){return e&&"run"in e?async function(n,r){const s=Ov(n,{file:r,...t});await e.run(s,r)}:function(n,r){return Ov(n,{file:r,...e||t})}}function Mv(e){if(e)throw e}var Jc=Object.prototype.hasOwnProperty,GC=Object.prototype.toString,Lv=Object.defineProperty,Dv=Object.getOwnPropertyDescriptor,Fv=function(t){return typeof Array.isArray=="function"?Array.isArray(t):GC.call(t)==="[object Array]"},$v=function(t){if(!t||GC.call(t)!=="[object Object]")return!1;var n=Jc.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Jc.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var s;for(s in t);return typeof s>"u"||Jc.call(t,s)},Bv=function(t,n){Lv&&n.name==="__proto__"?Lv(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Uv=function(t,n){if(n==="__proto__")if(Jc.call(t,n)){if(Dv)return Dv(t,n).value}else return;return t[n]},iB=function e(){var t,n,r,s,a,o,l=arguments[0],c=1,d=arguments.length,h=!1;for(typeof l=="boolean"&&(h=l,l=arguments[1]||{},c=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});co.length;let c;l&&o.push(s);try{c=e.apply(this,o)}catch(d){const h=d;if(l&&n)throw h;return s(h)}l||(c&&c.then&&typeof c.then=="function"?c.then(a,s):c instanceof Error?s(c):a(c))}function s(o,...l){n||(n=!0,t(o,...l))}function a(o){s(null,o)}}const or={basename:uB,dirname:dB,extname:hB,join:fB,sep:"/"};function uB(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Ul(e);let n=0,r=-1,s=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else r<0&&(a=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,l=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else o<0&&(a=!0,o=s+1),l>-1&&(e.codePointAt(s)===t.codePointAt(l--)?l<0&&(r=s):(l=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function dB(e){if(Ul(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function hB(e){Ul(e);let t=e.length,n=-1,r=0,s=-1,a=0,o;for(;t--;){const l=e.codePointAt(t);if(l===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),l===46?s<0?s=t:a!==1&&(a=1):s>-1&&(a=-1)}return s<0||n<0||a===0||a===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function fB(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function pB(e,t){let n="",r=0,s=-1,a=0,o=-1,l,c;for(;++o<=e.length;){if(o2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),s=o,a=0;continue}}else if(n.length>0){n="",r=0,s=o,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,o):n=e.slice(s+1,o),r=o-s-1;s=o,a=0}else l===46&&a>-1?a++:a=-1}return n}function Ul(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const gB={cwd:yB};function yB(){return"/"}function ep(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function xB(e){if(typeof e=="string")e=new URL(e);else if(!ep(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return vB(e)}function vB(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n0){let[m,...y]=h;const g=r[p][1];Zm(g)&&Zm(m)&&(m=Yh(!0,g,m)),r[p]=[d,m,...y]}}}}const kB=new e0().freeze();function nf(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function rf(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function sf(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Vv(e){if(!Zm(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Hv(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Tc(e){return CB(e)?e:new WC(e)}function CB(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function jB(e){return typeof e=="string"||EB(e)}function EB(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const NB="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",qv=[],Gv={allowDangerousHtml:!0},_B=/^(https?|ircs?|mailto|xmpp)$/i,TB=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function PB(e){const t=AB(e),n=RB(e);return IB(t.runSync(t.parse(n),n),e)}function AB(e){const t=e.rehypePlugins||qv,n=e.remarkPlugins||qv,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Gv}:Gv;return kB().use(d$).use(n).use(oB,r).use(t)}function RB(e){const t=e.children||"",n=new WC;return typeof t=="string"&&(n.value=t),n}function IB(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,a=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||OB;for(const h of TB)Object.hasOwn(t,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+NB+h.id,void 0);return qC(e,d),HD(e,{Fragment:i.Fragment,components:s,ignoreInvalidStyle:!0,jsx:i.jsx,jsxs:i.jsxs,passKeys:!0,passNode:!0});function d(h,f,p){if(h.type==="raw"&&p&&typeof f=="number")return o?p.children.splice(f,1):p.children[f]={type:"text",value:h.value},f;if(h.type==="element"){let m;for(m in Xh)if(Object.hasOwn(Xh,m)&&Object.hasOwn(h.properties,m)){const y=h.properties[m],g=Xh[m];(g===null||g.includes(h.tagName))&&(h.properties[m]=c(String(y||""),m,h))}}if(h.type==="element"){let m=n?!n.includes(h.tagName):a?a.includes(h.tagName):!1;if(!m&&r&&typeof f=="number"&&(m=!r(h,f,p)),m&&p&&typeof f=="number")return l&&h.children?p.children.splice(f,1,...h.children):p.children.splice(f,1),f}}}function OB(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||r!==-1&&t>r||_B.test(e.slice(0,t))?e:""}const af="[PROCESSING_REFUND]",Wv="[SHOW_RATING]",MB="[DATA_CONFIRM]",LB=({onDone:e})=>{const[t,n]=b.useState(0),r=[{icon:md,label:"Verificando dados..."},{icon:jr,label:"Validando solicitação..."},{icon:rm,label:"Registrando reembolso..."}];return b.useEffect(()=>{if(tn(a=>a+1),5e3);return()=>clearTimeout(s)}else{const s=setTimeout(e,5e3);return()=>clearTimeout(s)}},[t]),i.jsx("div",{className:"bg-secondary rounded-xl px-4 py-3 max-w-[85%] space-y-2",children:r.map((s,a)=>{const o=s.icon,l=a===t,c=at?"opacity-30":"opacity-100"}`,children:[c?i.jsx(rm,{className:"w-4 h-4 text-green-500 shrink-0"}):l?i.jsx(Wt,{className:"w-4 h-4 animate-spin text-muted-foreground shrink-0"}):i.jsx(o,{className:"w-4 h-4 text-muted-foreground shrink-0"}),i.jsx("span",{className:c?"text-green-600 dark:text-green-400":"text-foreground",children:s.label})]},a)})})},DB=()=>{const[e,t]=b.useState(0),[n,r]=b.useState(0),[s,a]=b.useState(!1);return s?i.jsxs("div",{className:"px-4 py-5 text-center animate-fade-in",children:[i.jsx(rm,{className:"w-8 h-8 mx-auto mb-2 text-green-500"}),i.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Obrigado pela avaliação! 💛"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Sua opinião nos ajuda a melhorar."})]}):i.jsxs("div",{className:"px-4 py-5 text-center animate-fade-in",children:[i.jsx("p",{className:"text-sm font-semibold text-foreground mb-1",children:"Como foi seu atendimento?"}),i.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:"Avalie de 1 a 5 estrelas"}),i.jsx("div",{className:"flex justify-center gap-1 mb-3",children:[1,2,3,4,5].map(o=>i.jsx("button",{onMouseEnter:()=>r(o),onMouseLeave:()=>r(0),onClick:()=>t(o),className:"transition-transform hover:scale-110",children:i.jsx(wr,{className:`w-8 h-8 transition-colors ${o<=(n||e)?"fill-yellow-400 text-yellow-400":"text-muted-foreground/30"}`})},o))}),e>0&&i.jsx("button",{onClick:()=>a(!0),className:"text-xs font-medium bg-foreground text-background px-4 py-2 rounded-lg hover:opacity-80 transition-opacity animate-fade-in",children:"Enviar avaliação"})]})},FB=()=>{const[e,t]=b.useState(!1),[n,r]=b.useState([{role:"assistant",content:"Olá! 👋 Sou a assistente da AlphaCars. Como posso te ajudar?"}]),[s,a]=b.useState(""),[o,l]=b.useState(!1),[c,d]=b.useState(!1),[h,f]=b.useState(null),[p,m]=b.useState(!1),y=b.useRef(null),g=[{label:"💰 Preço do kit",text:"Qual o preço dos kits?"},{label:"🚚 Frete e prazo",text:"Como funciona o frete e qual o prazo de entrega?"},{label:"🔄 Troca e garantia",text:"Como funciona a troca e a garantia?"},{label:"🛒 Como comprar",text:"Como faço para comprar?"},{label:"🚗 Tem para o meu carro?",text:"Vocês têm tapete para o meu carro?"}],S=n.length<=1&&!o&&!c&&!p;b.useEffect(()=>{var x;(x=y.current)==null||x.scrollIntoView({behavior:"smooth"})},[n,c,p]);const w=async x=>{const k=(x??s).trim();if(!k||o)return;const j={role:"user",content:k},C=[...n,j];r(C),x||a(""),l(!0),m(!1);try{const{data:T,error:P}=await tt.functions.invoke("customer-chat",{body:{messages:C.map(({role:I,content:A})=>({role:I,content:A}))}});if(P)throw P;let _=T.reply||"";const R=_.includes(Wv);if(R&&(_=_.replace(Wv,"").trim()),_.includes(MB)&&_.includes(af)){const I=_.match(/\[DATA_CONFIRM\]([\s\S]*?)\[\/DATA_CONFIRM\]/),A=_.match(/\[THANK_YOU\]([\s\S]*?)\[\/THANK_YOU\]/),z=I?I[1].trim():"",D=A?A[1].trim():"";r(F=>[...F,{role:"assistant",content:z}]),l(!1),setTimeout(()=>{d(!0),f(D)},2e3)}else if(_.includes(af)){const I=_.replace(af,"").trim();l(!1),d(!0),f(I)}else r(I=>[...I,{role:"assistant",content:_}]),l(!1),R&&setTimeout(()=>m(!0),500)}catch{r(T=>[...T,{role:"assistant",content:"Desculpe, tive um problema. Tente novamente em instantes."}]),l(!1)}},v=()=>{d(!1),h&&(r(x=>[...x,{role:"assistant",content:h}]),f(null))};return i.jsxs(i.Fragment,{children:[!e&&i.jsx("button",{onClick:()=>t(!0),className:"fixed bottom-5 right-5 z-50 w-14 h-14 rounded-full bg-foreground text-background shadow-lg flex items-center justify-center hover:scale-105 transition-transform","aria-label":"Abrir chat",children:i.jsx(Cu,{className:"w-6 h-6"})}),e&&i.jsxs("div",{className:"fixed bottom-5 right-5 z-50 w-[360px] max-w-[calc(100vw-2.5rem)] h-[500px] max-h-[calc(100vh-6rem)] bg-background border border-border rounded-2xl shadow-2xl flex flex-col overflow-hidden",children:[i.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-foreground text-background rounded-t-2xl",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Cu,{className:"w-5 h-5"}),i.jsx("span",{className:"font-semibold text-sm",children:"AlphaCars"})]}),i.jsx("button",{onClick:()=>t(!1),className:"hover:opacity-70 transition-opacity",children:i.jsx(Sr,{className:"w-5 h-5"})})]}),i.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 space-y-3",children:[n.map((x,k)=>i.jsx("div",{className:`flex ${x.role==="user"?"justify-end":"justify-start"}`,children:i.jsx("div",{className:`max-w-[80%] rounded-xl px-3 py-2 text-sm ${x.role==="user"?"bg-foreground text-background rounded-br-sm":"bg-secondary text-foreground rounded-bl-sm"}`,children:x.role==="assistant"?i.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none [&_p]:m-0 [&_ul]:my-1 [&_li]:my-0",children:i.jsx(PB,{children:x.content})}):x.content})},k)),c&&i.jsx("div",{className:"flex justify-start",children:i.jsx(LB,{onDone:v})}),o&&!c&&i.jsx("div",{className:"flex justify-start",children:i.jsx("div",{className:"bg-secondary rounded-xl px-3 py-2",children:i.jsx(Wt,{className:"w-4 h-4 animate-spin text-muted-foreground"})})}),p&&i.jsx("div",{className:"bg-secondary rounded-xl overflow-hidden",children:i.jsx(DB,{})}),i.jsx("div",{ref:y})]}),S&&i.jsx("div",{className:"px-3 pb-2 pt-1 flex flex-wrap gap-1.5 border-t border-border/50",children:g.map(x=>i.jsx("button",{type:"button",onClick:()=>w(x.text),className:"text-[11px] font-medium bg-secondary hover:bg-secondary/70 text-foreground px-2.5 py-1.5 rounded-full transition-colors border border-border",children:x.label},x.label))}),i.jsxs("form",{onSubmit:x=>{x.preventDefault(),w()},className:"flex items-center gap-2 px-3 py-3 border-t border-border",children:[i.jsx("input",{value:s,onChange:x=>a(x.target.value),placeholder:"Digite sua dúvida...",className:"flex-1 text-sm bg-secondary rounded-lg px-3 py-2 outline-none placeholder:text-muted-foreground",disabled:o||c}),i.jsx("button",{type:"submit",disabled:o||c||!s.trim(),className:"w-9 h-9 rounded-lg bg-foreground text-background flex items-center justify-center disabled:opacity-40 hover:opacity-80 transition-opacity",children:i.jsx(Xb,{className:"w-4 h-4"})})]})]})]})},$B=()=>{const{pathname:e}=Xt();return b.useEffect(()=>{window.scrollTo({top:0})},[e]),null},BB=()=>{const{pathname:e}=Xt();return e==="/checkout"||e==="/obrigado"||e==="/pix"||e==="/pix-preview"||e==="/upsell-icms"?null:i.jsx(FB,{})},UB=()=>{const{search:e,pathname:t}=Xt();return b.useEffect(()=>{Nd()},[e]),b.useEffect(()=>{z5()},[t]),null},zB=new _R,VB=()=>i.jsx(PR,{client:zB,children:i.jsxs($w,{children:[i.jsx(MT,{}),i.jsx(fP,{}),i.jsxs(A6,{children:[i.jsx($B,{}),i.jsx(UB,{}),i.jsxs(S6,{children:[i.jsx(Le,{path:"/",element:i.jsx(eI,{})}),i.jsx(Le,{path:"/produtos",element:i.jsx(aI,{})}),i.jsx(Le,{path:"/produto/:slug",element:i.jsx(Y9,{})}),i.jsx(Le,{path:"/sobre",element:i.jsx(Z9,{})}),i.jsx(Le,{path:"/faq",element:i.jsx(tM,{})}),i.jsx(Le,{path:"/contato",element:i.jsx(nM,{})}),i.jsx(Le,{path:"/checkout",element:i.jsx(jM,{})}),i.jsx(Le,{path:"/pix",element:i.jsx(Yx,{})}),i.jsx(Le,{path:"/pix-preview",element:i.jsx(Yx,{})}),i.jsx(Le,{path:"/obrigado",element:i.jsx(_M,{})}),i.jsx(Le,{path:"/upsell-icms",element:i.jsx(Zx,{})}),i.jsx(Le,{path:"/upsell-icms-preview",element:i.jsx(Zx,{})}),i.jsx(Le,{path:"/rastreio",element:i.jsx(MM,{})}),i.jsx(Le,{path:"/termos-de-uso",element:i.jsx(PM,{})}),i.jsx(Le,{path:"/politica-de-privacidade",element:i.jsx(AM,{})}),i.jsx(Le,{path:"/trocas-e-devolucoes",element:i.jsx(RM,{})}),i.jsx(Le,{path:"/politica-de-envio",element:i.jsx(IM,{})}),i.jsx(Le,{path:"/politica-de-reembolso",element:i.jsx(OM,{})}),i.jsxs(Le,{path:"/admin/vendas",element:i.jsx(EL,{}),children:[i.jsx(Le,{index:!0,element:i.jsx(_L,{})}),i.jsx(Le,{path:"lista",element:i.jsx(VL,{})}),i.jsx(Le,{path:"oportunidades",element:i.jsx(qL,{})}),i.jsx(Le,{path:"recuperacoes",element:i.jsx(WL,{})})]}),i.jsx(Le,{path:"*",element:i.jsx(Ik,{})})]}),i.jsx(BB,{})]})]})});pb(document.getElementById("root")).render(i.jsx(VB,{}));