var KQ=Object.defineProperty;var G4=e=>{throw TypeError(e)};var YQ=(e,t,r)=>t in e?KQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Gt=(e,t,r)=>YQ(e,typeof t!="symbol"?t+"":t,r),kS=(e,t,r)=>t.has(e)||G4("Cannot "+r);var pe=(e,t,r)=>(kS(e,t,"read from private field"),r?r.call(e):t.get(e)),xt=(e,t,r)=>t.has(e)?G4("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Ve=(e,t,r,n)=>(kS(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Jt=(e,t,r)=>(kS(e,t,"access private method"),r);var nb=(e,t,r,n)=>({set _(i){Ve(e,t,i,r)},get _(){return pe(e,t,n)}});function XQ(e,t){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();var ib=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ar(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var GF={exports:{}},J2={},KF={exports:{}},Kt={};/** * @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 F0=Symbol.for("react.element"),JQ=Symbol.for("react.portal"),ZQ=Symbol.for("react.fragment"),QQ=Symbol.for("react.strict_mode"),eee=Symbol.for("react.profiler"),tee=Symbol.for("react.provider"),ree=Symbol.for("react.context"),nee=Symbol.for("react.forward_ref"),iee=Symbol.for("react.suspense"),aee=Symbol.for("react.memo"),oee=Symbol.for("react.lazy"),K4=Symbol.iterator;function see(e){return e===null||typeof e!="object"?null:(e=K4&&e[K4]||e["@@iterator"],typeof e=="function"?e:null)}var YF={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},XF=Object.assign,JF={};function Lm(e,t,r){this.props=e,this.context=t,this.refs=JF,this.updater=r||YF}Lm.prototype.isReactComponent={};Lm.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")};Lm.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function ZF(){}ZF.prototype=Lm.prototype;function hC(e,t,r){this.props=e,this.context=t,this.refs=JF,this.updater=r||YF}var pC=hC.prototype=new ZF;pC.constructor=hC;XF(pC,Lm.prototype);pC.isPureReactComponent=!0;var Y4=Array.isArray,QF=Object.prototype.hasOwnProperty,mC={current:null},eB={key:!0,ref:!0,__self:!0,__source:!0};function tB(e,t,r){var n,i={},a=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(a=""+t.key),t)QF.call(t,n)&&!eB.hasOwnProperty(n)&&(i[n]=t[n]);var s=arguments.length-2;if(s===1)i.children=r;else if(1>>1,M=U[ue];if(0>>1;uei(ie,oe))lei(V,ie)?(U[ue]=V,U[le]=oe,ue=le):(U[ue]=ie,U[z]=oe,ue=z);else if(lei(V,oe))U[ue]=V,U[le]=oe,ue=le;else break e}}return X}function i(U,X){var oe=U.sortIndex-X.sortIndex;return oe!==0?oe:U.id-X.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var l=[],c=[],u=1,f=null,p=3,h=!1,g=!1,m=!1,v=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,b=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(U){for(var X=r(c);X!==null;){if(X.callback===null)n(c);else if(X.startTime<=U)n(c),X.sortIndex=X.expirationTime,t(l,X);else break;X=r(c)}}function S(U){if(m=!1,x(U),!g)if(r(l)!==null)g=!0,Y(_);else{var X=r(c);X!==null&&Z(S,X.startTime-U)}}function _(U,X){g=!1,m&&(m=!1,y(O),O=-1),h=!0;var oe=p;try{for(x(X),f=r(l);f!==null&&(!(f.expirationTime>X)||U&&!N());){var ue=f.callback;if(typeof ue=="function"){f.callback=null,p=f.priorityLevel;var M=ue(f.expirationTime<=X);X=e.unstable_now(),typeof M=="function"?f.callback=M:f===r(l)&&n(l),x(X)}else n(l);f=r(l)}if(f!==null)var W=!0;else{var z=r(c);z!==null&&Z(S,z.startTime-X),W=!1}return W}finally{f=null,p=oe,h=!1}}var k=!1,E=null,O=-1,R=5,$=-1;function N(){return!(e.unstable_now()-$U||125ue?(U.sortIndex=oe,t(c,U),r(l)===null&&U===r(c)&&(m?(y(O),O=-1):m=!0,Z(S,oe-ue))):(U.sortIndex=M,t(l,U),g||h||(g=!0,Y(_))),U},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(U){var X=p;return function(){var oe=p;p=X;try{return U.apply(this,arguments)}finally{p=oe}}}})(oB);aB.exports=oB;var yee=aB.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 bee=P,Wa=yee;function Re(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),tk=Object.prototype.hasOwnProperty,xee=/^[: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]*$/,J4={},Z4={};function wee(e){return tk.call(Z4,e)?!0:tk.call(J4,e)?!1:xee.test(e)?Z4[e]=!0:(J4[e]=!0,!1)}function _ee(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function See(e,t,r,n){if(t===null||typeof t>"u"||_ee(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ta(e,t,r,n,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var wi={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){wi[e]=new ta(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];wi[t]=new ta(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){wi[e]=new ta(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){wi[e]=new ta(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){wi[e]=new ta(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){wi[e]=new ta(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){wi[e]=new ta(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){wi[e]=new ta(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){wi[e]=new ta(e,5,!1,e.toLowerCase(),null,!1,!1)});var yC=/[\-:]([a-z])/g;function bC(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(yC,bC);wi[t]=new ta(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(yC,bC);wi[t]=new ta(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(yC,bC);wi[t]=new ta(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){wi[e]=new ta(e,1,!1,e.toLowerCase(),null,!1,!1)});wi.xlinkHref=new ta("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){wi[e]=new ta(e,1,!1,e.toLowerCase(),null,!0,!0)});function xC(e,t,r,n){var i=wi.hasOwnProperty(t)?wi[t]:null;(i!==null?i.type!==0:n||!(2s||i[o]!==a[s]){var l=` `+i[o].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=o&&0<=s);break}}}finally{ES=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?xv(e):""}function Aee(e){switch(e.tag){case 5:return xv(e.type);case 16:return xv("Lazy");case 13:return xv("Suspense");case 19:return xv("SuspenseList");case 0:case 2:case 15:return e=CS(e.type,!1),e;case 11:return e=CS(e.type.render,!1),e;case 1:return e=CS(e.type,!0),e;default:return""}}function ak(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 Lh:return"Fragment";case Rh:return"Portal";case rk:return"Profiler";case wC:return"StrictMode";case nk:return"Suspense";case ik:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case cB:return(e.displayName||"Context")+".Consumer";case lB:return(e._context.displayName||"Context")+".Provider";case _C:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case SC:return t=e.displayName||null,t!==null?t:ak(e.type)||"Memo";case Xc:t=e._payload,e=e._init;try{return ak(e(t))}catch{}}return null}function Pee(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 ak(t);case 8:return t===wC?"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 Mu(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function dB(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function kee(e){var t=dB(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function sb(e){e._valueTracker||(e._valueTracker=kee(e))}function fB(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=dB(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Kx(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 ok(e,t){var r=t.checked;return nn({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function eR(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Mu(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function hB(e,t){t=t.checked,t!=null&&xC(e,"checked",t,!1)}function sk(e,t){hB(e,t);var r=Mu(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?lk(e,t.type,r):t.hasOwnProperty("defaultValue")&&lk(e,t.type,Mu(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function tR(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function lk(e,t,r){(t!=="number"||Kx(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var wv=Array.isArray;function rp(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=lb.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function sy(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Tv={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},jee=["Webkit","ms","Moz","O"];Object.keys(Tv).forEach(function(e){jee.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Tv[t]=Tv[e]})});function vB(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Tv.hasOwnProperty(e)&&Tv[e]?(""+t).trim():t+"px"}function yB(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=vB(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var Nee=nn({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 dk(e,t){if(t){if(Nee[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Re(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Re(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Re(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Re(62))}}function fk(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 hk=null;function AC(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var pk=null,np=null,ip=null;function iR(e){if(e=z0(e)){if(typeof pk!="function")throw Error(Re(280));var t=e.stateNode;t&&(t=r5(t),pk(e.stateNode,e.type,t))}}function bB(e){np?ip?ip.push(e):ip=[e]:np=e}function xB(){if(np){var e=np,t=ip;if(ip=np=null,iR(e),t)for(e=0;e>>=0,e===0?32:31-(Fee(e)/Bee|0)|0}var cb=64,ub=4194304;function _v(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 Zx(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,a=e.pingedLanes,o=r&268435455;if(o!==0){var s=o&~i;s!==0?n=_v(s):(a&=o,a!==0&&(n=_v(a)))}else o=r&~i,o!==0?n=_v(o):a!==0&&(n=_v(a));if(n===0)return 0;if(t!==0&&t!==n&&!(t&i)&&(i=n&-n,a=t&-t,i>=a||i===16&&(a&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function B0(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ss(t),e[t]=r}function Vee(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0=Rv),hR=" ",pR=!1;function BB(e,t){switch(e){case"keyup":return yte.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function UB(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ih=!1;function xte(e,t){switch(e){case"compositionend":return UB(t);case"keypress":return t.which!==32?null:(pR=!0,hR);case"textInput":return e=t.data,e===hR&&pR?null:e;default:return null}}function wte(e,t){if(Ih)return e==="compositionend"||!OC&&BB(e,t)?(e=DB(),yx=EC=hu=null,Ih=!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:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=yR(r)}}function qB(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?qB(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function WB(){for(var e=window,t=Kx();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Kx(e.document)}return t}function RC(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 Cte(e){var t=WB(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&qB(r.ownerDocument.documentElement,r)){if(n!==null&&RC(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=r.textContent.length,a=Math.min(n.start,i);n=n.end===void 0?a:Math.min(n.end,i),!e.extend&&a>n&&(i=n,n=a,a=i),i=bR(r,a);var o=bR(r,n);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,Mh=null,xk=null,Iv=null,wk=!1;function xR(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;wk||Mh==null||Mh!==Kx(n)||(n=Mh,"selectionStart"in n&&RC(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Iv&&hy(Iv,n)||(Iv=n,n=tw(xk,"onSelect"),0Fh||(e.current=jk[Fh],jk[Fh]=null,Fh--)}function Dr(e,t){Fh++,jk[Fh]=e.current,e.current=t}var $u={},$i=Hu($u),fa=Hu(!1),mf=$u;function Up(e,t){var r=e.type.contextTypes;if(!r)return $u;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in r)i[a]=t[a];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function ha(e){return e=e.childContextTypes,e!=null}function nw(){Wr(fa),Wr($i)}function jR(e,t,r){if($i.current!==$u)throw Error(Re(168));Dr($i,t),Dr(fa,r)}function t9(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(Re(108,Pee(e)||"Unknown",i));return nn({},r,n)}function iw(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||$u,mf=$i.current,Dr($i,e),Dr(fa,fa.current),!0}function NR(e,t,r){var n=e.stateNode;if(!n)throw Error(Re(169));r?(e=t9(e,t,mf),n.__reactInternalMemoizedMergedChildContext=e,Wr(fa),Wr($i),Dr($i,e)):Wr(fa),Dr(fa,r)}var Ll=null,n5=!1,VS=!1;function r9(e){Ll===null?Ll=[e]:Ll.push(e)}function zte(e){n5=!0,r9(e)}function Vu(){if(!VS&&Ll!==null){VS=!0;var e=0,t=Sr;try{var r=Ll;for(Sr=1;e>=o,i-=o,Bl=1<<32-ss(t)+i|r<O?(R=E,E=null):R=E.sibling;var $=p(y,E,x[O],S);if($===null){E===null&&(E=R);break}e&&E&&$.alternate===null&&t(y,E),b=a($,b,O),k===null?_=$:k.sibling=$,k=$,E=R}if(O===x.length)return r(y,E),Xr&&Ad(y,O),_;if(E===null){for(;OO?(R=E,E=null):R=E.sibling;var N=p(y,E,$.value,S);if(N===null){E===null&&(E=R);break}e&&E&&N.alternate===null&&t(y,E),b=a(N,b,O),k===null?_=N:k.sibling=N,k=N,E=R}if($.done)return r(y,E),Xr&&Ad(y,O),_;if(E===null){for(;!$.done;O++,$=x.next())$=f(y,$.value,S),$!==null&&(b=a($,b,O),k===null?_=$:k.sibling=$,k=$);return Xr&&Ad(y,O),_}for(E=n(y,E);!$.done;O++,$=x.next())$=h(E,y,O,$.value,S),$!==null&&(e&&$.alternate!==null&&E.delete($.key===null?O:$.key),b=a($,b,O),k===null?_=$:k.sibling=$,k=$);return e&&E.forEach(function(C){return t(y,C)}),Xr&&Ad(y,O),_}function v(y,b,x,S){if(typeof x=="object"&&x!==null&&x.type===Lh&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case ob:e:{for(var _=x.key,k=b;k!==null;){if(k.key===_){if(_=x.type,_===Lh){if(k.tag===7){r(y,k.sibling),b=i(k,x.props.children),b.return=y,y=b;break e}}else if(k.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===Xc&&TR(_)===k.type){r(y,k.sibling),b=i(k,x.props),b.ref=Jg(y,k,x),b.return=y,y=b;break e}r(y,k);break}else t(y,k);k=k.sibling}x.type===Lh?(b=uf(x.props.children,y.mode,S,x.key),b.return=y,y=b):(S=kx(x.type,x.key,x.props,null,y.mode,S),S.ref=Jg(y,b,x),S.return=y,y=S)}return o(y);case Rh:e:{for(k=x.key;b!==null;){if(b.key===k)if(b.tag===4&&b.stateNode.containerInfo===x.containerInfo&&b.stateNode.implementation===x.implementation){r(y,b.sibling),b=i(b,x.children||[]),b.return=y,y=b;break e}else{r(y,b);break}else t(y,b);b=b.sibling}b=ZS(x,y.mode,S),b.return=y,y=b}return o(y);case Xc:return k=x._init,v(y,b,k(x._payload),S)}if(wv(x))return g(y,b,x,S);if(Wg(x))return m(y,b,x,S);vb(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,b!==null&&b.tag===6?(r(y,b.sibling),b=i(b,x),b.return=y,y=b):(r(y,b),b=JS(x,y.mode,S),b.return=y,y=b),o(y)):r(y,b)}return v}var Hp=o9(!0),s9=o9(!1),sw=Hu(null),lw=null,zh=null,$C=null;function DC(){$C=zh=lw=null}function FC(e){var t=sw.current;Wr(sw),e._currentValue=t}function Ck(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function op(e,t){lw=e,$C=zh=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ca=!0),e.firstContext=null)}function ko(e){var t=e._currentValue;if($C!==e)if(e={context:e,memoizedValue:t,next:null},zh===null){if(lw===null)throw Error(Re(308));zh=e,lw.dependencies={lanes:0,firstContext:e}}else zh=zh.next=e;return t}var $d=null;function BC(e){$d===null?$d=[e]:$d.push(e)}function l9(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,BC(t)):(r.next=i.next,i.next=r),t.interleaved=r,ic(e,n)}function ic(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Jc=!1;function UC(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function c9(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 Gl(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Pu(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,lr&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,ic(e,r)}return i=n.interleaved,i===null?(t.next=t,BC(n)):(t.next=i.next,i.next=t),n.interleaved=t,ic(e,r)}function xx(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,kC(e,r)}}function OR(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?i=a=o:a=a.next=o,r=r.next}while(r!==null);a===null?i=a=t:a=a.next=t}else i=a=t;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function cw(e,t,r,n){var i=e.updateQueue;Jc=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var l=s,c=l.next;l.next=null,o===null?a=c:o.next=c,o=l;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=c:s.next=c,u.lastBaseUpdate=l))}if(a!==null){var f=i.baseState;o=0,u=c=l=null,s=a;do{var p=s.lane,h=s.eventTime;if((n&p)===p){u!==null&&(u=u.next={eventTime:h,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var g=e,m=s;switch(p=t,h=r,m.tag){case 1:if(g=m.payload,typeof g=="function"){f=g.call(h,f,p);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=m.payload,p=typeof g=="function"?g.call(h,f,p):g,p==null)break e;f=nn({},f,p);break e;case 2:Jc=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,p=i.effects,p===null?i.effects=[s]:p.push(s))}else h={eventTime:h,lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(c=u=h,l=f):u=u.next=h,o|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(u===null&&(l=f),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);yf|=o,e.lanes=o,e.memoizedState=f}}function RR(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=WS.transition;WS.transition={};try{e(!1),t()}finally{Sr=r,WS.transition=n}}function k9(){return jo().memoizedState}function Wte(e,t,r){var n=ju(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},j9(e))N9(t,r);else if(r=l9(e,t,r,n),r!==null){var i=Xi();ls(r,e,n,i),E9(r,t,n)}}function Gte(e,t,r){var n=ju(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(j9(e))N9(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,r);if(i.hasEagerState=!0,i.eagerState=s,ds(s,o)){var l=t.interleaved;l===null?(i.next=i,BC(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}r=l9(e,t,i,n),r!==null&&(i=Xi(),ls(r,e,n,i),E9(r,t,n))}}function j9(e){var t=e.alternate;return e===rn||t!==null&&t===rn}function N9(e,t){Mv=dw=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function E9(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,kC(e,r)}}var fw={readContext:ko,useCallback:Si,useContext:Si,useEffect:Si,useImperativeHandle:Si,useInsertionEffect:Si,useLayoutEffect:Si,useMemo:Si,useReducer:Si,useRef:Si,useState:Si,useDebugValue:Si,useDeferredValue:Si,useTransition:Si,useMutableSource:Si,useSyncExternalStore:Si,useId:Si,unstable_isNewReconciler:!1},Kte={readContext:ko,useCallback:function(e,t){return Ls().memoizedState=[e,t===void 0?null:t],e},useContext:ko,useEffect:IR,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,_x(4194308,4,w9.bind(null,t,e),r)},useLayoutEffect:function(e,t){return _x(4194308,4,e,t)},useInsertionEffect:function(e,t){return _x(4,2,e,t)},useMemo:function(e,t){var r=Ls();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Ls();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=Wte.bind(null,rn,e),[n.memoizedState,e]},useRef:function(e){var t=Ls();return e={current:e},t.memoizedState=e},useState:LR,useDebugValue:YC,useDeferredValue:function(e){return Ls().memoizedState=e},useTransition:function(){var e=LR(!1),t=e[0];return e=qte.bind(null,e[1]),Ls().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=rn,i=Ls();if(Xr){if(r===void 0)throw Error(Re(407));r=r()}else{if(r=t(),Qn===null)throw Error(Re(349));vf&30||h9(n,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,IR(m9.bind(null,n,a,e),[e]),n.flags|=2048,wy(9,p9.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=Ls(),t=Qn.identifierPrefix;if(Xr){var r=Ul,n=Bl;r=(n&~(1<<32-ss(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=by++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[Fs]=t,e[gy]=n,F9(e,t,!1,!1),t.stateNode=e;e:{switch(o=fk(r,n),r){case"dialog":zr("cancel",e),zr("close",e),i=n;break;case"iframe":case"object":case"embed":zr("load",e),i=n;break;case"video":case"audio":for(i=0;iWp&&(t.flags|=128,n=!0,Zg(a,!1),t.lanes=4194304)}else{if(!n)if(e=uw(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Zg(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!Xr)return Ai(t),null}else 2*bn()-a.renderingStartTime>Wp&&r!==1073741824&&(t.flags|=128,n=!0,Zg(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(r=a.last,r!==null?r.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=bn(),t.sibling=null,r=en.current,Dr(en,n?r&1|2:r&1),t):(Ai(t),null);case 22:case 23:return t3(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Oa&1073741824&&(Ai(t),t.subtreeFlags&6&&(t.flags|=8192)):Ai(t),null;case 24:return null;case 25:return null}throw Error(Re(156,t.tag))}function rre(e,t){switch(IC(t),t.tag){case 1:return ha(t.type)&&nw(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Vp(),Wr(fa),Wr($i),VC(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return HC(t),null;case 13:if(Wr(en),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Re(340));zp()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Wr(en),null;case 4:return Vp(),null;case 10:return FC(t.type._context),null;case 22:case 23:return t3(),null;case 24:return null;default:return null}}var bb=!1,Oi=!1,nre=typeof WeakSet=="function"?WeakSet:Set,Ue=null;function Hh(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){fn(e,t,n)}else r.current=null}function Fk(e,t,r){try{r()}catch(n){fn(e,t,n)}}var WR=!1;function ire(e,t){if(_k=Qx,e=WB(),RC(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var o=0,s=-1,l=-1,c=0,u=0,f=e,p=null;t:for(;;){for(var h;f!==r||i!==0&&f.nodeType!==3||(s=o+i),f!==a||n!==0&&f.nodeType!==3||(l=o+n),f.nodeType===3&&(o+=f.nodeValue.length),(h=f.firstChild)!==null;)p=f,f=h;for(;;){if(f===e)break t;if(p===r&&++c===i&&(s=o),p===a&&++u===n&&(l=o),(h=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=h}r=s===-1||l===-1?null:{start:s,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(Sk={focusedElem:e,selectionRange:r},Qx=!1,Ue=t;Ue!==null;)if(t=Ue,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ue=e;else for(;Ue!==null;){t=Ue;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var m=g.memoizedProps,v=g.memoizedState,y=t.stateNode,b=y.getSnapshotBeforeUpdate(t.elementType===t.type?m:Yo(t.type,m),v);y.__reactInternalSnapshotBeforeUpdate=b}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(Re(163))}}catch(S){fn(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,Ue=e;break}Ue=t.return}return g=WR,WR=!1,g}function $v(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&Fk(t,r,a)}i=i.next}while(i!==n)}}function o5(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Bk(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function z9(e){var t=e.alternate;t!==null&&(e.alternate=null,z9(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Fs],delete t[gy],delete t[kk],delete t[Bte],delete t[Ute])),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 H9(e){return e.tag===5||e.tag===3||e.tag===4}function GR(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||H9(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 Uk(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=rw));else if(n!==4&&(e=e.child,e!==null))for(Uk(e,t,r),e=e.sibling;e!==null;)Uk(e,t,r),e=e.sibling}function zk(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(zk(e,t,r),e=e.sibling;e!==null;)zk(e,t,r),e=e.sibling}var pi=null,Qo=!1;function Bc(e,t,r){for(r=r.child;r!==null;)V9(e,t,r),r=r.sibling}function V9(e,t,r){if(Gs&&typeof Gs.onCommitFiberUnmount=="function")try{Gs.onCommitFiberUnmount(Z2,r)}catch{}switch(r.tag){case 5:Oi||Hh(r,t);case 6:var n=pi,i=Qo;pi=null,Bc(e,t,r),pi=n,Qo=i,pi!==null&&(Qo?(e=pi,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):pi.removeChild(r.stateNode));break;case 18:pi!==null&&(Qo?(e=pi,r=r.stateNode,e.nodeType===8?HS(e.parentNode,r):e.nodeType===1&&HS(e,r),dy(e)):HS(pi,r.stateNode));break;case 4:n=pi,i=Qo,pi=r.stateNode.containerInfo,Qo=!0,Bc(e,t,r),pi=n,Qo=i;break;case 0:case 11:case 14:case 15:if(!Oi&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&Fk(r,t,o),i=i.next}while(i!==n)}Bc(e,t,r);break;case 1:if(!Oi&&(Hh(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(s){fn(r,t,s)}Bc(e,t,r);break;case 21:Bc(e,t,r);break;case 22:r.mode&1?(Oi=(n=Oi)||r.memoizedState!==null,Bc(e,t,r),Oi=n):Bc(e,t,r);break;default:Bc(e,t,r)}}function KR(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new nre),t.forEach(function(n){var i=hre.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function Uo(e,t){var r=t.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~a}if(n=i,n=bn()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*ore(n/1960))-n,10e?16:e,pu===null)var n=!1;else{if(e=pu,pu=null,mw=0,lr&6)throw Error(Re(331));var i=lr;for(lr|=4,Ue=e.current;Ue!==null;){var a=Ue,o=a.child;if(Ue.flags&16){var s=a.deletions;if(s!==null){for(var l=0;lbn()-QC?cf(e,0):ZC|=r),pa(e,t)}function Z9(e,t){t===0&&(e.mode&1?(t=ub,ub<<=1,!(ub&130023424)&&(ub=4194304)):t=1);var r=Xi();e=ic(e,t),e!==null&&(B0(e,t,r),pa(e,r))}function fre(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Z9(e,r)}function hre(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(Re(314))}n!==null&&n.delete(t),Z9(e,r)}var Q9;Q9=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||fa.current)ca=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return ca=!1,ere(e,t,r);ca=!!(e.flags&131072)}else ca=!1,Xr&&t.flags&1048576&&n9(t,ow,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Sx(e,t),e=t.pendingProps;var i=Up(t,$i.current);op(t,r),i=WC(null,t,n,e,i,r);var a=GC();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ha(n)?(a=!0,iw(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,UC(t),i.updater=a5,t.stateNode=i,i._reactInternals=t,Ok(t,n,e,r),t=Ik(null,t,n,!0,a,r)):(t.tag=0,Xr&&a&&LC(t),qi(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Sx(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=mre(n),e=Yo(n,e),i){case 0:t=Lk(null,t,n,e,r);break e;case 1:t=HR(null,t,n,e,r);break e;case 11:t=UR(null,t,n,e,r);break e;case 14:t=zR(null,t,n,Yo(n.type,e),r);break e}throw Error(Re(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Yo(n,i),Lk(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Yo(n,i),HR(e,t,n,i,r);case 3:e:{if(M9(t),e===null)throw Error(Re(387));n=t.pendingProps,a=t.memoizedState,i=a.element,c9(e,t),cw(t,n,null,r);var o=t.memoizedState;if(n=o.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=qp(Error(Re(423)),t),t=VR(e,t,n,r,i);break e}else if(n!==i){i=qp(Error(Re(424)),t),t=VR(e,t,n,r,i);break e}else for(Fa=Au(t.stateNode.containerInfo.firstChild),Ha=t,Xr=!0,rs=null,r=s9(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(zp(),n===i){t=ac(e,t,r);break e}qi(e,t,n,r)}t=t.child}return t;case 5:return u9(t),e===null&&Ek(t),n=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,Ak(n,i)?o=null:a!==null&&Ak(n,a)&&(t.flags|=32),I9(e,t),qi(e,t,o,r),t.child;case 6:return e===null&&Ek(t),null;case 13:return $9(e,t,r);case 4:return zC(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Hp(t,null,n,r):qi(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Yo(n,i),UR(e,t,n,i,r);case 7:return qi(e,t,t.pendingProps,r),t.child;case 8:return qi(e,t,t.pendingProps.children,r),t.child;case 12:return qi(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value,Dr(sw,n._currentValue),n._currentValue=o,a!==null)if(ds(a.value,o)){if(a.children===i.children&&!fa.current){t=ac(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var s=a.dependencies;if(s!==null){o=a.child;for(var l=s.firstContext;l!==null;){if(l.context===n){if(a.tag===1){l=Gl(-1,r&-r),l.tag=2;var c=a.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}a.lanes|=r,l=a.alternate,l!==null&&(l.lanes|=r),Ck(a.return,r,t),s.lanes|=r;break}l=l.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(Re(341));o.lanes|=r,s=o.alternate,s!==null&&(s.lanes|=r),Ck(o,r,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}qi(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,op(t,r),i=ko(i),n=n(i),t.flags|=1,qi(e,t,n,r),t.child;case 14:return n=t.type,i=Yo(n,t.pendingProps),i=Yo(n.type,i),zR(e,t,n,i,r);case 15:return R9(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Yo(n,i),Sx(e,t),t.tag=1,ha(n)?(e=!0,iw(t)):e=!1,op(t,r),C9(t,n,i),Ok(t,n,i,r),Ik(null,t,n,!0,e,r);case 19:return D9(e,t,r);case 22:return L9(e,t,r)}throw Error(Re(156,t.tag))};function eU(e,t){return jB(e,t)}function pre(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yo(e,t,r,n){return new pre(e,t,r,n)}function n3(e){return e=e.prototype,!(!e||!e.isReactComponent)}function mre(e){if(typeof e=="function")return n3(e)?1:0;if(e!=null){if(e=e.$$typeof,e===_C)return 11;if(e===SC)return 14}return 2}function Nu(e,t){var r=e.alternate;return r===null?(r=yo(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function kx(e,t,r,n,i,a){var o=2;if(n=e,typeof e=="function")n3(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Lh:return uf(r.children,i,a,t);case wC:o=8,i|=8;break;case rk:return e=yo(12,r,t,i|2),e.elementType=rk,e.lanes=a,e;case nk:return e=yo(13,r,t,i),e.elementType=nk,e.lanes=a,e;case ik:return e=yo(19,r,t,i),e.elementType=ik,e.lanes=a,e;case uB:return l5(r,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case lB:o=10;break e;case cB:o=9;break e;case _C:o=11;break e;case SC:o=14;break e;case Xc:o=16,n=null;break e}throw Error(Re(130,e==null?e:typeof e,""))}return t=yo(o,r,t,i),t.elementType=e,t.type=n,t.lanes=a,t}function uf(e,t,r,n){return e=yo(7,e,n,t),e.lanes=r,e}function l5(e,t,r,n){return e=yo(22,e,n,t),e.elementType=uB,e.lanes=r,e.stateNode={isHidden:!1},e}function JS(e,t,r){return e=yo(6,e,null,t),e.lanes=r,e}function ZS(e,t,r){return t=yo(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function gre(e,t,r,n,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=OS(0),this.expirationTimes=OS(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=OS(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function i3(e,t,r,n,i,a,o,s,l){return e=new gre(e,t,r,s,l),t===1?(t=1,a===!0&&(t|=8)):t=0,a=yo(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},UC(a),e}function vre(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(iU)}catch(e){console.error(e)}}iU(),iB.exports=Ja;var $f=iB.exports;const aU=ar($f);var oU,rL=$f;oU=rL.createRoot,rL.hydrateRoot;const _re=1,Sre=1e6;let QS=0;function Are(){return QS=(QS+1)%Number.MAX_SAFE_INTEGER,QS.toString()}const eA=new Map,nL=e=>{if(eA.has(e))return;const t=setTimeout(()=>{eA.delete(e),Bv({type:"REMOVE_TOAST",toastId:e})},Sre);eA.set(e,t)},Pre=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,_re)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?nL(r):e.toasts.forEach(n=>{nL(n.id)}),{...e,toasts:e.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)}}},jx=[];let Nx={toasts:[]};function Bv(e){Nx=Pre(Nx,e),jx.forEach(t=>{t(Nx)})}function kre({...e}){const t=Are(),r=i=>Bv({type:"UPDATE_TOAST",toast:{...i,id:t}}),n=()=>Bv({type:"DISMISS_TOAST",toastId:t});return Bv({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:i=>{i||n()}}}),{id:t,dismiss:n,update:r}}function h5(){const[e,t]=P.useState(Nx);return P.useEffect(()=>(jx.push(t),()=>{const r=jx.indexOf(t);r>-1&&jx.splice(r,1)}),[e]),{...e,toast:kre,dismiss:r=>Bv({type:"DISMISS_TOAST",toastId:r})}}function qe(e,t,{checkForDefaultPrevented:r=!0}={}){return function(i){if(e==null||e(i),r===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function iL(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function sU(...e){return t=>{let r=!1;const n=e.map(i=>{const a=iL(i,t);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let i=0;i{const{children:o,...s}=a,l=P.useMemo(()=>s,Object.values(s));return d.jsx(r.Provider,{value:l,children:o})};n.displayName=e+"Provider";function i(a){const o=P.useContext(r);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[n,i]}function Qa(e,t=[]){let r=[];function n(a,o){const s=P.createContext(o),l=r.length;r=[...r,o];const c=f=>{var y;const{scope:p,children:h,...g}=f,m=((y=p==null?void 0:p[e])==null?void 0:y[l])||s,v=P.useMemo(()=>g,Object.values(g));return d.jsx(m.Provider,{value:v,children:h})};c.displayName=a+"Provider";function u(f,p){var m;const h=((m=p==null?void 0:p[e])==null?void 0:m[l])||s,g=P.useContext(h);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${a}\``)}return[c,u]}const i=()=>{const a=r.map(o=>P.createContext(o));return function(s){const l=(s==null?void 0:s[e])||a;return P.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[n,Nre(i,...t)]}function Nre(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const o=n.reduce((s,{useScope:l,scopeName:c})=>{const f=l(a)[`__scope${c}`];return{...s,...f}},{});return P.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}function xf(e){const t=Cre(e),r=P.forwardRef((n,i)=>{const{children:a,...o}=n,s=P.Children.toArray(a),l=s.find(Ore);if(l){const c=l.props.children,u=s.map(f=>f===l?P.Children.count(c)>1?P.Children.only(null):P.isValidElement(c)?c.props.children:null:f);return d.jsx(t,{...o,ref:i,children:P.isValidElement(c)?P.cloneElement(c,void 0,u):null})}return d.jsx(t,{...o,ref:i,children:a})});return r.displayName=`${e}.Slot`,r}var Ere=xf("Slot");function Cre(e){const t=P.forwardRef((r,n)=>{const{children:i,...a}=r;if(P.isValidElement(i)){const o=Lre(i),s=Rre(a,i.props);return i.type!==P.Fragment&&(s.ref=n?sU(n,o):o),P.cloneElement(i,s)}return P.Children.count(i)>1?P.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var lU=Symbol("radix.slottable");function Tre(e){const t=({children:r})=>d.jsx(d.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=lU,t}function Ore(e){return P.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===lU}function Rre(e,t){const r={...t};for(const n in t){const i=e[n],a=t[n];/^on[A-Z]/.test(n)?i&&a?r[n]=(...s)=>{const l=a(...s);return i(...s),l}:i&&(r[n]=i):n==="style"?r[n]={...i,...a}:n==="className"&&(r[n]=[i,a].filter(Boolean).join(" "))}return{...e,...r}}function Lre(e){var n,i;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function V0(e){const t=e+"CollectionProvider",[r,n]=Qa(t),[i,a]=r(t,{collectionRef:{current:null},itemMap:new Map}),o=m=>{const{scope:v,children:y}=m,b=K.useRef(null),x=K.useRef(new Map).current;return d.jsx(i,{scope:v,itemMap:x,collectionRef:b,children:y})};o.displayName=t;const s=e+"CollectionSlot",l=xf(s),c=K.forwardRef((m,v)=>{const{scope:y,children:b}=m,x=a(s,y),S=qt(v,x.collectionRef);return d.jsx(l,{ref:S,children:b})});c.displayName=s;const u=e+"CollectionItemSlot",f="data-radix-collection-item",p=xf(u),h=K.forwardRef((m,v)=>{const{scope:y,children:b,...x}=m,S=K.useRef(null),_=qt(v,S),k=a(u,y);return K.useEffect(()=>(k.itemMap.set(S,{ref:S,...x}),()=>void k.itemMap.delete(S))),d.jsx(p,{[f]:"",ref:_,children:b})});h.displayName=u;function g(m){const v=a(e+"CollectionConsumer",m);return K.useCallback(()=>{const b=v.collectionRef.current;if(!b)return[];const x=Array.from(b.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((k,E)=>x.indexOf(k.ref.current)-x.indexOf(E.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:o,Slot:c,ItemSlot:h},g,n]}var Ire=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ft=Ire.reduce((e,t)=>{const r=xf(`Primitive.${t}`),n=P.forwardRef((i,a)=>{const{asChild:o,...s}=i,l=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(l,{...s,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function cU(e,t){e&&$f.flushSync(()=>e.dispatchEvent(t))}function No(e){const t=P.useRef(e);return P.useEffect(()=>{t.current=e}),P.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function Mre(e,t=globalThis==null?void 0:globalThis.document){const r=No(e);P.useEffect(()=>{const n=i=>{i.key==="Escape"&&r(i)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var $re="DismissableLayer",Gk="dismissableLayer.update",Dre="dismissableLayer.pointerDownOutside",Fre="dismissableLayer.focusOutside",aL,uU=P.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$m=P.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...l}=e,c=P.useContext(uU),[u,f]=P.useState(null),p=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=P.useState({}),g=qt(t,E=>f(E)),m=Array.from(c.layers),[v]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(v),b=u?m.indexOf(u):-1,x=c.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,_=Ure(E=>{const O=E.target,R=[...c.branches].some($=>$.contains(O));!S||R||(i==null||i(E),o==null||o(E),E.defaultPrevented||s==null||s())},p),k=zre(E=>{const O=E.target;[...c.branches].some($=>$.contains(O))||(a==null||a(E),o==null||o(E),E.defaultPrevented||s==null||s())},p);return Mre(E=>{b===c.layers.size-1&&(n==null||n(E),!E.defaultPrevented&&s&&(E.preventDefault(),s()))},p),P.useEffect(()=>{if(u)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(aL=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),oL(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=aL)}},[u,p,r,c]),P.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),oL())},[u,c]),P.useEffect(()=>{const E=()=>h({});return document.addEventListener(Gk,E),()=>document.removeEventListener(Gk,E)},[]),d.jsx(ft.div,{...l,ref:g,style:{pointerEvents:x?S?"auto":"none":void 0,...e.style},onFocusCapture:qe(e.onFocusCapture,k.onFocusCapture),onBlurCapture:qe(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:qe(e.onPointerDownCapture,_.onPointerDownCapture)})});$m.displayName=$re;var Bre="DismissableLayerBranch",dU=P.forwardRef((e,t)=>{const r=P.useContext(uU),n=P.useRef(null),i=qt(t,n);return P.useEffect(()=>{const a=n.current;if(a)return r.branches.add(a),()=>{r.branches.delete(a)}},[r.branches]),d.jsx(ft.div,{...e,ref:i})});dU.displayName=Bre;function Ure(e,t=globalThis==null?void 0:globalThis.document){const r=No(e),n=P.useRef(!1),i=P.useRef(()=>{});return P.useEffect(()=>{const a=s=>{if(s.target&&!n.current){let l=function(){fU(Dre,r,c,{discrete:!0})};const c={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=l,t.addEventListener("click",i.current,{once:!0})):l()}else t.removeEventListener("click",i.current);n.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",i.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function zre(e,t=globalThis==null?void 0:globalThis.document){const r=No(e),n=P.useRef(!1);return P.useEffect(()=>{const i=a=>{a.target&&!n.current&&fU(Fre,r,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function oL(){const e=new CustomEvent(Gk);document.dispatchEvent(e)}function fU(e,t,r,{discrete:n}){const i=r.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),n?cU(i,a):i.dispatchEvent(a)}var Hre=$m,Vre=dU,ti=globalThis!=null&&globalThis.document?P.useLayoutEffect:()=>{},qre="Portal",q0=P.forwardRef((e,t)=>{var s;const{container:r,...n}=e,[i,a]=P.useState(!1);ti(()=>a(!0),[]);const o=r||i&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return o?aU.createPortal(d.jsx(ft.div,{...n,ref:t}),o):null});q0.displayName=qre;function Wre(e,t){return P.useReducer((r,n)=>t[r][n]??r,e)}var ms=e=>{const{present:t,children:r}=e,n=Gre(t),i=typeof r=="function"?r({present:n.isPresent}):P.Children.only(r),a=qt(n.ref,Kre(i));return typeof r=="function"||n.isPresent?P.cloneElement(i,{ref:a}):null};ms.displayName="Presence";function Gre(e){const[t,r]=P.useState(),n=P.useRef(null),i=P.useRef(e),a=P.useRef("none"),o=e?"mounted":"unmounted",[s,l]=Wre(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return P.useEffect(()=>{const c=_b(n.current);a.current=s==="mounted"?c:"none"},[s]),ti(()=>{const c=n.current,u=i.current;if(u!==e){const p=a.current,h=_b(c);e?l("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&p!==h?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),ti(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,f=h=>{const m=_b(n.current).includes(h.animationName);if(h.target===t&&m&&(l("ANIMATION_END"),!i.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},p=h=>{h.target===t&&(a.current=_b(n.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:P.useCallback(c=>{n.current=c?getComputedStyle(c):null,r(c)},[])}}function _b(e){return(e==null?void 0:e.animationName)||"none"}function Kre(e){var n,i;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Yre=vC[" useInsertionEffect ".trim().toString()]||ti;function Ga({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[i,a,o]=Xre({defaultProp:t,onChange:r}),s=e!==void 0,l=s?e:i;{const u=P.useRef(e!==void 0);P.useEffect(()=>{const f=u.current;f!==s&&console.warn(`${n} is changing from ${f?"controlled":"uncontrolled"} to ${s?"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.`),u.current=s},[s,n])}const c=P.useCallback(u=>{var f;if(s){const p=Jre(u)?u(e):u;p!==e&&((f=o.current)==null||f.call(o,p))}else a(u)},[s,e,a,o]);return[l,c]}function Xre({defaultProp:e,onChange:t}){const[r,n]=P.useState(e),i=P.useRef(r),a=P.useRef(t);return Yre(()=>{a.current=t},[t]),P.useEffect(()=>{var o;i.current!==r&&((o=a.current)==null||o.call(a,r),i.current=r)},[r,i]),[r,n,a]}function Jre(e){return typeof e=="function"}var hU=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"}),Zre="VisuallyHidden",p5=P.forwardRef((e,t)=>d.jsx(ft.span,{...e,ref:t,style:{...hU,...e.style}}));p5.displayName=Zre;var Qre=p5,l3="ToastProvider",[c3,ene,tne]=V0("Toast"),[pU,tqe]=Qa("Toast",[tne]),[rne,m5]=pU(l3),mU=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:i="right",swipeThreshold:a=50,children:o}=e,[s,l]=P.useState(null),[c,u]=P.useState(0),f=P.useRef(!1),p=P.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${l3}\`. Expected non-empty \`string\`.`),d.jsx(c3.Provider,{scope:t,children:d.jsx(rne,{scope:t,label:r,duration:n,swipeDirection:i,swipeThreshold:a,toastCount:c,viewport:s,onViewportChange:l,onToastAdd:P.useCallback(()=>u(h=>h+1),[]),onToastRemove:P.useCallback(()=>u(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:p,children:o})})};mU.displayName=l3;var gU="ToastViewport",nne=["F8"],Kk="toast.viewportPause",Yk="toast.viewportResume",vU=P.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=nne,label:i="Notifications ({hotkey})",...a}=e,o=m5(gU,r),s=ene(r),l=P.useRef(null),c=P.useRef(null),u=P.useRef(null),f=P.useRef(null),p=qt(t,f,o.onViewportChange),h=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),g=o.toastCount>0;P.useEffect(()=>{const v=y=>{var x;n.length!==0&&n.every(S=>y[S]||y.code===S)&&((x=f.current)==null||x.focus())};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[n]),P.useEffect(()=>{const v=l.current,y=f.current;if(g&&v&&y){const b=()=>{if(!o.isClosePausedRef.current){const k=new CustomEvent(Kk);y.dispatchEvent(k),o.isClosePausedRef.current=!0}},x=()=>{if(o.isClosePausedRef.current){const k=new CustomEvent(Yk);y.dispatchEvent(k),o.isClosePausedRef.current=!1}},S=k=>{!v.contains(k.relatedTarget)&&x()},_=()=>{v.contains(document.activeElement)||x()};return v.addEventListener("focusin",b),v.addEventListener("focusout",S),v.addEventListener("pointermove",b),v.addEventListener("pointerleave",_),window.addEventListener("blur",b),window.addEventListener("focus",x),()=>{v.removeEventListener("focusin",b),v.removeEventListener("focusout",S),v.removeEventListener("pointermove",b),v.removeEventListener("pointerleave",_),window.removeEventListener("blur",b),window.removeEventListener("focus",x)}}},[g,o.isClosePausedRef]);const m=P.useCallback(({tabbingDirection:v})=>{const b=s().map(x=>{const S=x.ref.current,_=[S,...gne(S)];return v==="forwards"?_:_.reverse()});return(v==="forwards"?b.reverse():b).flat()},[s]);return P.useEffect(()=>{const v=f.current;if(v){const y=b=>{var _,k,E;const x=b.altKey||b.ctrlKey||b.metaKey;if(b.key==="Tab"&&!x){const O=document.activeElement,R=b.shiftKey;if(b.target===v&&R){(_=c.current)==null||_.focus();return}const C=m({tabbingDirection:R?"backwards":"forwards"}),D=C.findIndex(I=>I===O);tA(C.slice(D+1))?b.preventDefault():R?(k=c.current)==null||k.focus():(E=u.current)==null||E.focus()}};return v.addEventListener("keydown",y),()=>v.removeEventListener("keydown",y)}},[s,m]),d.jsxs(Vre,{ref:l,role:"region","aria-label":i.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:g?void 0:"none"},children:[g&&d.jsx(Xk,{ref:c,onFocusFromOutsideViewport:()=>{const v=m({tabbingDirection:"forwards"});tA(v)}}),d.jsx(c3.Slot,{scope:r,children:d.jsx(ft.ol,{tabIndex:-1,...a,ref:p})}),g&&d.jsx(Xk,{ref:u,onFocusFromOutsideViewport:()=>{const v=m({tabbingDirection:"backwards"});tA(v)}})]})});vU.displayName=gU;var yU="ToastFocusProxy",Xk=P.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...i}=e,a=m5(yU,r);return d.jsx(p5,{"aria-hidden":!0,tabIndex:0,...i,ref:t,style:{position:"fixed"},onFocus:o=>{var c;const s=o.relatedTarget;!((c=a.viewport)!=null&&c.contains(s))&&n()}})});Xk.displayName=yU;var W0="Toast",ine="toast.swipeStart",ane="toast.swipeMove",one="toast.swipeCancel",sne="toast.swipeEnd",bU=P.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:i,onOpenChange:a,...o}=e,[s,l]=Ga({prop:n,defaultProp:i??!0,onChange:a,caller:W0});return d.jsx(ms,{present:r||s,children:d.jsx(une,{open:s,...o,ref:t,onClose:()=>l(!1),onPause:No(e.onPause),onResume:No(e.onResume),onSwipeStart:qe(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:qe(e.onSwipeMove,c=>{const{x:u,y:f}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:qe(e.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:qe(e.onSwipeEnd,c=>{const{x:u,y:f}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),l(!1)})})})});bU.displayName=W0;var[lne,cne]=pU(W0,{onClose(){}}),une=P.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:i,open:a,onClose:o,onEscapeKeyDown:s,onPause:l,onResume:c,onSwipeStart:u,onSwipeMove:f,onSwipeCancel:p,onSwipeEnd:h,...g}=e,m=m5(W0,r),[v,y]=P.useState(null),b=qt(t,I=>y(I)),x=P.useRef(null),S=P.useRef(null),_=i||m.duration,k=P.useRef(0),E=P.useRef(_),O=P.useRef(0),{onToastAdd:R,onToastRemove:$}=m,N=No(()=>{var G;(v==null?void 0:v.contains(document.activeElement))&&((G=m.viewport)==null||G.focus()),o()}),C=P.useCallback(I=>{!I||I===1/0||(window.clearTimeout(O.current),k.current=new Date().getTime(),O.current=window.setTimeout(N,I))},[N]);P.useEffect(()=>{const I=m.viewport;if(I){const G=()=>{C(E.current),c==null||c()},Y=()=>{const Z=new Date().getTime()-k.current;E.current=E.current-Z,window.clearTimeout(O.current),l==null||l()};return I.addEventListener(Kk,Y),I.addEventListener(Yk,G),()=>{I.removeEventListener(Kk,Y),I.removeEventListener(Yk,G)}}},[m.viewport,_,l,c,C]),P.useEffect(()=>{a&&!m.isClosePausedRef.current&&C(_)},[a,_,m.isClosePausedRef,C]),P.useEffect(()=>(R(),()=>$()),[R,$]);const D=P.useMemo(()=>v?kU(v):null,[v]);return m.viewport?d.jsxs(d.Fragment,{children:[D&&d.jsx(dne,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:D}),d.jsx(lne,{scope:r,onClose:N,children:$f.createPortal(d.jsx(c3.ItemSlot,{scope:r,children:d.jsx(Hre,{asChild:!0,onEscapeKeyDown:qe(s,()=>{m.isFocusedToastEscapeKeyDownRef.current||N(),m.isFocusedToastEscapeKeyDownRef.current=!1}),children:d.jsx(ft.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":a?"open":"closed","data-swipe-direction":m.swipeDirection,...g,ref:b,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:qe(e.onKeyDown,I=>{I.key==="Escape"&&(s==null||s(I.nativeEvent),I.nativeEvent.defaultPrevented||(m.isFocusedToastEscapeKeyDownRef.current=!0,N()))}),onPointerDown:qe(e.onPointerDown,I=>{I.button===0&&(x.current={x:I.clientX,y:I.clientY})}),onPointerMove:qe(e.onPointerMove,I=>{if(!x.current)return;const G=I.clientX-x.current.x,Y=I.clientY-x.current.y,Z=!!S.current,U=["left","right"].includes(m.swipeDirection),X=["left","up"].includes(m.swipeDirection)?Math.min:Math.max,oe=U?X(0,G):0,ue=U?0:X(0,Y),M=I.pointerType==="touch"?10:2,W={x:oe,y:ue},z={originalEvent:I,delta:W};Z?(S.current=W,Sb(ane,f,z,{discrete:!1})):sL(W,m.swipeDirection,M)?(S.current=W,Sb(ine,u,z,{discrete:!1}),I.target.setPointerCapture(I.pointerId)):(Math.abs(G)>M||Math.abs(Y)>M)&&(x.current=null)}),onPointerUp:qe(e.onPointerUp,I=>{const G=S.current,Y=I.target;if(Y.hasPointerCapture(I.pointerId)&&Y.releasePointerCapture(I.pointerId),S.current=null,x.current=null,G){const Z=I.currentTarget,U={originalEvent:I,delta:G};sL(G,m.swipeDirection,m.swipeThreshold)?Sb(sne,h,U,{discrete:!0}):Sb(one,p,U,{discrete:!0}),Z.addEventListener("click",X=>X.preventDefault(),{once:!0})}})})})}),m.viewport)})]}):null}),dne=e=>{const{__scopeToast:t,children:r,...n}=e,i=m5(W0,t),[a,o]=P.useState(!1),[s,l]=P.useState(!1);return pne(()=>o(!0)),P.useEffect(()=>{const c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),s?null:d.jsx(q0,{asChild:!0,children:d.jsx(p5,{...n,children:a&&d.jsxs(d.Fragment,{children:[i.label," ",r]})})})},fne="ToastTitle",xU=P.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return d.jsx(ft.div,{...n,ref:t})});xU.displayName=fne;var hne="ToastDescription",wU=P.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return d.jsx(ft.div,{...n,ref:t})});wU.displayName=hne;var _U="ToastAction",SU=P.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?d.jsx(PU,{altText:r,asChild:!0,children:d.jsx(u3,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${_U}\`. Expected non-empty \`string\`.`),null)});SU.displayName=_U;var AU="ToastClose",u3=P.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,i=cne(AU,r);return d.jsx(PU,{asChild:!0,children:d.jsx(ft.button,{type:"button",...n,ref:t,onClick:qe(e.onClick,i.onClose)})})});u3.displayName=AU;var PU=P.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...i}=e;return d.jsx(ft.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...i,ref:t})});function kU(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),mne(n)){const i=n.ariaHidden||n.hidden||n.style.display==="none",a=n.dataset.radixToastAnnounceExclude==="";if(!i)if(a){const o=n.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...kU(n))}}),t}function Sb(e,t,r,{discrete:n}){const i=r.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),n?cU(i,a):i.dispatchEvent(a)}var sL=(e,t,r=0)=>{const n=Math.abs(e.x),i=Math.abs(e.y),a=n>i;return t==="left"||t==="right"?a&&n>r:!a&&i>r};function pne(e=()=>{}){const t=No(e);ti(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function mne(e){return e.nodeType===e.ELEMENT_NODE}function gne(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function tA(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var vne=mU,jU=vU,NU=bU,EU=xU,CU=wU,TU=SU,OU=u3;function RU(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;ttypeof e=="boolean"?`${e}`:e===0?"0":e,cL=Ot,G0=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return cL(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:i,defaultVariants:a}=t,o=Object.keys(i).map(c=>{const u=r==null?void 0:r[c],f=a==null?void 0:a[c];if(u===null)return null;const p=lL(u)||lL(f);return i[c][p]}),s=r&&Object.entries(r).reduce((c,u)=>{let[f,p]=u;return p===void 0||(c[f]=p),c},{}),l=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((c,u)=>{let{class:f,className:p,...h}=u;return Object.entries(h).every(g=>{let[m,v]=g;return Array.isArray(v)?v.includes({...a,...s}[m]):{...a,...s}[m]===v})?[...c,f,p]:c},[]);return cL(e,o,l,r==null?void 0:r.class,r==null?void 0:r.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 yne=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),LU=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).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 bne={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 xne=P.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:i="",children:a,iconNode:o,...s},l)=>P.createElement("svg",{ref:l,...bne,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:LU("lucide",i),...s},[...o.map(([c,u])=>P.createElement(c,u)),...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 tt=(e,t)=>{const r=P.forwardRef(({className:n,...i},a)=>P.createElement(xne,{ref:a,iconNode:t,className:LU(`lucide-${yne(e)}`,n),...i}));return r.displayName=`${e}`,r};/** * @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 K0=tt("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 lp=tt("ArrowDownRight",[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]]);/** * @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 zl=tt("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 Kl=tt("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/** * @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 wne=tt("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** * @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 _ne=tt("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 Sne=tt("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 Ex=tt("BedDouble",[["path",{d:"M2 20v-8a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v8",key:"1k78r4"}],["path",{d:"M4 10V6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v4",key:"fb3tl2"}],["path",{d:"M12 4v6",key:"1dcgq2"}],["path",{d:"M2 18h20",key:"ajqnye"}]]);/** * @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 Ane=tt("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/** * @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 Pne=tt("BrainCircuit",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M9 13a4.5 4.5 0 0 0 3-4",key:"10igwf"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M12 13h4",key:"1ku699"}],["path",{d:"M12 18h6a2 2 0 0 1 2 2v1",key:"105ag5"}],["path",{d:"M12 8h8",key:"1lhi5i"}],["path",{d:"M16 8V5a2 2 0 0 1 2-2",key:"u6izg6"}],["circle",{cx:"16",cy:"13",r:".5",key:"ry7gng"}],["circle",{cx:"18",cy:"3",r:".5",key:"1aiba7"}],["circle",{cx:"20",cy:"21",r:".5",key:"yhc1fs"}],["circle",{cx:"20",cy:"8",r:".5",key:"1e43v0"}]]);/** * @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 Uv=tt("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/** * @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 g5=tt("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/** * @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 kne=tt("Calculator",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["line",{x1:"8",x2:"16",y1:"6",y2:"6",key:"x4nwl0"}],["line",{x1:"16",x2:"16",y1:"14",y2:"18",key:"wjye3r"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M8 18h.01",key:"lrp35t"}]]);/** * @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 jne=tt("CalendarDays",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);/** * @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 Jk=tt("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** * @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 oc=tt("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/** * @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=tt("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 Y0=tt("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 Gp=tt("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 IU=tt("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** * @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 Nne=tt("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/** * @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 Ene=tt("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 d3=tt("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 MU=tt("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 Cne=tt("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);/** * @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 Tne=tt("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/** * @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 Ia=tt("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/** * @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 Zk=tt("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** * @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 One=tt("Earth",[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** * @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 Rne=tt("Ellipsis",[["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"}]]);/** * @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 Kp=tt("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 uL=tt("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]);/** * @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 Lne=tt("GitCompare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);/** * @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 sc=tt("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** * @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 f3=tt("Hotel",[["path",{d:"M10 22v-6.57",key:"1wmca3"}],["path",{d:"M12 11h.01",key:"z322tv"}],["path",{d:"M12 7h.01",key:"1ivr5q"}],["path",{d:"M14 15.43V22",key:"1q2vjd"}],["path",{d:"M15 16a5 5 0 0 0-6 0",key:"o9wqvi"}],["path",{d:"M16 11h.01",key:"xkw8gn"}],["path",{d:"M16 7h.01",key:"1kdx03"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 7h.01",key:"1vti4s"}],["rect",{x:"4",y:"2",width:"16",height:"20",rx:"2",key:"1uxh74"}]]);/** * @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 dL=tt("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/** * @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 Ine=tt("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** * @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 Mne=tt("Landmark",[["line",{x1:"3",x2:"21",y1:"22",y2:"22",key:"j8o0r"}],["line",{x1:"6",x2:"6",y1:"18",y2:"11",key:"10tf0k"}],["line",{x1:"10",x2:"10",y1:"18",y2:"11",key:"54lgf6"}],["line",{x1:"14",x2:"14",y1:"18",y2:"11",key:"380y"}],["line",{x1:"18",x2:"18",y1:"18",y2:"11",key:"1kevvc"}],["polygon",{points:"12 2 20 7 4 7",key:"jkujk7"}]]);/** * @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 $ne=tt("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/** * @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 fL=tt("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 Va=tt("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 v5=tt("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 Yl=tt("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 Dne=tt("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 Fne=tt("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/** * @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 Bne=tt("Mountain",[["path",{d:"m8 3 4 8 5-5 5 15H2L8 3z",key:"otkl63"}]]);/** * @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 yw=tt("Percent",[["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5",key:"4mh3h7"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5",key:"1mdrzq"}]]);/** * @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 Une=tt("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);/** * @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 h3=tt("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 Ay=tt("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 zne=tt("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @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 hL=tt("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/** * @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=tt("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 lc=tt("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 cp=tt("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 Yp=tt("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 p3=tt("TrendingDown",[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]]);/** * @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 ri=tt("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 Dl=tt("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 Xp=tt("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 DU=tt("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"}]]),m3="-",Hne=e=>{const t=qne(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:o=>{const s=o.split(m3);return s[0]===""&&s.length!==1&&s.shift(),FU(s,t)||Vne(o)},getConflictingClassGroupIds:(o,s)=>{const l=r[o]||[];return s&&n[o]?[...l,...n[o]]:l}}},FU=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),i=n?FU(e.slice(1),n):void 0;if(i)return i;if(t.validators.length===0)return;const a=e.join(m3);return(o=t.validators.find(({validator:s})=>s(a)))==null?void 0:o.classGroupId},pL=/^\[(.+)\]$/,Vne=e=>{if(pL.test(e)){const t=pL.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},qne=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return Gne(Object.entries(e.classGroups),r).forEach(([a,o])=>{Qk(o,n,a,t)}),n},Qk=(e,t,r,n)=>{e.forEach(i=>{if(typeof i=="string"){const a=i===""?t:mL(t,i);a.classGroupId=r;return}if(typeof i=="function"){if(Wne(i)){Qk(i(n),t,r,n);return}t.validators.push({validator:i,classGroupId:r});return}Object.entries(i).forEach(([a,o])=>{Qk(o,mL(t,a),r,n)})})},mL=(e,t)=>{let r=e;return t.split(m3).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},Wne=e=>e.isThemeGetter,Gne=(e,t)=>t?e.map(([r,n])=>{const i=n.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([o,s])=>[t+o,s])):a);return[r,i]}):e,Kne=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const i=(a,o)=>{r.set(a,o),t++,t>e&&(t=0,n=r,r=new Map)};return{get(a){let o=r.get(a);if(o!==void 0)return o;if((o=n.get(a))!==void 0)return i(a,o),o},set(a,o){r.has(a)?r.set(a,o):i(a,o)}}},BU="!",Yne=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,i=t[0],a=t.length,o=s=>{const l=[];let c=0,u=0,f;for(let v=0;vu?f-u:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:m}};return r?s=>r({className:s,parseClassName:o}):o},Xne=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},Jne=e=>({cache:Kne(e.cacheSize),parseClassName:Yne(e),...Hne(e)}),Zne=/\s+/,Qne=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i}=t,a=[],o=e.trim().split(Zne);let s="";for(let l=o.length-1;l>=0;l-=1){const c=o[l],{modifiers:u,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:h}=r(c);let g=!!h,m=n(g?p.substring(0,h):p);if(!m){if(!g){s=c+(s.length>0?" "+s:s);continue}if(m=n(p),!m){s=c+(s.length>0?" "+s:s);continue}g=!1}const v=Xne(u).join(":"),y=f?v+BU:v,b=y+m;if(a.includes(b))continue;a.push(b);const x=i(m,g);for(let S=0;S0?" "+s:s)}return s};function eie(){let e=0,t,r,n="";for(;e{if(typeof e=="string")return e;let t,r="";for(let n=0;nf(u),e());return r=Jne(c),n=r.cache.get,i=r.cache.set,a=s,s(l)}function s(l){const c=n(l);if(c)return c;const u=Qne(l,r);return i(l,u),u}return function(){return a(eie.apply(null,arguments))}}const Ur=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},zU=/^\[(?:([a-z-]+):)?(.+)\]$/i,rie=/^\d+\/\d+$/,nie=new Set(["px","full","screen"]),iie=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,aie=/\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$/,oie=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,sie=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,lie=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,kl=e=>up(e)||nie.has(e)||rie.test(e),Uc=e=>Dm(e,"length",gie),up=e=>!!e&&!Number.isNaN(Number(e)),rA=e=>Dm(e,"number",up),ev=e=>!!e&&Number.isInteger(Number(e)),cie=e=>e.endsWith("%")&&up(e.slice(0,-1)),Ut=e=>zU.test(e),zc=e=>iie.test(e),uie=new Set(["length","size","percentage"]),die=e=>Dm(e,uie,HU),fie=e=>Dm(e,"position",HU),hie=new Set(["image","url"]),pie=e=>Dm(e,hie,yie),mie=e=>Dm(e,"",vie),tv=()=>!0,Dm=(e,t,r)=>{const n=zU.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},gie=e=>aie.test(e)&&!oie.test(e),HU=()=>!1,vie=e=>sie.test(e),yie=e=>lie.test(e),bie=()=>{const e=Ur("colors"),t=Ur("spacing"),r=Ur("blur"),n=Ur("brightness"),i=Ur("borderColor"),a=Ur("borderRadius"),o=Ur("borderSpacing"),s=Ur("borderWidth"),l=Ur("contrast"),c=Ur("grayscale"),u=Ur("hueRotate"),f=Ur("invert"),p=Ur("gap"),h=Ur("gradientColorStops"),g=Ur("gradientColorStopPositions"),m=Ur("inset"),v=Ur("margin"),y=Ur("opacity"),b=Ur("padding"),x=Ur("saturate"),S=Ur("scale"),_=Ur("sepia"),k=Ur("skew"),E=Ur("space"),O=Ur("translate"),R=()=>["auto","contain","none"],$=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto",Ut,t],C=()=>[Ut,t],D=()=>["",kl,Uc],I=()=>["auto",up,Ut],G=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Y=()=>["solid","dashed","dotted","double","none"],Z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],U=()=>["start","end","center","between","around","evenly","stretch"],X=()=>["","0",Ut],oe=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ue=()=>[up,Ut];return{cacheSize:500,separator:":",theme:{colors:[tv],spacing:[kl,Uc],blur:["none","",zc,Ut],brightness:ue(),borderColor:[e],borderRadius:["none","","full",zc,Ut],borderSpacing:C(),borderWidth:D(),contrast:ue(),grayscale:X(),hueRotate:ue(),invert:X(),gap:C(),gradientColorStops:[e],gradientColorStopPositions:[cie,Uc],inset:N(),margin:N(),opacity:ue(),padding:C(),saturate:ue(),scale:ue(),sepia:X(),skew:ue(),space:C(),translate:C()},classGroups:{aspect:[{aspect:["auto","square","video",Ut]}],container:["container"],columns:[{columns:[zc]}],"break-after":[{"break-after":oe()}],"break-before":[{"break-before":oe()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...G(),Ut]}],overflow:[{overflow:$()}],"overflow-x":[{"overflow-x":$()}],"overflow-y":[{"overflow-y":$()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ev,Ut]}],basis:[{basis:N()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ut]}],grow:[{grow:X()}],shrink:[{shrink:X()}],order:[{order:["first","last","none",ev,Ut]}],"grid-cols":[{"grid-cols":[tv]}],"col-start-end":[{col:["auto",{span:["full",ev,Ut]},Ut]}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":[tv]}],"row-start-end":[{row:["auto",{span:[ev,Ut]},Ut]}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ut]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ut]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...U()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...U(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...U(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ut,t]}],"min-w":[{"min-w":[Ut,t,"min","max","fit"]}],"max-w":[{"max-w":[Ut,t,"none","full","min","max","fit","prose",{screen:[zc]},zc]}],h:[{h:[Ut,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ut,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ut,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ut,t,"auto","min","max","fit"]}],"font-size":[{text:["base",zc,Uc]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",rA]}],"font-family":[{font:[tv]}],"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",Ut]}],"line-clamp":[{"line-clamp":["none",up,rA]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",kl,Ut]}],"list-image":[{"list-image":["none",Ut]}],"list-style-type":[{list:["none","disc","decimal",Ut]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Y(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",kl,Uc]}],"underline-offset":[{"underline-offset":["auto",kl,Ut]}],"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:C()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ut]}],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",Ut]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...G(),fie]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",die]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},pie]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],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:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...Y(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:Y()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...Y()]}],"outline-offset":[{"outline-offset":[kl,Ut]}],"outline-w":[{outline:[kl,Uc]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[kl,Uc]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",zc,mie]}],"shadow-color":[{shadow:[tv]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...Z(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Z()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",zc,Ut]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[x]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ut]}],duration:[{duration:ue()}],ease:[{ease:["linear","in","out","in-out",Ut]}],delay:[{delay:ue()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ut]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[ev,Ut]}],"translate-x":[{"translate-x":[O]}],"translate-y":[{"translate-y":[O]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ut]}],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",Ut]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"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",Ut]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[kl,Uc,rA]}],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"]}}},xie=tie(bie);function lt(...e){return xie(Ot(e))}const wie=vne,VU=P.forwardRef(({className:e,...t},r)=>d.jsx(jU,{ref:r,className:lt("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}));VU.displayName=jU.displayName;const _ie=G0("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"}}),qU=P.forwardRef(({className:e,variant:t,...r},n)=>d.jsx(NU,{ref:n,className:lt(_ie({variant:t}),e),...r}));qU.displayName=NU.displayName;const Sie=P.forwardRef(({className:e,...t},r)=>d.jsx(TU,{ref:r,className:lt("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}));Sie.displayName=TU.displayName;const WU=P.forwardRef(({className:e,...t},r)=>d.jsx(OU,{ref:r,className:lt("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:d.jsx(Xp,{className:"h-4 w-4"})}));WU.displayName=OU.displayName;const GU=P.forwardRef(({className:e,...t},r)=>d.jsx(EU,{ref:r,className:lt("text-sm font-semibold",e),...t}));GU.displayName=EU.displayName;const KU=P.forwardRef(({className:e,...t},r)=>d.jsx(CU,{ref:r,className:lt("text-sm opacity-90",e),...t}));KU.displayName=CU.displayName;function Aie(){const{toasts:e}=h5();return d.jsxs(wie,{children:[e.map(function({id:t,title:r,description:n,action:i,...a}){return d.jsxs(qU,{...a,children:[d.jsxs("div",{className:"grid gap-1",children:[r&&d.jsx(GU,{children:r}),n&&d.jsx(KU,{children:n})]}),i,d.jsx(WU,{})]},t)}),d.jsx(VU,{})]})}var gL=["light","dark"],Pie="(prefers-color-scheme: dark)",kie=P.createContext(void 0),jie={setTheme:e=>{},themes:[]},Nie=()=>{var e;return(e=P.useContext(kie))!=null?e:jie};P.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:n,enableColorScheme:i,defaultTheme:a,value:o,attrs:s,nonce:l})=>{let c=a==="system",u=r==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${s.map(g=>`'${g}'`).join(",")})`};`:`var d=document.documentElement,n='${r}',s='setAttribute';`,f=i?gL.includes(a)&&a?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${a}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",p=(g,m=!1,v=!0)=>{let y=o?o[g]:g,b=m?g+"|| ''":`'${y}'`,x="";return i&&v&&!m&&gL.includes(g)&&(x+=`d.style.colorScheme = '${g}';`),r==="class"?m||y?x+=`c.add(${b})`:x+="null":y&&(x+=`d[s](n,${b})`),x},h=e?`!function(){${u}${p(e)}}()`:n?`!function(){try{${u}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${c})){var t='${Pie}',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)}}${c?"":"else{"+p(a,!1,!1)+"}"}${f}}catch(e){}}()`:`!function(){try{${u}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 P.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:h}})});var Eie=e=>{switch(e){case"success":return Oie;case"info":return Lie;case"warning":return Rie;case"error":return Iie;default:return null}},Cie=Array(12).fill(0),Tie=({visible:e,className:t})=>K.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},K.createElement("div",{className:"sonner-spinner"},Cie.map((r,n)=>K.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),Oie=K.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},K.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"})),Rie=K.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},K.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"})),Lie=K.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},K.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"})),Iie=K.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},K.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"})),Mie=K.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"},K.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),K.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),$ie=()=>{let[e,t]=K.useState(document.hidden);return K.useEffect(()=>{let r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e},ej=1,Die=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let r=this.subscribers.indexOf(t);this.subscribers.splice(r,1)}),this.publish=t=>{this.subscribers.forEach(r=>r(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var r;let{message:n,...i}=t,a=typeof(t==null?void 0:t.id)=="number"||((r=t.id)==null?void 0:r.length)>0?t.id:ej++,o=this.toasts.find(l=>l.id===a),s=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),o?this.toasts=this.toasts.map(l=>l.id===a?(this.publish({...l,...t,id:a,title:n}),{...l,...t,id:a,dismissible:s,title:n}):l):this.addToast({title:n,...i,dismissible:s,id:a}),a},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(r=>{this.subscribers.forEach(n=>n({id:r.id,dismiss:!0}))}),this.subscribers.forEach(r=>r({id:t,dismiss:!0})),t),this.message=(t,r)=>this.create({...r,message:t}),this.error=(t,r)=>this.create({...r,message:t,type:"error"}),this.success=(t,r)=>this.create({...r,type:"success",message:t}),this.info=(t,r)=>this.create({...r,type:"info",message:t}),this.warning=(t,r)=>this.create({...r,type:"warning",message:t}),this.loading=(t,r)=>this.create({...r,type:"loading",message:t}),this.promise=(t,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:t,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));let i=t instanceof Promise?t:t(),a=n!==void 0,o,s=i.then(async c=>{if(o=["resolve",c],K.isValidElement(c))a=!1,this.create({id:n,type:"default",message:c});else if(Bie(c)&&!c.ok){a=!1;let u=typeof r.error=="function"?await r.error(`HTTP error! status: ${c.status}`):r.error,f=typeof r.description=="function"?await r.description(`HTTP error! status: ${c.status}`):r.description;this.create({id:n,type:"error",message:u,description:f})}else if(r.success!==void 0){a=!1;let u=typeof r.success=="function"?await r.success(c):r.success,f=typeof r.description=="function"?await r.description(c):r.description;this.create({id:n,type:"success",message:u,description:f})}}).catch(async c=>{if(o=["reject",c],r.error!==void 0){a=!1;let u=typeof r.error=="function"?await r.error(c):r.error,f=typeof r.description=="function"?await r.description(c):r.description;this.create({id:n,type:"error",message:u,description:f})}}).finally(()=>{var c;a&&(this.dismiss(n),n=void 0),(c=r.finally)==null||c.call(r)}),l=()=>new Promise((c,u)=>s.then(()=>o[0]==="reject"?u(o[1]):c(o[1])).catch(u));return typeof n!="string"&&typeof n!="number"?{unwrap:l}:Object.assign(n,{unwrap:l})},this.custom=(t,r)=>{let n=(r==null?void 0:r.id)||ej++;return this.create({jsx:t(n),id:n,...r}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},oa=new Die,Fie=(e,t)=>{let r=(t==null?void 0:t.id)||ej++;return oa.addToast({title:e,...t,id:r}),r},Bie=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Uie=Fie,zie=()=>oa.toasts,Hie=()=>oa.getActiveToasts(),xr=Object.assign(Uie,{success:oa.success,info:oa.info,warning:oa.warning,error:oa.error,custom:oa.custom,message:oa.message,promise:oa.promise,dismiss:oa.dismiss,loading:oa.loading},{getHistory:zie,getToasts:Hie});function Vie(e,{insertAt:t}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}Vie(`: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 Ab(e){return e.label!==void 0}var qie=3,Wie="32px",Gie="16px",vL=4e3,Kie=356,Yie=14,Xie=20,Jie=200;function zo(...e){return e.filter(Boolean).join(" ")}function Zie(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}var Qie=e=>{var t,r,n,i,a,o,s,l,c,u,f;let{invert:p,toast:h,unstyled:g,interacting:m,setHeights:v,visibleToasts:y,heights:b,index:x,toasts:S,expanded:_,removeToast:k,defaultRichColors:E,closeButton:O,style:R,cancelButtonStyle:$,actionButtonStyle:N,className:C="",descriptionClassName:D="",duration:I,position:G,gap:Y,loadingIcon:Z,expandByDefault:U,classNames:X,icons:oe,closeButtonAriaLabel:ue="Close toast",pauseWhenPageIsHidden:M}=e,[W,z]=K.useState(null),[ie,le]=K.useState(null),[V,se]=K.useState(!1),[ae,de]=K.useState(!1),[ve,fe]=K.useState(!1),[je,Te]=K.useState(!1),[Q,Ce]=K.useState(!1),[Ke,Fe]=K.useState(0),[ke,rt]=K.useState(0),Me=K.useRef(h.duration||I||vL),Ye=K.useRef(null),Be=K.useRef(null),Yt=x===0,Dt=x+1<=y,ut=h.type,Lt=h.dismissible!==!1,Ht=h.className||"",Ze=h.descriptionClassName||"",_t=K.useMemo(()=>b.findIndex(gt=>gt.toastId===h.id)||0,[b,h.id]),nt=K.useMemo(()=>{var gt;return(gt=h.closeButton)!=null?gt:O},[h.closeButton,O]),Gr=K.useMemo(()=>h.duration||I||vL,[h.duration,I]),Wt=K.useRef(0),Pt=K.useRef(0),It=K.useRef(0),fr=K.useRef(null),[ht,Pr]=G.split("-"),mt=K.useMemo(()=>b.reduce((gt,Et,rr)=>rr>=_t?gt:gt+Et.height,0),[b,_t]),kt=$ie(),Or=h.invert||p,Mt=ut==="loading";Pt.current=K.useMemo(()=>_t*Y+mt,[_t,mt]),K.useEffect(()=>{Me.current=Gr},[Gr]),K.useEffect(()=>{se(!0)},[]),K.useEffect(()=>{let gt=Be.current;if(gt){let Et=gt.getBoundingClientRect().height;return rt(Et),v(rr=>[{toastId:h.id,height:Et,position:h.position},...rr]),()=>v(rr=>rr.filter(an=>an.toastId!==h.id))}},[v,h.id]),K.useLayoutEffect(()=>{if(!V)return;let gt=Be.current,Et=gt.style.height;gt.style.height="auto";let rr=gt.getBoundingClientRect().height;gt.style.height=Et,rt(rr),v(an=>an.find(Je=>Je.toastId===h.id)?an.map(Je=>Je.toastId===h.id?{...Je,height:rr}:Je):[{toastId:h.id,height:rr,position:h.position},...an])},[V,h.title,h.description,v,h.id]);let it=K.useCallback(()=>{de(!0),Fe(Pt.current),v(gt=>gt.filter(Et=>Et.toastId!==h.id)),setTimeout(()=>{k(h)},Jie)},[h,k,v,Pt]);K.useEffect(()=>{if(h.promise&&ut==="loading"||h.duration===1/0||h.type==="loading")return;let gt;return _||m||M&&kt?(()=>{if(It.current{var Et;(Et=h.onAutoClose)==null||Et.call(h,h),it()},Me.current)),()=>clearTimeout(gt)},[_,m,h,ut,M,kt,it]),K.useEffect(()=>{h.delete&&it()},[it,h.delete]);function cr(){var gt,Et,rr;return oe!=null&&oe.loading?K.createElement("div",{className:zo(X==null?void 0:X.loader,(gt=h==null?void 0:h.classNames)==null?void 0:gt.loader,"sonner-loader"),"data-visible":ut==="loading"},oe.loading):Z?K.createElement("div",{className:zo(X==null?void 0:X.loader,(Et=h==null?void 0:h.classNames)==null?void 0:Et.loader,"sonner-loader"),"data-visible":ut==="loading"},Z):K.createElement(Tie,{className:zo(X==null?void 0:X.loader,(rr=h==null?void 0:h.classNames)==null?void 0:rr.loader),visible:ut==="loading"})}return K.createElement("li",{tabIndex:0,ref:Be,className:zo(C,Ht,X==null?void 0:X.toast,(t=h==null?void 0:h.classNames)==null?void 0:t.toast,X==null?void 0:X.default,X==null?void 0:X[ut],(r=h==null?void 0:h.classNames)==null?void 0:r[ut]),"data-sonner-toast":"","data-rich-colors":(n=h.richColors)!=null?n:E,"data-styled":!(h.jsx||h.unstyled||g),"data-mounted":V,"data-promise":!!h.promise,"data-swiped":Q,"data-removed":ae,"data-visible":Dt,"data-y-position":ht,"data-x-position":Pr,"data-index":x,"data-front":Yt,"data-swiping":ve,"data-dismissible":Lt,"data-type":ut,"data-invert":Or,"data-swipe-out":je,"data-swipe-direction":ie,"data-expanded":!!(_||U&&V),style:{"--index":x,"--toasts-before":x,"--z-index":S.length-x,"--offset":`${ae?Ke:Pt.current}px`,"--initial-height":U?"auto":`${ke}px`,...R,...h.style},onDragEnd:()=>{fe(!1),z(null),fr.current=null},onPointerDown:gt=>{Mt||!Lt||(Ye.current=new Date,Fe(Pt.current),gt.target.setPointerCapture(gt.pointerId),gt.target.tagName!=="BUTTON"&&(fe(!0),fr.current={x:gt.clientX,y:gt.clientY}))},onPointerUp:()=>{var gt,Et,rr,an;if(je||!Lt)return;fr.current=null;let Je=Number(((gt=Be.current)==null?void 0:gt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Gn=Number(((Et=Be.current)==null?void 0:Et.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ii=new Date().getTime()-((rr=Ye.current)==null?void 0:rr.getTime()),Kr=W==="x"?Je:Gn,pn=Math.abs(Kr)/ii;if(Math.abs(Kr)>=Xie||pn>.11){Fe(Pt.current),(an=h.onDismiss)==null||an.call(h,h),le(W==="x"?Je>0?"right":"left":Gn>0?"down":"up"),it(),Te(!0),Ce(!1);return}fe(!1),z(null)},onPointerMove:gt=>{var Et,rr,an,Je;if(!fr.current||!Lt||((Et=window.getSelection())==null?void 0:Et.toString().length)>0)return;let Gn=gt.clientY-fr.current.y,ii=gt.clientX-fr.current.x,Kr=(rr=e.swipeDirections)!=null?rr:Zie(G);!W&&(Math.abs(ii)>1||Math.abs(Gn)>1)&&z(Math.abs(ii)>Math.abs(Gn)?"x":"y");let pn={x:0,y:0};W==="y"?(Kr.includes("top")||Kr.includes("bottom"))&&(Kr.includes("top")&&Gn<0||Kr.includes("bottom")&&Gn>0)&&(pn.y=Gn):W==="x"&&(Kr.includes("left")||Kr.includes("right"))&&(Kr.includes("left")&&ii<0||Kr.includes("right")&&ii>0)&&(pn.x=ii),(Math.abs(pn.x)>0||Math.abs(pn.y)>0)&&Ce(!0),(an=Be.current)==null||an.style.setProperty("--swipe-amount-x",`${pn.x}px`),(Je=Be.current)==null||Je.style.setProperty("--swipe-amount-y",`${pn.y}px`)}},nt&&!h.jsx?K.createElement("button",{"aria-label":ue,"data-disabled":Mt,"data-close-button":!0,onClick:Mt||!Lt?()=>{}:()=>{var gt;it(),(gt=h.onDismiss)==null||gt.call(h,h)},className:zo(X==null?void 0:X.closeButton,(i=h==null?void 0:h.classNames)==null?void 0:i.closeButton)},(a=oe==null?void 0:oe.close)!=null?a:Mie):null,h.jsx||P.isValidElement(h.title)?h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title:K.createElement(K.Fragment,null,ut||h.icon||h.promise?K.createElement("div",{"data-icon":"",className:zo(X==null?void 0:X.icon,(o=h==null?void 0:h.classNames)==null?void 0:o.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||cr():null,h.type!=="loading"?h.icon||(oe==null?void 0:oe[ut])||Eie(ut):null):null,K.createElement("div",{"data-content":"",className:zo(X==null?void 0:X.content,(s=h==null?void 0:h.classNames)==null?void 0:s.content)},K.createElement("div",{"data-title":"",className:zo(X==null?void 0:X.title,(l=h==null?void 0:h.classNames)==null?void 0:l.title)},typeof h.title=="function"?h.title():h.title),h.description?K.createElement("div",{"data-description":"",className:zo(D,Ze,X==null?void 0:X.description,(c=h==null?void 0:h.classNames)==null?void 0:c.description)},typeof h.description=="function"?h.description():h.description):null),P.isValidElement(h.cancel)?h.cancel:h.cancel&&Ab(h.cancel)?K.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||$,onClick:gt=>{var Et,rr;Ab(h.cancel)&&Lt&&((rr=(Et=h.cancel).onClick)==null||rr.call(Et,gt),it())},className:zo(X==null?void 0:X.cancelButton,(u=h==null?void 0:h.classNames)==null?void 0:u.cancelButton)},h.cancel.label):null,P.isValidElement(h.action)?h.action:h.action&&Ab(h.action)?K.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||N,onClick:gt=>{var Et,rr;Ab(h.action)&&((rr=(Et=h.action).onClick)==null||rr.call(Et,gt),!gt.defaultPrevented&&it())},className:zo(X==null?void 0:X.actionButton,(f=h==null?void 0:h.classNames)==null?void 0:f.actionButton)},h.action.label):null))};function yL(){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 eae(e,t){let r={};return[e,t].forEach((n,i)=>{let a=i===1,o=a?"--mobile-offset":"--offset",s=a?Gie:Wie;function l(c){["top","right","bottom","left"].forEach(u=>{r[`${o}-${u}`]=typeof c=="number"?`${c}px`:c})}typeof n=="number"||typeof n=="string"?l(n):typeof n=="object"?["top","right","bottom","left"].forEach(c=>{n[c]===void 0?r[`${o}-${c}`]=s:r[`${o}-${c}`]=typeof n[c]=="number"?`${n[c]}px`:n[c]}):l(s)}),r}var tae=P.forwardRef(function(e,t){let{invert:r,position:n="bottom-right",hotkey:i=["altKey","KeyT"],expand:a,closeButton:o,className:s,offset:l,mobileOffset:c,theme:u="light",richColors:f,duration:p,style:h,visibleToasts:g=qie,toastOptions:m,dir:v=yL(),gap:y=Yie,loadingIcon:b,icons:x,containerAriaLabel:S="Notifications",pauseWhenPageIsHidden:_}=e,[k,E]=K.useState([]),O=K.useMemo(()=>Array.from(new Set([n].concat(k.filter(M=>M.position).map(M=>M.position)))),[k,n]),[R,$]=K.useState([]),[N,C]=K.useState(!1),[D,I]=K.useState(!1),[G,Y]=K.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Z=K.useRef(null),U=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),X=K.useRef(null),oe=K.useRef(!1),ue=K.useCallback(M=>{E(W=>{var z;return(z=W.find(ie=>ie.id===M.id))!=null&&z.delete||oa.dismiss(M.id),W.filter(({id:ie})=>ie!==M.id)})},[]);return K.useEffect(()=>oa.subscribe(M=>{if(M.dismiss){E(W=>W.map(z=>z.id===M.id?{...z,delete:!0}:z));return}setTimeout(()=>{aU.flushSync(()=>{E(W=>{let z=W.findIndex(ie=>ie.id===M.id);return z!==-1?[...W.slice(0,z),{...W[z],...M},...W.slice(z+1)]:[M,...W]})})})}),[]),K.useEffect(()=>{if(u!=="system"){Y(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Y("dark"):Y("light")),typeof window>"u")return;let M=window.matchMedia("(prefers-color-scheme: dark)");try{M.addEventListener("change",({matches:W})=>{Y(W?"dark":"light")})}catch{M.addListener(({matches:z})=>{try{Y(z?"dark":"light")}catch(ie){console.error(ie)}})}},[u]),K.useEffect(()=>{k.length<=1&&C(!1)},[k]),K.useEffect(()=>{let M=W=>{var z,ie;i.every(le=>W[le]||W.code===le)&&(C(!0),(z=Z.current)==null||z.focus()),W.code==="Escape"&&(document.activeElement===Z.current||(ie=Z.current)!=null&&ie.contains(document.activeElement))&&C(!1)};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[i]),K.useEffect(()=>{if(Z.current)return()=>{X.current&&(X.current.focus({preventScroll:!0}),X.current=null,oe.current=!1)}},[Z.current]),K.createElement("section",{ref:t,"aria-label":`${S} ${U}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},O.map((M,W)=>{var z;let[ie,le]=M.split("-");return k.length?K.createElement("ol",{key:M,dir:v==="auto"?yL():v,tabIndex:-1,ref:Z,className:s,"data-sonner-toaster":!0,"data-theme":G,"data-y-position":ie,"data-lifted":N&&k.length>1&&!a,"data-x-position":le,style:{"--front-toast-height":`${((z=R[0])==null?void 0:z.height)||0}px`,"--width":`${Kie}px`,"--gap":`${y}px`,...h,...eae(l,c)},onBlur:V=>{oe.current&&!V.currentTarget.contains(V.relatedTarget)&&(oe.current=!1,X.current&&(X.current.focus({preventScroll:!0}),X.current=null))},onFocus:V=>{V.target instanceof HTMLElement&&V.target.dataset.dismissible==="false"||oe.current||(oe.current=!0,X.current=V.relatedTarget)},onMouseEnter:()=>C(!0),onMouseMove:()=>C(!0),onMouseLeave:()=>{D||C(!1)},onDragEnd:()=>C(!1),onPointerDown:V=>{V.target instanceof HTMLElement&&V.target.dataset.dismissible==="false"||I(!0)},onPointerUp:()=>I(!1)},k.filter(V=>!V.position&&W===0||V.position===M).map((V,se)=>{var ae,de;return K.createElement(Qie,{key:V.id,icons:x,index:se,toast:V,defaultRichColors:f,duration:(ae=m==null?void 0:m.duration)!=null?ae:p,className:m==null?void 0:m.className,descriptionClassName:m==null?void 0:m.descriptionClassName,invert:r,visibleToasts:g,closeButton:(de=m==null?void 0:m.closeButton)!=null?de:o,interacting:D,position:M,style:m==null?void 0:m.style,unstyled:m==null?void 0:m.unstyled,classNames:m==null?void 0:m.classNames,cancelButtonStyle:m==null?void 0:m.cancelButtonStyle,actionButtonStyle:m==null?void 0:m.actionButtonStyle,removeToast:ue,toasts:k.filter(ve=>ve.position==V.position),heights:R.filter(ve=>ve.position==V.position),setHeights:$,expandByDefault:a,gap:y,loadingIcon:b,expanded:N,pauseWhenPageIsHidden:_,swipeDirections:e.swipeDirections})})):null}))});const rae=({...e})=>{const{theme:t="system"}=Nie();return d.jsx(tae,{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 nae=vC[" useId ".trim().toString()]||(()=>{}),iae=0;function _o(e){const[t,r]=P.useState(nae());return ti(()=>{r(n=>n??String(iae++))},[e]),t?`radix-${t}`:""}const aae=["top","right","bottom","left"],Du=Math.min,La=Math.max,bw=Math.round,Pb=Math.floor,Ys=e=>({x:e,y:e}),oae={left:"right",right:"left",bottom:"top",top:"bottom"},sae={start:"end",end:"start"};function tj(e,t,r){return La(e,Du(t,r))}function cc(e,t){return typeof e=="function"?e(t):e}function uc(e){return e.split("-")[0]}function Fm(e){return e.split("-")[1]}function g3(e){return e==="x"?"y":"x"}function v3(e){return e==="y"?"height":"width"}const lae=new Set(["top","bottom"]);function zs(e){return lae.has(uc(e))?"y":"x"}function y3(e){return g3(zs(e))}function cae(e,t,r){r===void 0&&(r=!1);const n=Fm(e),i=y3(e),a=v3(i);let o=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=xw(o)),[o,xw(o)]}function uae(e){const t=xw(e);return[rj(e),t,rj(t)]}function rj(e){return e.replace(/start|end/g,t=>sae[t])}const bL=["left","right"],xL=["right","left"],dae=["top","bottom"],fae=["bottom","top"];function hae(e,t,r){switch(e){case"top":case"bottom":return r?t?xL:bL:t?bL:xL;case"left":case"right":return t?dae:fae;default:return[]}}function pae(e,t,r,n){const i=Fm(e);let a=hae(uc(e),r==="start",n);return i&&(a=a.map(o=>o+"-"+i),t&&(a=a.concat(a.map(rj)))),a}function xw(e){return e.replace(/left|right|bottom|top/g,t=>oae[t])}function mae(e){return{top:0,right:0,bottom:0,left:0,...e}}function YU(e){return typeof e!="number"?mae(e):{top:e,right:e,bottom:e,left:e}}function ww(e){const{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function wL(e,t,r){let{reference:n,floating:i}=e;const a=zs(t),o=y3(t),s=v3(o),l=uc(t),c=a==="y",u=n.x+n.width/2-i.width/2,f=n.y+n.height/2-i.height/2,p=n[s]/2-i[s]/2;let h;switch(l){case"top":h={x:u,y:n.y-i.height};break;case"bottom":h={x:u,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:f};break;case"left":h={x:n.x-i.width,y:f};break;default:h={x:n.x,y:n.y}}switch(Fm(t)){case"start":h[o]-=p*(r&&c?-1:1);break;case"end":h[o]+=p*(r&&c?-1:1);break}return h}const gae=async(e,t,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:a=[],platform:o}=r,s=a.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let c=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:f}=wL(c,n,l),p=n,h={},g=0;for(let m=0;m({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:i,rects:a,platform:o,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=cc(e,t)||{};if(c==null)return{};const f=YU(u),p={x:r,y:n},h=y3(i),g=v3(h),m=await o.getDimensions(c),v=h==="y",y=v?"top":"left",b=v?"bottom":"right",x=v?"clientHeight":"clientWidth",S=a.reference[g]+a.reference[h]-p[h]-a.floating[g],_=p[h]-a.reference[h],k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let E=k?k[x]:0;(!E||!await(o.isElement==null?void 0:o.isElement(k)))&&(E=s.floating[x]||a.floating[g]);const O=S/2-_/2,R=E/2-m[g]/2-1,$=Du(f[y],R),N=Du(f[b],R),C=$,D=E-m[g]-N,I=E/2-m[g]/2+O,G=tj(C,I,D),Y=!l.arrow&&Fm(i)!=null&&I!==G&&a.reference[g]/2-(II<=0)){var N,C;const I=(((N=a.flip)==null?void 0:N.index)||0)+1,G=E[I];if(G&&(!(f==="alignment"?b!==zs(G):!1)||$.every(U=>U.overflows[0]>0&&zs(U.placement)===b)))return{data:{index:I,overflows:$},reset:{placement:G}};let Y=(C=$.filter(Z=>Z.overflows[0]<=0).sort((Z,U)=>Z.overflows[1]-U.overflows[1])[0])==null?void 0:C.placement;if(!Y)switch(h){case"bestFit":{var D;const Z=(D=$.filter(U=>{if(k){const X=zs(U.placement);return X===b||X==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(X=>X>0).reduce((X,oe)=>X+oe,0)]).sort((U,X)=>U[1]-X[1])[0])==null?void 0:D[0];Z&&(Y=Z);break}case"initialPlacement":Y=s;break}if(i!==Y)return{reset:{placement:Y}}}return{}}}};function _L(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function SL(e){return aae.some(t=>e[t]>=0)}const bae=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...i}=cc(e,t);switch(n){case"referenceHidden":{const a=await Py(t,{...i,elementContext:"reference"}),o=_L(a,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:SL(o)}}}case"escaped":{const a=await Py(t,{...i,altBoundary:!0}),o=_L(a,r.floating);return{data:{escapedOffsets:o,escaped:SL(o)}}}default:return{}}}}},XU=new Set(["left","top"]);async function xae(e,t){const{placement:r,platform:n,elements:i}=e,a=await(n.isRTL==null?void 0:n.isRTL(i.floating)),o=uc(r),s=Fm(r),l=zs(r)==="y",c=XU.has(o)?-1:1,u=a&&l?-1:1,f=cc(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return s&&typeof g=="number"&&(h=s==="end"?g*-1:g),l?{x:h*u,y:p*c}:{x:p*c,y:h*u}}const wae=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:i,y:a,placement:o,middlewareData:s}=t,l=await xae(t,e);return o===((r=s.offset)==null?void 0:r.placement)&&(n=s.arrow)!=null&&n.alignmentOffset?{}:{x:i+l.x,y:a+l.y,data:{...l,placement:o}}}}},_ae=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:v=>{let{x:y,y:b}=v;return{x:y,y:b}}},...l}=cc(e,t),c={x:r,y:n},u=await Py(t,l),f=zs(uc(i)),p=g3(f);let h=c[p],g=c[f];if(a){const v=p==="y"?"top":"left",y=p==="y"?"bottom":"right",b=h+u[v],x=h-u[y];h=tj(b,h,x)}if(o){const v=f==="y"?"top":"left",y=f==="y"?"bottom":"right",b=g+u[v],x=g-u[y];g=tj(b,g,x)}const m=s.fn({...t,[p]:h,[f]:g});return{...m,data:{x:m.x-r,y:m.y-n,enabled:{[p]:a,[f]:o}}}}}},Sae=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=cc(e,t),u={x:r,y:n},f=zs(i),p=g3(f);let h=u[p],g=u[f];const m=cc(s,t),v=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const x=p==="y"?"height":"width",S=a.reference[p]-a.floating[x]+v.mainAxis,_=a.reference[p]+a.reference[x]-v.mainAxis;h_&&(h=_)}if(c){var y,b;const x=p==="y"?"width":"height",S=XU.has(uc(i)),_=a.reference[f]-a.floating[x]+(S&&((y=o.offset)==null?void 0:y[f])||0)+(S?0:v.crossAxis),k=a.reference[f]+a.reference[x]+(S?0:((b=o.offset)==null?void 0:b[f])||0)-(S?v.crossAxis:0);g<_?g=_:g>k&&(g=k)}return{[p]:h,[f]:g}}}},Aae=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:i,rects:a,platform:o,elements:s}=t,{apply:l=()=>{},...c}=cc(e,t),u=await Py(t,c),f=uc(i),p=Fm(i),h=zs(i)==="y",{width:g,height:m}=a.floating;let v,y;f==="top"||f==="bottom"?(v=f,y=p===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(y=f,v=p==="end"?"top":"bottom");const b=m-u.top-u.bottom,x=g-u.left-u.right,S=Du(m-u[v],b),_=Du(g-u[y],x),k=!t.middlewareData.shift;let E=S,O=_;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(O=x),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(E=b),k&&!p){const $=La(u.left,0),N=La(u.right,0),C=La(u.top,0),D=La(u.bottom,0);h?O=g-2*($!==0||N!==0?$+N:La(u.left,u.right)):E=m-2*(C!==0||D!==0?C+D:La(u.top,u.bottom))}await l({...t,availableWidth:O,availableHeight:E});const R=await o.getDimensions(s.floating);return g!==R.width||m!==R.height?{reset:{rects:!0}}:{}}}};function y5(){return typeof window<"u"}function Bm(e){return JU(e)?(e.nodeName||"").toLowerCase():"#document"}function qa(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function sl(e){var t;return(t=(JU(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function JU(e){return y5()?e instanceof Node||e instanceof qa(e).Node:!1}function fs(e){return y5()?e instanceof Element||e instanceof qa(e).Element:!1}function rl(e){return y5()?e instanceof HTMLElement||e instanceof qa(e).HTMLElement:!1}function AL(e){return!y5()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof qa(e).ShadowRoot}const Pae=new Set(["inline","contents"]);function X0(e){const{overflow:t,overflowX:r,overflowY:n,display:i}=hs(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Pae.has(i)}const kae=new Set(["table","td","th"]);function jae(e){return kae.has(Bm(e))}const Nae=[":popover-open",":modal"];function b5(e){return Nae.some(t=>{try{return e.matches(t)}catch{return!1}})}const Eae=["transform","translate","scale","rotate","perspective"],Cae=["transform","translate","scale","rotate","perspective","filter"],Tae=["paint","layout","strict","content"];function b3(e){const t=x3(),r=fs(e)?hs(e):e;return Eae.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||Cae.some(n=>(r.willChange||"").includes(n))||Tae.some(n=>(r.contain||"").includes(n))}function Oae(e){let t=Fu(e);for(;rl(t)&&!Jp(t);){if(b3(t))return t;if(b5(t))return null;t=Fu(t)}return null}function x3(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Rae=new Set(["html","body","#document"]);function Jp(e){return Rae.has(Bm(e))}function hs(e){return qa(e).getComputedStyle(e)}function x5(e){return fs(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Fu(e){if(Bm(e)==="html")return e;const t=e.assignedSlot||e.parentNode||AL(e)&&e.host||sl(e);return AL(t)?t.host:t}function ZU(e){const t=Fu(e);return Jp(t)?e.ownerDocument?e.ownerDocument.body:e.body:rl(t)&&X0(t)?t:ZU(t)}function ky(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const i=ZU(e),a=i===((n=e.ownerDocument)==null?void 0:n.body),o=qa(i);if(a){const s=nj(o);return t.concat(o,o.visualViewport||[],X0(i)?i:[],s&&r?ky(s):[])}return t.concat(i,ky(i,[],r))}function nj(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function QU(e){const t=hs(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const i=rl(e),a=i?e.offsetWidth:r,o=i?e.offsetHeight:n,s=bw(r)!==a||bw(n)!==o;return s&&(r=a,n=o),{width:r,height:n,$:s}}function w3(e){return fs(e)?e:e.contextElement}function dp(e){const t=w3(e);if(!rl(t))return Ys(1);const r=t.getBoundingClientRect(),{width:n,height:i,$:a}=QU(t);let o=(a?bw(r.width):r.width)/n,s=(a?bw(r.height):r.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const Lae=Ys(0);function ez(e){const t=qa(e);return!x3()||!t.visualViewport?Lae:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Iae(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==qa(e)?!1:t}function wf(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const i=e.getBoundingClientRect(),a=w3(e);let o=Ys(1);t&&(n?fs(n)&&(o=dp(n)):o=dp(e));const s=Iae(a,r,n)?ez(a):Ys(0);let l=(i.left+s.x)/o.x,c=(i.top+s.y)/o.y,u=i.width/o.x,f=i.height/o.y;if(a){const p=qa(a),h=n&&fs(n)?qa(n):n;let g=p,m=nj(g);for(;m&&n&&h!==g;){const v=dp(m),y=m.getBoundingClientRect(),b=hs(m),x=y.left+(m.clientLeft+parseFloat(b.paddingLeft))*v.x,S=y.top+(m.clientTop+parseFloat(b.paddingTop))*v.y;l*=v.x,c*=v.y,u*=v.x,f*=v.y,l+=x,c+=S,g=qa(m),m=nj(g)}}return ww({width:u,height:f,x:l,y:c})}function _3(e,t){const r=x5(e).scrollLeft;return t?t.left+r:wf(sl(e)).left+r}function tz(e,t,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-(r?0:_3(e,n)),a=n.top+t.scrollTop;return{x:i,y:a}}function Mae(e){let{elements:t,rect:r,offsetParent:n,strategy:i}=e;const a=i==="fixed",o=sl(n),s=t?b5(t.floating):!1;if(n===o||s&&a)return r;let l={scrollLeft:0,scrollTop:0},c=Ys(1);const u=Ys(0),f=rl(n);if((f||!f&&!a)&&((Bm(n)!=="body"||X0(o))&&(l=x5(n)),rl(n))){const h=wf(n);c=dp(n),u.x=h.x+n.clientLeft,u.y=h.y+n.clientTop}const p=o&&!f&&!a?tz(o,l,!0):Ys(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+u.x+p.x,y:r.y*c.y-l.scrollTop*c.y+u.y+p.y}}function $ae(e){return Array.from(e.getClientRects())}function Dae(e){const t=sl(e),r=x5(e),n=e.ownerDocument.body,i=La(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=La(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+_3(e);const s=-r.scrollTop;return hs(n).direction==="rtl"&&(o+=La(t.clientWidth,n.clientWidth)-i),{width:i,height:a,x:o,y:s}}function Fae(e,t){const r=qa(e),n=sl(e),i=r.visualViewport;let a=n.clientWidth,o=n.clientHeight,s=0,l=0;if(i){a=i.width,o=i.height;const c=x3();(!c||c&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:a,height:o,x:s,y:l}}const Bae=new Set(["absolute","fixed"]);function Uae(e,t){const r=wf(e,!0,t==="fixed"),n=r.top+e.clientTop,i=r.left+e.clientLeft,a=rl(e)?dp(e):Ys(1),o=e.clientWidth*a.x,s=e.clientHeight*a.y,l=i*a.x,c=n*a.y;return{width:o,height:s,x:l,y:c}}function PL(e,t,r){let n;if(t==="viewport")n=Fae(e,r);else if(t==="document")n=Dae(sl(e));else if(fs(t))n=Uae(t,r);else{const i=ez(e);n={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return ww(n)}function rz(e,t){const r=Fu(e);return r===t||!fs(r)||Jp(r)?!1:hs(r).position==="fixed"||rz(r,t)}function zae(e,t){const r=t.get(e);if(r)return r;let n=ky(e,[],!1).filter(s=>fs(s)&&Bm(s)!=="body"),i=null;const a=hs(e).position==="fixed";let o=a?Fu(e):e;for(;fs(o)&&!Jp(o);){const s=hs(o),l=b3(o);!l&&s.position==="fixed"&&(i=null),(a?!l&&!i:!l&&s.position==="static"&&!!i&&Bae.has(i.position)||X0(o)&&!l&&rz(e,o))?n=n.filter(u=>u!==o):i=s,o=Fu(o)}return t.set(e,n),n}function Hae(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e;const o=[...r==="clippingAncestors"?b5(t)?[]:zae(t,this._c):[].concat(r),n],s=o[0],l=o.reduce((c,u)=>{const f=PL(t,u,i);return c.top=La(f.top,c.top),c.right=Du(f.right,c.right),c.bottom=Du(f.bottom,c.bottom),c.left=La(f.left,c.left),c},PL(t,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Vae(e){const{width:t,height:r}=QU(e);return{width:t,height:r}}function qae(e,t,r){const n=rl(t),i=sl(t),a=r==="fixed",o=wf(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=Ys(0);function c(){l.x=_3(i)}if(n||!n&&!a)if((Bm(t)!=="body"||X0(i))&&(s=x5(t)),n){const h=wf(t,!0,a,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else i&&c();a&&!n&&i&&c();const u=i&&!n&&!a?tz(i,s):Ys(0),f=o.left+s.scrollLeft-l.x-u.x,p=o.top+s.scrollTop-l.y-u.y;return{x:f,y:p,width:o.width,height:o.height}}function nA(e){return hs(e).position==="static"}function kL(e,t){if(!rl(e)||hs(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return sl(e)===r&&(r=r.ownerDocument.body),r}function nz(e,t){const r=qa(e);if(b5(e))return r;if(!rl(e)){let i=Fu(e);for(;i&&!Jp(i);){if(fs(i)&&!nA(i))return i;i=Fu(i)}return r}let n=kL(e,t);for(;n&&jae(n)&&nA(n);)n=kL(n,t);return n&&Jp(n)&&nA(n)&&!b3(n)?r:n||Oae(e)||r}const Wae=async function(e){const t=this.getOffsetParent||nz,r=this.getDimensions,n=await r(e.floating);return{reference:qae(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Gae(e){return hs(e).direction==="rtl"}const Kae={convertOffsetParentRelativeRectToViewportRelativeRect:Mae,getDocumentElement:sl,getClippingRect:Hae,getOffsetParent:nz,getElementRects:Wae,getClientRects:$ae,getDimensions:Vae,getScale:dp,isElement:fs,isRTL:Gae};function iz(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Yae(e,t){let r=null,n;const i=sl(e);function a(){var s;clearTimeout(n),(s=r)==null||s.disconnect(),r=null}function o(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),a();const c=e.getBoundingClientRect(),{left:u,top:f,width:p,height:h}=c;if(s||t(),!p||!h)return;const g=Pb(f),m=Pb(i.clientWidth-(u+p)),v=Pb(i.clientHeight-(f+h)),y=Pb(u),x={rootMargin:-g+"px "+-m+"px "+-v+"px "+-y+"px",threshold:La(0,Du(1,l))||1};let S=!0;function _(k){const E=k[0].intersectionRatio;if(E!==l){if(!S)return o();E?o(!1,E):n=setTimeout(()=>{o(!1,1e-7)},1e3)}E===1&&!iz(c,e.getBoundingClientRect())&&o(),S=!1}try{r=new IntersectionObserver(_,{...x,root:i.ownerDocument})}catch{r=new IntersectionObserver(_,x)}r.observe(e)}return o(!0),a}function Xae(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,c=w3(e),u=i||a?[...c?ky(c):[],...ky(t)]:[];u.forEach(y=>{i&&y.addEventListener("scroll",r,{passive:!0}),a&&y.addEventListener("resize",r)});const f=c&&s?Yae(c,r):null;let p=-1,h=null;o&&(h=new ResizeObserver(y=>{let[b]=y;b&&b.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(t)})),r()}),c&&!l&&h.observe(c),h.observe(t));let g,m=l?wf(e):null;l&&v();function v(){const y=wf(e);m&&!iz(m,y)&&r(),m=y,g=requestAnimationFrame(v)}return r(),()=>{var y;u.forEach(b=>{i&&b.removeEventListener("scroll",r),a&&b.removeEventListener("resize",r)}),f==null||f(),(y=h)==null||y.disconnect(),h=null,l&&cancelAnimationFrame(g)}}const Jae=wae,Zae=_ae,Qae=yae,eoe=Aae,toe=bae,jL=vae,roe=Sae,noe=(e,t,r)=>{const n=new Map,i={platform:Kae,...r},a={...i.platform,_c:n};return gae(e,t,{...i,platform:a})};var ioe=typeof document<"u",aoe=function(){},Cx=ioe?P.useLayoutEffect:aoe;function _w(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!_w(e[n],t[n]))return!1;return!0}if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,i[n]))return!1;for(n=r;n--!==0;){const a=i[n];if(!(a==="_owner"&&e.$$typeof)&&!_w(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function az(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function NL(e,t){const r=az(e);return Math.round(t*r)/r}function iA(e){const t=P.useRef(e);return Cx(()=>{t.current=e}),t}function ooe(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:l,open:c}=e,[u,f]=P.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=P.useState(n);_w(p,n)||h(n);const[g,m]=P.useState(null),[v,y]=P.useState(null),b=P.useCallback(U=>{U!==k.current&&(k.current=U,m(U))},[]),x=P.useCallback(U=>{U!==E.current&&(E.current=U,y(U))},[]),S=a||g,_=o||v,k=P.useRef(null),E=P.useRef(null),O=P.useRef(u),R=l!=null,$=iA(l),N=iA(i),C=iA(c),D=P.useCallback(()=>{if(!k.current||!E.current)return;const U={placement:t,strategy:r,middleware:p};N.current&&(U.platform=N.current),noe(k.current,E.current,U).then(X=>{const oe={...X,isPositioned:C.current!==!1};I.current&&!_w(O.current,oe)&&(O.current=oe,$f.flushSync(()=>{f(oe)}))})},[p,t,r,N,C]);Cx(()=>{c===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,f(U=>({...U,isPositioned:!1})))},[c]);const I=P.useRef(!1);Cx(()=>(I.current=!0,()=>{I.current=!1}),[]),Cx(()=>{if(S&&(k.current=S),_&&(E.current=_),S&&_){if($.current)return $.current(S,_,D);D()}},[S,_,D,$,R]);const G=P.useMemo(()=>({reference:k,floating:E,setReference:b,setFloating:x}),[b,x]),Y=P.useMemo(()=>({reference:S,floating:_}),[S,_]),Z=P.useMemo(()=>{const U={position:r,left:0,top:0};if(!Y.floating)return U;const X=NL(Y.floating,u.x),oe=NL(Y.floating,u.y);return s?{...U,transform:"translate("+X+"px, "+oe+"px)",...az(Y.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:X,top:oe}},[r,s,Y.floating,u.x,u.y]);return P.useMemo(()=>({...u,update:D,refs:G,elements:Y,floatingStyles:Z}),[u,D,G,Y,Z])}const soe=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:i}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?jL({element:n.current,padding:i}).fn(r):{}:n?jL({element:n,padding:i}).fn(r):{}}}},loe=(e,t)=>({...Jae(e),options:[e,t]}),coe=(e,t)=>({...Zae(e),options:[e,t]}),uoe=(e,t)=>({...roe(e),options:[e,t]}),doe=(e,t)=>({...Qae(e),options:[e,t]}),foe=(e,t)=>({...eoe(e),options:[e,t]}),hoe=(e,t)=>({...toe(e),options:[e,t]}),poe=(e,t)=>({...soe(e),options:[e,t]});var moe="Arrow",oz=P.forwardRef((e,t)=>{const{children:r,width:n=10,height:i=5,...a}=e;return d.jsx(ft.svg,{...a,ref:t,width:n,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});oz.displayName=moe;var goe=oz;function S3(e){const[t,r]=P.useState(void 0);return ti(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const a=i[0];let o,s;if("borderBoxSize"in a){const l=a.borderBoxSize,c=Array.isArray(l)?l[0]:l;o=c.inlineSize,s=c.blockSize}else o=e.offsetWidth,s=e.offsetHeight;r({width:o,height:s})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var A3="Popper",[sz,Um]=Qa(A3),[voe,lz]=sz(A3),cz=e=>{const{__scopePopper:t,children:r}=e,[n,i]=P.useState(null);return d.jsx(voe,{scope:t,anchor:n,onAnchorChange:i,children:r})};cz.displayName=A3;var uz="PopperAnchor",dz=P.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...i}=e,a=lz(uz,r),o=P.useRef(null),s=qt(t,o);return P.useEffect(()=>{a.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:d.jsx(ft.div,{...i,ref:s})});dz.displayName=uz;var P3="PopperContent",[yoe,boe]=sz(P3),fz=P.forwardRef((e,t)=>{var V,se,ae,de,ve,fe;const{__scopePopper:r,side:n="bottom",sideOffset:i=0,align:a="center",alignOffset:o=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:g,...m}=e,v=lz(P3,r),[y,b]=P.useState(null),x=qt(t,je=>b(je)),[S,_]=P.useState(null),k=S3(S),E=(k==null?void 0:k.width)??0,O=(k==null?void 0:k.height)??0,R=n+(a!=="center"?"-"+a:""),$=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},N=Array.isArray(c)?c:[c],C=N.length>0,D={padding:$,boundary:N.filter(woe),altBoundary:C},{refs:I,floatingStyles:G,placement:Y,isPositioned:Z,middlewareData:U}=ooe({strategy:"fixed",placement:R,whileElementsMounted:(...je)=>Xae(...je,{animationFrame:h==="always"}),elements:{reference:v.anchor},middleware:[loe({mainAxis:i+O,alignmentAxis:o}),l&&coe({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?uoe():void 0,...D}),l&&doe({...D}),foe({...D,apply:({elements:je,rects:Te,availableWidth:Q,availableHeight:Ce})=>{const{width:Ke,height:Fe}=Te.reference,ke=je.floating.style;ke.setProperty("--radix-popper-available-width",`${Q}px`),ke.setProperty("--radix-popper-available-height",`${Ce}px`),ke.setProperty("--radix-popper-anchor-width",`${Ke}px`),ke.setProperty("--radix-popper-anchor-height",`${Fe}px`)}}),S&&poe({element:S,padding:s}),_oe({arrowWidth:E,arrowHeight:O}),p&&hoe({strategy:"referenceHidden",...D})]}),[X,oe]=mz(Y),ue=No(g);ti(()=>{Z&&(ue==null||ue())},[Z,ue]);const M=(V=U.arrow)==null?void 0:V.x,W=(se=U.arrow)==null?void 0:se.y,z=((ae=U.arrow)==null?void 0:ae.centerOffset)!==0,[ie,le]=P.useState();return ti(()=>{y&&le(window.getComputedStyle(y).zIndex)},[y]),d.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:Z?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ie,"--radix-popper-transform-origin":[(de=U.transformOrigin)==null?void 0:de.x,(ve=U.transformOrigin)==null?void 0:ve.y].join(" "),...((fe=U.hide)==null?void 0:fe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:d.jsx(yoe,{scope:r,placedSide:X,onArrowChange:_,arrowX:M,arrowY:W,shouldHideArrow:z,children:d.jsx(ft.div,{"data-side":X,"data-align":oe,...m,ref:x,style:{...m.style,animation:Z?void 0:"none"}})})})});fz.displayName=P3;var hz="PopperArrow",xoe={top:"bottom",right:"left",bottom:"top",left:"right"},pz=P.forwardRef(function(t,r){const{__scopePopper:n,...i}=t,a=boe(hz,n),o=xoe[a.placedSide];return d.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:d.jsx(goe,{...i,ref:r,style:{...i.style,display:"block"}})})});pz.displayName=hz;function woe(e){return e!==null}var _oe=e=>({name:"transformOrigin",options:e,fn(t){var v,y,b;const{placement:r,rects:n,middlewareData:i}=t,o=((v=i.arrow)==null?void 0:v.centerOffset)!==0,s=o?0:e.arrowWidth,l=o?0:e.arrowHeight,[c,u]=mz(r),f={start:"0%",center:"50%",end:"100%"}[u],p=(((y=i.arrow)==null?void 0:y.x)??0)+s/2,h=(((b=i.arrow)==null?void 0:b.y)??0)+l/2;let g="",m="";return c==="bottom"?(g=o?f:`${p}px`,m=`${-l}px`):c==="top"?(g=o?f:`${p}px`,m=`${n.floating.height+l}px`):c==="right"?(g=`${-l}px`,m=o?f:`${h}px`):c==="left"&&(g=`${n.floating.width+l}px`,m=o?f:`${h}px`),{data:{x:g,y:m}}}});function mz(e){const[t,r="center"]=e.split("-");return[t,r]}var k3=cz,w5=dz,j3=fz,N3=pz,[_5,nqe]=Qa("Tooltip",[Um]),S5=Um(),gz="TooltipProvider",Soe=700,ij="tooltip.open",[Aoe,E3]=_5(gz),vz=e=>{const{__scopeTooltip:t,delayDuration:r=Soe,skipDelayDuration:n=300,disableHoverableContent:i=!1,children:a}=e,o=P.useRef(!0),s=P.useRef(!1),l=P.useRef(0);return P.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),d.jsx(Aoe,{scope:t,isOpenDelayedRef:o,delayDuration:r,onOpen:P.useCallback(()=>{window.clearTimeout(l.current),o.current=!1},[]),onClose:P.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>o.current=!0,n)},[n]),isPointerInTransitRef:s,onPointerInTransitChange:P.useCallback(c=>{s.current=c},[]),disableHoverableContent:i,children:a})};vz.displayName=gz;var jy="Tooltip",[Poe,A5]=_5(jy),yz=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,l=E3(jy,e.__scopeTooltip),c=S5(t),[u,f]=P.useState(null),p=_o(),h=P.useRef(0),g=o??l.disableHoverableContent,m=s??l.delayDuration,v=P.useRef(!1),[y,b]=Ga({prop:n,defaultProp:i??!1,onChange:E=>{E?(l.onOpen(),document.dispatchEvent(new CustomEvent(ij))):l.onClose(),a==null||a(E)},caller:jy}),x=P.useMemo(()=>y?v.current?"delayed-open":"instant-open":"closed",[y]),S=P.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,b(!0)},[b]),_=P.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b(!1)},[b]),k=P.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,b(!0),h.current=0},m)},[m,b]);return P.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),d.jsx(k3,{...c,children:d.jsx(Poe,{scope:t,contentId:p,open:y,stateAttribute:x,trigger:u,onTriggerChange:f,onTriggerEnter:P.useCallback(()=>{l.isOpenDelayedRef.current?k():S()},[l.isOpenDelayedRef,k,S]),onTriggerLeave:P.useCallback(()=>{g?_():(window.clearTimeout(h.current),h.current=0)},[_,g]),onOpen:S,onClose:_,disableHoverableContent:g,children:r})})};yz.displayName=jy;var aj="TooltipTrigger",bz=P.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,i=A5(aj,r),a=E3(aj,r),o=S5(r),s=P.useRef(null),l=qt(t,s,i.onTriggerChange),c=P.useRef(!1),u=P.useRef(!1),f=P.useCallback(()=>c.current=!1,[]);return P.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),d.jsx(w5,{asChild:!0,...o,children:d.jsx(ft.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...n,ref:l,onPointerMove:qe(e.onPointerMove,p=>{p.pointerType!=="touch"&&!u.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:qe(e.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:qe(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:qe(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:qe(e.onBlur,i.onClose),onClick:qe(e.onClick,i.onClose)})})});bz.displayName=aj;var koe="TooltipPortal",[iqe,joe]=_5(koe,{forceMount:void 0}),Zp="TooltipContent",xz=P.forwardRef((e,t)=>{const r=joe(Zp,e.__scopeTooltip),{forceMount:n=r.forceMount,side:i="top",...a}=e,o=A5(Zp,e.__scopeTooltip);return d.jsx(ms,{present:n||o.open,children:o.disableHoverableContent?d.jsx(wz,{side:i,...a,ref:t}):d.jsx(Noe,{side:i,...a,ref:t})})}),Noe=P.forwardRef((e,t)=>{const r=A5(Zp,e.__scopeTooltip),n=E3(Zp,e.__scopeTooltip),i=P.useRef(null),a=qt(t,i),[o,s]=P.useState(null),{trigger:l,onClose:c}=r,u=i.current,{onPointerInTransitChange:f}=n,p=P.useCallback(()=>{s(null),f(!1)},[f]),h=P.useCallback((g,m)=>{const v=g.currentTarget,y={x:g.clientX,y:g.clientY},b=Roe(y,v.getBoundingClientRect()),x=Loe(y,b),S=Ioe(m.getBoundingClientRect()),_=$oe([...x,...S]);s(_),f(!0)},[f]);return P.useEffect(()=>()=>p(),[p]),P.useEffect(()=>{if(l&&u){const g=v=>h(v,u),m=v=>h(v,l);return l.addEventListener("pointerleave",g),u.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",g),u.removeEventListener("pointerleave",m)}}},[l,u,h,p]),P.useEffect(()=>{if(o){const g=m=>{const v=m.target,y={x:m.clientX,y:m.clientY},b=(l==null?void 0:l.contains(v))||(u==null?void 0:u.contains(v)),x=!Moe(y,o);b?p():x&&(p(),c())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[l,u,o,c,p]),d.jsx(wz,{...e,ref:a})}),[Eoe,Coe]=_5(jy,{isInside:!1}),Toe=Tre("TooltipContent"),wz=P.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,l=A5(Zp,r),c=S5(r),{onClose:u}=l;return P.useEffect(()=>(document.addEventListener(ij,u),()=>document.removeEventListener(ij,u)),[u]),P.useEffect(()=>{if(l.trigger){const f=p=>{const h=p.target;h!=null&&h.contains(l.trigger)&&u()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,u]),d.jsx($m,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:f=>f.preventDefault(),onDismiss:u,children:d.jsxs(j3,{"data-state":l.stateAttribute,...c,...s,ref:t,style:{...s.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:[d.jsx(Toe,{children:n}),d.jsx(Eoe,{scope:r,isInside:!0,children:d.jsx(Qre,{id:l.contentId,role:"tooltip",children:i||n})})]})})});xz.displayName=Zp;var _z="TooltipArrow",Ooe=P.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,i=S5(r);return Coe(_z,r).isInside?null:d.jsx(N3,{...i,...n,ref:t})});Ooe.displayName=_z;function Roe(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(r,n,i,a)){case a:return"left";case i:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function Loe(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function Ioe(e){const{top:t,right:r,bottom:n,left:i}=e;return[{x:i,y:t},{x:r,y:t},{x:r,y:n},{x:i,y:n}]}function Moe(e,t){const{x:r,y:n}=e;let i=!1;for(let a=0,o=t.length-1;an!=p>n&&r<(f-c)*(n-u)/(p-u)+c&&(i=!i)}return i}function $oe(e){const t=e.slice();return t.sort((r,n)=>r.xn.x?1:r.yn.y?1:0),Doe(t)}function Doe(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n=2;){const a=t[t.length-1],o=t[t.length-2];if((a.x-o.x)*(i.y-o.y)>=(a.y-o.y)*(i.x-o.x))t.pop();else break}t.push(i)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const i=e[n];for(;r.length>=2;){const a=r[r.length-1],o=r[r.length-2];if((a.x-o.x)*(i.y-o.y)>=(a.y-o.y)*(i.x-o.x))r.pop();else break}r.push(i)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var Foe=vz,Boe=yz,Uoe=bz,Sz=xz;const Az=Foe,zoe=Boe,Hoe=Uoe,Pz=P.forwardRef(({className:e,sideOffset:t=4,...r},n)=>d.jsx(Sz,{ref:n,sideOffset:t,className:lt("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));Pz.displayName=Sz.displayName;var J0=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(){}},_f=typeof window>"u"||"Deno"in globalThis;function sa(){}function Voe(e,t){return typeof e=="function"?e(t):e}function oj(e){return typeof e=="number"&&e>=0&&e!==1/0}function kz(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Eu(e,t){return typeof e=="function"?e(t):e}function ho(e,t){return typeof e=="function"?e(t):e}function EL(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(n){if(t.queryHash!==C3(o,t.options))return!1}else if(!Ey(t.queryKey,o))return!1}if(r!=="all"){const l=t.isActive();if(r==="active"&&!l||r==="inactive"&&l)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function CL(e,t){const{exact:r,status:n,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(Ny(t.options.mutationKey)!==Ny(a))return!1}else if(!Ey(t.options.mutationKey,a))return!1}return!(n&&t.state.status!==n||i&&!i(t))}function C3(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ny)(e)}function Ny(e){return JSON.stringify(e,(t,r)=>lj(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function Ey(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Ey(e[r],t[r])):!1}function jz(e,t){if(e===t)return e;const r=TL(e)&&TL(t);if(r||lj(e)&&lj(t)){const n=r?e:Object.keys(e),i=n.length,a=r?t:Object.keys(t),o=a.length,s=r?[]:{},l=new Set(n);let c=0;for(let u=0;u{setTimeout(t,e)})}function cj(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?jz(e,t):t}function Woe(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function Goe(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var T3=Symbol();function Nz(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===T3?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Koe(e,t){return typeof e=="function"?e(...t):!!e}var Zd,au,Np,DF,Yoe=(DF=class extends J0{constructor(){super();xt(this,Zd);xt(this,au);xt(this,Np);Ve(this,Np,t=>{if(!_f&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){pe(this,au)||this.setEventListener(pe(this,Np))}onUnsubscribe(){var t;this.hasListeners()||((t=pe(this,au))==null||t.call(this),Ve(this,au,void 0))}setEventListener(t){var r;Ve(this,Np,t),(r=pe(this,au))==null||r.call(this),Ve(this,au,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){pe(this,Zd)!==t&&(Ve(this,Zd,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof pe(this,Zd)=="boolean"?pe(this,Zd):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Zd=new WeakMap,au=new WeakMap,Np=new WeakMap,DF),O3=new Yoe,Ep,ou,Cp,FF,Xoe=(FF=class extends J0{constructor(){super();xt(this,Ep,!0);xt(this,ou);xt(this,Cp);Ve(this,Cp,t=>{if(!_f&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){pe(this,ou)||this.setEventListener(pe(this,Cp))}onUnsubscribe(){var t;this.hasListeners()||((t=pe(this,ou))==null||t.call(this),Ve(this,ou,void 0))}setEventListener(t){var r;Ve(this,Cp,t),(r=pe(this,ou))==null||r.call(this),Ve(this,ou,t(this.setOnline.bind(this)))}setOnline(t){pe(this,Ep)!==t&&(Ve(this,Ep,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return pe(this,Ep)}},Ep=new WeakMap,ou=new WeakMap,Cp=new WeakMap,FF),Sw=new Xoe;function uj(){let e,t;const r=new Promise((i,a)=>{e=i,t=a});r.status="pending",r.catch(()=>{});function n(i){Object.assign(r,i),delete r.resolve,delete r.reject}return r.resolve=i=>{n({status:"fulfilled",value:i}),e(i)},r.reject=i=>{n({status:"rejected",reason:i}),t(i)},r}function Joe(e){return Math.min(1e3*2**e,3e4)}function Ez(e){return(e??"online")==="online"?Sw.isOnline():!0}var Cz=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function aA(e){return e instanceof Cz}function Tz(e){let t=!1,r=0,n=!1,i;const a=uj(),o=m=>{var v;n||(p(new Cz(m)),(v=e.abort)==null||v.call(e))},s=()=>{t=!0},l=()=>{t=!1},c=()=>O3.isFocused()&&(e.networkMode==="always"||Sw.isOnline())&&e.canRun(),u=()=>Ez(e.networkMode)&&e.canRun(),f=m=>{var v;n||(n=!0,(v=e.onSuccess)==null||v.call(e,m),i==null||i(),a.resolve(m))},p=m=>{var v;n||(n=!0,(v=e.onError)==null||v.call(e,m),i==null||i(),a.reject(m))},h=()=>new Promise(m=>{var v;i=y=>{(n||c())&&m(y)},(v=e.onPause)==null||v.call(e)}).then(()=>{var m;i=void 0,n||(m=e.onContinue)==null||m.call(e)}),g=()=>{if(n)return;let m;const v=r===0?e.initialPromise:void 0;try{m=v??e.fn()}catch(y){m=Promise.reject(y)}Promise.resolve(m).then(f).catch(y=>{var k;if(n)return;const b=e.retry??(_f?0:3),x=e.retryDelay??Joe,S=typeof x=="function"?x(r,y):x,_=b===!0||typeof b=="number"&&rc()?void 0:h()).then(()=>{t?p(y):g()})})};return{promise:a,cancel:o,continue:()=>(i==null||i(),a),cancelRetry:s,continueRetry:l,canStart:u,start:()=>(u()?g():h().then(g),a)}}var Zoe=e=>setTimeout(e,0);function Qoe(){let e=[],t=0,r=s=>{s()},n=s=>{s()},i=Zoe;const a=s=>{t?e.push(s):i(()=>{r(s)})},o=()=>{const s=e;e=[],s.length&&i(()=>{n(()=>{s.forEach(l=>{r(l)})})})};return{batch:s=>{let l;t++;try{l=s()}finally{t--,t||o()}return l},batchCalls:s=>(...l)=>{a(()=>{s(...l)})},schedule:a,setNotifyFunction:s=>{r=s},setBatchNotifyFunction:s=>{n=s},setScheduler:s=>{i=s}}}var vi=Qoe(),Qd,BF,Oz=(BF=class{constructor(){xt(this,Qd)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),oj(this.gcTime)&&Ve(this,Qd,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(_f?1/0:5*60*1e3))}clearGcTimeout(){pe(this,Qd)&&(clearTimeout(pe(this,Qd)),Ve(this,Qd,void 0))}},Qd=new WeakMap,BF),Tp,ef,fo,tf,Ci,I0,rf,Jo,Cl,UF,ese=(UF=class extends Oz{constructor(t){super();xt(this,Jo);xt(this,Tp);xt(this,ef);xt(this,fo);xt(this,tf);xt(this,Ci);xt(this,I0);xt(this,rf);Ve(this,rf,!1),Ve(this,I0,t.defaultOptions),this.setOptions(t.options),this.observers=[],Ve(this,tf,t.client),Ve(this,fo,pe(this,tf).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ve(this,Tp,tse(this.options)),this.state=t.state??pe(this,Tp),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=pe(this,Ci))==null?void 0:t.promise}setOptions(t){this.options={...pe(this,I0),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&pe(this,fo).remove(this)}setData(t,r){const n=cj(this.state.data,t,this.options);return Jt(this,Jo,Cl).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){Jt(this,Jo,Cl).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,i;const r=(n=pe(this,Ci))==null?void 0:n.promise;return(i=pe(this,Ci))==null||i.cancel(t),r?r.then(sa).catch(sa):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(pe(this,Tp))}isActive(){return this.observers.some(t=>ho(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===T3||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Eu(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:!kz(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=pe(this,Ci))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=pe(this,Ci))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),pe(this,fo).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(pe(this,Ci)&&(pe(this,rf)?pe(this,Ci).cancel({revert:!0}):pe(this,Ci).cancelRetry()),this.scheduleGc()),pe(this,fo).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Jt(this,Jo,Cl).call(this,{type:"invalidate"})}fetch(t,r){var c,u,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(pe(this,Ci))return pe(this,Ci).continueRetry(),pe(this,Ci).promise}if(t&&this.setOptions(t),!this.options.queryFn){const p=this.observers.find(h=>h.options.queryFn);p&&this.setOptions(p.options)}const n=new AbortController,i=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(Ve(this,rf,!0),n.signal)})},a=()=>{const p=Nz(this.options,r),g=(()=>{const m={client:pe(this,tf),queryKey:this.queryKey,meta:this.meta};return i(m),m})();return Ve(this,rf,!1),this.options.persister?this.options.persister(p,g,this):p(g)},s=(()=>{const p={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:pe(this,tf),state:this.state,fetchFn:a};return i(p),p})();(c=this.options.behavior)==null||c.onFetch(s,this),Ve(this,ef,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=s.fetchOptions)==null?void 0:u.meta))&&Jt(this,Jo,Cl).call(this,{type:"fetch",meta:(f=s.fetchOptions)==null?void 0:f.meta});const l=p=>{var h,g,m,v;aA(p)&&p.silent||Jt(this,Jo,Cl).call(this,{type:"error",error:p}),aA(p)||((g=(h=pe(this,fo).config).onError)==null||g.call(h,p,this),(v=(m=pe(this,fo).config).onSettled)==null||v.call(m,this.state.data,p,this)),this.scheduleGc()};return Ve(this,Ci,Tz({initialPromise:r==null?void 0:r.initialPromise,fn:s.fetchFn,abort:n.abort.bind(n),onSuccess:p=>{var h,g,m,v;if(p===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(p)}catch(y){l(y);return}(g=(h=pe(this,fo).config).onSuccess)==null||g.call(h,p,this),(v=(m=pe(this,fo).config).onSettled)==null||v.call(m,p,this.state.error,this),this.scheduleGc()},onError:l,onFail:(p,h)=>{Jt(this,Jo,Cl).call(this,{type:"failed",failureCount:p,error:h})},onPause:()=>{Jt(this,Jo,Cl).call(this,{type:"pause"})},onContinue:()=>{Jt(this,Jo,Cl).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0})),pe(this,Ci).start()}},Tp=new WeakMap,ef=new WeakMap,fo=new WeakMap,tf=new WeakMap,Ci=new WeakMap,I0=new WeakMap,rf=new WeakMap,Jo=new WeakSet,Cl=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Rz(n.data,this.options),fetchMeta:t.meta??null};case"success":return Ve(this,ef,void 0),{...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return aA(i)&&i.revert&&pe(this,ef)?{...pe(this,ef),fetchStatus:"idle"}:{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),vi.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),pe(this,fo).notify({query:this,type:"updated",action:t})})},UF);function Rz(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ez(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function tse(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Ms,zF,rse=(zF=class extends J0{constructor(t={}){super();xt(this,Ms);this.config=t,Ve(this,Ms,new Map)}build(t,r,n){const i=r.queryKey,a=r.queryHash??C3(i,r);let o=this.get(a);return o||(o=new ese({client:t,queryKey:i,queryHash:a,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){pe(this,Ms).has(t.queryHash)||(pe(this,Ms).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=pe(this,Ms).get(t.queryHash);r&&(t.destroy(),r===t&&pe(this,Ms).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){vi.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return pe(this,Ms).get(t)}getAll(){return[...pe(this,Ms).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>EL(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>EL(t,n)):r}notify(t){vi.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){vi.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){vi.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ms=new WeakMap,zF),$s,zi,nf,Ds,qc,HF,nse=(HF=class extends Oz{constructor(t){super();xt(this,Ds);xt(this,$s);xt(this,zi);xt(this,nf);this.mutationId=t.mutationId,Ve(this,zi,t.mutationCache),Ve(this,$s,[]),this.state=t.state||ise(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){pe(this,$s).includes(t)||(pe(this,$s).push(t),this.clearGcTimeout(),pe(this,zi).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ve(this,$s,pe(this,$s).filter(r=>r!==t)),this.scheduleGc(),pe(this,zi).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){pe(this,$s).length||(this.state.status==="pending"?this.scheduleGc():pe(this,zi).remove(this))}continue(){var t;return((t=pe(this,nf))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var a,o,s,l,c,u,f,p,h,g,m,v,y,b,x,S,_,k,E,O;const r=()=>{Jt(this,Ds,qc).call(this,{type:"continue"})};Ve(this,nf,Tz({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(R,$)=>{Jt(this,Ds,qc).call(this,{type:"failed",failureCount:R,error:$})},onPause:()=>{Jt(this,Ds,qc).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>pe(this,zi).canRun(this)}));const n=this.state.status==="pending",i=!pe(this,nf).canStart();try{if(n)r();else{Jt(this,Ds,qc).call(this,{type:"pending",variables:t,isPaused:i}),await((o=(a=pe(this,zi).config).onMutate)==null?void 0:o.call(a,t,this));const $=await((l=(s=this.options).onMutate)==null?void 0:l.call(s,t));$!==this.state.context&&Jt(this,Ds,qc).call(this,{type:"pending",context:$,variables:t,isPaused:i})}const R=await pe(this,nf).start();return await((u=(c=pe(this,zi).config).onSuccess)==null?void 0:u.call(c,R,t,this.state.context,this)),await((p=(f=this.options).onSuccess)==null?void 0:p.call(f,R,t,this.state.context)),await((g=(h=pe(this,zi).config).onSettled)==null?void 0:g.call(h,R,null,this.state.variables,this.state.context,this)),await((v=(m=this.options).onSettled)==null?void 0:v.call(m,R,null,t,this.state.context)),Jt(this,Ds,qc).call(this,{type:"success",data:R}),R}catch(R){try{throw await((b=(y=pe(this,zi).config).onError)==null?void 0:b.call(y,R,t,this.state.context,this)),await((S=(x=this.options).onError)==null?void 0:S.call(x,R,t,this.state.context)),await((k=(_=pe(this,zi).config).onSettled)==null?void 0:k.call(_,void 0,R,this.state.variables,this.state.context,this)),await((O=(E=this.options).onSettled)==null?void 0:O.call(E,void 0,R,t,this.state.context)),R}finally{Jt(this,Ds,qc).call(this,{type:"error",error:R})}}finally{pe(this,zi).runNext(this)}}},$s=new WeakMap,zi=new WeakMap,nf=new WeakMap,Ds=new WeakSet,qc=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),vi.batch(()=>{pe(this,$s).forEach(n=>{n.onMutationUpdate(t)}),pe(this,zi).notify({mutation:this,type:"updated",action:t})})},HF);function ise(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var $l,Zo,M0,VF,ase=(VF=class extends J0{constructor(t={}){super();xt(this,$l);xt(this,Zo);xt(this,M0);this.config=t,Ve(this,$l,new Set),Ve(this,Zo,new Map),Ve(this,M0,0)}build(t,r,n){const i=new nse({mutationCache:this,mutationId:++nb(this,M0)._,options:t.defaultMutationOptions(r),state:n});return this.add(i),i}add(t){pe(this,$l).add(t);const r=kb(t);if(typeof r=="string"){const n=pe(this,Zo).get(r);n?n.push(t):pe(this,Zo).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(pe(this,$l).delete(t)){const r=kb(t);if(typeof r=="string"){const n=pe(this,Zo).get(r);if(n)if(n.length>1){const i=n.indexOf(t);i!==-1&&n.splice(i,1)}else n[0]===t&&pe(this,Zo).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=kb(t);if(typeof r=="string"){const n=pe(this,Zo).get(r),i=n==null?void 0:n.find(a=>a.state.status==="pending");return!i||i===t}else return!0}runNext(t){var n;const r=kb(t);if(typeof r=="string"){const i=(n=pe(this,Zo).get(r))==null?void 0:n.find(a=>a!==t&&a.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){vi.batch(()=>{pe(this,$l).forEach(t=>{this.notify({type:"removed",mutation:t})}),pe(this,$l).clear(),pe(this,Zo).clear()})}getAll(){return Array.from(pe(this,$l))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>CL(r,n))}findAll(t={}){return this.getAll().filter(r=>CL(t,r))}notify(t){vi.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return vi.batch(()=>Promise.all(t.map(r=>r.continue().catch(sa))))}},$l=new WeakMap,Zo=new WeakMap,M0=new WeakMap,VF);function kb(e){var t;return(t=e.options.scope)==null?void 0:t.id}function RL(e){return{onFetch:(t,r)=>{var u,f,p,h,g;const n=t.options,i=(p=(f=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:f.fetchMore)==null?void 0:p.direction,a=((h=t.state.data)==null?void 0:h.pages)||[],o=((g=t.state.data)==null?void 0:g.pageParams)||[];let s={pages:[],pageParams:[]},l=0;const c=async()=>{let m=!1;const v=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(t.signal.aborted?m=!0:t.signal.addEventListener("abort",()=>{m=!0}),t.signal)})},y=Nz(t.options,t.fetchOptions),b=async(x,S,_)=>{if(m)return Promise.reject();if(S==null&&x.pages.length)return Promise.resolve(x);const E=(()=>{const N={client:t.client,queryKey:t.queryKey,pageParam:S,direction:_?"backward":"forward",meta:t.options.meta};return v(N),N})(),O=await y(E),{maxPages:R}=t.options,$=_?Goe:Woe;return{pages:$(x.pages,O,R),pageParams:$(x.pageParams,S,R)}};if(i&&a.length){const x=i==="backward",S=x?ose:LL,_={pages:a,pageParams:o},k=S(n,_);s=await b(_,k,x)}else{const x=e??a.length;do{const S=l===0?o[0]??n.initialPageParam:LL(n,s);if(l>0&&S==null)break;s=await b(s,S),l++}while(l{var m,v;return(v=(m=t.options).persister)==null?void 0:v.call(m,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=c}}}function LL(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function ose(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var cn,su,lu,Op,Rp,cu,Lp,Ip,qF,sse=(qF=class{constructor(e={}){xt(this,cn);xt(this,su);xt(this,lu);xt(this,Op);xt(this,Rp);xt(this,cu);xt(this,Lp);xt(this,Ip);Ve(this,cn,e.queryCache||new rse),Ve(this,su,e.mutationCache||new ase),Ve(this,lu,e.defaultOptions||{}),Ve(this,Op,new Map),Ve(this,Rp,new Map),Ve(this,cu,0)}mount(){nb(this,cu)._++,pe(this,cu)===1&&(Ve(this,Lp,O3.subscribe(async e=>{e&&(await this.resumePausedMutations(),pe(this,cn).onFocus())})),Ve(this,Ip,Sw.subscribe(async e=>{e&&(await this.resumePausedMutations(),pe(this,cn).onOnline())})))}unmount(){var e,t;nb(this,cu)._--,pe(this,cu)===0&&((e=pe(this,Lp))==null||e.call(this),Ve(this,Lp,void 0),(t=pe(this,Ip))==null||t.call(this),Ve(this,Ip,void 0))}isFetching(e){return pe(this,cn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return pe(this,su).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=pe(this,cn).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=pe(this,cn).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Eu(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return pe(this,cn).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),i=pe(this,cn).get(n.queryHash),a=i==null?void 0:i.state.data,o=Voe(t,a);if(o!==void 0)return pe(this,cn).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return vi.batch(()=>pe(this,cn).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=pe(this,cn).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=pe(this,cn);vi.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=pe(this,cn);return vi.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=vi.batch(()=>pe(this,cn).findAll(e).map(i=>i.cancel(r)));return Promise.all(n).then(sa).catch(sa)}invalidateQueries(e,t={}){return vi.batch(()=>(pe(this,cn).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=vi.batch(()=>pe(this,cn).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,r);return r.throwOnError||(a=a.catch(sa)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(n).then(sa)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=pe(this,cn).build(this,t);return r.isStaleByTime(Eu(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(sa).catch(sa)}fetchInfiniteQuery(e){return e.behavior=RL(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(sa).catch(sa)}ensureInfiniteQueryData(e){return e.behavior=RL(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Sw.isOnline()?pe(this,su).resumePausedMutations():Promise.resolve()}getQueryCache(){return pe(this,cn)}getMutationCache(){return pe(this,su)}getDefaultOptions(){return pe(this,lu)}setDefaultOptions(e){Ve(this,lu,e)}setQueryDefaults(e,t){pe(this,Op).set(Ny(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...pe(this,Op).values()],r={};return t.forEach(n=>{Ey(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){pe(this,Rp).set(Ny(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...pe(this,Rp).values()],r={};return t.forEach(n=>{Ey(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...pe(this,lu).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=C3(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===T3&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...pe(this,lu).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){pe(this,cn).clear(),pe(this,su).clear()}},cn=new WeakMap,su=new WeakMap,lu=new WeakMap,Op=new WeakMap,Rp=new WeakMap,cu=new WeakMap,Lp=new WeakMap,Ip=new WeakMap,qF),aa,Zt,$0,Hi,af,Mp,uu,du,D0,$p,Dp,of,sf,fu,Fp,gr,Av,dj,fj,hj,pj,mj,gj,vj,Lz,WF,lse=(WF=class extends J0{constructor(t,r){super();xt(this,gr);xt(this,aa);xt(this,Zt);xt(this,$0);xt(this,Hi);xt(this,af);xt(this,Mp);xt(this,uu);xt(this,du);xt(this,D0);xt(this,$p);xt(this,Dp);xt(this,of);xt(this,sf);xt(this,fu);xt(this,Fp,new Set);this.options=r,Ve(this,aa,t),Ve(this,du,null),Ve(this,uu,uj()),this.options.experimental_prefetchInRender||pe(this,uu).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(pe(this,Zt).addObserver(this),IL(pe(this,Zt),this.options)?Jt(this,gr,Av).call(this):this.updateResult(),Jt(this,gr,pj).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return yj(pe(this,Zt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return yj(pe(this,Zt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Jt(this,gr,mj).call(this),Jt(this,gr,gj).call(this),pe(this,Zt).removeObserver(this)}setOptions(t){const r=this.options,n=pe(this,Zt);if(this.options=pe(this,aa).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ho(this.options.enabled,pe(this,Zt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Jt(this,gr,vj).call(this),pe(this,Zt).setOptions(this.options),r._defaulted&&!sj(this.options,r)&&pe(this,aa).getQueryCache().notify({type:"observerOptionsUpdated",query:pe(this,Zt),observer:this});const i=this.hasListeners();i&&ML(pe(this,Zt),n,this.options,r)&&Jt(this,gr,Av).call(this),this.updateResult(),i&&(pe(this,Zt)!==n||ho(this.options.enabled,pe(this,Zt))!==ho(r.enabled,pe(this,Zt))||Eu(this.options.staleTime,pe(this,Zt))!==Eu(r.staleTime,pe(this,Zt)))&&Jt(this,gr,dj).call(this);const a=Jt(this,gr,fj).call(this);i&&(pe(this,Zt)!==n||ho(this.options.enabled,pe(this,Zt))!==ho(r.enabled,pe(this,Zt))||a!==pe(this,fu))&&Jt(this,gr,hj).call(this,a)}getOptimisticResult(t){const r=pe(this,aa).getQueryCache().build(pe(this,aa),t),n=this.createResult(r,t);return use(this,n)&&(Ve(this,Hi,n),Ve(this,Mp,this.options),Ve(this,af,pe(this,Zt).state)),n}getCurrentResult(){return pe(this,Hi)}trackResult(t,r){return new Proxy(t,{get:(n,i)=>(this.trackProp(i),r==null||r(i),Reflect.get(n,i))})}trackProp(t){pe(this,Fp).add(t)}getCurrentQuery(){return pe(this,Zt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=pe(this,aa).defaultQueryOptions(t),n=pe(this,aa).getQueryCache().build(pe(this,aa),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Jt(this,gr,Av).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),pe(this,Hi)))}createResult(t,r){var R;const n=pe(this,Zt),i=this.options,a=pe(this,Hi),o=pe(this,af),s=pe(this,Mp),c=t!==n?t.state:pe(this,$0),{state:u}=t;let f={...u},p=!1,h;if(r._optimisticResults){const $=this.hasListeners(),N=!$&&IL(t,r),C=$&&ML(t,n,r,i);(N||C)&&(f={...f,...Rz(u.data,t.options)}),r._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:g,errorUpdatedAt:m,status:v}=f;h=f.data;let y=!1;if(r.placeholderData!==void 0&&h===void 0&&v==="pending"){let $;a!=null&&a.isPlaceholderData&&r.placeholderData===(s==null?void 0:s.placeholderData)?($=a.data,y=!0):$=typeof r.placeholderData=="function"?r.placeholderData((R=pe(this,Dp))==null?void 0:R.state.data,pe(this,Dp)):r.placeholderData,$!==void 0&&(v="success",h=cj(a==null?void 0:a.data,$,r),p=!0)}if(r.select&&h!==void 0&&!y)if(a&&h===(o==null?void 0:o.data)&&r.select===pe(this,D0))h=pe(this,$p);else try{Ve(this,D0,r.select),h=r.select(h),h=cj(a==null?void 0:a.data,h,r),Ve(this,$p,h),Ve(this,du,null)}catch($){Ve(this,du,$)}pe(this,du)&&(g=pe(this,du),h=pe(this,$p),m=Date.now(),v="error");const b=f.fetchStatus==="fetching",x=v==="pending",S=v==="error",_=x&&b,k=h!==void 0,O={status:v,fetchStatus:f.fetchStatus,isPending:x,isSuccess:v==="success",isError:S,isInitialLoading:_,isLoading:_,data:h,dataUpdatedAt:f.dataUpdatedAt,error:g,errorUpdatedAt:m,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>c.dataUpdateCount||f.errorUpdateCount>c.errorUpdateCount,isFetching:b,isRefetching:b&&!x,isLoadingError:S&&!k,isPaused:f.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:S&&k,isStale:R3(t,r),refetch:this.refetch,promise:pe(this,uu),isEnabled:ho(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const $=D=>{O.status==="error"?D.reject(O.error):O.data!==void 0&&D.resolve(O.data)},N=()=>{const D=Ve(this,uu,O.promise=uj());$(D)},C=pe(this,uu);switch(C.status){case"pending":t.queryHash===n.queryHash&&$(C);break;case"fulfilled":(O.status==="error"||O.data!==C.value)&&N();break;case"rejected":(O.status!=="error"||O.error!==C.reason)&&N();break}}return O}updateResult(){const t=pe(this,Hi),r=this.createResult(pe(this,Zt),this.options);if(Ve(this,af,pe(this,Zt).state),Ve(this,Mp,this.options),pe(this,af).data!==void 0&&Ve(this,Dp,pe(this,Zt)),sj(r,t))return;Ve(this,Hi,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!pe(this,Fp).size)return!0;const o=new Set(a??pe(this,Fp));return this.options.throwOnError&&o.add("error"),Object.keys(pe(this,Hi)).some(s=>{const l=s;return pe(this,Hi)[l]!==t[l]&&o.has(l)})};Jt(this,gr,Lz).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Jt(this,gr,pj).call(this)}},aa=new WeakMap,Zt=new WeakMap,$0=new WeakMap,Hi=new WeakMap,af=new WeakMap,Mp=new WeakMap,uu=new WeakMap,du=new WeakMap,D0=new WeakMap,$p=new WeakMap,Dp=new WeakMap,of=new WeakMap,sf=new WeakMap,fu=new WeakMap,Fp=new WeakMap,gr=new WeakSet,Av=function(t){Jt(this,gr,vj).call(this);let r=pe(this,Zt).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(sa)),r},dj=function(){Jt(this,gr,mj).call(this);const t=Eu(this.options.staleTime,pe(this,Zt));if(_f||pe(this,Hi).isStale||!oj(t))return;const n=kz(pe(this,Hi).dataUpdatedAt,t)+1;Ve(this,of,setTimeout(()=>{pe(this,Hi).isStale||this.updateResult()},n))},fj=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(pe(this,Zt)):this.options.refetchInterval)??!1},hj=function(t){Jt(this,gr,gj).call(this),Ve(this,fu,t),!(_f||ho(this.options.enabled,pe(this,Zt))===!1||!oj(pe(this,fu))||pe(this,fu)===0)&&Ve(this,sf,setInterval(()=>{(this.options.refetchIntervalInBackground||O3.isFocused())&&Jt(this,gr,Av).call(this)},pe(this,fu)))},pj=function(){Jt(this,gr,dj).call(this),Jt(this,gr,hj).call(this,Jt(this,gr,fj).call(this))},mj=function(){pe(this,of)&&(clearTimeout(pe(this,of)),Ve(this,of,void 0))},gj=function(){pe(this,sf)&&(clearInterval(pe(this,sf)),Ve(this,sf,void 0))},vj=function(){const t=pe(this,aa).getQueryCache().build(pe(this,aa),this.options);if(t===pe(this,Zt))return;const r=pe(this,Zt);Ve(this,Zt,t),Ve(this,$0,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},Lz=function(t){vi.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(pe(this,Hi))}),pe(this,aa).getQueryCache().notify({query:pe(this,Zt),type:"observerResultsUpdated"})})},WF);function cse(e,t){return ho(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function IL(e,t){return cse(e,t)||e.state.data!==void 0&&yj(e,t,t.refetchOnMount)}function yj(e,t,r){if(ho(t.enabled,e)!==!1&&Eu(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&R3(e,t)}return!1}function ML(e,t,r,n){return(e!==t||ho(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&R3(e,r)}function R3(e,t){return ho(t.enabled,e)!==!1&&e.isStaleByTime(Eu(t.staleTime,e))}function use(e,t){return!sj(e.getCurrentResult(),t)}var Iz=P.createContext(void 0),P5=e=>{const t=P.useContext(Iz);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},dse=({client:e,children:t})=>(P.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),d.jsx(Iz.Provider,{value:e,children:t})),Mz=P.createContext(!1),fse=()=>P.useContext(Mz);Mz.Provider;function hse(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var pse=P.createContext(hse()),mse=()=>P.useContext(pse),gse=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},vse=e=>{P.useEffect(()=>{e.clearReset()},[e])},yse=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(i&&e.data===void 0||Koe(r,[e.error,n])),bse=e=>{if(e.suspense){const t=n=>n==="static"?n:Math.max(n??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...n)=>t(r(...n)):t(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},xse=(e,t)=>e.isLoading&&e.isFetching&&!t,wse=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,$L=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function _se(e,t,r){var f,p,h,g,m;const n=fse(),i=mse(),a=P5(),o=a.defaultQueryOptions(e);(p=(f=a.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||p.call(f,o),o._optimisticResults=n?"isRestoring":"optimistic",bse(o),gse(o,i),vse(i);const s=!a.getQueryCache().get(o.queryHash),[l]=P.useState(()=>new t(a,o)),c=l.getOptimisticResult(o),u=!n&&e.subscribed!==!1;if(P.useSyncExternalStore(P.useCallback(v=>{const y=u?l.subscribe(vi.batchCalls(v)):sa;return l.updateResult(),y},[l,u]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),P.useEffect(()=>{l.setOptions(o)},[o,l]),wse(o,c))throw $L(o,l,i);if(yse({result:c,errorResetBoundary:i,throwOnError:o.throwOnError,query:a.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw c.error;if((g=(h=a.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||g.call(h,o,c),o.experimental_prefetchInRender&&!_f&&xse(c,n)){const v=s?$L(o,l,i):(m=a.getQueryCache().get(o.queryHash))==null?void 0:m.promise;v==null||v.catch(sa).finally(()=>{l.updateResult()})}return o.notifyOnChangeProps?c:l.trackResult(c)}function fp(e,t){return _se(e,lse)}/** * @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 Cy(){return Cy=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function $z(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Ase(){return Math.random().toString(36).substr(2,8)}function FL(e,t){return{usr:e.state,key:e.key,idx:t}}function bj(e,t,r,n){return r===void 0&&(r=null),Cy({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?zm(t):t,{state:r,key:t&&t.key||n||Ase()})}function Aw(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function zm(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function Pse(e,t,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:a=!1}=n,o=i.history,s=mu.Pop,l=null,c=u();c==null&&(c=0,o.replaceState(Cy({},o.state,{idx:c}),""));function u(){return(o.state||{idx:null}).idx}function f(){s=mu.Pop;let v=u(),y=v==null?null:v-c;c=v,l&&l({action:s,location:m.location,delta:y})}function p(v,y){s=mu.Push;let b=bj(m.location,v,y);c=u()+1;let x=FL(b,c),S=m.createHref(b);try{o.pushState(x,"",S)}catch(_){if(_ instanceof DOMException&&_.name==="DataCloneError")throw _;i.location.assign(S)}a&&l&&l({action:s,location:m.location,delta:1})}function h(v,y){s=mu.Replace;let b=bj(m.location,v,y);c=u();let x=FL(b,c),S=m.createHref(b);o.replaceState(x,"",S),a&&l&&l({action:s,location:m.location,delta:0})}function g(v){let y=i.location.origin!=="null"?i.location.origin:i.location.href,b=typeof v=="string"?v:Aw(v);return b=b.replace(/ $/,"%20"),Tn(y,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,y)}let m={get action(){return s},get location(){return e(i,o)},listen(v){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(DL,f),l=v,()=>{i.removeEventListener(DL,f),l=null}},createHref(v){return t(i,v)},createURL:g,encodeLocation(v){let y=g(v);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:p,replace:h,go(v){return o.go(v)}};return m}var BL;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(BL||(BL={}));function kse(e,t,r){return r===void 0&&(r="/"),jse(e,t,r,!1)}function jse(e,t,r,n){let i=typeof t=="string"?zm(t):t,a=L3(i.pathname||"/",r);if(a==null)return null;let o=Dz(e);Nse(o);let s=null;for(let l=0;s==null&&l{let l={relativePath:s===void 0?a.path||"":s,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};l.relativePath.startsWith("/")&&(Tn(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let c=Cu([n,l.relativePath]),u=r.concat(l);a.children&&a.children.length>0&&(Tn(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),Dz(a.children,t,u,c)),!(a.path==null&&!a.index)&&t.push({path:c,score:Ise(c,a.index),routesMeta:u})};return e.forEach((a,o)=>{var s;if(a.path===""||!((s=a.path)!=null&&s.includes("?")))i(a,o);else for(let l of Fz(a.path))i(a,o,l)}),t}function Fz(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,i=r.endsWith("?"),a=r.replace(/\?$/,"");if(n.length===0)return i?[a,""]:[a];let o=Fz(n.join("/")),s=[];return s.push(...o.map(l=>l===""?a:[a,l].join("/"))),i&&s.push(...o),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function Nse(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Mse(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const Ese=/^:[\w-]+$/,Cse=3,Tse=2,Ose=1,Rse=10,Lse=-2,UL=e=>e==="*";function Ise(e,t){let r=e.split("/"),n=r.length;return r.some(UL)&&(n+=Lse),t&&(n+=Tse),r.filter(i=>!UL(i)).reduce((i,a)=>i+(Ese.test(a)?Cse:a===""?Ose:Rse),n)}function Mse(e,t){return e.length===t.length&&e.slice(0,-1).every((n,i)=>n===t[i])?e[e.length-1]-t[t.length-1]:0}function $se(e,t,r){let{routesMeta:n}=e,i={},a="/",o=[];for(let s=0;s{let{paramName:p,isOptional:h}=u;if(p==="*"){let m=s[f]||"";o=a.slice(0,a.length-m.length).replace(/(.)\/+$/,"$1")}const g=s[f];return h&&!g?c[p]=void 0:c[p]=(g||"").replace(/%2F/g,"/"),c},{}),pathname:a,pathnameBase:o,pattern:e}}function Dse(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),$z(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,s,l)=>(n.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),n]}function Fse(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return $z(!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 L3(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function Bse(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:i=""}=typeof e=="string"?zm(e):e;return{pathname:r?r.startsWith("/")?r:Use(r,t):t,search:Vse(n),hash:qse(i)}}function Use(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function oA(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function zse(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Bz(e,t){let r=zse(e);return t?r.map((n,i)=>i===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function Uz(e,t,r,n){n===void 0&&(n=!1);let i;typeof e=="string"?i=zm(e):(i=Cy({},e),Tn(!i.pathname||!i.pathname.includes("?"),oA("?","pathname","search",i)),Tn(!i.pathname||!i.pathname.includes("#"),oA("#","pathname","hash",i)),Tn(!i.search||!i.search.includes("#"),oA("#","search","hash",i)));let a=e===""||i.pathname==="",o=a?"/":i.pathname,s;if(o==null)s=r;else{let f=t.length-1;if(!n&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),f-=1;i.pathname=p.join("/")}s=f>=0?t[f]:"/"}let l=Bse(i,s),c=o&&o!=="/"&&o.endsWith("/"),u=(a||o===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const Cu=e=>e.join("/").replace(/\/\/+/g,"/"),Hse=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Vse=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,qse=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Wse(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const zz=["post","put","patch","delete"];new Set(zz);const Gse=["get",...zz];new Set(Gse);/** * 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 Ty(){return Ty=Object.assign?Object.assign.bind():function(e){for(var t=1;t{s.current=!0}),P.useCallback(function(c,u){if(u===void 0&&(u={}),!s.current)return;if(typeof c=="number"){n.go(c);return}let f=Uz(c,JSON.parse(o),a,u.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Cu([t,f.pathname])),(u.replace?n.replace:n.push)(f,u.state,u)},[t,n,o,a,e])}function M3(){let{matches:e}=P.useContext(qu),t=e[e.length-1];return t?t.params:{}}function qz(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=P.useContext(Df),{matches:i}=P.useContext(qu),{pathname:a}=yc(),o=JSON.stringify(Bz(i,n.v7_relativeSplatPath));return P.useMemo(()=>Uz(e,JSON.parse(o),a,r==="path"),[e,o,a,r])}function Jse(e,t){return Zse(e,t)}function Zse(e,t,r,n){Z0()||Tn(!1);let{navigator:i}=P.useContext(Df),{matches:a}=P.useContext(qu),o=a[a.length-1],s=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let c=yc(),u;if(t){var f;let v=typeof t=="string"?zm(t):t;l==="/"||(f=v.pathname)!=null&&f.startsWith(l)||Tn(!1),u=v}else u=c;let p=u.pathname||"/",h=p;if(l!=="/"){let v=l.replace(/^\//,"").split("/");h="/"+p.replace(/^\//,"").split("/").slice(v.length).join("/")}let g=kse(e,{pathname:h}),m=nle(g&&g.map(v=>Object.assign({},v,{params:Object.assign({},s,v.params),pathname:Cu([l,i.encodeLocation?i.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?l:Cu([l,i.encodeLocation?i.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),a,r,n);return t&&m?P.createElement(k5.Provider,{value:{location:Ty({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:mu.Pop}},m):m}function Qse(){let e=sle(),t=Wse(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return P.createElement(P.Fragment,null,P.createElement("h2",null,"Unexpected Application Error!"),P.createElement("h3",{style:{fontStyle:"italic"}},t),r?P.createElement("pre",{style:i},r):null,null)}const ele=P.createElement(Qse,null);class tle extends P.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?P.createElement(qu.Provider,{value:this.props.routeContext},P.createElement(Hz.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function rle(e){let{routeContext:t,match:r,children:n}=e,i=P.useContext(I3);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),P.createElement(qu.Provider,{value:t},n)}function nle(e,t,r,n){var i;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var a;if(!r)return null;if(r.errors)e=r.matches;else if((a=n)!=null&&a.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,s=(i=r)==null?void 0:i.errors;if(s!=null){let u=o.findIndex(f=>f.route.id&&(s==null?void 0:s[f.route.id])!==void 0);u>=0||Tn(!1),o=o.slice(0,Math.min(o.length,u+1))}let l=!1,c=-1;if(r&&n&&n.v7_partialHydration)for(let u=0;u=0?o=o.slice(0,c+1):o=[o[0]];break}}}return o.reduceRight((u,f,p)=>{let h,g=!1,m=null,v=null;r&&(h=s&&f.route.id?s[f.route.id]:void 0,m=f.route.errorElement||ele,l&&(c<0&&p===0?(g=!0,v=null):c===p&&(g=!0,v=f.route.hydrateFallbackElement||null)));let y=t.concat(o.slice(0,p+1)),b=()=>{let x;return h?x=m:g?x=v:f.route.Component?x=P.createElement(f.route.Component,null):f.route.element?x=f.route.element:x=u,P.createElement(rle,{match:f,routeContext:{outlet:u,matches:y,isDataRoute:r!=null},children:x})};return r&&(f.route.ErrorBoundary||f.route.errorElement||p===0)?P.createElement(tle,{location:r.location,revalidation:r.revalidation,component:m,error:h,children:b(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):b()},null)}var Wz=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Wz||{}),Pw=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}(Pw||{});function ile(e){let t=P.useContext(I3);return t||Tn(!1),t}function ale(e){let t=P.useContext(Kse);return t||Tn(!1),t}function ole(e){let t=P.useContext(qu);return t||Tn(!1),t}function Gz(e){let t=ole(),r=t.matches[t.matches.length-1];return r.route.id||Tn(!1),r.route.id}function sle(){var e;let t=P.useContext(Hz),r=ale(Pw.UseRouteError),n=Gz(Pw.UseRouteError);return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function lle(){let{router:e}=ile(Wz.UseNavigateStable),t=Gz(Pw.UseNavigateStable),r=P.useRef(!1);return Vz(()=>{r.current=!0}),P.useCallback(function(i,a){a===void 0&&(a={}),r.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Ty({fromRouteId:t},a)))},[e,t])}function cle(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Ei(e){Tn(!1)}function ule(e){let{basename:t="/",children:r=null,location:n,navigationType:i=mu.Pop,navigator:a,static:o=!1,future:s}=e;Z0()&&Tn(!1);let l=t.replace(/^\/*/,"/"),c=P.useMemo(()=>({basename:l,navigator:a,static:o,future:Ty({v7_relativeSplatPath:!1},s)}),[l,s,a,o]);typeof n=="string"&&(n=zm(n));let{pathname:u="/",search:f="",hash:p="",state:h=null,key:g="default"}=n,m=P.useMemo(()=>{let v=L3(u,l);return v==null?null:{location:{pathname:v,search:f,hash:p,state:h,key:g},navigationType:i}},[l,u,f,p,h,g,i]);return m==null?null:P.createElement(Df.Provider,{value:c},P.createElement(k5.Provider,{children:r,value:m}))}function dle(e){let{children:t,location:r}=e;return Jse(xj(t),r)}new Promise(()=>{});function xj(e,t){t===void 0&&(t=[]);let r=[];return P.Children.forEach(e,(n,i)=>{if(!P.isValidElement(n))return;let a=[...t,i];if(n.type===P.Fragment){r.push.apply(r,xj(n.props.children,a));return}n.type!==Ei&&Tn(!1),!n.props.index||!n.props.children||Tn(!1);let o={id:n.props.id||a.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=xj(n.props.children,a)),r.push(o)}),r}/** * 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 wj(){return wj=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[i]=e[i]);return r}function hle(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ple(e,t){return e.button===0&&(!t||t==="_self")&&!hle(e)}function _j(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(i=>[r,i]):[[r,n]])},[]))}function mle(e,t){let r=_j(e);return t&&t.forEach((n,i)=>{r.has(i)||t.getAll(i).forEach(a=>{r.append(i,a)})}),r}const gle=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],vle="6";try{window.__reactRouterVersion=vle}catch{}const yle="startTransition",HL=vC[yle];function ble(e){let{basename:t,children:r,future:n,window:i}=e,a=P.useRef();a.current==null&&(a.current=Sse({window:i,v5Compat:!0}));let o=a.current,[s,l]=P.useState({action:o.action,location:o.location}),{v7_startTransition:c}=n||{},u=P.useCallback(f=>{c&&HL?HL(()=>l(f)):l(f)},[l,c]);return P.useLayoutEffect(()=>o.listen(u),[o,u]),P.useEffect(()=>cle(n),[n]),P.createElement(ule,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:o,future:n})}const xle=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",wle=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,At=P.forwardRef(function(t,r){let{onClick:n,relative:i,reloadDocument:a,replace:o,state:s,target:l,to:c,preventScrollReset:u,viewTransition:f}=t,p=fle(t,gle),{basename:h}=P.useContext(Df),g,m=!1;if(typeof c=="string"&&wle.test(c)&&(g=c,xle))try{let x=new URL(window.location.href),S=c.startsWith("//")?new URL(x.protocol+c):new URL(c),_=L3(S.pathname,h);S.origin===x.origin&&_!=null?c=_+S.search+S.hash:m=!0}catch{}let v=Yse(c,{relative:i}),y=_le(c,{replace:o,state:s,target:l,preventScrollReset:u,relative:i,viewTransition:f});function b(x){n&&n(x),x.defaultPrevented||y(x)}return P.createElement("a",wj({},p,{href:g||v,onClick:m||a?n:b,ref:r,target:l}))});var VL;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(VL||(VL={}));var qL;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(qL||(qL={}));function _le(e,t){let{target:r,replace:n,state:i,preventScrollReset:a,relative:o,viewTransition:s}=t===void 0?{}:t,l=gs(),c=yc(),u=qz(e,{relative:o});return P.useCallback(f=>{if(ple(f,r)){f.preventDefault();let p=n!==void 0?n:Aw(c)===Aw(u);l(e,{replace:p,state:i,preventScrollReset:a,relative:o,viewTransition:s})}},[c,l,u,n,i,r,e,a,o,s])}function Sle(e){let t=P.useRef(_j(e)),r=P.useRef(!1),n=yc(),i=P.useMemo(()=>mle(n.search,r.current?null:t.current),[n.search]),a=gs(),o=P.useCallback((s,l)=>{const c=_j(typeof s=="function"?s(i):s);r.current=!0,a("?"+c,l)},[a,i]);return[i,o]}var Ale=typeof Element<"u",Ple=typeof Map=="function",kle=typeof Set=="function",jle=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Tx(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,n,i;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!Tx(e[n],t[n]))return!1;return!0}var a;if(Ple&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(a=e.entries();!(n=a.next()).done;)if(!t.has(n.value[0]))return!1;for(a=e.entries();!(n=a.next()).done;)if(!Tx(n.value[1],t.get(n.value[0])))return!1;return!0}if(kle&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(a=e.entries();!(n=a.next()).done;)if(!t.has(n.value[0]))return!1;return!0}if(jle&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(e[n]!==t[n])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[n]))return!1;if(Ale&&e instanceof Element)return!1;for(n=r;n--!==0;)if(!((i[n]==="_owner"||i[n]==="__v"||i[n]==="__o")&&e.$$typeof)&&!Tx(e[i[n]],t[i[n]]))return!1;return!0}return e!==e&&t!==t}var Nle=function(t,r){try{return Tx(t,r)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}};const Ele=ar(Nle);var Cle=function(e,t,r,n,i,a,o,s){if(!e){var l;if(t===void 0)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[r,n,i,a,o,s],u=0;l=new Error(t.replace(/%s/g,function(){return c[u++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}},Tle=Cle;const WL=ar(Tle);var Ole=function(t,r,n,i){var a=n?n.call(i,t,r):void 0;if(a!==void 0)return!!a;if(t===r)return!0;if(typeof t!="object"||!t||typeof r!="object"||!r)return!1;var o=Object.keys(t),s=Object.keys(r);if(o.length!==s.length)return!1;for(var l=Object.prototype.hasOwnProperty.bind(r),c=0;c(e.BASE="base",e.BODY="body",e.HEAD="head",e.HTML="html",e.LINK="link",e.META="meta",e.NOSCRIPT="noscript",e.SCRIPT="script",e.STYLE="style",e.TITLE="title",e.FRAGMENT="Symbol(react.fragment)",e))(Kz||{}),sA={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]},meta:{charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]}},GL=Object.values(Kz),$3={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},Lle=Object.entries($3).reduce((e,[t,r])=>(e[r]=t,e),{}),is="data-rh",hp={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},pp=(e,t)=>{for(let r=e.length-1;r>=0;r-=1){const n=e[r];if(Object.prototype.hasOwnProperty.call(n,t))return n[t]}return null},Ile=e=>{let t=pp(e,"title");const r=pp(e,hp.TITLE_TEMPLATE);if(Array.isArray(t)&&(t=t.join("")),r&&t)return r.replace(/%s/g,()=>t);const n=pp(e,hp.DEFAULT_TITLE);return t||n||void 0},Mle=e=>pp(e,hp.ON_CHANGE_CLIENT_STATE)||(()=>{}),lA=(e,t)=>t.filter(r=>typeof r[e]<"u").map(r=>r[e]).reduce((r,n)=>({...r,...n}),{}),$le=(e,t)=>t.filter(r=>typeof r.base<"u").map(r=>r.base).reverse().reduce((r,n)=>{if(!r.length){const i=Object.keys(n);for(let a=0;aconsole&&typeof console.warn=="function"&&console.warn(e),rv=(e,t,r)=>{const n={};return r.filter(i=>Array.isArray(i[e])?!0:(typeof i[e]<"u"&&Dle(`Helmet: ${e} should be of type "Array". Instead found type "${typeof i[e]}"`),!1)).map(i=>i[e]).reverse().reduce((i,a)=>{const o={};a.filter(l=>{let c;const u=Object.keys(l);for(let p=0;pi.push(l));const s=Object.keys(o);for(let l=0;l{if(Array.isArray(e)&&e.length){for(let r=0;r({baseTag:$le(["href"],e),bodyAttributes:lA("bodyAttributes",e),defer:pp(e,hp.DEFER),encode:pp(e,hp.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:lA("htmlAttributes",e),linkTags:rv("link",["rel","href"],e),metaTags:rv("meta",["name","charset","http-equiv","property","itemprop"],e),noscriptTags:rv("noscript",["innerHTML"],e),onChangeClientState:Mle(e),scriptTags:rv("script",["src","innerHTML"],e),styleTags:rv("style",["cssText"],e),title:Ile(e),titleAttributes:lA("titleAttributes",e),prioritizeSeoTags:Fle(e,hp.PRIORITIZE_SEO_TAGS)}),Yz=e=>Array.isArray(e)?e.join(""):e,Ule=(e,t)=>{const r=Object.keys(e);for(let n=0;nArray.isArray(e)?e.reduce((r,n)=>(Ule(n,t)?r.priority.push(n):r.default.push(n),r),{priority:[],default:[]}):{default:e,priority:[]},KL=(e,t)=>({...e,[t]:void 0}),zle=["noscript","script","style"],Sj=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),Xz=e=>Object.keys(e).reduce((t,r)=>{const n=typeof e[r]<"u"?`${r}="${e[r]}"`:`${r}`;return t?`${t} ${n}`:n},""),Hle=(e,t,r,n)=>{const i=Xz(r),a=Yz(t);return i?`<${e} ${is}="true" ${i}>${Sj(a,n)}`:`<${e} ${is}="true">${Sj(a,n)}`},Vle=(e,t,r=!0)=>t.reduce((n,i)=>{const a=i,o=Object.keys(a).filter(c=>!(c==="innerHTML"||c==="cssText")).reduce((c,u)=>{const f=typeof a[u]>"u"?u:`${u}="${Sj(a[u],r)}"`;return c?`${c} ${f}`:f},""),s=a.innerHTML||a.cssText||"",l=zle.indexOf(e)===-1;return`${n}<${e} ${is}="true" ${o}${l?"/>":`>${s}`}`},""),Jz=(e,t={})=>Object.keys(e).reduce((r,n)=>{const i=$3[n];return r[i||n]=e[n],r},t),qle=(e,t,r)=>{const n={key:t,[is]:!0},i=Jz(r,n);return[K.createElement("title",i,t)]},Ox=(e,t)=>t.map((r,n)=>{const i={key:n,[is]:!0};return Object.keys(r).forEach(a=>{const s=$3[a]||a;if(s==="innerHTML"||s==="cssText"){const l=r.innerHTML||r.cssText;i.dangerouslySetInnerHTML={__html:l}}else i[s]=r[a]}),K.createElement(e,i)}),uo=(e,t,r=!0)=>{switch(e){case"title":return{toComponent:()=>qle(e,t.title,t.titleAttributes),toString:()=>Hle(e,t.title,t.titleAttributes,r)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>Jz(t),toString:()=>Xz(t)};default:return{toComponent:()=>Ox(e,t),toString:()=>Vle(e,t,r)}}},Wle=({metaTags:e,linkTags:t,scriptTags:r,encode:n})=>{const i=cA(e,sA.meta),a=cA(t,sA.link),o=cA(r,sA.script);return{priorityMethods:{toComponent:()=>[...Ox("meta",i.priority),...Ox("link",a.priority),...Ox("script",o.priority)],toString:()=>`${uo("meta",i.priority,n)} ${uo("link",a.priority,n)} ${uo("script",o.priority,n)}`},metaTags:i.default,linkTags:a.default,scriptTags:o.default}},Gle=e=>{const{baseTag:t,bodyAttributes:r,encode:n=!0,htmlAttributes:i,noscriptTags:a,styleTags:o,title:s="",titleAttributes:l,prioritizeSeoTags:c}=e;let{linkTags:u,metaTags:f,scriptTags:p}=e,h={toComponent:()=>{},toString:()=>""};return c&&({priorityMethods:h,linkTags:u,metaTags:f,scriptTags:p}=Wle(e)),{priority:h,base:uo("base",t,n),bodyAttributes:uo("bodyAttributes",r,n),htmlAttributes:uo("htmlAttributes",i,n),link:uo("link",u,n),meta:uo("meta",f,n),noscript:uo("noscript",a,n),script:uo("script",p,n),style:uo("style",o,n),title:uo("title",{title:s,titleAttributes:l},n)}},Aj=Gle,jb=[],Zz=!!(typeof window<"u"&&window.document&&window.document.createElement),Pj=class{constructor(e,t){Gt(this,"instances",[]);Gt(this,"canUseDOM",Zz);Gt(this,"context");Gt(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?jb:this.instances,add:e=>{(this.canUseDOM?jb:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?jb:this.instances).indexOf(e);(this.canUseDOM?jb:this.instances).splice(t,1)}}});this.context=e,this.canUseDOM=t||!1,t||(e.helmet=Aj({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},Kle={},Qz=K.createContext(Kle),lf,eH=(lf=class extends P.Component{constructor(r){super(r);Gt(this,"helmetData");this.helmetData=new Pj(this.props.context||{},lf.canUseDOM)}render(){return K.createElement(Qz.Provider,{value:this.helmetData.value},this.props.children)}},Gt(lf,"canUseDOM",Zz),lf),ah=(e,t)=>{const r=document.head||document.querySelector("head"),n=r.querySelectorAll(`${e}[${is}]`),i=[].slice.call(n),a=[];let o;return t&&t.length&&t.forEach(s=>{const l=document.createElement(e);for(const c in s)if(Object.prototype.hasOwnProperty.call(s,c))if(c==="innerHTML")l.innerHTML=s.innerHTML;else if(c==="cssText")l.styleSheet?l.styleSheet.cssText=s.cssText:l.appendChild(document.createTextNode(s.cssText));else{const u=c,f=typeof s[u]>"u"?"":s[u];l.setAttribute(c,f)}l.setAttribute(is,"true"),i.some((c,u)=>(o=u,l.isEqualNode(c)))?i.splice(o,1):a.push(l)}),i.forEach(s=>{var l;return(l=s.parentNode)==null?void 0:l.removeChild(s)}),a.forEach(s=>r.appendChild(s)),{oldTags:i,newTags:a}},kj=(e,t)=>{const r=document.getElementsByTagName(e)[0];if(!r)return;const n=r.getAttribute(is),i=n?n.split(","):[],a=[...i],o=Object.keys(t);for(const s of o){const l=t[s]||"";r.getAttribute(s)!==l&&r.setAttribute(s,l),i.indexOf(s)===-1&&i.push(s);const c=a.indexOf(s);c!==-1&&a.splice(c,1)}for(let s=a.length-1;s>=0;s-=1)r.removeAttribute(a[s]);i.length===a.length?r.removeAttribute(is):r.getAttribute(is)!==o.join(",")&&r.setAttribute(is,o.join(","))},Yle=(e,t)=>{typeof e<"u"&&document.title!==e&&(document.title=Yz(e)),kj("title",t)},YL=(e,t)=>{const{baseTag:r,bodyAttributes:n,htmlAttributes:i,linkTags:a,metaTags:o,noscriptTags:s,onChangeClientState:l,scriptTags:c,styleTags:u,title:f,titleAttributes:p}=e;kj("body",n),kj("html",i),Yle(f,p);const h={baseTag:ah("base",r),linkTags:ah("link",a),metaTags:ah("meta",o),noscriptTags:ah("noscript",s),scriptTags:ah("script",c),styleTags:ah("style",u)},g={},m={};Object.keys(h).forEach(v=>{const{newTags:y,oldTags:b}=h[v];y.length&&(g[v]=y),b.length&&(m[v]=h[v].oldTags)}),t&&t(),l(e,g,m)},nv=null,Xle=e=>{nv&&cancelAnimationFrame(nv),e.defer?nv=requestAnimationFrame(()=>{YL(e,()=>{nv=null})}):(YL(e),nv=null)},Jle=Xle,XL=class extends P.Component{constructor(){super(...arguments);Gt(this,"rendered",!1)}shouldComponentUpdate(t){return!Rle(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:r}=this.props.context;let n=null;const i=Ble(t.get().map(a=>{const o={...a.props};return delete o.context,o}));eH.canUseDOM?Jle(i):Aj&&(n=Aj(i)),r(n)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},ek,Zle=(ek=class extends P.Component{shouldComponentUpdate(e){return!Ele(KL(this.props,"helmetData"),KL(e,"helmetData"))}mapNestedChildrenToProps(e,t){if(!t)return null;switch(e.type){case"script":case"noscript":return{innerHTML:t};case"style":return{cssText:t};default:throw new Error(`<${e.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(e,t,r,n){return{...t,[e.type]:[...t[e.type]||[],{...r,...this.mapNestedChildrenToProps(e,n)}]}}mapObjectTypeChildren(e,t,r,n){switch(e.type){case"title":return{...t,[e.type]:n,titleAttributes:{...r}};case"body":return{...t,bodyAttributes:{...r}};case"html":return{...t,htmlAttributes:{...r}};default:return{...t,[e.type]:{...r}}}}mapArrayTypeChildrenToProps(e,t){let r={...t};return Object.keys(e).forEach(n=>{r={...r,[n]:e[n]}}),r}warnOnInvalidChildren(e,t){return WL(GL.some(r=>e.type===r),typeof e.type=="function"?"You may be attempting to nest components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${GL.join(", ")} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`),WL(!t||typeof t=="string"||Array.isArray(t)&&!t.some(r=>typeof r!="string"),`Helmet expects a string as a child of <${e.type}>. Did you forget to wrap your children in braces? ( <${e.type}>{\`\`} ) Refer to our API for more information.`),!0}mapChildrenToProps(e,t){let r={};return K.Children.forEach(e,n=>{if(!n||!n.props)return;const{children:i,...a}=n.props,o=Object.keys(a).reduce((l,c)=>(l[Lle[c]||c]=a[c],l),{});let{type:s}=n;switch(typeof s=="symbol"?s=s.toString():this.warnOnInvalidChildren(n,i),s){case"Symbol(react.fragment)":t=this.mapChildrenToProps(i,t);break;case"link":case"meta":case"noscript":case"script":case"style":r=this.flattenArrayTypeChildren(n,r,o,i);break;default:t=this.mapObjectTypeChildren(n,t,o,i);break}}),this.mapArrayTypeChildrenToProps(r,t)}render(){const{children:e,...t}=this.props;let r={...t},{helmetData:n}=t;if(e&&(r=this.mapChildrenToProps(e,r)),n&&!(n instanceof Pj)){const i=n;n=new Pj(i.context,!0),delete r.helmetData}return n?K.createElement(XL,{...r,context:n.value}):K.createElement(Qz.Consumer,null,i=>K.createElement(XL,{...r,context:i}))}},Gt(ek,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),ek),Bs=function(){return Bs=Object.assign||function(t){for(var r,n=1,i=arguments.length;ne?(...t)=>e(...t):(...t)=>fetch(...t);class D3 extends Error{constructor(t,r="FunctionsError",n){super(t),this.name=r,this.context=n}}class rce extends D3{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class JL extends D3{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class ZL extends D3{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var jj;(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"})(jj||(jj={}));class nce{constructor(t,{headers:r={},customFetch:n,region:i=jj.Any}={}){this.url=t,this.headers=r,this.region=i,this.fetch=tce(n)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return Qle(this,arguments,void 0,function*(r,n={}){var i;let a,o;try{const{headers:s,method:l,body:c,signal:u,timeout:f}=n;let p={},{region:h}=n;h||(h=this.region);const g=new URL(`${this.url}/${r}`);h&&h!=="any"&&(p["x-region"]=h,g.searchParams.set("forceFunctionRegion",h));let m;c&&(s&&!Object.prototype.hasOwnProperty.call(s,"Content-Type")||!s)?typeof Blob<"u"&&c instanceof Blob||c instanceof ArrayBuffer?(p["Content-Type"]="application/octet-stream",m=c):typeof c=="string"?(p["Content-Type"]="text/plain",m=c):typeof FormData<"u"&&c instanceof FormData?m=c:(p["Content-Type"]="application/json",m=JSON.stringify(c)):c&&typeof c!="string"&&!(typeof Blob<"u"&&c instanceof Blob)&&!(c instanceof ArrayBuffer)&&!(typeof FormData<"u"&&c instanceof FormData)?m=JSON.stringify(c):m=c;let v=u;f&&(o=new AbortController,a=setTimeout(()=>o.abort(),f),u?(v=o.signal,u.addEventListener("abort",()=>o.abort())):v=o.signal);const y=yield this.fetch(g.toString(),{method:l||"POST",headers:Object.assign(Object.assign(Object.assign({},p),this.headers),s),body:m,signal:v}).catch(_=>{throw new rce(_)}),b=y.headers.get("x-relay-error");if(b&&b==="true")throw new JL(y);if(!y.ok)throw new ZL(y);let x=((i=y.headers.get("Content-Type"))!==null&&i!==void 0?i:"text/plain").split(";")[0].trim(),S;return x==="application/json"?S=yield y.json():x==="application/octet-stream"||x==="application/pdf"?S=yield y.blob():x==="text/event-stream"?S=y:x==="multipart/form-data"?S=yield y.formData():S=yield y.text(),{data:S,error:null,response:y}}catch(s){return{data:null,error:s,response:s instanceof ZL||s instanceof JL?s.context:void 0}}finally{a&&clearTimeout(a)}})}}var ice=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}},ace=class{constructor(e){var t,r,n;this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=(t=e.shouldThrowOnError)!==null&&t!==void 0?t:!1,this.signal=e.signal,this.isMaybeSingle=(r=e.isMaybeSingle)!==null&&r!==void 0?r:!1,this.urlLengthLimit=(n=e.urlLengthLimit)!==null&&n!==void 0?n:8e3,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}then(e,t){var r=this;this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");const n=this.fetch;let i=n(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async a=>{let o=null,s=null,l=null,c=a.status,u=a.statusText;if(a.ok){var f,p;if(r.method!=="HEAD"){var h;const y=await a.text();y===""||(r.headers.get("Accept")==="text/csv"||r.headers.get("Accept")&&(!((h=r.headers.get("Accept"))===null||h===void 0)&&h.includes("application/vnd.pgrst.plan+text"))?s=y:s=JSON.parse(y))}const m=(f=r.headers.get("Prefer"))===null||f===void 0?void 0:f.match(/count=(exact|planned|estimated)/),v=(p=a.headers.get("content-range"))===null||p===void 0?void 0:p.split("/");m&&v&&v.length>1&&(l=parseInt(v[1])),r.isMaybeSingle&&r.method==="GET"&&Array.isArray(s)&&(s.length>1?(o={code:"PGRST116",details:`Results contain ${s.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},s=null,l=null,c=406,u="Not Acceptable"):s.length===1?s=s[0]:s=null)}else{var g;const m=await a.text();try{o=JSON.parse(m),Array.isArray(o)&&a.status===404&&(s=[],o=null,c=200,u="OK")}catch{a.status===404&&m===""?(c=204,u="No Content"):o={message:m}}if(o&&r.isMaybeSingle&&(!(o==null||(g=o.details)===null||g===void 0)&&g.includes("0 rows"))&&(o=null,c=200,u="OK"),o&&r.shouldThrowOnError)throw new ice(o)}return{error:o,data:s,count:l,status:c,statusText:u}});return this.shouldThrowOnError||(i=i.catch(a=>{var o;let s="",l="",c="";const u=a==null?void 0:a.cause;if(u){var f,p,h,g;const y=(f=u==null?void 0:u.message)!==null&&f!==void 0?f:"",b=(p=u==null?void 0:u.code)!==null&&p!==void 0?p:"";s=`${(h=a==null?void 0:a.name)!==null&&h!==void 0?h:"FetchError"}: ${a==null?void 0:a.message}`,s+=` Caused by: ${(g=u==null?void 0:u.name)!==null&&g!==void 0?g:"Error"}: ${y}`,b&&(s+=` (${b})`),u!=null&&u.stack&&(s+=` ${u.stack}`)}else{var m;s=(m=a==null?void 0:a.stack)!==null&&m!==void 0?m:""}const v=this.url.toString().length;return(a==null?void 0:a.name)==="AbortError"||(a==null?void 0:a.code)==="ABORT_ERR"?(c="",l="Request was aborted (timeout or manual cancellation)",v>this.urlLengthLimit&&(l+=`. Note: Your request URL is ${v} 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.`)):((u==null?void 0:u.name)==="HeadersOverflowError"||(u==null?void 0:u.code)==="UND_ERR_HEADERS_OVERFLOW")&&(c="",l="HTTP headers exceeded server limits (typically 16KB)",v>this.urlLengthLimit&&(l+=`. Your request URL is ${v} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{error:{message:`${(o=a==null?void 0:a.name)!==null&&o!==void 0?o:"FetchError"}: ${a==null?void 0:a.message}`,details:s,hint:l,code:c},data:null,count:null,status:0,statusText:""}})),i.then(e,t)}returns(){return this}overrideTypes(){return this}},oce=class extends ace{select(e){let t=!1;const r=(e??"*").split("").map(n=>/\s/.test(n)&&!t?"":(n==='"'&&(t=!t),n)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:r,foreignTable:n,referencedTable:i=n}={}){const a=i?`${i}.order`:"order",o=this.url.searchParams.get(a);return this.url.searchParams.set(a,`${o?`${o},`:""}${e}.${t?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:r=t}={}){const n=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(n,`${e}`),this}range(e,t,{foreignTable:r,referencedTable:n=r}={}){const i=typeof n>"u"?"offset":`${n}.offset`,a=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(i,`${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.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:e=!1,verbose:t=!1,settings:r=!1,buffers:n=!1,wal:i=!1,format:a="text"}={}){var o;const s=[e?"analyze":null,t?"verbose":null,r?"settings":null,n?"buffers":null,i?"wal":null].filter(Boolean).join("|"),l=(o=this.headers.get("Accept"))!==null&&o!==void 0?o:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${a}; for="${l}"; options=${s};`),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 QL=new RegExp("[,()]");var jh=class extends oce{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){const r=Array.from(new Set(t)).map(n=>typeof n=="string"&&QL.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(e,`in.(${r})`),this}notIn(e,t){const r=Array.from(new Set(t)).map(n=>typeof n=="string"&&QL.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(e,`not.in.(${r})`),this}contains(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t=="string"?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:r,type:n}={}){let i="";n==="plain"?i="pl":n==="phrase"?i="ph":n==="websearch"&&(i="w");const a=r===void 0?"":`(${r})`;return this.url.searchParams.append(e,`${i}fts${a}.${t}`),this}match(e){return Object.entries(e).forEach(([t,r])=>{this.url.searchParams.append(t,`eq.${r}`)}),this}not(e,t,r){return this.url.searchParams.append(e,`not.${t}.${r}`),this}or(e,{foreignTable:t,referencedTable:r=t}={}){const n=r?`${r}.or`:"or";return this.url.searchParams.append(n,`(${e})`),this}filter(e,t,r){return this.url.searchParams.append(e,`${t}.${r}`),this}},sce=class{constructor(e,{headers:t={},schema:r,fetch:n,urlLengthLimit:i=8e3}){this.url=e,this.headers=new Headers(t),this.schema=r,this.fetch=n,this.urlLengthLimit=i}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){const{head:r=!1,count:n}=t??{},i=r?"HEAD":"GET";let a=!1;const o=(e??"*").split("").map(c=>/\s/.test(c)&&!a?"":(c==='"'&&(a=!a),c)).join(""),{url:s,headers:l}=this.cloneRequestState();return s.searchParams.set("select",o),n&&l.append("Prefer",`count=${n}`),new jh({method:i,url:s,headers:l,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}insert(e,{count:t,defaultToNull:r=!0}={}){var n;const i="POST",{url:a,headers:o}=this.cloneRequestState();if(t&&o.append("Prefer",`count=${t}`),r||o.append("Prefer","missing=default"),Array.isArray(e)){const s=e.reduce((l,c)=>l.concat(Object.keys(c)),[]);if(s.length>0){const l=[...new Set(s)].map(c=>`"${c}"`);a.searchParams.set("columns",l.join(","))}}return new jh({method:i,url:a,headers:o,schema:this.schema,body:e,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit})}upsert(e,{onConflict:t,ignoreDuplicates:r=!1,count:n,defaultToNull:i=!0}={}){var a;const o="POST",{url:s,headers:l}=this.cloneRequestState();if(l.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),t!==void 0&&s.searchParams.set("on_conflict",t),n&&l.append("Prefer",`count=${n}`),i||l.append("Prefer","missing=default"),Array.isArray(e)){const c=e.reduce((u,f)=>u.concat(Object.keys(f)),[]);if(c.length>0){const u=[...new Set(c)].map(f=>`"${f}"`);s.searchParams.set("columns",u.join(","))}}return new jh({method:o,url:s,headers:l,schema:this.schema,body:e,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch,urlLengthLimit:this.urlLengthLimit})}update(e,{count:t}={}){var r;const n="PATCH",{url:i,headers:a}=this.cloneRequestState();return t&&a.append("Prefer",`count=${t}`),new jh({method:n,url:i,headers:a,schema:this.schema,body:e,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit})}delete({count:e}={}){var t;const r="DELETE",{url:n,headers:i}=this.cloneRequestState();return e&&i.append("Prefer",`count=${e}`),new jh({method:r,url:n,headers:i,schema:this.schema,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch,urlLengthLimit:this.urlLengthLimit})}};function Oy(e){"@babel/helpers - typeof";return Oy=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},Oy(e)}function lce(e,t){if(Oy(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Oy(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cce(e){var t=lce(e,"string");return Oy(t)=="symbol"?t:t+""}function uce(e,t,r){return(t=cce(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function e6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Nb(e){for(var t=1;t0?this.fetch=(l,c)=>{const u=new AbortController,f=setTimeout(()=>u.abort(),a),p=c==null?void 0:c.signal;if(p){if(p.aborted)return clearTimeout(f),s(l,c);const h=()=>{clearTimeout(f),u.abort()};return p.addEventListener("abort",h,{once:!0}),s(l,Nb(Nb({},c),{},{signal:u.signal})).finally(()=>{clearTimeout(f),p.removeEventListener("abort",h)})}return s(l,Nb(Nb({},c),{},{signal:u.signal})).finally(()=>clearTimeout(f))}:this.fetch=s}from(t){if(!t||typeof t!="string"||t.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new sce(new URL(`${this.url}/${t}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}schema(t){return new tH(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}rpc(t,r={},{head:n=!1,get:i=!1,count:a}={}){var o;let s;const l=new URL(`${this.url}/rpc/${t}`);let c;const u=h=>h!==null&&typeof h=="object"&&(!Array.isArray(h)||h.some(u)),f=n&&Object.values(r).some(u);f?(s="POST",c=r):n||i?(s=n?"HEAD":"GET",Object.entries(r).filter(([h,g])=>g!==void 0).map(([h,g])=>[h,Array.isArray(g)?`{${g.join(",")}}`:`${g}`]).forEach(([h,g])=>{l.searchParams.append(h,g)})):(s="POST",c=r);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 jh({method:s,url:l,headers:p,schema:this.schemaName,body:c,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch,urlLengthLimit:this.urlLengthLimit})}};class fce{constructor(){}static detectEnvironment(){var t;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((t=navigator.userAgent)===null||t===void 0)&&t.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const r=globalThis.process;if(r){const n=r.versions;if(n&&n.node){const i=n.node,a=parseInt(i.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 r=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(r+=` Suggested solution: ${t.workaround}`),new Error(r)}static createWebSocket(t,r){const n=this.getWebSocketConstructor();return new n(t,r)}static isWebSocketSupported(){try{const t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}}const hce="2.97.0",pce=`realtime-js/${hce}`,mce="1.0.0",rH="2.0.0",t6=rH,Nj=1e4,gce=1e3,vce=100;var Zc;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(Zc||(Zc={}));var Un;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(Un||(Un={}));var es;(function(e){e.close="phx_close",e.error="phx_error",e.join="phx_join",e.reply="phx_reply",e.leave="phx_leave",e.access_token="access_token"})(es||(es={}));var Ej;(function(e){e.websocket="websocket"})(Ej||(Ej={}));var Od;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(Od||(Od={}));class yce{constructor(t){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=t??[]}encode(t,r){if(t.event===this.BROADCAST_EVENT&&!(t.payload instanceof ArrayBuffer)&&typeof t.payload.event=="string")return r(this._binaryEncodeUserBroadcastPush(t));let n=[t.join_ref,t.ref,t.topic,t.event,t.payload];return r(JSON.stringify(n))}_binaryEncodeUserBroadcastPush(t){var r;return this._isArrayBuffer((r=t.payload)===null||r===void 0?void 0:r.payload)?this._encodeBinaryUserBroadcastPush(t):this._encodeJsonUserBroadcastPush(t)}_encodeBinaryUserBroadcastPush(t){var r,n;const i=(n=(r=t.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:new ArrayBuffer(0);return this._encodeUserBroadcastPush(t,this.BINARY_ENCODING,i)}_encodeJsonUserBroadcastPush(t){var r,n;const i=(n=(r=t.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:{},o=new TextEncoder().encode(JSON.stringify(i)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,o)}_encodeUserBroadcastPush(t,r,n){var i,a;const o=t.topic,s=(i=t.ref)!==null&&i!==void 0?i:"",l=(a=t.join_ref)!==null&&a!==void 0?a:"",c=t.payload.event,u=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},f=Object.keys(u).length===0?"":JSON.stringify(u);if(l.length>255)throw new Error(`joinRef length ${l.length} exceeds maximum of 255`);if(s.length>255)throw new Error(`ref length ${s.length} exceeds maximum of 255`);if(o.length>255)throw new Error(`topic length ${o.length} exceeds maximum of 255`);if(c.length>255)throw new Error(`userEvent length ${c.length} exceeds maximum of 255`);if(f.length>255)throw new Error(`metadata length ${f.length} exceeds maximum of 255`);const p=this.USER_BROADCAST_PUSH_META_LENGTH+l.length+s.length+o.length+c.length+f.length,h=new ArrayBuffer(this.HEADER_LENGTH+p);let g=new DataView(h),m=0;g.setUint8(m++,this.KINDS.userBroadcastPush),g.setUint8(m++,l.length),g.setUint8(m++,s.length),g.setUint8(m++,o.length),g.setUint8(m++,c.length),g.setUint8(m++,f.length),g.setUint8(m++,r),Array.from(l,y=>g.setUint8(m++,y.charCodeAt(0))),Array.from(s,y=>g.setUint8(m++,y.charCodeAt(0))),Array.from(o,y=>g.setUint8(m++,y.charCodeAt(0))),Array.from(c,y=>g.setUint8(m++,y.charCodeAt(0))),Array.from(f,y=>g.setUint8(m++,y.charCodeAt(0)));var v=new Uint8Array(h.byteLength+n.byteLength);return v.set(new Uint8Array(h),0),v.set(new Uint8Array(n),h.byteLength),v.buffer}decode(t,r){if(this._isArrayBuffer(t)){let n=this._binaryDecode(t);return r(n)}if(typeof t=="string"){const n=JSON.parse(t),[i,a,o,s,l]=n;return r({join_ref:i,ref:a,topic:o,event:s,payload:l})}return r({})}_binaryDecode(t){const r=new DataView(t),n=r.getUint8(0),i=new TextDecoder;switch(n){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(t,r,i)}}_decodeUserBroadcast(t,r,n){const i=r.getUint8(1),a=r.getUint8(2),o=r.getUint8(3),s=r.getUint8(4);let l=this.HEADER_LENGTH+4;const c=n.decode(t.slice(l,l+i));l=l+i;const u=n.decode(t.slice(l,l+a));l=l+a;const f=n.decode(t.slice(l,l+o));l=l+o;const p=t.slice(l,t.byteLength),h=s===this.JSON_ENCODING?JSON.parse(n.decode(p)):p,g={type:this.BROADCAST_EVENT,event:u,payload:h};return o>0&&(g.meta=JSON.parse(f)),{join_ref:null,ref:null,topic:c,event:this.BROADCAST_EVENT,payload:g}}_isArrayBuffer(t){var r;return t instanceof ArrayBuffer||((r=t==null?void 0:t.constructor)===null||r===void 0?void 0:r.name)==="ArrayBuffer"}_pick(t,r){return!t||typeof t!="object"?{}:Object.fromEntries(Object.entries(t).filter(([n])=>r.includes(n)))}}class nH{constructor(t,r){this.callback=t,this.timerCalc=r,this.timer=void 0,this.tries=0,this.callback=t,this.timerCalc=r}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var Mr;(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"})(Mr||(Mr={}));const r6=(e,t,r={})=>{var n;const i=(n=r.skipTypes)!==null&&n!==void 0?n:[];return t?Object.keys(t).reduce((a,o)=>(a[o]=bce(o,e,t,i),a),{}):{}},bce=(e,t,r,n)=>{const i=t.find(s=>s.name===e),a=i==null?void 0:i.type,o=r[e];return a&&!n.includes(a)?iH(a,o):Cj(o)},iH=(e,t)=>{if(e.charAt(0)==="_"){const r=e.slice(1,e.length);return Sce(t,r)}switch(e){case Mr.bool:return xce(t);case Mr.float4:case Mr.float8:case Mr.int2:case Mr.int4:case Mr.int8:case Mr.numeric:case Mr.oid:return wce(t);case Mr.json:case Mr.jsonb:return _ce(t);case Mr.timestamp:return Ace(t);case Mr.abstime:case Mr.date:case Mr.daterange:case Mr.int4range:case Mr.int8range:case Mr.money:case Mr.reltime:case Mr.text:case Mr.time:case Mr.timestamptz:case Mr.timetz:case Mr.tsrange:case Mr.tstzrange:return Cj(t);default:return Cj(t)}},Cj=e=>e,xce=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},wce=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},_ce=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},Sce=(e,t)=>{if(typeof e!="string")return e;const r=e.length-1,n=e[r];if(e[0]==="{"&&n==="}"){let a;const o=e.slice(1,r);try{a=JSON.parse("["+o+"]")}catch{a=o?o.split(","):[]}return a.map(s=>iH(t,s))}return e},Ace=e=>typeof e=="string"?e.replace(" ","T"):e,aH=e=>{const t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),t.pathname===""||t.pathname==="/"?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};class uA{constructor(t,r,n={},i=Nj){this.channel=t,this.event=r,this.payload=n,this.timeout=i,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(t){this.timeout=t,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(t){this.payload=Object.assign(Object.assign({},this.payload),t)}receive(t,r){var n;return this._hasReceived(t)&&r((n=this.receivedResp)===null||n===void 0?void 0:n.response),this.recHooks.push({status:t,callback:r}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const t=r=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=r,this._matchReceive(r)};this.channel._on(this.refEvent,{},t),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(t,r){this.refEvent&&this.channel._trigger(this.refEvent,{status:t,response:r})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:t,response:r}){this.recHooks.filter(n=>n.status===t).forEach(n=>n.callback(r))}_hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}}var n6;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(n6||(n6={}));class zv{constructor(t,r){this.channel=t,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const n=(r==null?void 0:r.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(n.state,{},i=>{const{onJoin:a,onLeave:o,onSync:s}=this.caller;this.joinRef=this.channel._joinRef(),this.state=zv.syncState(this.state,i,a,o),this.pendingDiffs.forEach(l=>{this.state=zv.syncDiff(this.state,l,a,o)}),this.pendingDiffs=[],s()}),this.channel._on(n.diff,{},i=>{const{onJoin:a,onLeave:o,onSync:s}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(i):(this.state=zv.syncDiff(this.state,i,a,o),s())}),this.onJoin((i,a,o)=>{this.channel._trigger("presence",{event:"join",key:i,currentPresences:a,newPresences:o})}),this.onLeave((i,a,o)=>{this.channel._trigger("presence",{event:"leave",key:i,currentPresences:a,leftPresences:o})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(t,r,n,i){const a=this.cloneDeep(t),o=this.transformState(r),s={},l={};return this.map(a,(c,u)=>{o[c]||(l[c]=u)}),this.map(o,(c,u)=>{const f=a[c];if(f){const p=u.map(v=>v.presence_ref),h=f.map(v=>v.presence_ref),g=u.filter(v=>h.indexOf(v.presence_ref)<0),m=f.filter(v=>p.indexOf(v.presence_ref)<0);g.length>0&&(s[c]=g),m.length>0&&(l[c]=m)}else s[c]=u}),this.syncDiff(a,{joins:s,leaves:l},n,i)}static syncDiff(t,r,n,i){const{joins:a,leaves:o}={joins:this.transformState(r.joins),leaves:this.transformState(r.leaves)};return n||(n=()=>{}),i||(i=()=>{}),this.map(a,(s,l)=>{var c;const u=(c=t[s])!==null&&c!==void 0?c:[];if(t[s]=this.cloneDeep(l),u.length>0){const f=t[s].map(h=>h.presence_ref),p=u.filter(h=>f.indexOf(h.presence_ref)<0);t[s].unshift(...p)}n(s,u,l)}),this.map(o,(s,l)=>{let c=t[s];if(!c)return;const u=l.map(f=>f.presence_ref);c=c.filter(f=>u.indexOf(f.presence_ref)<0),t[s]=c,i(s,c,l),c.length===0&&delete t[s]}),t}static map(t,r){return Object.getOwnPropertyNames(t).map(n=>r(n,t[n]))}static transformState(t){return t=this.cloneDeep(t),Object.getOwnPropertyNames(t).reduce((r,n)=>{const i=t[n];return"metas"in i?r[n]=i.metas.map(a=>(a.presence_ref=a.phx_ref,delete a.phx_ref,delete a.phx_ref_prev,a)):r[n]=i,r},{})}static cloneDeep(t){return JSON.parse(JSON.stringify(t))}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var i6;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(i6||(i6={}));var Hv;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(Hv||(Hv={}));var Ol;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(Ol||(Ol={}));class qh{constructor(t,r={config:{}},n){var i,a;if(this.topic=t,this.params=r,this.socket=n,this.bindings={},this.state=Un.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},r.config),this.timeout=this.socket.timeout,this.joinPush=new uA(this,es.join,this.params,this.timeout),this.rejoinTimer=new nH(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=Un.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(o=>o.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=Un.closed,this.socket._remove(this)}),this._onError(o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=Un.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=Un.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=Un.errored,this.rejoinTimer.scheduleTimeout())}),this._on(es.reply,{},(o,s)=>{this._trigger(this._replyEventName(s),o)}),this.presence=new zv(this),this.broadcastEndpointURL=aH(this.socket.endPoint),this.private=this.params.config.private||!1,!this.private&&(!((a=(i=this.params.config)===null||i===void 0?void 0:i.broadcast)===null||a===void 0)&&a.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(t,r=this.timeout){var n,i,a;if(this.socket.isConnected()||this.socket.connect(),this.state==Un.closed){const{config:{broadcast:o,presence:s,private:l}}=this.params,c=(i=(n=this.bindings.postgres_changes)===null||n===void 0?void 0:n.map(h=>h.filter))!==null&&i!==void 0?i:[],u=!!this.bindings[Hv.PRESENCE]&&this.bindings[Hv.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({},s),{enabled:u}),postgres_changes:c,private:l};this.socket.accessTokenValue&&(f.access_token=this.socket.accessTokenValue),this._onError(h=>t==null?void 0:t(Ol.CHANNEL_ERROR,h)),this._onClose(()=>t==null?void 0:t(Ol.CLOSED)),this.updateJoinPayload(Object.assign({config:p},f)),this.joinedOnce=!0,this._rejoin(r),this.joinPush.receive("ok",async({postgres_changes:h})=>{var g;if(this.socket._isManualToken()||this.socket.setAuth(),h===void 0){t==null||t(Ol.SUBSCRIBED);return}else{const m=this.bindings.postgres_changes,v=(g=m==null?void 0:m.length)!==null&&g!==void 0?g:0,y=[];for(let b=0;b{this.state=Un.errored,t==null||t(Ol.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(h).join(", ")||"error")))}).receive("timeout",()=>{t==null||t(Ol.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(t,r={}){return await this.send({type:"presence",event:"track",payload:t},r.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,r,n){return this.state===Un.joined&&t===Hv.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(async()=>await this.subscribe())),this._on(t,r,n)}async httpSend(t,r,n={}){var i;if(r==null)return Promise.reject("Payload is required for httpSend()");const a={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(a.Authorization=`Bearer ${this.socket.accessTokenValue}`);const o={method:"POST",headers:a,body:JSON.stringify({messages:[{topic:this.subTopic,event:t,payload:r,private:this.private}]})},s=await this._fetchWithTimeout(this.broadcastEndpointURL,o,(i=n.timeout)!==null&&i!==void 0?i:this.timeout);if(s.status===202)return{success:!0};let l=s.statusText;try{const c=await s.json();l=c.error||c.message||l}catch{}return Promise.reject(new Error(l))}async send(t,r={}){var n,i;if(!this._canPush()&&t.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:a,payload:o}=t,s={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(s.Authorization=`Bearer ${this.socket.accessTokenValue}`);const l={method:"POST",headers:s,body:JSON.stringify({messages:[{topic:this.subTopic,event:a,payload:o,private:this.private}]})};try{const c=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(n=r.timeout)!==null&&n!==void 0?n:this.timeout);return await((i=c.body)===null||i===void 0?void 0:i.cancel()),c.ok?"ok":"error"}catch(c){return c.name==="AbortError"?"timed out":"error"}}else return new Promise(a=>{var o,s,l;const c=this._push(t.type,t,r.timeout||this.timeout);t.type==="broadcast"&&!(!((l=(s=(o=this.params)===null||o===void 0?void 0:o.config)===null||s===void 0?void 0:s.broadcast)===null||l===void 0)&&l.ack)&&a("ok"),c.receive("ok",()=>a("ok")),c.receive("error",()=>a("error")),c.receive("timeout",()=>a("timed out"))})}updateJoinPayload(t){this.joinPush.updatePayload(t)}unsubscribe(t=this.timeout){this.state=Un.leaving;const r=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(es.close,"leave",this._joinRef())};this.joinPush.destroy();let n=null;return new Promise(i=>{n=new uA(this,es.leave,{},t),n.receive("ok",()=>{r(),i("ok")}).receive("timeout",()=>{r(),i("timed out")}).receive("error",()=>{i("error")}),n.send(),this._canPush()||n.trigger("ok",{})}).finally(()=>{n==null||n.destroy()})}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Un.closed,this.bindings={}}async _fetchWithTimeout(t,r,n){const i=new AbortController,a=setTimeout(()=>i.abort(),n),o=await this.socket.fetch(t,Object.assign(Object.assign({},r),{signal:i.signal}));return clearTimeout(a),o}_push(t,r,n=this.timeout){if(!this.joinedOnce)throw`tried to push '${t}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let i=new uA(this,t,r,n);return this._canPush()?i.send():this._addToPushBuffer(i),i}_addToPushBuffer(t){if(t.startTimeout(),this.pushBuffer.push(t),this.pushBuffer.length>vce){const r=this.pushBuffer.shift();r&&(r.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${r.event}`,r.payload))}}_onMessage(t,r,n){return r}_isMember(t){return this.topic===t}_joinRef(){return this.joinPush.ref}_trigger(t,r,n){var i,a;const o=t.toLocaleLowerCase(),{close:s,error:l,leave:c,join:u}=es;if(n&&[s,l,c,u].indexOf(o)>=0&&n!==this._joinRef())return;let p=this._onMessage(o,r,n);if(r&&!p)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(o)?(i=this.bindings.postgres_changes)===null||i===void 0||i.filter(h=>{var g,m,v;return((g=h.filter)===null||g===void 0?void 0:g.event)==="*"||((v=(m=h.filter)===null||m===void 0?void 0:m.event)===null||v===void 0?void 0:v.toLocaleLowerCase())===o}).map(h=>h.callback(p,n)):(a=this.bindings[o])===null||a===void 0||a.filter(h=>{var g,m,v,y,b,x;if(["broadcast","presence","postgres_changes"].includes(o))if("id"in h){const S=h.id,_=(g=h.filter)===null||g===void 0?void 0:g.event;return S&&((m=r.ids)===null||m===void 0?void 0:m.includes(S))&&(_==="*"||(_==null?void 0:_.toLocaleLowerCase())===((v=r.data)===null||v===void 0?void 0:v.type.toLocaleLowerCase()))}else{const S=(b=(y=h==null?void 0:h.filter)===null||y===void 0?void 0:y.event)===null||b===void 0?void 0:b.toLocaleLowerCase();return S==="*"||S===((x=r==null?void 0:r.event)===null||x===void 0?void 0:x.toLocaleLowerCase())}else return h.type.toLocaleLowerCase()===o}).map(h=>{if(typeof p=="object"&&"ids"in p){const g=p.data,{schema:m,table:v,commit_timestamp:y,type:b,errors:x}=g;p=Object.assign(Object.assign({},{schema:m,table:v,commit_timestamp:y,eventType:b,new:{},old:{},errors:x}),this._getPayloadRecords(g))}h.callback(p,n)})}_isClosed(){return this.state===Un.closed}_isJoined(){return this.state===Un.joined}_isJoining(){return this.state===Un.joining}_isLeaving(){return this.state===Un.leaving}_replyEventName(t){return`chan_reply_${t}`}_on(t,r,n){const i=t.toLocaleLowerCase(),a={type:i,filter:r,callback:n};return this.bindings[i]?this.bindings[i].push(a):this.bindings[i]=[a],this}_off(t,r){const n=t.toLocaleLowerCase();return this.bindings[n]&&(this.bindings[n]=this.bindings[n].filter(i=>{var a;return!(((a=i.type)===null||a===void 0?void 0:a.toLocaleLowerCase())===n&&qh.isEqual(i.filter,r))})),this}static isEqual(t,r){if(Object.keys(t).length!==Object.keys(r).length)return!1;for(const n in t)if(t[n]!==r[n])return!1;return!0}static isFilterValueEqual(t,r){return(t??void 0)===(r??void 0)}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(t){this._on(es.close,{},t)}_onError(t){this._on(es.error,{},r=>t(r))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(t=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=Un.joining,this.joinPush.resend(t))}_getPayloadRecords(t){const r={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(r.new=r6(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(r.old=r6(t.columns,t.old_record)),r}}const dA=()=>{},Eb={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},Pce=[1e3,2e3,5e3,1e4],kce=1e4,jce=` addEventListener("message", (e) => { if (e.data.event === "start") { setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); } });`;class Nce{constructor(t,r){var n;if(this.accessTokenValue=null,this.apiKey=null,this._manuallySetToken=!1,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=Nj,this.transport=null,this.heartbeatIntervalMs=Eb.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=dA,this.ref=0,this.reconnectTimer=null,this.vsn=t6,this.logger=dA,this.conn=null,this.sendBuffer=[],this.serializer=new yce,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._heartbeatSentAt=null,this._resolveFetch=i=>i?(...a)=>i(...a):(...a)=>fetch(...a),!(!((n=r==null?void 0:r.params)===null||n===void 0)&&n.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=r.params.apikey,this.endPoint=`${t}/${Ej.websocket}`,this.httpEndpoint=aH(t),this._initializeOptions(r),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(r==null?void 0:r.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=fce.createWebSocket(this.endpointURL())}catch(t){this._setConnectionState("disconnected");const r=t.message;throw r.includes("Node.js")?new Error(`${r} 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: ${r}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:this.vsn}))}disconnect(t,r){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const n=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(n),this._setConnectionState("disconnected")},typeof this.conn.close=="function"&&(t?this.conn.close(t,r??""):this.conn.close()),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(t){const r=await t.unsubscribe();return this.channels.length===0&&this.disconnect(),r}async removeAllChannels(){const t=await Promise.all(this.channels.map(r=>r.unsubscribe()));return this.channels=[],this.disconnect(),t}log(t,r,n){this.logger(t,r,n)}connectionState(){switch(this.conn&&this.conn.readyState){case Zc.connecting:return Od.Connecting;case Zc.open:return Od.Open;case Zc.closing:return Od.Closing;default:return Od.Closed}}isConnected(){return this.connectionState()===Od.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(t,r={config:{}}){const n=`realtime:${t}`,i=this.getChannels().find(a=>a.topic===n);if(i)return i;{const a=new qh(`realtime:${t}`,r,this);return this.channels.push(a),a}}push(t){const{topic:r,event:n,payload:i,ref:a}=t,o=()=>{this.encode(t,s=>{var l;(l=this.conn)===null||l===void 0||l.send(s)})};this.log("push",`${r} ${n} (${a})`,i),this.isConnected()?o():this.sendBuffer.push(o)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){var t;if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(r){this.log("error","error in heartbeat callback",r)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this._heartbeatSentAt=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(r){this.log("error","error in heartbeat callback",r)}this._wasManualDisconnect=!1,(t=this.conn)===null||t===void 0||t.close(gce,"heartbeat timeout"),setTimeout(()=>{var r;this.isConnected()||(r=this.reconnectTimer)===null||r===void 0||r.scheduleTimeout()},Eb.HEARTBEAT_TIMEOUT_FALLBACK);return}this._heartbeatSentAt=Date.now(),this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(r){this.log("error","error in heartbeat callback",r)}this._setAuthSafely("heartbeat")}onHeartbeat(t){this.heartbeatCallback=t}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}_makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}_leaveOpenTopic(t){let r=this.channels.find(n=>n.topic===t&&(n._isJoined()||n._isJoining()));r&&(this.log("transport",`leaving duplicate topic "${t}"`),r.unsubscribe())}_remove(t){this.channels=this.channels.filter(r=>r.topic!==t.topic)}_onConnMessage(t){this.decode(t.data,r=>{if(r.topic==="phoenix"&&r.event==="phx_reply"&&r.ref&&r.ref===this.pendingHeartbeatRef){const c=this._heartbeatSentAt?Date.now()-this._heartbeatSentAt:void 0;try{this.heartbeatCallback(r.payload.status==="ok"?"ok":"error",c)}catch(u){this.log("error","error in heartbeat callback",u)}this._heartbeatSentAt=null,this.pendingHeartbeatRef=null}const{topic:n,event:i,payload:a,ref:o}=r,s=o?`(${o})`:"",l=a.status||"";this.log("receive",`${l} ${n} ${i} ${s}`.trim(),a),this.channels.filter(c=>c._isMember(n)).forEach(c=>c._trigger(i,a,o)),this._triggerStateCallbacks("message",r)})}_clearTimer(t){var r;t==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):t==="reconnect"&&((r=this.reconnectTimer)===null||r===void 0||r.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=t=>this._onConnError(t),this.conn.onmessage=t=>this._onConnMessage(t),this.conn.onclose=t=>this._onConnClose(t),this.conn.readyState===Zc.open&&this._onConnOpen())}_teardownConnection(){if(this.conn){if(this.conn.readyState===Zc.open||this.conn.readyState===Zc.connecting)try{this.conn.close()}catch(t){this.log("error","Error closing connection",t)}this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null}this._clearAllTimers(),this._terminateWorker(),this.channels.forEach(t=>t.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).then(()=>{this.flushSendBuffer()}).catch(r=>{this.log("error","error waiting for auth on connect",r),this.flushSendBuffer()}),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=r=>{this.log("worker","worker error",r.message),this._terminateWorker()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_onConnClose(t){var r;this._setConnectionState("disconnected"),this.log("transport","close",t),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(r=this.reconnectTimer)===null||r===void 0||r.scheduleTimeout(),this._triggerStateCallbacks("close",t)}_onConnError(t){this._setConnectionState("disconnected"),this.log("transport",`${t}`),this._triggerChanError(),this._triggerStateCallbacks("error",t);try{this.heartbeatCallback("error")}catch(r){this.log("error","error in heartbeat callback",r)}}_triggerChanError(){this.channels.forEach(t=>t._trigger(es.error))}_appendParams(t,r){if(Object.keys(r).length===0)return t;const n=t.match(/\?/)?"&":"?",i=new URLSearchParams(r);return`${t}${n}${i}`}_workerObjectUrl(t){let r;if(t)r=t;else{const n=new Blob([jce],{type:"application/javascript"});r=URL.createObjectURL(n)}return r}_setConnectionState(t,r=!1){this._connectionState=t,t==="connecting"?this._wasManualDisconnect=!1:t==="disconnecting"&&(this._wasManualDisconnect=r)}async _performAuth(t=null){let r,n=!1;if(t)r=t,n=!0;else if(this.accessToken)try{r=await this.accessToken()}catch(i){this.log("error","Error fetching access token from callback",i),r=this.accessTokenValue}else r=this.accessTokenValue;n?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(i=>{const a={access_token:r,version:pce};r&&i.updateJoinPayload(a),i.joinedOnce&&i._isJoined()&&i._push(es.access_token,{access_token:r})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this._isManualToken()||this.setAuth().catch(r=>{this.log("error",`Error setting auth in ${t}`,r)})}_triggerStateCallbacks(t,r){try{this.stateChangeCallbacks[t].forEach(n=>{try{n(r)}catch(i){this.log("error",`error in ${t} callback`,i)}})}catch(n){this.log("error",`error triggering ${t} callbacks`,n)}}_setupReconnectionTimer(){this.reconnectTimer=new nH(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},Eb.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(t){var r,n,i,a,o,s,l,c,u,f,p,h;switch(this.transport=(r=t==null?void 0:t.transport)!==null&&r!==void 0?r:null,this.timeout=(n=t==null?void 0:t.timeout)!==null&&n!==void 0?n:Nj,this.heartbeatIntervalMs=(i=t==null?void 0:t.heartbeatIntervalMs)!==null&&i!==void 0?i:Eb.HEARTBEAT_INTERVAL,this.worker=(a=t==null?void 0:t.worker)!==null&&a!==void 0?a:!1,this.accessToken=(o=t==null?void 0:t.accessToken)!==null&&o!==void 0?o:null,this.heartbeatCallback=(s=t==null?void 0:t.heartbeatCallback)!==null&&s!==void 0?s:dA,this.vsn=(l=t==null?void 0:t.vsn)!==null&&l!==void 0?l:t6,t!=null&&t.params&&(this.params=t.params),t!=null&&t.logger&&(this.logger=t.logger),(t!=null&&t.logLevel||t!=null&&t.log_level)&&(this.logLevel=t.logLevel||t.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(c=t==null?void 0:t.reconnectAfterMs)!==null&&c!==void 0?c:g=>Pce[g-1]||kce,this.vsn){case mce:this.encode=(u=t==null?void 0:t.encode)!==null&&u!==void 0?u:(g,m)=>m(JSON.stringify(g)),this.decode=(f=t==null?void 0:t.decode)!==null&&f!==void 0?f:(g,m)=>m(JSON.parse(g));break;case rH:this.encode=(p=t==null?void 0:t.encode)!==null&&p!==void 0?p:this.serializer.encode.bind(this.serializer),this.decode=(h=t==null?void 0:t.decode)!==null&&h!==void 0?h:this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${this.vsn}`)}if(this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t==null?void 0:t.workerUrl}}}var Ry=class extends Error{constructor(e,t){var r;super(e),this.name="IcebergError",this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown=t.icebergType==="CommitStateUnknownException"||[500,502,504].includes(t.status)&&((r=t.icebergType)==null?void 0:r.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function Ece(e,t,r){const n=new URL(t,e);if(r)for(const[i,a]of Object.entries(r))a!==void 0&&n.searchParams.set(i,a);return n.toString()}async function Cce(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 Tce(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:r,path:n,query:i,body:a,headers:o}){const s=Ece(e.baseUrl,n,i),l=await Cce(e.auth),c=await t(s,{method:r,headers:{...a?{"Content-Type":"application/json"}:{},...l,...o},body:a?JSON.stringify(a):void 0}),u=await c.text(),f=(c.headers.get("content-type")||"").includes("application/json"),p=f&&u?JSON.parse(u):u;if(!c.ok){const h=f?p:void 0,g=h==null?void 0:h.error;throw new Ry((g==null?void 0:g.message)??`Request failed with status ${c.status}`,{status:c.status,icebergType:g==null?void 0:g.type,icebergCode:g==null?void 0:g.code,details:h})}return{status:c.status,headers:c.headers,data:p}}}}function Cb(e){return e.join("")}var Oce=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:Cb(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(n=>({namespace:n}))}async createNamespace(e,t){const r={namespace:e.namespace,properties:t==null?void 0:t.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:r})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Cb(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Cb(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Cb(e.namespace)}`}),!0}catch(t){if(t instanceof Ry&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(r){if(r instanceof Ry&&r.status===409)return;throw r}}};function oh(e){return e.join("")}var Rce=class{constructor(e,t="",r){this.client=e,this.prefix=t,this.accessDelegation=r}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${oh(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){const r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${oh(e.namespace)}/tables`,body:t,headers:r})).data.metadata}async updateTable(e,t){const r=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${oh(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":r.data["metadata-location"],metadata:r.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${oh(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/${oh(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/${oh(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(r){if(r instanceof Ry&&r.status===404)return!1;throw r}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(r){if(r instanceof Ry&&r.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw r}}},Lce=class{constructor(e){var n;let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const r=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=Tce({baseUrl:r,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=(n=e.accessDelegation)==null?void 0:n.join(","),this.namespaceOps=new Oce(this.client,t),this.tableOps=new Rce(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)}},j5=class extends Error{constructor(e,t="storage",r,n){super(e),this.__isStorageError=!0,this.namespace=t,this.name=t==="vectors"?"StorageVectorsError":"StorageError",this.status=r,this.statusCode=n}};function N5(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var Tb=class extends j5{constructor(e,t,r,n="storage"){super(e,n,t,r),this.name=n==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=t,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},oH=class extends j5{constructor(e,t,r="storage"){super(e,r),this.name=r==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=t}};const Ice=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),Mce=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)},Tj=e=>{if(Array.isArray(e))return e.map(r=>Tj(r));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([r,n])=>{const i=r.replace(/([-_][a-z])/gi,a=>a.toUpperCase().replace(/[-_]/g,""));t[i]=Tj(n)}),t},$ce=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e);function Ly(e){"@babel/helpers - typeof";return Ly=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},Ly(e)}function Dce(e,t){if(Ly(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ly(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Fce(e){var t=Dce(e,"string");return Ly(t)=="symbol"?t:t+""}function Bce(e,t,r){return(t=Fce(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function vt(e){for(var t=1;t{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)},Uce=async(e,t,r,n)=>{if(e&&typeof e=="object"&&"status"in e&&"ok"in e&&typeof e.status=="number"&&!(r!=null&&r.noResolveJson)){const i=e,a=i.status||500;if(typeof i.json=="function")i.json().then(o=>{const s=(o==null?void 0:o.statusCode)||(o==null?void 0:o.code)||a+"";t(new Tb(o6(o),a,s,n))}).catch(()=>{if(n==="vectors"){const o=a+"";t(new Tb(i.statusText||`HTTP ${a} error`,a,o,n))}else{const o=a+"";t(new Tb(i.statusText||`HTTP ${a} error`,a,o,n))}});else{const o=a+"";t(new Tb(i.statusText||`HTTP ${a} error`,a,o,n))}}else t(new oH(o6(e),e,n))},zce=(e,t,r,n)=>{const i={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"||e==="HEAD"||!n?vt(vt({},i),r):(Mce(n)?(i.headers=vt({"Content-Type":"application/json"},t==null?void 0:t.headers),i.body=JSON.stringify(n)):i.body=n,t!=null&&t.duplex&&(i.duplex=t.duplex),vt(vt({},i),r))};async function iv(e,t,r,n,i,a,o){return new Promise((s,l)=>{e(r,zce(t,n,i,a)).then(c=>{if(!c.ok)throw c;if(n!=null&&n.noResolveJson)return c;if(o==="vectors"){const u=c.headers.get("content-type");if(c.headers.get("content-length")==="0"||c.status===204)return{};if(!u||!u.includes("application/json"))return{}}return c.json()}).then(c=>s(c)).catch(c=>Uce(c,l,n,o))})}function sH(e="storage"){return{get:async(t,r,n,i)=>iv(t,"GET",r,n,i,void 0,e),post:async(t,r,n,i,a)=>iv(t,"POST",r,i,a,n,e),put:async(t,r,n,i,a)=>iv(t,"PUT",r,i,a,n,e),head:async(t,r,n,i)=>iv(t,"HEAD",r,vt(vt({},n),{},{noResolveJson:!0}),i,void 0,e),remove:async(t,r,n,i,a)=>iv(t,"DELETE",r,i,a,n,e)}}const Hce=sH("storage"),{get:Iy,post:Xo,put:Oj,head:Vce,remove:F3}=Hce,Ma=sH("vectors");var Vm=class{constructor(e,t={},r,n="storage"){this.shouldThrowOnError=!1,this.url=e,this.headers=t,this.fetch=Ice(r),this.namespace=n}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=vt(vt({},this.headers),{},{[e]:t}),this}async handleOperation(e){var t=this;try{return{data:await e(),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(N5(r))return{data:null,error:r};throw r}}},qce=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(N5(t))return{data:null,error:t};throw t}}};let lH;lH=Symbol.toStringTag;var Wce=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[lH]="BlobDownloadBuilder",this.promise=null}asStream(){return new qce(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(N5(t))return{data:null,error:t};throw t}}};const Gce={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},s6={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var Kce=class extends Vm{constructor(e,t={},r,n){super(e,t,n,"storage"),this.bucketId=r}async uploadOrUpdate(e,t,r,n){var i=this;return i.handleOperation(async()=>{let a;const o=vt(vt({},s6),n);let s=vt(vt({},i.headers),e==="POST"&&{"x-upsert":String(o.upsert)});const l=o.metadata;typeof Blob<"u"&&r instanceof Blob?(a=new FormData,a.append("cacheControl",o.cacheControl),l&&a.append("metadata",i.encodeMetadata(l)),a.append("",r)):typeof FormData<"u"&&r instanceof FormData?(a=r,a.has("cacheControl")||a.append("cacheControl",o.cacheControl),l&&!a.has("metadata")&&a.append("metadata",i.encodeMetadata(l))):(a=r,s["cache-control"]=`max-age=${o.cacheControl}`,s["content-type"]=o.contentType,l&&(s["x-metadata"]=i.toBase64(i.encodeMetadata(l))),(typeof ReadableStream<"u"&&a instanceof ReadableStream||a&&typeof a=="object"&&"pipe"in a&&typeof a.pipe=="function")&&!o.duplex&&(o.duplex="half")),n!=null&&n.headers&&(s=vt(vt({},s),n.headers));const c=i._removeEmptyFolders(t),u=i._getFinalPath(c),f=await(e=="PUT"?Oj:Xo)(i.fetch,`${i.url}/object/${u}`,a,vt({headers:s},o!=null&&o.duplex?{duplex:o.duplex}:{}));return{path:c,id:f.Id,fullPath:f.Key}})}async upload(e,t,r){return this.uploadOrUpdate("POST",e,t,r)}async uploadToSignedUrl(e,t,r,n){var i=this;const a=i._removeEmptyFolders(e),o=i._getFinalPath(a),s=new URL(i.url+`/object/upload/sign/${o}`);return s.searchParams.set("token",t),i.handleOperation(async()=>{let l;const c=vt({upsert:s6.upsert},n),u=vt(vt({},i.headers),{"x-upsert":String(c.upsert)});return typeof Blob<"u"&&r instanceof Blob?(l=new FormData,l.append("cacheControl",c.cacheControl),l.append("",r)):typeof FormData<"u"&&r instanceof FormData?(l=r,l.append("cacheControl",c.cacheControl)):(l=r,u["cache-control"]=`max-age=${c.cacheControl}`,u["content-type"]=c.contentType),{path:a,fullPath:(await Oj(i.fetch,s.toString(),l,{headers:u})).Key}})}async createSignedUploadUrl(e,t){var r=this;return r.handleOperation(async()=>{let n=r._getFinalPath(e);const i=vt({},r.headers);t!=null&&t.upsert&&(i["x-upsert"]="true");const a=await Xo(r.fetch,`${r.url}/object/upload/sign/${n}`,{},{headers:i}),o=new URL(r.url+a.url),s=o.searchParams.get("token");if(!s)throw new j5("No token returned by API");return{signedUrl:o.toString(),path:e,token:s}})}async update(e,t,r){return this.uploadOrUpdate("PUT",e,t,r)}async move(e,t,r){var n=this;return n.handleOperation(async()=>await Xo(n.fetch,`${n.url}/object/move`,{bucketId:n.bucketId,sourceKey:e,destinationKey:t,destinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers}))}async copy(e,t,r){var n=this;return n.handleOperation(async()=>({path:(await Xo(n.fetch,`${n.url}/object/copy`,{bucketId:n.bucketId,sourceKey:e,destinationKey:t,destinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers})).Key}))}async createSignedUrl(e,t,r){var n=this;return n.handleOperation(async()=>{let i=n._getFinalPath(e),a=await Xo(n.fetch,`${n.url}/object/sign/${i}`,vt({expiresIn:t},r!=null&&r.transform?{transform:r.transform}:{}),{headers:n.headers});const o=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return{signedUrl:encodeURI(`${n.url}${a.signedURL}${o}`)}})}async createSignedUrls(e,t,r){var n=this;return n.handleOperation(async()=>{const i=await Xo(n.fetch,`${n.url}/object/sign/${n.bucketId}`,{expiresIn:t,paths:e},{headers:n.headers}),a=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return i.map(o=>vt(vt({},o),{},{signedUrl:o.signedURL?encodeURI(`${n.url}${o.signedURL}${a}`):null}))})}download(e,t,r){const n=typeof(t==null?void 0:t.transform)<"u"?"render/image/authenticated":"object",i=this.transformOptsToQueryString((t==null?void 0:t.transform)||{}),a=i?`?${i}`:"",o=this._getFinalPath(e),s=()=>Iy(this.fetch,`${this.url}/${n}/${o}${a}`,{headers:this.headers,noResolveJson:!0},r);return new Wce(s,this.shouldThrowOnError)}async info(e){var t=this;const r=t._getFinalPath(e);return t.handleOperation(async()=>Tj(await Iy(t.fetch,`${t.url}/object/info/${r}`,{headers:t.headers})))}async exists(e){var t=this;const r=t._getFinalPath(e);try{return await Vce(t.fetch,`${t.url}/object/${r}`,{headers:t.headers}),{data:!0,error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(N5(n)&&n instanceof oH){const i=n.originalError;if([400,404].includes(i==null?void 0:i.status))return{data:!1,error:n}}throw n}}getPublicUrl(e,t){const r=this._getFinalPath(e),n=[],i=t!=null&&t.download?`download=${t.download===!0?"":t.download}`:"";i!==""&&n.push(i);const a=typeof(t==null?void 0:t.transform)<"u"?"render/image":"object",o=this.transformOptsToQueryString((t==null?void 0:t.transform)||{});o!==""&&n.push(o);let s=n.join("&");return s!==""&&(s=`?${s}`),{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${r}${s}`)}}}async remove(e){var t=this;return t.handleOperation(async()=>await F3(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async list(e,t,r){var n=this;return n.handleOperation(async()=>{const i=vt(vt(vt({},Gce),t),{},{prefix:e||""});return await Xo(n.fetch,`${n.url}/object/list/${n.bucketId}`,i,{headers:n.headers},r)})}async listV2(e,t){var r=this;return r.handleOperation(async()=>{const n=vt({},e);return await Xo(r.fetch,`${r.url}/object/list-v2/${r.bucketId}`,n,{headers:r.headers},t)})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){const t=[];return e.width&&t.push(`width=${e.width}`),e.height&&t.push(`height=${e.height}`),e.resize&&t.push(`resize=${e.resize}`),e.format&&t.push(`format=${e.format}`),e.quality&&t.push(`quality=${e.quality}`),t.join("&")}};const Yce="2.97.0",Q0={"X-Client-Info":`storage-js/${Yce}`};var Xce=class extends Vm{constructor(e,t={},r,n){const i=new URL(e);n!=null&&n.useNewHostname&&/supabase\.(co|in|red)$/.test(i.hostname)&&!i.hostname.includes("storage.supabase.")&&(i.hostname=i.hostname.replace("supabase.","storage.supabase."));const a=i.href.replace(/\/$/,""),o=vt(vt({},Q0),t);super(a,o,r,"storage")}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const r=t.listBucketOptionsToQueryString(e);return await Iy(t.fetch,`${t.url}/bucket${r}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Iy(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var r=this;return r.handleOperation(async()=>await Xo(r.fetch,`${r.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:r.headers}))}async updateBucket(e,t){var r=this;return r.handleOperation(async()=>await Oj(r.fetch,`${r.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:r.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await Xo(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await F3(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():""}},Jce=class extends Vm{constructor(e,t={},r){const n=e.replace(/\/$/,""),i=vt(vt({},Q0),t);super(n,i,r,"storage")}async createBucket(e){var t=this;return t.handleOperation(async()=>await Xo(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const r=new URLSearchParams;(e==null?void 0:e.limit)!==void 0&&r.set("limit",e.limit.toString()),(e==null?void 0:e.offset)!==void 0&&r.set("offset",e.offset.toString()),e!=null&&e.sortColumn&&r.set("sortColumn",e.sortColumn),e!=null&&e.sortOrder&&r.set("sortOrder",e.sortOrder),e!=null&&e.search&&r.set("search",e.search);const n=r.toString(),i=n?`${t.url}/bucket?${n}`:`${t.url}/bucket`;return await Iy(t.fetch,i,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await F3(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!$ce(e))throw new j5("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const r=new Lce({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}),n=this.shouldThrowOnError;return new Proxy(r,{get(i,a){const o=i[a];return typeof o!="function"?o:async(...s)=>{try{return{data:await o.apply(i,s),error:null}}catch(l){if(n)throw l;return{data:null,error:l}}}}})}},Zce=class extends Vm{constructor(e,t={},r){const n=e.replace(/\/$/,""),i=vt(vt({},Q0),{},{"Content-Type":"application/json"},t);super(n,i,r,"vectors")}async createIndex(e){var t=this;return t.handleOperation(async()=>await Ma.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var r=this;return r.handleOperation(async()=>await Ma.post(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await Ma.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var r=this;return r.handleOperation(async()=>await Ma.post(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers})||{})}},Qce=class extends Vm{constructor(e,t={},r){const n=e.replace(/\/$/,""),i=vt(vt({},Q0),{},{"Content-Type":"application/json"},t);super(n,i,r,"vectors")}async putVectors(e){var t=this;if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return t.handleOperation(async()=>await Ma.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await Ma.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 Ma.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await Ma.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 Ma.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},eue=class extends Vm{constructor(e,t={},r){const n=e.replace(/\/$/,""),i=vt(vt({},Q0),{},{"Content-Type":"application/json"},t);super(n,i,r,"vectors")}async createBucket(e){var t=this;return t.handleOperation(async()=>await Ma.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Ma.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await Ma.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Ma.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},tue=class extends eue{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new rue(this.url,this.headers,e,this.fetch)}async createBucket(e){var t=()=>super.createBucket,r=this;return t().call(r,e)}async getBucket(e){var t=()=>super.getBucket,r=this;return t().call(r,e)}async listBuckets(e={}){var t=()=>super.listBuckets,r=this;return t().call(r,e)}async deleteBucket(e){var t=()=>super.deleteBucket,r=this;return t().call(r,e)}},rue=class extends Zce{constructor(e,t,r,n){super(e,t,n),this.vectorBucketName=r}async createIndex(e){var t=()=>super.createIndex,r=this;return t().call(r,vt(vt({},e),{},{vectorBucketName:r.vectorBucketName}))}async listIndexes(e={}){var t=()=>super.listIndexes,r=this;return t().call(r,vt(vt({},e),{},{vectorBucketName:r.vectorBucketName}))}async getIndex(e){var t=()=>super.getIndex,r=this;return t().call(r,r.vectorBucketName,e)}async deleteIndex(e){var t=()=>super.deleteIndex,r=this;return t().call(r,r.vectorBucketName,e)}index(e){return new nue(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},nue=class extends Qce{constructor(e,t,r,n,i){super(e,t,i),this.vectorBucketName=r,this.indexName=n}async putVectors(e){var t=()=>super.putVectors,r=this;return t().call(r,vt(vt({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async getVectors(e){var t=()=>super.getVectors,r=this;return t().call(r,vt(vt({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,r=this;return t().call(r,vt(vt({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,r=this;return t().call(r,vt(vt({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,r=this;return t().call(r,vt(vt({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}},iue=class extends Xce{constructor(e,t={},r,n){super(e,t,r,n)}from(e){return new Kce(this.url,this.headers,e,this.fetch)}get vectors(){return new tue(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new Jce(this.url+"/iceberg",this.headers,this.fetch)}};const cH="2.97.0",Nh=30*1e3,Rj=3,fA=Rj*Nh,aue="http://localhost:9999",oue="supabase.auth.token",sue={"X-Client-Info":`gotrue-js/${cH}`},Lj="X-Supabase-Api-Version",uH={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},lue=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,cue=10*60*1e3;class My extends Error{constructor(t,r,n){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}}function ot(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class uue extends My{constructor(t,r,n){super(t,r,n),this.name="AuthApiError",this.status=r,this.code=n}}function due(e){return ot(e)&&e.name==="AuthApiError"}class Rd extends My{constructor(t,r){super(t),this.name="AuthUnknownError",this.originalError=r}}class bc extends My{constructor(t,r,n,i){super(t,n,i),this.name=r,this.status=n}}class Ea extends bc{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function hA(e){return ot(e)&&e.name==="AuthSessionMissingError"}class sh extends bc{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class Ob extends bc{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class Rb extends bc{constructor(t,r=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function fue(e){return ot(e)&&e.name==="AuthImplicitGrantRedirectError"}class l6 extends bc{constructor(t,r=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class hue extends bc{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class Ij extends bc{constructor(t,r){super(t,"AuthRetryableFetchError",r,void 0)}}function pA(e){return ot(e)&&e.name==="AuthRetryableFetchError"}class c6 extends bc{constructor(t,r,n){super(t,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}}class Mj extends bc{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const kw="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),u6=` \r=`.split(""),pue=(()=>{const e=new Array(128);for(let t=0;t=6;){const n=t.queue>>t.queuedBits-6&63;r(kw[n]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const n=t.queue>>t.queuedBits-6&63;r(kw[n]),t.queuedBits-=6}}function dH(e,t,r){const n=pue[e];if(n>-1)for(t.queue=t.queue<<6|n,t.queuedBits+=6;t.queuedBits>=8;)r(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(n===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function f6(e){const t=[],r=o=>{t.push(String.fromCodePoint(o))},n={utf8seq:0,codepoint:0},i={queue:0,queuedBits:0},a=o=>{vue(o,n,r)};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 gue(e,t){for(let r=0;r55295&&n<=56319){const i=(n-55296)*1024&65535;n=(e.charCodeAt(r+1)-56320&65535|i)+65536,r+=1}mue(n,t)}}function vue(e,t,r){if(t.utf8seq===0){if(e<=127){r(e);return}for(let n=1;n<6;n+=1)if(!(e>>7-n&1)){t.utf8seq=n;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&r(t.codepoint)}}function mp(e){const t=[],r={queue:0,queuedBits:0},n=i=>{t.push(i)};for(let i=0;it.push(r)),new Uint8Array(t)}function Fd(e){const t=[],r={queue:0,queuedBits:0},n=i=>{t.push(i)};return e.forEach(i=>d6(i,r,n)),d6(null,r,n),t.join("")}function bue(e){return Math.round(Date.now()/1e3)+e}function xue(){return Symbol("auth-callback")}const fi=()=>typeof window<"u"&&typeof document<"u",vd={tested:!1,writable:!1},fH=()=>{if(!fi())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(vd.tested)return vd.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),vd.tested=!0,vd.writable=!0}catch{vd.tested=!0,vd.writable=!1}return vd.writable};function wue(e){const t={},r=new URL(e);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((i,a)=>{t[a]=i})}catch{}return r.searchParams.forEach((n,i)=>{t[i]=n}),t}const hH=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),_ue=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",Eh=async(e,t,r)=>{await e.setItem(t,JSON.stringify(r))},yd=async(e,t)=>{const r=await e.getItem(t);if(!r)return null;try{return JSON.parse(r)}catch{return r}},di=async(e,t)=>{await e.removeItem(t)};class E5{constructor(){this.promise=new E5.promiseConstructor((t,r)=>{this.resolve=t,this.reject=r})}}E5.promiseConstructor=Promise;function Lb(e){const t=e.split(".");if(t.length!==3)throw new Mj("Invalid JWT structure");for(let n=0;n{setTimeout(()=>t(null),e)})}function Aue(e,t){return new Promise((n,i)=>{(async()=>{for(let a=0;a<1/0;a++)try{const o=await e(a);if(!t(a,null,o)){n(o);return}}catch(o){if(!t(a,o)){i(o);return}}})()})}function Pue(e){return("0"+e.toString(16)).substr(-2)}function kue(){const t=new Uint32Array(56);if(typeof crypto>"u"){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=r.length;let i="";for(let a=0;a<56;a++)i+=r.charAt(Math.floor(Math.random()*n));return i}return crypto.getRandomValues(t),Array.from(t,Pue).join("")}async function jue(e){const r=new TextEncoder().encode(e),n=await crypto.subtle.digest("SHA-256",r),i=new Uint8Array(n);return Array.from(i).map(a=>String.fromCharCode(a)).join("")}async function Nue(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;const r=await jue(e);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function lh(e,t,r=!1){const n=kue();let i=n;r&&(i+="/PASSWORD_RECOVERY"),await Eh(e,`${t}-code-verifier`,i);const a=await Nue(n);return[a,n===a?"plain":"s256"]}const Eue=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function Cue(e){const t=e.headers.get(Lj);if(!t||!t.match(Eue))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function Tue(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 Oue(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 Rue=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function ch(e){if(!Rue.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function mA(){const e={};return new Proxy(e,{get:(t,r)=>{if(r==="__isUserNotAvailableProxy")return!0;if(typeof r=="symbol"){const n=r.toString();if(n==="Symbol(Symbol.toPrimitive)"||n==="Symbol(Symbol.toStringTag)"||n==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${r}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function Lue(e,t){return new Proxy(e,{get:(r,n,i)=>{if(n==="__isInsecureUserWarningProxy")return!0;if(typeof n=="symbol"){const a=n.toString();if(a==="Symbol(Symbol.toPrimitive)"||a==="Symbol(Symbol.toStringTag)"||a==="Symbol(util.inspect.custom)"||a==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(r,n,i)}return!t.value&&typeof n=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),t.value=!0),Reflect.get(r,n,i)}})}function h6(e){return JSON.parse(JSON.stringify(e))}const kd=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),Iue=[502,503,504];async function p6(e){var t;if(!_ue(e))throw new Ij(kd(e),0);if(Iue.includes(e.status))throw new Ij(kd(e),e.status);let r;try{r=await e.json()}catch(a){throw new Rd(kd(a),a)}let n;const i=Cue(e);if(i&&i.getTime()>=uH["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?n=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(n=r.error_code),n){if(n==="weak_password")throw new c6(kd(r),e.status,((t=r.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(n==="session_not_found")throw new Ea}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((a,o)=>a&&typeof o=="string",!0))throw new c6(kd(r),e.status,r.weak_password.reasons);throw new uue(kd(r),e.status||500,n)}const Mue=(e,t,r,n)=>{const i={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?i:(i.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),i.body=JSON.stringify(n),Object.assign(Object.assign({},i),r))};async function bt(e,t,r,n){var i;const a=Object.assign({},n==null?void 0:n.headers);a[Lj]||(a[Lj]=uH["2024-01-01"].name),n!=null&&n.jwt&&(a.Authorization=`Bearer ${n.jwt}`);const o=(i=n==null?void 0:n.query)!==null&&i!==void 0?i:{};n!=null&&n.redirectTo&&(o.redirect_to=n.redirectTo);const s=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",l=await $ue(e,t,r+s,{headers:a,noResolveJson:n==null?void 0:n.noResolveJson},{},n==null?void 0:n.body);return n!=null&&n.xform?n==null?void 0:n.xform(l):{data:Object.assign({},l),error:null}}async function $ue(e,t,r,n,i,a){const o=Mue(t,n,i,a);let s;try{s=await e(r,Object.assign({},o))}catch(l){throw console.error(l),new Ij(kd(l),0)}if(s.ok||await p6(s),n!=null&&n.noResolveJson)return s;try{return await s.json()}catch(l){await p6(l)}}function Wo(e){var t;let r=null;Bue(e)&&(r=Object.assign({},e),e.expires_at||(r.expires_at=bue(e.expires_in)));const n=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:r,user:n},error:null}}function m6(e){const t=Wo(e);return!t.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((r,n)=>r&&typeof n=="string",!0)&&(t.data.weak_password=e.weak_password),t}function ru(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function Due(e){return{data:e,error:null}}function Fue(e){const{action_link:t,email_otp:r,hashed_token:n,redirect_to:i,verification_type:a}=e,o=Hm(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),s={action_link:t,email_otp:r,hashed_token:n,redirect_to:i,verification_type:a},l=Object.assign({},o);return{data:{properties:s,user:l},error:null}}function g6(e){return e}function Bue(e){return e.access_token&&e.refresh_token&&e.expires_in}const gA=["global","local","others"];class Uue{constructor({url:t="",headers:r={},fetch:n}){this.url=t,this.headers=r,this.fetch=hH(n),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)}}async signOut(t,r=gA[0]){if(gA.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${gA.join(", ")}`);try{return await bt(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(n){if(ot(n))return{data:null,error:n};throw n}}async inviteUserByEmail(t,r={}){try{return await bt(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:ru})}catch(n){if(ot(n))return{data:{user:null},error:n};throw n}}async generateLink(t){try{const{options:r}=t,n=Hm(t,["options"]),i=Object.assign(Object.assign({},n),r);return"newEmail"in n&&(i.new_email=n==null?void 0:n.newEmail,delete i.newEmail),await bt(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:i,headers:this.headers,xform:Fue,redirectTo:r==null?void 0:r.redirectTo})}catch(r){if(ot(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(t){try{return await bt(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:ru})}catch(r){if(ot(r))return{data:{user:null},error:r};throw r}}async listUsers(t){var r,n,i,a,o,s,l;try{const c={nextPage:null,lastPage:0,total:0},u=await bt(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=t==null?void 0:t.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(a=(i=t==null?void 0:t.perPage)===null||i===void 0?void 0:i.toString())!==null&&a!==void 0?a:""},xform:g6});if(u.error)throw u.error;const f=await u.json(),p=(o=u.headers.get("x-total-count"))!==null&&o!==void 0?o:0,h=(l=(s=u.headers.get("link"))===null||s===void 0?void 0:s.split(","))!==null&&l!==void 0?l:[];return h.length>0&&(h.forEach(g=>{const m=parseInt(g.split(";")[0].split("=")[1].substring(0,1)),v=JSON.parse(g.split(";")[1].split("=")[1]);c[`${v}Page`]=m}),c.total=parseInt(p)),{data:Object.assign(Object.assign({},f),c),error:null}}catch(c){if(ot(c))return{data:{users:[]},error:c};throw c}}async getUserById(t){ch(t);try{return await bt(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:ru})}catch(r){if(ot(r))return{data:{user:null},error:r};throw r}}async updateUserById(t,r){ch(t);try{return await bt(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:r,headers:this.headers,xform:ru})}catch(n){if(ot(n))return{data:{user:null},error:n};throw n}}async deleteUser(t,r=!1){ch(t);try{return await bt(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:r},xform:ru})}catch(n){if(ot(n))return{data:{user:null},error:n};throw n}}async _listFactors(t){ch(t.userId);try{const{data:r,error:n}=await bt(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:i=>({data:{factors:i},error:null})});return{data:r,error:n}}catch(r){if(ot(r))return{data:null,error:r};throw r}}async _deleteFactor(t){ch(t.userId),ch(t.id);try{return{data:await bt(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(r){if(ot(r))return{data:null,error:r};throw r}}async _listOAuthClients(t){var r,n,i,a,o,s,l;try{const c={nextPage:null,lastPage:0,total:0},u=await bt(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=t==null?void 0:t.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(a=(i=t==null?void 0:t.perPage)===null||i===void 0?void 0:i.toString())!==null&&a!==void 0?a:""},xform:g6});if(u.error)throw u.error;const f=await u.json(),p=(o=u.headers.get("x-total-count"))!==null&&o!==void 0?o:0,h=(l=(s=u.headers.get("link"))===null||s===void 0?void 0:s.split(","))!==null&&l!==void 0?l:[];return h.length>0&&(h.forEach(g=>{const m=parseInt(g.split(";")[0].split("=")[1].substring(0,1)),v=JSON.parse(g.split(";")[1].split("=")[1]);c[`${v}Page`]=m}),c.total=parseInt(p)),{data:Object.assign(Object.assign({},f),c),error:null}}catch(c){if(ot(c))return{data:{clients:[]},error:c};throw c}}async _createOAuthClient(t){try{return await bt(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(ot(r))return{data:null,error:r};throw r}}async _getOAuthClient(t){try{return await bt(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(ot(r))return{data:null,error:r};throw r}}async _updateOAuthClient(t,r){try{return await bt(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ot(n))return{data:null,error:n};throw n}}async _deleteOAuthClient(t){try{return await bt(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(ot(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(t){try{return await bt(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(ot(r))return{data:null,error:r};throw r}}}function v6(e={}){return{getItem:t=>e[t]||null,setItem:(t,r)=>{e[t]=r},removeItem:t=>{delete e[t]}}}const uh={debug:!!(globalThis&&fH()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class pH extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class y6 extends pH{}async function zue(e,t,r){uh.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const n=new globalThis.AbortController;t>0&&setTimeout(()=>{n.abort(),uh.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t),await Promise.resolve();try{return await globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async i=>{if(i){uh.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,i.name);try{return await r()}finally{uh.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,i.name)}}else{if(t===0)throw uh.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new y6(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(uh.debug)try{const a=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(a,null," "))}catch(a){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",a)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await r()}})}catch(i){throw(i==null?void 0:i.name)==="AbortError"?new y6(`Acquiring an exclusive Navigator LockManager lock "${e}" timed out waiting ${t}ms`):i}}function Hue(){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 mH(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function Vue(e){return parseInt(e,16)}function que(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,n=>n.toString(16).padStart(2,"0")).join("")}function Wue(e){var t;const{chainId:r,domain:n,expirationTime:i,issuedAt:a=new Date,nonce:o,notBefore:s,requestId:l,resources:c,scheme:u,uri:f,version:p}=e;{if(!Number.isInteger(r))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!n)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(o&&o.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${o}`);if(!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 h=mH(e.address),g=u?`${u}://${n}`:n,m=e.statement?`${e.statement} `:"",v=`${g} wants you to sign in with your Ethereum account: ${h} ${m}`;let y=`URI: ${f} Version: ${p} Chain ID: ${r}${o?` Nonce: ${o}`:""} Issued At: ${a.toISOString()}`;if(i&&(y+=` Expiration Time: ${i.toISOString()}`),s&&(y+=` Not Before: ${s.toISOString()}`),l&&(y+=` Request ID: ${l}`),c){let b=` Resources:`;for(const x of c){if(!x||typeof x!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${x}`);b+=` - ${x}`}y+=b}return`${v} ${y}`}class jn extends Error{constructor({message:t,code:r,cause:n,name:i}){var a;super(t,{cause:n}),this.__isWebAuthnError=!0,this.name=(a=i??(n instanceof Error?n.name:void 0))!==null&&a!==void 0?a:"Unknown Error",this.code=r}}class jw extends jn{constructor(t,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:t}),this.name="WebAuthnUnknownError",this.originalError=r}}function Gue({error:e,options:t}){var r,n,i;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 jn({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((r=a.authenticatorSelection)===null||r===void 0?void 0:r.requireResidentKey)===!0)return new jn({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&((n=a.authenticatorSelection)===null||n===void 0?void 0:n.userVerification)==="required")return new jn({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((i=a.authenticatorSelection)===null||i===void 0?void 0:i.userVerification)==="required")return new jn({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 jn({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new jn({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return a.pubKeyCredParams.filter(s=>s.type==="public-key").length===0?new jn({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new jn({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(gH(o)){if(a.rp.id!==o)return new jn({message:`The RP ID "${a.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new jn({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 jn({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 jn({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 jn({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function Kue({error:e,options:t}){const{publicKey:r}=t;if(!r)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new jn({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new jn({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const n=window.location.hostname;if(gH(n)){if(r.rpId!==n)return new jn({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new jn({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new jn({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 jn({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class Yue{createNewAbortSignal(){if(this.controller){const r=new Error("Cancelling existing WebAuthn API call for new one");r.name="AbortError",this.controller.abort(r)}const t=new AbortController;return this.controller=t,t.signal}cancelCeremony(){if(this.controller){const t=new Error("Manually cancelling existing WebAuthn API call");t.name="AbortError",this.controller.abort(t),this.controller=void 0}}}const Xue=new Yue;function Jue(e){if(!e)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(e);const{challenge:t,user:r,excludeCredentials:n}=e,i=Hm(e,["challenge","user","excludeCredentials"]),a=mp(t).buffer,o=Object.assign(Object.assign({},r),{id:mp(r.id).buffer}),s=Object.assign(Object.assign({},i),{challenge:a,user:o});if(n&&n.length>0){s.excludeCredentials=new Array(n.length);for(let l=0;l0){a.allowCredentials=new Array(r.length);for(let o=0;oi!==null&&typeof i=="object"&&!Array.isArray(i),r=i=>i instanceof ArrayBuffer||ArrayBuffer.isView(i),n={};for(const i of e)if(i)for(const a in i){const o=i[a];if(o!==void 0)if(Array.isArray(o))n[a]=o;else if(r(o))n[a]=o;else if(t(o)){const s=n[a];t(s)?n[a]=Nw(s,o):n[a]=Nw(o)}else n[a]=o}return n}function ade(e,t){return Nw(nde,e,t||{})}function ode(e,t){return Nw(ide,e,t||{})}class sde{constructor(t){this.client=t,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(t){return this.client.mfa.enroll(Object.assign(Object.assign({},t),{factorType:"webauthn"}))}async _challenge({factorId:t,webauthn:r,friendlyName:n,signal:i},a){var o;try{const{data:s,error:l}=await this.client.mfa.challenge({factorId:t,webauthn:r});if(!s)return{data:null,error:l};const c=i??Xue.createNewAbortSignal();if(s.webauthn.type==="create"){const{user:u}=s.webauthn.credential_options.publicKey;if(!u.name){const f=n;if(f)u.name=`${u.id}:${f}`;else{const h=(await this.client.getUser()).data.user,g=((o=h==null?void 0:h.user_metadata)===null||o===void 0?void 0:o.name)||(h==null?void 0:h.email)||(h==null?void 0:h.id)||"User";u.name=`${u.id}:${g}`}}u.displayName||(u.displayName=u.name)}switch(s.webauthn.type){case"create":{const u=ade(s.webauthn.credential_options.publicKey,a==null?void 0:a.create),{data:f,error:p}=await tde({publicKey:u,signal:c});return f?{data:{factorId:t,challengeId:s.id,webauthn:{type:s.webauthn.type,credential_response:f}},error:null}:{data:null,error:p}}case"request":{const u=ode(s.webauthn.credential_options.publicKey,a==null?void 0:a.request),{data:f,error:p}=await rde(Object.assign(Object.assign({},s.webauthn.credential_options),{publicKey:u,signal:c}));return f?{data:{factorId:t,challengeId:s.id,webauthn:{type:s.webauthn.type,credential_response:f}},error:null}:{data:null,error:p}}}}catch(s){return ot(s)?{data:null,error:s}:{data:null,error:new Rd("Unexpected error in challenge",s)}}}async _verify({challengeId:t,factorId:r,webauthn:n}){return this.client.mfa.verify({factorId:r,challengeId:t,webauthn:n})}async _authenticate({factorId:t,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:i}={}},a){if(!r)return{data:null,error:new My("rpId is required for WebAuthn authentication")};try{if(!b6())return{data:null,error:new Rd("Browser does not support WebAuthn",null)};const{data:o,error:s}=await this.challenge({factorId:t,webauthn:{rpId:r,rpOrigins:n},signal:i},{request:a});if(!o)return{data:null,error:s};const{webauthn:l}=o;return this._verify({factorId:t,challengeId:o.challengeId,webauthn:{type:l.type,rpId:r,rpOrigins:n,credential_response:l.credential_response}})}catch(o){return ot(o)?{data:null,error:o}:{data:null,error:new Rd("Unexpected error in authenticate",o)}}}async _register({friendlyName:t,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:i}={}},a){if(!r)return{data:null,error:new My("rpId is required for WebAuthn registration")};try{if(!b6())return{data:null,error:new Rd("Browser does not support WebAuthn",null)};const{data:o,error:s}=await this._enroll({friendlyName:t});if(!o)return await this.client.mfa.listFactors().then(u=>{var f;return(f=u.data)===null||f===void 0?void 0:f.all.find(p=>p.factor_type==="webauthn"&&p.friendly_name===t&&p.status!=="unverified")}).then(u=>u?this.client.mfa.unenroll({factorId:u==null?void 0:u.id}):void 0),{data:null,error:s};const{data:l,error:c}=await this._challenge({factorId:o.id,friendlyName:o.friendly_name,webauthn:{rpId:r,rpOrigins:n},signal:i},{create:a});return l?this._verify({factorId:o.id,challengeId:l.challengeId,webauthn:{rpId:r,rpOrigins:n,type:l.webauthn.type,credential_response:l.webauthn.credential_response}}):{data:null,error:c}}catch(o){return ot(o)?{data:null,error:o}:{data:null,error:new Rd("Unexpected error in register",o)}}}}Hue();const lde={url:aue,storageKey:oue,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:sue,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:1e4,skipAutoInitialize:!1};async function x6(e,t,r){return await r()}const dh={};class $y{get jwks(){var t,r;return(r=(t=dh[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(t){dh[this.storageKey]=Object.assign(Object.assign({},dh[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,r;return(r=(t=dh[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){dh[this.storageKey]=Object.assign(Object.assign({},dh[this.storageKey]),{cachedAt:t})}constructor(t){var r,n,i;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({},lde),t);if(this.storageKey=a.storageKey,this.instanceID=(r=$y.nextInstanceID[this.storageKey])!==null&&r!==void 0?r:0,$y.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!a.debug,typeof a.debug=="function"&&(this.logger=a.debug),this.instanceID>0&&fi()){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 Uue({url:a.url,headers:a.headers,fetch:a.fetch}),this.url=a.url,this.headers=a.headers,this.fetch=hH(a.fetch),this.lock=a.lock||x6,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&&fi()&&(!((n=globalThis==null?void 0:globalThis.navigator)===null||n===void 0)&&n.locks)?this.lock=zue:this.lock=x6,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 sde(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:fH()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=v6(this.memoryStorage)),a.userStorage&&(this.userStorage=a.userStorage)):(this.memoryStorage={},this.storage=v6(this.memoryStorage)),fi()&&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)}(i=this.broadcastChannel)===null||i===void 0||i.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(s){this._debug("#broadcastChannel","error",s)}})}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} (${cH}) ${new Date().toISOString()}`}_debug(...t){return this.logDebugMessages&&this.logger(this._logPrefix(),...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{let r={},n="none";if(fi()&&(r=wue(window.location.href),this._isImplicitGrantCallback(r)?n="implicit":await this._isPKCECallback(r)&&(n="pkce")),fi()&&this.detectSessionInUrl&&n!=="none"){const{data:i,error:a}=await this._getSessionFromURL(r,n);if(a){if(this._debug("#_initialize()","error detecting session from URL",a),fue(a)){const l=(t=a.details)===null||t===void 0?void 0:t.code;if(l==="identity_already_exists"||l==="identity_not_found"||l==="single_identity_not_deletable")return{error:a}}return{error:a}}const{session:o,redirectType:s}=i;return this._debug("#_initialize()","detected session in URL",o,"redirect type",s),await this._saveSession(o),setTimeout(async()=>{s==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",o):await this._notifyAllSubscribers("SIGNED_IN",o)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return ot(r)?this._returnResult({error:r}):this._returnResult({error:new Rd("Unexpected error during initialization",r)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var r,n,i;try{const a=await bt(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(r=t==null?void 0:t.options)===null||r===void 0?void 0:r.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(i=t==null?void 0:t.options)===null||i===void 0?void 0:i.captchaToken}},xform:Wo}),{data:o,error:s}=a;if(s||!o)return this._returnResult({data:{user:null,session:null},error:s});const l=o.session,c=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:c,session:l},error:null})}catch(a){if(ot(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signUp(t){var r,n,i;try{let a;if("email"in t){const{email:u,password:f,options:p}=t;let h=null,g=null;this.flowType==="pkce"&&([h,g]=await lh(this.storage,this.storageKey)),a=await bt(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:p==null?void 0:p.emailRedirectTo,body:{email:u,password:f,data:(r=p==null?void 0:p.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:p==null?void 0:p.captchaToken},code_challenge:h,code_challenge_method:g},xform:Wo})}else if("phone"in t){const{phone:u,password:f,options:p}=t;a=await bt(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:u,password:f,data:(n=p==null?void 0:p.data)!==null&&n!==void 0?n:{},channel:(i=p==null?void 0:p.channel)!==null&&i!==void 0?i:"sms",gotrue_meta_security:{captcha_token:p==null?void 0:p.captchaToken}},xform:Wo})}else throw new Ob("You must provide either an email or phone number and a password");const{data:o,error:s}=a;if(s||!o)return await di(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:s});const l=o.session,c=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:c,session:l},error:null})}catch(a){if(await di(this.storage,`${this.storageKey}-code-verifier`),ot(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signInWithPassword(t){try{let r;if("email"in t){const{email:a,password:o,options:s}=t;r=await bt(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:a,password:o,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken}},xform:m6})}else if("phone"in t){const{phone:a,password:o,options:s}=t;r=await bt(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:a,password:o,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken}},xform:m6})}else throw new Ob("You must provide either an email or phone number and a password");const{data:n,error:i}=r;if(i)return this._returnResult({data:{user:null,session:null},error:i});if(!n||!n.session||!n.user){const a=new sh;return this._returnResult({data:{user:null,session:null},error:a})}return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:i})}catch(r){if(ot(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOAuth(t){var r,n,i,a;return await this._handleProviderSignIn(t.provider,{redirectTo:(r=t.options)===null||r===void 0?void 0:r.redirectTo,scopes:(n=t.options)===null||n===void 0?void 0:n.scopes,queryParams:(i=t.options)===null||i===void 0?void 0:i.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:r}=t;switch(r){case"ethereum":return await this.signInWithEthereum(t);case"solana":return await this.signInWithSolana(t);default:throw new Error(`@supabase/auth-js: Unsupported chain "${r}"`)}}async signInWithEthereum(t){var r,n,i,a,o,s,l,c,u,f,p;let h,g;if("message"in t)h=t.message,g=t.signature;else{const{chain:m,wallet:v,statement:y,options:b}=t;let x;if(fi())if(typeof v=="object")x=v;else{const R=window;if("ethereum"in R&&typeof R.ethereum=="object"&&"request"in R.ethereum&&typeof R.ethereum.request=="function")x=R.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof v!="object"||!(b!=null&&b.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");x=v}const S=new URL((r=b==null?void 0:b.url)!==null&&r!==void 0?r:window.location.href),_=await x.request({method:"eth_requestAccounts"}).then(R=>R).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!_||_.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const k=mH(_[0]);let E=(n=b==null?void 0:b.signInWithEthereum)===null||n===void 0?void 0:n.chainId;if(!E){const R=await x.request({method:"eth_chainId"});E=Vue(R)}const O={domain:S.host,address:k,statement:y,uri:S.href,version:"1",chainId:E,nonce:(i=b==null?void 0:b.signInWithEthereum)===null||i===void 0?void 0:i.nonce,issuedAt:(o=(a=b==null?void 0:b.signInWithEthereum)===null||a===void 0?void 0:a.issuedAt)!==null&&o!==void 0?o:new Date,expirationTime:(s=b==null?void 0:b.signInWithEthereum)===null||s===void 0?void 0:s.expirationTime,notBefore:(l=b==null?void 0:b.signInWithEthereum)===null||l===void 0?void 0:l.notBefore,requestId:(c=b==null?void 0:b.signInWithEthereum)===null||c===void 0?void 0:c.requestId,resources:(u=b==null?void 0:b.signInWithEthereum)===null||u===void 0?void 0:u.resources};h=Wue(O),g=await x.request({method:"personal_sign",params:[que(h),k]})}try{const{data:m,error:v}=await bt(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:h,signature:g},!((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:Wo});if(v)throw v;if(!m||!m.session||!m.user){const y=new sh;return this._returnResult({data:{user:null,session:null},error:y})}return m.session&&(await this._saveSession(m.session),await this._notifyAllSubscribers("SIGNED_IN",m.session)),this._returnResult({data:Object.assign({},m),error:v})}catch(m){if(ot(m))return this._returnResult({data:{user:null,session:null},error:m});throw m}}async signInWithSolana(t){var r,n,i,a,o,s,l,c,u,f,p,h;let g,m;if("message"in t)g=t.message,m=t.signature;else{const{chain:v,wallet:y,statement:b,options:x}=t;let S;if(fi())if(typeof y=="object")S=y;else{const k=window;if("solana"in k&&typeof k.solana=="object"&&("signIn"in k.solana&&typeof k.solana.signIn=="function"||"signMessage"in k.solana&&typeof k.solana.signMessage=="function"))S=k.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof y!="object"||!(x!=null&&x.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");S=y}const _=new URL((r=x==null?void 0:x.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in S&&S.signIn){const k=await S.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},x==null?void 0:x.signInWithSolana),{version:"1",domain:_.host,uri:_.href}),b?{statement:b}:null));let E;if(Array.isArray(k)&&k[0]&&typeof k[0]=="object")E=k[0];else if(k&&typeof k=="object"&&"signedMessage"in k&&"signature"in k)E=k;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in E&&"signature"in E&&(typeof E.signedMessage=="string"||E.signedMessage instanceof Uint8Array)&&E.signature instanceof Uint8Array)g=typeof E.signedMessage=="string"?E.signedMessage:new TextDecoder().decode(E.signedMessage),m=E.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in S)||typeof S.signMessage!="function"||!("publicKey"in S)||typeof S!="object"||!S.publicKey||!("toBase58"in S.publicKey)||typeof S.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");g=[`${_.host} wants you to sign in with your Solana account:`,S.publicKey.toBase58(),...b?["",b,""]:[""],"Version: 1",`URI: ${_.href}`,`Issued At: ${(i=(n=x==null?void 0:x.signInWithSolana)===null||n===void 0?void 0:n.issuedAt)!==null&&i!==void 0?i: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}`]:[],...!((s=x==null?void 0:x.signInWithSolana)===null||s===void 0)&&s.chainId?[`Chain ID: ${x.signInWithSolana.chainId}`]:[],...!((l=x==null?void 0:x.signInWithSolana)===null||l===void 0)&&l.nonce?[`Nonce: ${x.signInWithSolana.nonce}`]:[],...!((c=x==null?void 0:x.signInWithSolana)===null||c===void 0)&&c.requestId?[`Request ID: ${x.signInWithSolana.requestId}`]:[],...!((f=(u=x==null?void 0:x.signInWithSolana)===null||u===void 0?void 0:u.resources)===null||f===void 0)&&f.length?["Resources",...x.signInWithSolana.resources.map(E=>`- ${E}`)]:[]].join(` `);const k=await S.signMessage(new TextEncoder().encode(g),"utf8");if(!k||!(k instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");m=k}}try{const{data:v,error:y}=await bt(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:g,signature:Fd(m)},!((p=t.options)===null||p===void 0)&&p.captchaToken?{gotrue_meta_security:{captcha_token:(h=t.options)===null||h===void 0?void 0:h.captchaToken}}:null),xform:Wo});if(y)throw y;if(!v||!v.session||!v.user){const b=new sh;return this._returnResult({data:{user:null,session:null},error:b})}return v.session&&(await this._saveSession(v.session),await this._notifyAllSubscribers("SIGNED_IN",v.session)),this._returnResult({data:Object.assign({},v),error:y})}catch(v){if(ot(v))return this._returnResult({data:{user:null,session:null},error:v});throw v}}async _exchangeCodeForSession(t){const r=await yd(this.storage,`${this.storageKey}-code-verifier`),[n,i]=(r??"").split("/");try{if(!n&&this.flowType==="pkce")throw new hue;const{data:a,error:o}=await bt(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:n},xform:Wo});if(await di(this.storage,`${this.storageKey}-code-verifier`),o)throw o;if(!a||!a.session||!a.user){const s=new sh;return this._returnResult({data:{user:null,session:null,redirectType:null},error:s})}return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",a.session)),this._returnResult({data:Object.assign(Object.assign({},a),{redirectType:i??null}),error:o})}catch(a){if(await di(this.storage,`${this.storageKey}-code-verifier`),ot(a))return this._returnResult({data:{user:null,session:null,redirectType:null},error:a});throw a}}async signInWithIdToken(t){try{const{options:r,provider:n,token:i,access_token:a,nonce:o}=t,s=await bt(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:i,access_token:a,nonce:o,gotrue_meta_security:{captcha_token:r==null?void 0:r.captchaToken}},xform:Wo}),{data:l,error:c}=s;if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!l||!l.session||!l.user){const u=new sh;return this._returnResult({data:{user:null,session:null},error:u})}return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),this._returnResult({data:l,error:c})}catch(r){if(ot(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOtp(t){var r,n,i,a,o;try{if("email"in t){const{email:s,options:l}=t;let c=null,u=null;this.flowType==="pkce"&&([c,u]=await lh(this.storage,this.storageKey));const{error:f}=await bt(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:s,data:(r=l==null?void 0:l.data)!==null&&r!==void 0?r:{},create_user:(n=l==null?void 0:l.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},code_challenge:c,code_challenge_method:u},redirectTo:l==null?void 0:l.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:f})}if("phone"in t){const{phone:s,options:l}=t,{data:c,error:u}=await bt(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:s,data:(i=l==null?void 0:l.data)!==null&&i!==void 0?i:{},create_user:(a=l==null?void 0:l.shouldCreateUser)!==null&&a!==void 0?a:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},channel:(o=l==null?void 0:l.channel)!==null&&o!==void 0?o:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:c==null?void 0:c.message_id},error:u})}throw new Ob("You must provide either an email or phone number.")}catch(s){if(await di(this.storage,`${this.storageKey}-code-verifier`),ot(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async verifyOtp(t){var r,n;try{let i,a;"options"in t&&(i=(r=t.options)===null||r===void 0?void 0:r.redirectTo,a=(n=t.options)===null||n===void 0?void 0:n.captchaToken);const{data:o,error:s}=await bt(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:a}}),redirectTo:i,xform:Wo});if(s)throw s;if(!o)throw new Error("An error occurred on token verification.");const l=o.session,c=o.user;return l!=null&&l.access_token&&(await this._saveSession(l),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",l)),this._returnResult({data:{user:c,session:l},error:null})}catch(i){if(ot(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithSSO(t){var r,n,i,a,o;try{let s=null,l=null;this.flowType==="pkce"&&([s,l]=await lh(this.storage,this.storageKey));const c=await bt(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(n=(r=t.options)===null||r===void 0?void 0:r.redirectTo)!==null&&n!==void 0?n:void 0}),!((i=t==null?void 0:t.options)===null||i===void 0)&&i.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:s,code_challenge_method:l}),headers:this.headers,xform:Due});return!((a=c.data)===null||a===void 0)&&a.url&&fi()&&!(!((o=t.options)===null||o===void 0)&&o.skipBrowserRedirect)&&window.location.assign(c.data.url),this._returnResult(c)}catch(s){if(await di(this.storage,`${this.storageKey}-code-verifier`),ot(s))return this._returnResult({data:null,error:s});throw s}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;if(n)throw n;if(!r)throw new Ea;const{error:i}=await bt(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return this._returnResult({data:{user:null,session:null},error:i})})}catch(t){if(ot(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async resend(t){try{const r=`${this.url}/resend`;if("email"in t){const{email:n,type:i,options:a}=t,{error:o}=await bt(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:i,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:n,type:i,options:a}=t,{data:o,error:s}=await bt(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:i,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:s})}throw new Ob("You must provide either an email or phone number and a type")}catch(r){if(ot(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async r=>r))}async _acquireLock(t,r){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),i=(async()=>(await n,await r()))();return this.pendingInLock.push((async()=>{try{await i}catch{}})()),i}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){const i=[...this.pendingInLock];await Promise.all(i),this.pendingInLock.splice(0,i.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(t){this._debug("#_useSession","begin");try{const r=await this.__loadSession();return await t(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let t=null;const r=await yd(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?t=r:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!t)return{data:{session:null},error:null};const n=t.expires_at?t.expires_at*1e3-Date.now()await this._getUser());return r.data.user&&(this.suppressGetSessionWarning=!0),r}async _getUser(t){try{return t?await bt(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:ru}):await this._useSession(async r=>{var n,i,a;const{data:o,error:s}=r;if(s)throw s;return!(!((n=o.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Ea}:await bt(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(a=(i=o.session)===null||i===void 0?void 0:i.access_token)!==null&&a!==void 0?a:void 0,xform:ru})})}catch(r){if(ot(r))return hA(r)&&(await this._removeSession(),await di(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:r});throw r}}async updateUser(t,r={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(t,r))}async _updateUser(t,r={}){try{return await this._useSession(async n=>{const{data:i,error:a}=n;if(a)throw a;if(!i.session)throw new Ea;const o=i.session;let s=null,l=null;this.flowType==="pkce"&&t.email!=null&&([s,l]=await lh(this.storage,this.storageKey));const{data:c,error:u}=await bt(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r==null?void 0:r.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:s,code_challenge_method:l}),jwt:o.access_token,xform:ru});if(u)throw u;return o.user=c.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),this._returnResult({data:{user:o.user},error:null})})}catch(n){if(await di(this.storage,`${this.storageKey}-code-verifier`),ot(n))return this._returnResult({data:{user:null},error:n});throw n}}async setSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new Ea;const r=Date.now()/1e3;let n=r,i=!0,a=null;const{payload:o}=Lb(t.access_token);if(o.exp&&(n=o.exp,i=n<=r),i){const{data:s,error:l}=await this._callRefreshToken(t.refresh_token);if(l)return this._returnResult({data:{user:null,session:null},error:l});if(!s)return{data:{user:null,session:null},error:null};a=s}else{const{data:s,error:l}=await this._getUser(t.access_token);if(l)return this._returnResult({data:{user:null,session:null},error:l});a={access_token:t.access_token,refresh_token:t.refresh_token,user:s.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(a),await this._notifyAllSubscribers("SIGNED_IN",a)}return this._returnResult({data:{user:a.user,session:a},error:null})}catch(r){if(ot(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async r=>{var n;if(!t){const{data:o,error:s}=r;if(s)throw s;t=(n=o.session)!==null&&n!==void 0?n:void 0}if(!(t!=null&&t.refresh_token))throw new Ea;const{data:i,error:a}=await this._callRefreshToken(t.refresh_token);return a?this._returnResult({data:{user:null,session:null},error:a}):i?this._returnResult({data:{user:i.user,session:i},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(r){if(ot(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async _getSessionFromURL(t,r){try{if(!fi())throw new Rb("No browser detected.");if(t.error||t.error_description||t.error_code)throw new Rb(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new l6("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Rb("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new l6("No code detected.");const{data:b,error:x}=await this._exchangeCodeForSession(t.code);if(x)throw x;const S=new URL(window.location.href);return S.searchParams.delete("code"),window.history.replaceState(window.history.state,"",S.toString()),{data:{session:b.session,redirectType:null},error:null}}const{provider_token:n,provider_refresh_token:i,access_token:a,refresh_token:o,expires_in:s,expires_at:l,token_type:c}=t;if(!a||!s||!o||!c)throw new Rb("No session defined in URL");const u=Math.round(Date.now()/1e3),f=parseInt(s);let p=u+f;l&&(p=parseInt(l));const h=p-u;h*1e3<=Nh&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${h}s, should have been closer to ${f}s`);const g=p-f;u-g>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",g,p,u):u-g<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",g,p,u);const{data:m,error:v}=await this._getUser(a);if(v)throw v;const y={provider_token:n,provider_refresh_token:i,access_token:a,expires_in:f,expires_at:p,refresh_token:o,token_type:c,user:m.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:y,redirectType:t.type},error:null})}catch(n){if(ot(n))return this._returnResult({data:{session:null,redirectType:null},error:n});throw n}}_isImplicitGrantCallback(t){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),t):!!(t.access_token||t.error_description)}async _isPKCECallback(t){const r=await yd(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&r)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async r=>{var n;const{data:i,error:a}=r;if(a&&!hA(a))return this._returnResult({error:a});const o=(n=i.session)===null||n===void 0?void 0:n.access_token;if(o){const{error:s}=await this.admin.signOut(o,t);if(s&&!(due(s)&&(s.status===404||s.status===401||s.status===403)||hA(s)))return this._returnResult({error:s})}return t!=="others"&&(await this._removeSession(),await di(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){const r=xue(),n={id:r,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,n),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:n}}}async _emitInitialSession(t){return await this._useSession(async r=>{var n,i;try{const{data:{session:a},error:o}=r;if(o)throw o;await((n=this.stateChangeEmitters.get(t))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",a)),this._debug("INITIAL_SESSION","callback id",t,"session",a)}catch(a){await((i=this.stateChangeEmitters.get(t))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",a),console.error(a)}})}async resetPasswordForEmail(t,r={}){let n=null,i=null;this.flowType==="pkce"&&([n,i]=await lh(this.storage,this.storageKey,!0));try{return await bt(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:n,code_challenge_method:i,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(a){if(await di(this.storage,`${this.storageKey}-code-verifier`),ot(a))return this._returnResult({data:null,error:a});throw a}}async getUserIdentities(){var t;try{const{data:r,error:n}=await this.getUser();if(n)throw n;return this._returnResult({data:{identities:(t=r.user.identities)!==null&&t!==void 0?t:[]},error:null})}catch(r){if(ot(r))return this._returnResult({data:null,error:r});throw r}}async linkIdentity(t){return"token"in t?this.linkIdentityIdToken(t):this.linkIdentityOAuth(t)}async linkIdentityOAuth(t){var r;try{const{data:n,error:i}=await this._useSession(async a=>{var o,s,l,c,u;const{data:f,error:p}=a;if(p)throw p;const h=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(o=t.options)===null||o===void 0?void 0:o.redirectTo,scopes:(s=t.options)===null||s===void 0?void 0:s.scopes,queryParams:(l=t.options)===null||l===void 0?void 0:l.queryParams,skipBrowserRedirect:!0});return await bt(this.fetch,"GET",h,{headers:this.headers,jwt:(u=(c=f.session)===null||c===void 0?void 0:c.access_token)!==null&&u!==void 0?u:void 0})});if(i)throw i;return fi()&&!(!((r=t.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n==null?void 0:n.url),this._returnResult({data:{provider:t.provider,url:n==null?void 0:n.url},error:null})}catch(n){if(ot(n))return this._returnResult({data:{provider:t.provider,url:null},error:n});throw n}}async linkIdentityIdToken(t){return await this._useSession(async r=>{var n;try{const{error:i,data:{session:a}}=r;if(i)throw i;const{options:o,provider:s,token:l,access_token:c,nonce:u}=t,f=await bt(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(n=a==null?void 0:a.access_token)!==null&&n!==void 0?n:void 0,body:{provider:s,id_token:l,access_token:c,nonce:u,link_identity:!0,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:Wo}),{data:p,error:h}=f;return h?this._returnResult({data:{user:null,session:null},error:h}):!p||!p.session||!p.user?this._returnResult({data:{user:null,session:null},error:new sh}):(p.session&&(await this._saveSession(p.session),await this._notifyAllSubscribers("USER_UPDATED",p.session)),this._returnResult({data:p,error:h}))}catch(i){if(await di(this.storage,`${this.storageKey}-code-verifier`),ot(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}})}async unlinkIdentity(t){try{return await this._useSession(async r=>{var n,i;const{data:a,error:o}=r;if(o)throw o;return await bt(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(i=(n=a.session)===null||n===void 0?void 0:n.access_token)!==null&&i!==void 0?i:void 0})})}catch(r){if(ot(r))return this._returnResult({data:null,error:r});throw r}}async _refreshAccessToken(t){const r=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(r,"begin");try{const n=Date.now();return await Aue(async i=>(i>0&&await Sue(200*Math.pow(2,i-1)),this._debug(r,"refreshing attempt",i),await bt(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:Wo})),(i,a)=>{const o=200*Math.pow(2,i);return a&&pA(a)&&Date.now()+o-n{try{await s.callback(t,r)}catch(l){a.push(l)}});if(await Promise.all(o),a.length>0){for(let s=0;sthis._autoRefreshTokenTick(),Nh);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t);const r=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=r,r&&typeof r=="object"&&typeof r.unref=="function"?r.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(r)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t);const r=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,r&&clearTimeout(r)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const t=Date.now();try{return await this._useSession(async r=>{const{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const i=Math.floor((n.expires_at*1e3-t)/Nh);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${Nh}ms, refresh threshold is ${Rj} ticks`),i<=Rj&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t.isAcquireTimeout||t instanceof pH)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!fi()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(t){this._debug("#visibilityChangedCallback","error",t)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const r=`#_onVisibilityChanged(${t})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(t,r,n){const i=[`provider=${encodeURIComponent(r)}`];if(n!=null&&n.redirectTo&&i.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n!=null&&n.scopes&&i.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){const[a,o]=await lh(this.storage,this.storageKey),s=new URLSearchParams({code_challenge:`${encodeURIComponent(a)}`,code_challenge_method:`${encodeURIComponent(o)}`});i.push(s.toString())}if(n!=null&&n.queryParams){const a=new URLSearchParams(n.queryParams);i.push(a.toString())}return n!=null&&n.skipBrowserRedirect&&i.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${t}?${i.join("&")}`}async _unenroll(t){try{return await this._useSession(async r=>{var n;const{data:i,error:a}=r;return a?this._returnResult({data:null,error:a}):await bt(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(n=i==null?void 0:i.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if(ot(r))return this._returnResult({data:null,error:r});throw r}}async _enroll(t){try{return await this._useSession(async r=>{var n,i;const{data:a,error:o}=r;if(o)return this._returnResult({data:null,error:o});const s=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:t.factorType==="totp"?{issuer:t.issuer}:{}),{data:l,error:c}=await bt(this.fetch,"POST",`${this.url}/factors`,{body:s,headers:this.headers,jwt:(n=a==null?void 0:a.session)===null||n===void 0?void 0:n.access_token});return c?this._returnResult({data:null,error:c}):(t.factorType==="totp"&&l.type==="totp"&&(!((i=l==null?void 0:l.totp)===null||i===void 0)&&i.qr_code)&&(l.totp.qr_code=`data:image/svg+xml;utf-8,${l.totp.qr_code}`),this._returnResult({data:l,error:null}))})}catch(r){if(ot(r))return this._returnResult({data:null,error:r});throw r}}async _verify(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async r=>{var n;const{data:i,error:a}=r;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"?Que(t.webauthn.credential_response):ede(t.webauthn.credential_response)})}:{code:t.code}),{data:s,error:l}=await bt(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:o,headers:this.headers,jwt:(n=i==null?void 0:i.session)===null||n===void 0?void 0:n.access_token});return l?this._returnResult({data:null,error:l}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+s.expires_in},s)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",s),this._returnResult({data:s,error:l}))})}catch(r){if(ot(r))return this._returnResult({data:null,error:r});throw r}})}async _challenge(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async r=>{var n;const{data:i,error:a}=r;if(a)return this._returnResult({data:null,error:a});const o=await bt(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(n=i==null?void 0:i.session)===null||n===void 0?void 0:n.access_token});if(o.error)return o;const{data:s}=o;if(s.type!=="webauthn")return{data:s,error:null};switch(s.webauthn.type){case"create":return{data:Object.assign(Object.assign({},s),{webauthn:Object.assign(Object.assign({},s.webauthn),{credential_options:Object.assign(Object.assign({},s.webauthn.credential_options),{publicKey:Jue(s.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},s),{webauthn:Object.assign(Object.assign({},s.webauthn),{credential_options:Object.assign(Object.assign({},s.webauthn.credential_options),{publicKey:Zue(s.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(r){if(ot(r))return this._returnResult({data:null,error:r});throw r}})}async _challengeAndVerify(t){const{data:r,error:n}=await this._challenge({factorId:t.factorId});return n?this._returnResult({data:null,error:n}):await this._verify({factorId:t.factorId,challengeId:r.id,code:t.code})}async _listFactors(){var t;const{data:{user:r},error:n}=await this.getUser();if(n)return{data:null,error:n};const i={all:[],phone:[],totp:[],webauthn:[]};for(const a of(t=r==null?void 0:r.factors)!==null&&t!==void 0?t:[])i.all.push(a),a.status==="verified"&&i[a.factor_type].push(a);return{data:i,error:null}}async _getAuthenticatorAssuranceLevel(t){var r,n,i,a;if(t)try{const{payload:h}=Lb(t);let g=null;h.aal&&(g=h.aal);let m=g;const{data:{user:v},error:y}=await this.getUser(t);if(y)return this._returnResult({data:null,error:y});((n=(r=v==null?void 0:v.factors)===null||r===void 0?void 0:r.filter(S=>S.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(m="aal2");const x=h.amr||[];return{data:{currentLevel:g,nextLevel:m,currentAuthenticationMethods:x},error:null}}catch(h){if(ot(h))return this._returnResult({data:null,error:h});throw h}const{data:{session:o},error:s}=await this.getSession();if(s)return this._returnResult({data:null,error:s});if(!o)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:l}=Lb(o.access_token);let c=null;l.aal&&(c=l.aal);let u=c;((a=(i=o.user.factors)===null||i===void 0?void 0:i.filter(h=>h.status==="verified"))!==null&&a!==void 0?a:[]).length>0&&(u="aal2");const p=l.amr||[];return{data:{currentLevel:c,nextLevel:u,currentAuthenticationMethods:p},error:null}}async _getAuthorizationDetails(t){try{return await this._useSession(async r=>{const{data:{session:n},error:i}=r;return i?this._returnResult({data:null,error:i}):n?await bt(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:n.access_token,xform:a=>({data:a,error:null})}):this._returnResult({data:null,error:new Ea})})}catch(r){if(ot(r))return this._returnResult({data:null,error:r});throw r}}async _approveAuthorization(t,r){try{return await this._useSession(async n=>{const{data:{session:i},error:a}=n;if(a)return this._returnResult({data:null,error:a});if(!i)return this._returnResult({data:null,error:new Ea});const o=await bt(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"approve"},xform:s=>({data:s,error:null})});return o.data&&o.data.redirect_url&&fi()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(n){if(ot(n))return this._returnResult({data:null,error:n});throw n}}async _denyAuthorization(t,r){try{return await this._useSession(async n=>{const{data:{session:i},error:a}=n;if(a)return this._returnResult({data:null,error:a});if(!i)return this._returnResult({data:null,error:new Ea});const o=await bt(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"deny"},xform:s=>({data:s,error:null})});return o.data&&o.data.redirect_url&&fi()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(n){if(ot(n))return this._returnResult({data:null,error:n});throw n}}async _listOAuthGrants(){try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;return n?this._returnResult({data:null,error:n}):r?await bt(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,xform:i=>({data:i,error:null})}):this._returnResult({data:null,error:new Ea})})}catch(t){if(ot(t))return this._returnResult({data:null,error:t});throw t}}async _revokeOAuthGrant(t){try{return await this._useSession(async r=>{const{data:{session:n},error:i}=r;return i?this._returnResult({data:null,error:i}):n?(await bt(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,query:{client_id:t.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new Ea})})}catch(r){if(ot(r))return this._returnResult({data:null,error:r});throw r}}async fetchJwk(t,r={keys:[]}){let n=r.keys.find(s=>s.kid===t);if(n)return n;const i=Date.now();if(n=this.jwks.keys.find(s=>s.kid===t),n&&this.jwks_cached_at+cue>i)return n;const{data:a,error:o}=await bt(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=i,n=a.keys.find(s=>s.kid===t),!n)?null:n}async getClaims(t,r={}){try{let n=t;if(!n){const{data:h,error:g}=await this.getSession();if(g||!h.session)return this._returnResult({data:null,error:g});n=h.session.access_token}const{header:i,payload:a,signature:o,raw:{header:s,payload:l}}=Lb(n);r!=null&&r.allowExpired||Tue(a.exp);const c=!i.alg||i.alg.startsWith("HS")||!i.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(i.kid,r!=null&&r.keys?{keys:r.keys}:r==null?void 0:r.jwks);if(!c){const{error:h}=await this.getUser(n);if(h)throw h;return{data:{claims:a,header:i,signature:o},error:null}}const u=Oue(i.alg),f=await crypto.subtle.importKey("jwk",c,u,!0,["verify"]);if(!await crypto.subtle.verify(u,f,o,yue(`${s}.${l}`)))throw new Mj("Invalid JWT signature");return{data:{claims:a,header:i,signature:o},error:null}}catch(n){if(ot(n))return this._returnResult({data:null,error:n});throw n}}}$y.nextInstanceID={};const cde=$y,ude="2.97.0";let Pv="";typeof Deno<"u"?Pv="deno":typeof document<"u"?Pv="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Pv="react-native":Pv="node";const dde={"X-Client-Info":`supabase-js-${Pv}/${ude}`},fde={headers:dde},hde={schema:"public"},pde={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},mde={};function Dy(e){"@babel/helpers - typeof";return Dy=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},Dy(e)}function gde(e,t){if(Dy(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Dy(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vde(e){var t=gde(e,"string");return Dy(t)=="symbol"?t:t+""}function yde(e,t,r){return(t=vde(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function w6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function dn(e){for(var t=1;te?(...t)=>e(...t):(...t)=>fetch(...t),xde=()=>Headers,wde=(e,t,r)=>{const n=bde(r),i=xde();return async(a,o)=>{var s;const l=(s=await t())!==null&&s!==void 0?s:e;let c=new i(o==null?void 0:o.headers);return c.has("apikey")||c.set("apikey",e),c.has("Authorization")||c.set("Authorization",`Bearer ${l}`),n(a,dn(dn({},o),{},{headers:c}))}};function _de(e){return e.endsWith("/")?e:e+"/"}function Sde(e,t){var r,n;const{db:i,auth:a,realtime:o,global:s}=e,{db:l,auth:c,realtime:u,global:f}=t,p={db:dn(dn({},l),i),auth:dn(dn({},c),a),realtime:dn(dn({},u),o),storage:{},global:dn(dn(dn({},f),s),{},{headers:dn(dn({},(r=f==null?void 0:f.headers)!==null&&r!==void 0?r:{}),(n=s==null?void 0:s.headers)!==null&&n!==void 0?n:{})}),accessToken:async()=>""};return e.accessToken?p.accessToken=e.accessToken:delete p.accessToken,p}function Ade(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(_de(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var Pde=class extends cde{constructor(e){super(e)}},kde=class{constructor(e,t,r){var n,i;this.supabaseUrl=e,this.supabaseKey=t;const a=Ade(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`,s={db:hde,realtime:mde,auth:dn(dn({},pde),{},{storageKey:o}),global:fde},l=Sde(r??{},s);if(this.storageKey=(n=l.auth.storageKey)!==null&&n!==void 0?n:"",this.headers=(i=l.global.headers)!==null&&i!==void 0?i:{},l.accessToken)this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(u,f)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(f)} is not possible`)}});else{var c;this.auth=this._initSupabaseAuthClient((c=l.auth)!==null&&c!==void 0?c:{},this.headers,l.global.fetch)}this.fetch=wde(t,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient(dn({headers:this.headers,accessToken:this._getAccessToken.bind(this)},l.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(u=>this.realtime.setAuth(u)).catch(u=>console.warn("Failed to set initial Realtime auth token:",u)),this.rest=new dce(new URL("rest/v1",a).href,{headers:this.headers,schema:l.db.schema,fetch:this.fetch,timeout:l.db.timeout,urlLengthLimit:l.db.urlLengthLimit}),this.storage=new iue(this.storageUrl.href,this.headers,this.fetch,r==null?void 0:r.storage),l.accessToken||this._listenForAuthEvents()}get functions(){return new nce(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,r)}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,r;if(e.accessToken)return await e.accessToken();const{data:n}=await e.auth.getSession();return(t=(r=n.session)===null||r===void 0?void 0:r.access_token)!==null&&t!==void 0?t:e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,userStorage:i,storageKey:a,flowType:o,lock:s,debug:l,throwOnError:c},u,f){const p={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new Pde({url:this.authUrl.href,headers:dn(dn({},p),u),storageKey:a,autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,userStorage:i,flowType:o,lock:s,debug:l,throwOnError:c,fetch:f,hasCustomAuthorizationHeader:Object.keys(this.headers).some(h=>h.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new Nce(this.realtimeUrl.href,dn(dn({},e),{},{params:dn(dn({},{apikey:this.supabaseKey}),e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",t==null?void 0:t.access_token)})}_handleTokenChanged(e,t,r){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const jde=(e,t,r)=>new kde(e,t,r);function Nde(){if(typeof window<"u")return!1;const e=globalThis.process;if(!e)return!1;const t=e.version;if(t==null)return!1;const r=t.match(/^v(\d+)\./);return r?parseInt(r[1],10)<=18:!1}Nde()&&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 Ede="https://cefnrlcowzpdlfmevmwq.supabase.co",Cde="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImNlZm5ybGNvd3pwZGxmbWV2bXdxIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzE5NzE1MTYsImV4cCI6MjA4NzU0NzUxNn0.IhRFsa5YZnoEBVnWUWa0lf_ZS3xanbiOi7lsS8mrX1A",wr=jde(Ede,Cde,{auth:{storage:localStorage,persistSession:!0,autoRefreshToken:!0}}),vH=P.createContext(void 0),vs=()=>{const e=P.useContext(vH);if(!e)throw new Error("useAuth must be used within AuthProvider");return e},Tde=({children:e})=>{const[t,r]=P.useState(null),[n,i]=P.useState(null),[a,o]=P.useState(!0),[s,l]=P.useState(!1),[c,u]=P.useState("free"),[f,p]=P.useState(null),[h,g]=P.useState(!1),m=P.useCallback(async _=>{try{const{data:k}=await wr.from("user_roles").select("role").eq("user_id",_).eq("role","admin").maybeSingle();g(!!k)}catch{g(!1)}},[]),v=P.useCallback(async()=>{try{const{data:_,error:k}=await wr.functions.invoke("check-subscription");if(k){console.error("check-subscription error:",k);return}l((_==null?void 0:_.subscribed)??!1),u((_==null?void 0:_.tier)??"free"),p((_==null?void 0:_.subscription_end)??null)}catch(_){console.error("Failed to check subscription:",_)}},[]),y=P.useCallback(async()=>{await v()},[v]);P.useEffect(()=>{const{data:{subscription:_}}=wr.auth.onAuthStateChange((k,E)=>{i(E),r((E==null?void 0:E.user)??null),E!=null&&E.user?(setTimeout(()=>v(),0),m(E.user.id)):(l(!1),u("free"),p(null),g(!1)),o(!1)});return wr.auth.getSession().then(({data:{session:k}})=>{i(k),r((k==null?void 0:k.user)??null),k!=null&&k.user&&(v(),m(k.user.id)),o(!1)}),()=>_.unsubscribe()},[v]),P.useEffect(()=>{if(!t)return;const _=setInterval(v,6e4);return()=>clearInterval(_)},[t,v]),P.useEffect(()=>{if(!t)return;const _=()=>v();return window.addEventListener("focus",_),()=>window.removeEventListener("focus",_)},[t,v]);const b=async(_,k,E)=>{const{error:O}=await wr.auth.signUp({email:_,password:k,options:{data:{full_name:E}}});if(O)throw O},x=async(_,k)=>{const{error:E}=await wr.auth.signInWithPassword({email:_,password:k});if(E)throw E},S=async()=>{const{error:_}=await wr.auth.signOut();if(_)throw _};return d.jsx(vH.Provider,{value:{user:t,session:n,loading:a,subscribed:s,subscriptionTier:c,subscriptionEnd:f,isAdmin:h,refreshSubscription:y,signUp:b,signIn:x,signOut:S},children:e})},Ode=()=>{const{pathname:e}=yc();return P.useEffect(()=>{window.scrollTo(0,0)},[e]),null},Rde=G0("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"}}),pt=P.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...i},a)=>{const o=n?Ere:"button";return d.jsx(o,{className:lt(Rde({variant:t,size:r,className:e})),ref:a,...i})});pt.displayName="Button";var vA="focusScope.autoFocusOnMount",yA="focusScope.autoFocusOnUnmount",_6={bubbles:!1,cancelable:!0},Lde="FocusScope",C5=P.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,l]=P.useState(null),c=No(i),u=No(a),f=P.useRef(null),p=qt(t,m=>l(m)),h=P.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;P.useEffect(()=>{if(n){let m=function(x){if(h.paused||!s)return;const S=x.target;s.contains(S)?f.current=S:Wc(f.current,{select:!0})},v=function(x){if(h.paused||!s)return;const S=x.relatedTarget;S!==null&&(s.contains(S)||Wc(f.current,{select:!0}))},y=function(x){if(document.activeElement===document.body)for(const _ of x)_.removedNodes.length>0&&Wc(s)};document.addEventListener("focusin",m),document.addEventListener("focusout",v);const b=new MutationObserver(y);return s&&b.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",v),b.disconnect()}}},[n,s,h.paused]),P.useEffect(()=>{if(s){A6.add(h);const m=document.activeElement;if(!s.contains(m)){const y=new CustomEvent(vA,_6);s.addEventListener(vA,c),s.dispatchEvent(y),y.defaultPrevented||(Ide(Bde(yH(s)),{select:!0}),document.activeElement===m&&Wc(s))}return()=>{s.removeEventListener(vA,c),setTimeout(()=>{const y=new CustomEvent(yA,_6);s.addEventListener(yA,u),s.dispatchEvent(y),y.defaultPrevented||Wc(m??document.body,{select:!0}),s.removeEventListener(yA,u),A6.remove(h)},0)}}},[s,c,u,h]);const g=P.useCallback(m=>{if(!r&&!n||h.paused)return;const v=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,y=document.activeElement;if(v&&y){const b=m.currentTarget,[x,S]=Mde(b);x&&S?!m.shiftKey&&y===S?(m.preventDefault(),r&&Wc(x,{select:!0})):m.shiftKey&&y===x&&(m.preventDefault(),r&&Wc(S,{select:!0})):y===b&&m.preventDefault()}},[r,n,h.paused]);return d.jsx(ft.div,{tabIndex:-1,...o,ref:p,onKeyDown:g})});C5.displayName=Lde;function Ide(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Wc(n,{select:t}),document.activeElement!==r)return}function Mde(e){const t=yH(e),r=S6(t,e),n=S6(t.reverse(),e);return[r,n]}function yH(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function S6(e,t){for(const r of e)if(!$de(r,{upTo:t}))return r}function $de(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 Dde(e){return e instanceof HTMLInputElement&&"select"in e}function Wc(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&Dde(e)&&t&&e.select()}}var A6=Fde();function Fde(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=P6(e,t),e.unshift(t)},remove(t){var r;e=P6(e,t),(r=e[0])==null||r.resume()}}}function P6(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function Bde(e){return e.filter(t=>t.tagName!=="A")}var bA=0;function B3(){P.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??k6()),document.body.insertAdjacentElement("beforeend",e[1]??k6()),bA++,()=>{bA===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),bA--}},[])}function k6(){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 Rx="right-scroll-bar-position",Lx="width-before-scroll-bar",Ude="with-scroll-bars-hidden",zde="--removed-body-scroll-bar-size";function xA(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Hde(e,t){var r=P.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var i=r.value;i!==n&&(r.value=n,r.callback(n,i))}}}})[0];return r.callback=t,r.facade}var Vde=typeof window<"u"?P.useLayoutEffect:P.useEffect,j6=new WeakMap;function qde(e,t){var r=Hde(null,function(n){return e.forEach(function(i){return xA(i,n)})});return Vde(function(){var n=j6.get(r);if(n){var i=new Set(n),a=new Set(e),o=r.current;i.forEach(function(s){a.has(s)||xA(s,null)}),a.forEach(function(s){i.has(s)||xA(s,o)})}j6.set(r,e)},[e]),r}function Wde(e){return e}function Gde(e,t){t===void 0&&(t=Wde);var r=[],n=!1,i={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(a){var o=t(a,n);return r.push(o),function(){r=r.filter(function(s){return s!==o})}},assignSyncMedium:function(a){for(n=!0;r.length;){var o=r;r=[],o.forEach(a)}r={push:function(s){return a(s)},filter:function(){return r}}},assignMedium:function(a){n=!0;var o=[];if(r.length){var s=r;r=[],s.forEach(a),o=r}var l=function(){var u=o;o=[],u.forEach(a)},c=function(){return Promise.resolve().then(l)};c(),r={push:function(u){o.push(u),c()},filter:function(u){return o=o.filter(u),r}}}};return i}function Kde(e){e===void 0&&(e={});var t=Gde(null);return t.options=Bs({async:!0,ssr:!1},e),t}var bH=function(e){var t=e.sideCar,r=Hm(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return P.createElement(n,Bs({},r))};bH.isSideCarExport=!0;function Yde(e,t){return e.useMedium(t),bH}var xH=Kde(),wA=function(){},T5=P.forwardRef(function(e,t){var r=P.useRef(null),n=P.useState({onScrollCapture:wA,onWheelCapture:wA,onTouchMoveCapture:wA}),i=n[0],a=n[1],o=e.forwardProps,s=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,f=e.shards,p=e.sideCar,h=e.noRelative,g=e.noIsolation,m=e.inert,v=e.allowPinchZoom,y=e.as,b=y===void 0?"div":y,x=e.gapMode,S=Hm(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=p,k=qde([r,t]),E=Bs(Bs({},S),i);return P.createElement(P.Fragment,null,u&&P.createElement(_,{sideCar:xH,removeScrollBar:c,shards:f,noRelative:h,noIsolation:g,inert:m,setCallbacks:a,allowPinchZoom:!!v,lockRef:r,gapMode:x}),o?P.cloneElement(P.Children.only(s),Bs(Bs({},E),{ref:k})):P.createElement(b,Bs({},E,{className:l,ref:k}),s))});T5.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};T5.classNames={fullWidth:Lx,zeroRight:Rx};var Xde=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Jde(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Xde();return t&&e.setAttribute("nonce",t),e}function Zde(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Qde(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var efe=function(){var e=0,t=null;return{add:function(r){e==0&&(t=Jde())&&(Zde(t,r),Qde(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},tfe=function(){var e=efe();return function(t,r){P.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},wH=function(){var e=tfe(),t=function(r){var n=r.styles,i=r.dynamic;return e(n,i),null};return t},rfe={left:0,top:0,right:0,gap:0},_A=function(e){return parseInt(e||"",10)||0},nfe=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[_A(r),_A(n),_A(i)]},ife=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return rfe;var t=nfe(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},afe=wH(),gp="data-scroll-locked",ofe=function(e,t,r,n){var i=e.left,a=e.top,o=e.right,s=e.gap;return r===void 0&&(r="margin"),` .`.concat(Ude,` { overflow: hidden `).concat(n,`; padding-right: `).concat(s,"px ").concat(n,`; } body[`).concat(gp,`] { overflow: hidden `).concat(n,`; overscroll-behavior: contain; `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&` padding-left: `.concat(i,`px; padding-top: `).concat(a,`px; padding-right: `).concat(o,`px; margin-left:0; margin-top:0; margin-right: `).concat(s,"px ").concat(n,`; `),r==="padding"&&"padding-right: ".concat(s,"px ").concat(n,";")].filter(Boolean).join(""),` } .`).concat(Rx,` { right: `).concat(s,"px ").concat(n,`; } .`).concat(Lx,` { margin-right: `).concat(s,"px ").concat(n,`; } .`).concat(Rx," .").concat(Rx,` { right: 0 `).concat(n,`; } .`).concat(Lx," .").concat(Lx,` { margin-right: 0 `).concat(n,`; } body[`).concat(gp,`] { `).concat(zde,": ").concat(s,`px; } `)},N6=function(){var e=parseInt(document.body.getAttribute(gp)||"0",10);return isFinite(e)?e:0},sfe=function(){P.useEffect(function(){return document.body.setAttribute(gp,(N6()+1).toString()),function(){var e=N6()-1;e<=0?document.body.removeAttribute(gp):document.body.setAttribute(gp,e.toString())}},[])},lfe=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,i=n===void 0?"margin":n;sfe();var a=P.useMemo(function(){return ife(i)},[i]);return P.createElement(afe,{styles:ofe(a,!t,i,r?"":"!important")})},$j=!1;if(typeof window<"u")try{var Ib=Object.defineProperty({},"passive",{get:function(){return $j=!0,!0}});window.addEventListener("test",Ib,Ib),window.removeEventListener("test",Ib,Ib)}catch{$j=!1}var fh=$j?{passive:!1}:!1,cfe=function(e){return e.tagName==="TEXTAREA"},_H=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!cfe(e)&&r[t]==="visible")},ufe=function(e){return _H(e,"overflowY")},dfe=function(e){return _H(e,"overflowX")},E6=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var i=SH(e,n);if(i){var a=AH(e,n),o=a[1],s=a[2];if(o>s)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},ffe=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},hfe=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},SH=function(e,t){return e==="v"?ufe(t):dfe(t)},AH=function(e,t){return e==="v"?ffe(t):hfe(t)},pfe=function(e,t){return e==="h"&&t==="rtl"?-1:1},mfe=function(e,t,r,n,i){var a=pfe(e,window.getComputedStyle(t).direction),o=a*n,s=r.target,l=t.contains(s),c=!1,u=o>0,f=0,p=0;do{if(!s)break;var h=AH(e,s),g=h[0],m=h[1],v=h[2],y=m-v-a*g;(g||y)&&SH(e,s)&&(f+=y,p+=g);var b=s.parentNode;s=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(u&&(Math.abs(f)<1||!i)||!u&&(Math.abs(p)<1||!i))&&(c=!0),c},Mb=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},C6=function(e){return[e.deltaX,e.deltaY]},T6=function(e){return e&&"current"in e?e.current:e},gfe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},vfe=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} `)},yfe=0,hh=[];function bfe(e){var t=P.useRef([]),r=P.useRef([0,0]),n=P.useRef(),i=P.useState(yfe++)[0],a=P.useState(wH)[0],o=P.useRef(e);P.useEffect(function(){o.current=e},[e]),P.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var m=ece([e.lockRef.current],(e.shards||[]).map(T6),!0).filter(Boolean);return m.forEach(function(v){return v.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),m.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=P.useCallback(function(m,v){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!o.current.allowPinchZoom;var y=Mb(m),b=r.current,x="deltaX"in m?m.deltaX:b[0]-y[0],S="deltaY"in m?m.deltaY:b[1]-y[1],_,k=m.target,E=Math.abs(x)>Math.abs(S)?"h":"v";if("touches"in m&&E==="h"&&k.type==="range")return!1;var O=E6(E,k);if(!O)return!0;if(O?_=E:(_=E==="v"?"h":"v",O=E6(E,k)),!O)return!1;if(!n.current&&"changedTouches"in m&&(x||S)&&(n.current=_),!_)return!0;var R=n.current||_;return mfe(R,v,m,R==="h"?x:S,!0)},[]),l=P.useCallback(function(m){var v=m;if(!(!hh.length||hh[hh.length-1]!==a)){var y="deltaY"in v?C6(v):Mb(v),b=t.current.filter(function(_){return _.name===v.type&&(_.target===v.target||v.target===_.shadowParent)&&gfe(_.delta,y)})[0];if(b&&b.should){v.cancelable&&v.preventDefault();return}if(!b){var x=(o.current.shards||[]).map(T6).filter(Boolean).filter(function(_){return _.contains(v.target)}),S=x.length>0?s(v,x[0]):!o.current.noIsolation;S&&v.cancelable&&v.preventDefault()}}},[]),c=P.useCallback(function(m,v,y,b){var x={name:m,delta:v,target:y,should:b,shadowParent:xfe(y)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(S){return S!==x})},1)},[]),u=P.useCallback(function(m){r.current=Mb(m),n.current=void 0},[]),f=P.useCallback(function(m){c(m.type,C6(m),m.target,s(m,e.lockRef.current))},[]),p=P.useCallback(function(m){c(m.type,Mb(m),m.target,s(m,e.lockRef.current))},[]);P.useEffect(function(){return hh.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",l,fh),document.addEventListener("touchmove",l,fh),document.addEventListener("touchstart",u,fh),function(){hh=hh.filter(function(m){return m!==a}),document.removeEventListener("wheel",l,fh),document.removeEventListener("touchmove",l,fh),document.removeEventListener("touchstart",u,fh)}},[]);var h=e.removeScrollBar,g=e.inert;return P.createElement(P.Fragment,null,g?P.createElement(a,{styles:vfe(i)}):null,h?P.createElement(lfe,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function xfe(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const wfe=Yde(xH,bfe);var O5=P.forwardRef(function(e,t){return P.createElement(T5,Bs({},e,{ref:t,sideCar:wfe}))});O5.classNames=T5.classNames;var _fe=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ph=new WeakMap,$b=new WeakMap,Db={},SA=0,PH=function(e){return e&&(e.host||PH(e.parentNode))},Sfe=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=PH(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},Afe=function(e,t,r,n){var i=Sfe(t,Array.isArray(e)?e:[e]);Db[r]||(Db[r]=new WeakMap);var a=Db[r],o=[],s=new Set,l=new Set(i),c=function(f){!f||s.has(f)||(s.add(f),c(f.parentNode))};i.forEach(c);var u=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(p){if(s.has(p))u(p);else try{var h=p.getAttribute(n),g=h!==null&&h!=="false",m=(ph.get(p)||0)+1,v=(a.get(p)||0)+1;ph.set(p,m),a.set(p,v),o.push(p),m===1&&g&&$b.set(p,!0),v===1&&p.setAttribute(r,"true"),g||p.setAttribute(n,"true")}catch(y){console.error("aria-hidden: cannot operate on ",p,y)}})};return u(t),s.clear(),SA++,function(){o.forEach(function(f){var p=ph.get(f)-1,h=a.get(f)-1;ph.set(f,p),a.set(f,h),p||($b.has(f)||f.removeAttribute(n),$b.delete(f)),h||f.removeAttribute(r)}),SA--,SA||(ph=new WeakMap,ph=new WeakMap,$b=new WeakMap,Db={})}},U3=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),i=_fe(e);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live]"))),Afe(n,i,r,"aria-hidden")):function(){return null}},R5="Dialog",[kH,aqe]=Qa(R5),[Pfe,ys]=kH(R5),jH=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=P.useRef(null),l=P.useRef(null),[c,u]=Ga({prop:n,defaultProp:i??!1,onChange:a,caller:R5});return d.jsx(Pfe,{scope:t,triggerRef:s,contentRef:l,contentId:_o(),titleId:_o(),descriptionId:_o(),open:c,onOpenChange:u,onOpenToggle:P.useCallback(()=>u(f=>!f),[u]),modal:o,children:r})};jH.displayName=R5;var NH="DialogTrigger",EH=P.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=ys(NH,r),a=qt(t,i.triggerRef);return d.jsx(ft.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":V3(i.open),...n,ref:a,onClick:qe(e.onClick,i.onOpenToggle)})});EH.displayName=NH;var z3="DialogPortal",[kfe,CH]=kH(z3,{forceMount:void 0}),TH=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:i}=e,a=ys(z3,t);return d.jsx(kfe,{scope:t,forceMount:r,children:P.Children.map(n,o=>d.jsx(ms,{present:r||a.open,children:d.jsx(q0,{asChild:!0,container:i,children:o})}))})};TH.displayName=z3;var Ew="DialogOverlay",OH=P.forwardRef((e,t)=>{const r=CH(Ew,e.__scopeDialog),{forceMount:n=r.forceMount,...i}=e,a=ys(Ew,e.__scopeDialog);return a.modal?d.jsx(ms,{present:n||a.open,children:d.jsx(Nfe,{...i,ref:t})}):null});OH.displayName=Ew;var jfe=xf("DialogOverlay.RemoveScroll"),Nfe=P.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=ys(Ew,r);return d.jsx(O5,{as:jfe,allowPinchZoom:!0,shards:[i.contentRef],children:d.jsx(ft.div,{"data-state":V3(i.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),Sf="DialogContent",RH=P.forwardRef((e,t)=>{const r=CH(Sf,e.__scopeDialog),{forceMount:n=r.forceMount,...i}=e,a=ys(Sf,e.__scopeDialog);return d.jsx(ms,{present:n||a.open,children:a.modal?d.jsx(Efe,{...i,ref:t}):d.jsx(Cfe,{...i,ref:t})})});RH.displayName=Sf;var Efe=P.forwardRef((e,t)=>{const r=ys(Sf,e.__scopeDialog),n=P.useRef(null),i=qt(t,r.contentRef,n);return P.useEffect(()=>{const a=n.current;if(a)return U3(a)},[]),d.jsx(LH,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:qe(e.onCloseAutoFocus,a=>{var o;a.preventDefault(),(o=r.triggerRef.current)==null||o.focus()}),onPointerDownOutside:qe(e.onPointerDownOutside,a=>{const o=a.detail.originalEvent,s=o.button===0&&o.ctrlKey===!0;(o.button===2||s)&&a.preventDefault()}),onFocusOutside:qe(e.onFocusOutside,a=>a.preventDefault())})}),Cfe=P.forwardRef((e,t)=>{const r=ys(Sf,e.__scopeDialog),n=P.useRef(!1),i=P.useRef(!1);return d.jsx(LH,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,s;(o=e.onCloseAutoFocus)==null||o.call(e,a),a.defaultPrevented||(n.current||(s=r.triggerRef.current)==null||s.focus(),a.preventDefault()),n.current=!1,i.current=!1},onInteractOutside:a=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=a.target;((c=r.triggerRef.current)==null?void 0:c.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),LH=P.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=ys(Sf,r),l=P.useRef(null),c=qt(t,l);return B3(),d.jsxs(d.Fragment,{children:[d.jsx(C5,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:a,children:d.jsx($m,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":V3(s.open),...o,ref:c,onDismiss:()=>s.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx(Tfe,{titleId:s.titleId}),d.jsx(Rfe,{contentRef:l,descriptionId:s.descriptionId})]})]})}),H3="DialogTitle",IH=P.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=ys(H3,r);return d.jsx(ft.h2,{id:i.titleId,...n,ref:t})});IH.displayName=H3;var MH="DialogDescription",$H=P.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=ys(MH,r);return d.jsx(ft.p,{id:i.descriptionId,...n,ref:t})});$H.displayName=MH;var DH="DialogClose",FH=P.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=ys(DH,r);return d.jsx(ft.button,{type:"button",...n,ref:t,onClick:qe(e.onClick,()=>i.onOpenChange(!1))})});FH.displayName=DH;function V3(e){return e?"open":"closed"}var BH="DialogTitleWarning",[oqe,UH]=jre(BH,{contentName:Sf,titleName:H3,docsSlug:"dialog"}),Tfe=({titleId:e})=>{const t=UH(BH),r=`\`${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 P.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},Ofe="DialogDescriptionWarning",Rfe=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${UH(Ofe).contentName}}.`;return P.useEffect(()=>{var a;const i=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},zH=jH,Lfe=EH,HH=TH,L5=OH,I5=RH,M5=IH,$5=$H,VH=FH;const qH=zH,WH=Lfe,Ife=HH,GH=P.forwardRef(({className:e,...t},r)=>d.jsx(L5,{className:lt("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));GH.displayName=L5.displayName;const Mfe=G0("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"}}),q3=P.forwardRef(({side:e="right",className:t,children:r,...n},i)=>d.jsxs(Ife,{children:[d.jsx(GH,{}),d.jsxs(I5,{ref:i,className:lt(Mfe({side:e}),t),...n,children:[r,d.jsxs(VH,{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:[d.jsx(Xp,{className:"h-4 w-4"}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));q3.displayName=I5.displayName;const W3=({className:e,...t})=>d.jsx("div",{className:lt("flex flex-col space-y-2 text-center sm:text-left",e),...t});W3.displayName="SheetHeader";const G3=P.forwardRef(({className:e,...t},r)=>d.jsx(M5,{ref:r,className:lt("text-lg font-semibold text-foreground",e),...t}));G3.displayName=M5.displayName;const $fe=P.forwardRef(({className:e,...t},r)=>d.jsx($5,{ref:r,className:lt("text-sm text-muted-foreground",e),...t}));$fe.displayName=$5.displayName;const O6=[{label:"Dashboard",to:"/dashboard"},{label:"Explorer",to:"/explorer"},{label:"Trends",to:"/trends"},{label:"Compare",to:"/compare"},{label:"Calculator",to:"/calculator"},{label:"AI Advisor",to:"/advisor"},{label:"Reports",to:"/reports"},{label:"Pricing",to:"/pricing"}],Dfe=()=>{const[e,t]=P.useState(!1),r=yc(),n=gs(),{user:i,signOut:a}=vs(),o=async()=>{await a(),t(!1),n("/")};return d.jsx("header",{className:"sticky top-0 z-50 border-b bg-background/80 backdrop-blur-lg",children:d.jsxs("div",{className:"container mx-auto flex h-16 items-center justify-between px-4",children:[d.jsxs(At,{to:"/",className:"flex items-center gap-2.5",children:[d.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg bg-primary",children:d.jsx(f3,{className:"h-5 w-5 text-primary-foreground"})}),d.jsx("span",{className:"text-xl font-bold tracking-tight",style:{fontFamily:"'Space Grotesk', sans-serif"},children:"HotelPulse"})]}),d.jsx("nav",{className:"hidden items-center gap-1 md:flex",children:O6.map(s=>d.jsx(At,{to:s.to,className:`rounded-md px-3 py-2 text-sm font-medium transition-colors hover:bg-secondary hover:text-secondary-foreground ${r.pathname===s.to?"bg-secondary text-secondary-foreground":"text-muted-foreground"}`,children:s.label},s.to))}),d.jsx("div",{className:"hidden items-center gap-2 md:flex",children:i?d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"text-sm text-muted-foreground truncate max-w-[160px]",children:i.email}),d.jsx(pt,{variant:"ghost",size:"sm",onClick:o,children:"Sign Out"})]}):d.jsxs(d.Fragment,{children:[d.jsx(pt,{variant:"ghost",size:"sm",asChild:!0,children:d.jsx(At,{to:"/auth",children:"Log In"})}),d.jsx(pt,{size:"sm",asChild:!0,children:d.jsx(At,{to:"/auth",children:"Get Started Free"})})]})}),d.jsxs(qH,{open:e,onOpenChange:t,children:[d.jsx(WH,{asChild:!0,className:"hidden",children:d.jsx(pt,{variant:"ghost",size:"icon","aria-label":"Toggle menu",children:d.jsx(Dne,{className:"h-5 w-5"})})}),d.jsxs(q3,{side:"right",className:"w-72 pt-12",children:[d.jsx(W3,{className:"sr-only",children:d.jsx(G3,{children:"Navigation"})}),d.jsx("nav",{className:"flex flex-col gap-1",children:O6.map(s=>d.jsx(At,{to:s.to,onClick:()=>t(!1),className:`rounded-md px-4 py-3 text-sm font-medium transition-colors ${r.pathname===s.to?"bg-secondary text-secondary-foreground":"text-muted-foreground hover:bg-secondary"}`,children:s.label},s.to))}),d.jsx("div",{className:"mt-6 flex flex-col gap-2 border-t pt-4",children:i?d.jsxs(d.Fragment,{children:[d.jsx("p",{className:"px-4 text-xs text-muted-foreground truncate",children:i.email}),d.jsx(pt,{variant:"outline",size:"sm",className:"w-full",onClick:o,children:"Sign Out"})]}):d.jsxs(d.Fragment,{children:[d.jsx(pt,{variant:"outline",size:"sm",className:"w-full",asChild:!0,children:d.jsx(At,{to:"/auth",onClick:()=>t(!1),children:"Log In"})}),d.jsx(pt,{size:"sm",className:"w-full",asChild:!0,children:d.jsx(At,{to:"/auth",onClick:()=>t(!1),children:"Get Started Free"})})]})})]})]})]})})},vp="https://hotel-pulse.com",e1=[{slug:"new-york",city:"New York",country:"USA",countrySlug:"usa",region:"North America",title:"New York Hotel Market Data 2026 — Rates, Occupancy & RevPAR | HotelPulse",metaDescription:"New York City hotel market intelligence for 2026. Average nightly rates from $189 (3★) to $587 (5★), 87% occupancy, $271 RevPAR, and +4.2% YoY growth.",keywords:["new york hotel rates","nyc hotel market data","new york hotel occupancy","nyc revpar","manhattan hotel pricing"],relatedSlugs:["miami","london","paris","tokyo","dubai"],overview:"New York City remains one of the world's most competitive hotel markets, with over 700 hotels and occupancy rates consistently above 85%. The city's 4-star average rate of $312 per night reflects strong demand from both business and leisure travelers. Peak season from September through December drives rates above $400, fueled by holiday tourism and major events."},{slug:"paris",city:"Paris",country:"France",countrySlug:"france",region:"Europe",title:"Paris Hotel Market Data 2026 — Rates, Occupancy & RevPAR | HotelPulse",metaDescription:"Paris hotel pricing intelligence for 2026. Average rates from €145 (3★) to €620 (5★), 82% occupancy, €228 RevPAR. Complete market analysis.",keywords:["paris hotel rates","paris hotel market","france hotel occupancy","paris revpar","paris hotel pricing 2026"],relatedSlugs:["london","barcelona","rome","amsterdam","lisbon"],overview:"Paris continues to lead European hotel markets with strong demand driven by cultural tourism, business travel, and major international events. The city's 5-star segment commands an average of €620 per night, while 4-star properties average €278. Summer months (June–September) represent peak season with rates climbing 35% above annual averages."},{slug:"london",city:"London",country:"UK",countrySlug:"uk",region:"Europe",title:"London Hotel Market Data 2026 — Rates, Occupancy & RevPAR | HotelPulse",metaDescription:"London hotel market analytics for 2026. Average rates from £165 (3★) to £545 (5★), 84% occupancy, £248 RevPAR. Seasonal trends and competitive analysis.",keywords:["london hotel rates","london hotel occupancy","uk hotel market","london revpar","london hotel data"],relatedSlugs:["paris","amsterdam","barcelona","rome","vienna"],overview:"London's hotel market remains among Europe's strongest, with 84% occupancy and a RevPAR of £248. The city's diverse demand base — from financial district business travelers to West End tourists — supports premium pricing year-round. Summer months drive the highest rates, with 4-star properties averaging £395 during peak season."},{slug:"tokyo",city:"Tokyo",country:"Japan",countrySlug:"japan",region:"Asia Pacific",title:"Tokyo Hotel Market Data 2026 — Rates, Occupancy & RevPAR | HotelPulse",metaDescription:"Tokyo hotel market data for 2026. Average rates from ¥98 (3★) to ¥420 (5★), 79% occupancy, ¥154 RevPAR. +8.5% YoY growth analysis.",keywords:["tokyo hotel rates","japan hotel market","tokyo occupancy rates","tokyo revpar","asia hotel pricing"],relatedSlugs:["seoul","singapore","bangkok","sydney"],overview:"Tokyo's hotel market is experiencing remarkable growth at +8.5% YoY, driven by a resurgence in international tourism and major event hosting. Cherry blossom season (March–May) commands premium rates, with 4-star hotels averaging ¥250 per night. The city's unique blend of business and cultural tourism creates stable year-round demand."},{slug:"dubai",city:"Dubai",country:"UAE",countrySlug:"uae",region:"Middle East",title:"Dubai Hotel Market Data 2026 — Rates, Occupancy & RevPAR | HotelPulse",metaDescription:"Dubai hotel market intelligence for 2026. Average rates from $110 (3★) to $510 (5★), 76% occupancy, $186 RevPAR. +9.3% YoY growth.",keywords:["dubai hotel rates","dubai hotel market","uae hotel data","dubai revpar","dubai hotel occupancy"],relatedSlugs:["istanbul","singapore","marrakech","bangkok"],overview:"Dubai's hotel market continues its rapid expansion with +9.3% YoY growth, the second-highest among tracked cities. The winter season (November–March) dominates with rates reaching $380 for 4-star properties, while summer rates drop significantly due to extreme heat. The city's aggressive tourism strategy targets 25 million visitors annually."},{slug:"barcelona",city:"Barcelona",country:"Spain",countrySlug:"spain",region:"Europe",title:"Barcelona Hotel Market Data 2026 — Rates, Occupancy & RevPAR | HotelPulse",metaDescription:"Barcelona hotel market data for 2026. Average rates from €120 (3★) to €395 (5★), 80% occupancy, €168 RevPAR. Seasonal trends & competition.",keywords:["barcelona hotel rates","spain hotel market","barcelona hotel occupancy","barcelona revpar","mediterranean hotel data"],relatedSlugs:["lisbon","rome","paris","amsterdam","vienna"],overview:"Barcelona's hotel market benefits from year-round Mediterranean appeal, with summer months (June–September) driving peak demand. The city's 80% average occupancy reflects strong leisure tourism, while regulatory changes around short-term rentals are reshaping competitive dynamics and pushing demand toward traditional hotels."},{slug:"rome",city:"Rome",country:"Italy",countrySlug:"italy",region:"Europe",title:"Rome Hotel Market Data 2026 — Rates, Occupancy & RevPAR | HotelPulse",metaDescription:"Rome hotel market analytics for 2026. Average rates from €115 (3★) to €410 (5★), 78% occupancy, €160 RevPAR. Complete Italian market data.",keywords:["rome hotel rates","italy hotel market","rome occupancy data","rome revpar","italian hotel pricing"],relatedSlugs:["barcelona","paris","lisbon","vienna","amsterdam"],overview:"Rome's hotel market thrives on its unmatched cultural heritage, with the extended peak season from April through October driving sustained demand. The Eternal City's 4-star segment averages €205 per night, with Jubilee events and Vatican tourism providing additional demand tailwinds beyond traditional seasonal patterns."},{slug:"sydney",city:"Sydney",country:"Australia",countrySlug:"australia",region:"Asia Pacific",title:"Sydney Hotel Market Data 2026 — Rates, Occupancy & RevPAR | HotelPulse",metaDescription:"Sydney hotel market data for 2026. Average rates from A$135 (3★) to A$475 (5★), 81% occupancy, A$201 RevPAR. Australian market analysis.",keywords:["sydney hotel rates","australia hotel market","sydney occupancy","sydney revpar","australian hotel data"],relatedSlugs:["tokyo","singapore","bangkok","seoul"],overview:"Sydney anchors Australia's hotel market with 81% occupancy and strong international demand, particularly during the Southern Hemisphere summer (December–February). The city's convention and events calendar supports premium corporate rates, while harbor-view properties command significant premiums in the 5-star segment."},{slug:"singapore",city:"Singapore",country:"Singapore",countrySlug:"singapore",region:"Asia Pacific",title:"Singapore Hotel Market Data 2026 — Rates, Occupancy & RevPAR | HotelPulse",metaDescription:"Singapore hotel market intelligence for 2026. Average rates from S$125 (3★) to S$460 (5★), 83% occupancy, S$191 RevPAR.",keywords:["singapore hotel rates","singapore hotel market","singapore occupancy","singapore revpar","southeast asia hotel data"],relatedSlugs:["bangkok","tokyo","seoul","sydney"],overview:"Singapore's hotel market delivers consistently high performance with 83% occupancy, underpinned by the city-state's position as Southeast Asia's premier business hub. Major conventions, Formula 1 Grand Prix, and steady leisure tourism create remarkably stable demand patterns with less seasonal variation than most markets."},{slug:"bangkok",city:"Bangkok",country:"Thailand",countrySlug:"thailand",region:"Asia Pacific",title:"Bangkok Hotel Market Data 2026 — Rates, Occupancy & RevPAR | HotelPulse",metaDescription:"Bangkok hotel market data for 2026. Average rates from $55 (3★) to $285 (5★), 74% occupancy, $85 RevPAR. +7.8% YoY growth.",keywords:["bangkok hotel rates","thailand hotel market","bangkok occupancy","bangkok revpar","southeast asia hotel pricing"],relatedSlugs:["singapore","tokyo","seoul","dubai"],overview:"Bangkok offers exceptional value in Asia Pacific's hotel landscape, with 3-star rates averaging just $55 per night while delivering +7.8% YoY growth. The cool season (November–February) drives peak tourism, and the city's growing reputation for medical tourism and digital nomad stays is diversifying demand beyond traditional leisure travel."},{slug:"istanbul",city:"Istanbul",country:"Turkey",countrySlug:"turkey",region:"Europe",title:"Istanbul Hotel Market Data 2026 — Rates, Occupancy & RevPAR | HotelPulse",metaDescription:"Istanbul hotel market analytics for 2026. Average rates from $65 (3★) to $290 (5★), 72% occupancy, $94 RevPAR. Fastest-growing at +12.4% YoY.",keywords:["istanbul hotel rates","turkey hotel market","istanbul occupancy","istanbul revpar","turkish hotel data"],relatedSlugs:["dubai","marrakech","rome","barcelona"],overview:"Istanbul leads all tracked markets with +12.4% YoY RevPAR growth, making it the fastest-growing hotel market in our coverage. The city's strategic position bridging Europe and Asia, combined with aggressive tourism promotion and a favorable exchange rate, is attracting record visitor numbers. Summer months (May–September) drive peak demand."},{slug:"miami",city:"Miami",country:"USA",countrySlug:"usa",region:"North America",title:"Miami Hotel Market Data 2026 — Rates, Occupancy & RevPAR | HotelPulse",metaDescription:"Miami hotel market data for 2026. Average rates from $155 (3★) to $520 (5★), 78% occupancy, $215 RevPAR. Seasonal pricing analysis.",keywords:["miami hotel rates","miami hotel market","florida hotel data","miami beach hotel pricing","miami revpar"],relatedSlugs:["new-york","cancun","mexico-city","cape-town"],overview:"Miami's hotel market exhibits dramatic seasonality, with winter rates (December–April) nearly double summer pricing. The city's 5-star beachfront properties average $520 per night, while strong Latin American demand and a growing tech sector provide diverse revenue streams beyond traditional tourism."},{slug:"lisbon",city:"Lisbon",country:"Portugal",countrySlug:"portugal",region:"Europe",title:"Lisbon Hotel Market Data 2026 — Rates, Occupancy & RevPAR | HotelPulse",metaDescription:"Lisbon hotel market intelligence for 2026. Average rates from €95 (3★) to €340 (5★), 77% occupancy, €135 RevPAR. +8.9% YoY growth.",keywords:["lisbon hotel rates","portugal hotel market","lisbon occupancy","lisbon revpar","portuguese hotel data"],relatedSlugs:["barcelona","rome","marrakech","paris"],overview:"Lisbon has emerged as one of Europe's most dynamic hotel markets, with +8.9% YoY growth reflecting the city's rising profile as a tech hub, digital nomad destination, and cultural tourism hotspot. Competitive pricing relative to Western European peers makes Lisbon attractive for both travelers and hotel investors."},{slug:"mexico-city",city:"Mexico City",country:"Mexico",countrySlug:"mexico",region:"Latin America",title:"Mexico City Hotel Market Data 2026 — Rates, Occupancy & RevPAR | HotelPulse",metaDescription:"Mexico City hotel market data for 2026. Average rates from $65 (3★) to $280 (5★), 71% occupancy, $89 RevPAR. Latin American market insights.",keywords:["mexico city hotel rates","mexico hotel market","cdmx hotel data","mexico city revpar","latin america hotel pricing"],relatedSlugs:["cancun","miami","cape-town","bangkok"],overview:"Mexico City's hotel market is gaining international attention with +6.7% YoY growth, driven by the city's cultural renaissance and growing appeal to remote workers. The winter dry season (November–March) represents peak demand, and the city's value positioning at $125 average (4-star) makes it one of the most affordable major markets globally."},{slug:"marrakech",city:"Marrakech",country:"Morocco",countrySlug:"morocco",region:"Africa",title:"Marrakech Hotel Market Data 2026 — Rates, Occupancy & RevPAR | HotelPulse",metaDescription:"Marrakech hotel market analytics for 2026. Average rates from $55 (3★) to $310 (5★), 68% occupancy, $82 RevPAR. +11.2% YoY growth.",keywords:["marrakech hotel rates","morocco hotel market","marrakech occupancy","marrakech revpar","africa hotel data"],relatedSlugs:["istanbul","lisbon","cape-town","dubai"],overview:"Marrakech is experiencing a hotel market renaissance with +11.2% YoY growth, the second-highest among tracked cities. The riad segment adds unique character to the market, while spring (March–May) offers ideal weather driving peak tourism. Low competition levels present opportunities for investors seeking emerging market exposure."},{slug:"seoul",city:"Seoul",country:"South Korea",countrySlug:"south-korea",region:"Asia Pacific",title:"Seoul Hotel Market Data 2026 — Rates, Occupancy & RevPAR | HotelPulse",metaDescription:"Seoul hotel market data for 2026. Average rates from $85 (3★) to $350 (5★), 76% occupancy, $125 RevPAR. Korean hospitality intelligence.",keywords:["seoul hotel rates","south korea hotel market","seoul occupancy","seoul revpar","korean hotel pricing"],relatedSlugs:["tokyo","singapore","bangkok","sydney"],overview:"Seoul's hotel market benefits from the Korean Wave (Hallyu), driving cultural tourism alongside strong corporate demand. Spring cherry blossom season (April–June) commands premium rates, while K-pop tourism and medical tourism create unique demand drivers not seen in other Asia Pacific markets."},{slug:"amsterdam",city:"Amsterdam",country:"Netherlands",countrySlug:"netherlands",region:"Europe",title:"Amsterdam Hotel Market Data 2026 — Rates, Occupancy & RevPAR | HotelPulse",metaDescription:"Amsterdam hotel market intelligence for 2026. Average rates from €140 (3★) to €480 (5★), 85% occupancy, €217 RevPAR.",keywords:["amsterdam hotel rates","netherlands hotel market","amsterdam occupancy","amsterdam revpar","dutch hotel data"],relatedSlugs:["london","paris","barcelona","vienna","lisbon"],overview:"Amsterdam achieves the highest occupancy rate in continental Europe at 85%, despite regulatory constraints on new hotel development and tourist taxes. The city's compact size and year-round appeal through tulip season, summer festivals, and winter holidays create sustained demand, with 4-star properties averaging €255."},{slug:"cancun",city:"Cancún",country:"Mexico",countrySlug:"mexico",region:"Latin America",title:"Cancún Hotel Market Data 2026 — Rates, Occupancy & RevPAR | HotelPulse",metaDescription:"Cancún hotel market data for 2026. Average rates from $95 (3★) to $395 (5★), 73% occupancy, $135 RevPAR. Resort market analysis.",keywords:["cancun hotel rates","cancun hotel market","mexico resort data","cancun revpar","caribbean hotel pricing"],relatedSlugs:["mexico-city","miami","cape-town","bangkok"],overview:"Cancún's resort-driven hotel market shows strong seasonal patterns, with North American winter travelers (December–April) driving peak occupancy. The all-inclusive segment dominates, with 5-star properties averaging $395 per night. Growing airlift from European and South American markets is diversifying the city's tourist base."},{slug:"cape-town",city:"Cape Town",country:"South Africa",countrySlug:"south-africa",region:"Africa",title:"Cape Town Hotel Market Data 2026 — Rates, Occupancy & RevPAR | HotelPulse",metaDescription:"Cape Town hotel market data for 2026. Average rates from $70 (3★) to $320 (5★), 69% occupancy, $100 RevPAR. +9.8% YoY growth.",keywords:["cape town hotel rates","south africa hotel market","cape town occupancy","cape town revpar","african hotel data"],relatedSlugs:["marrakech","dubai","lisbon","istanbul"],overview:"Cape Town's hotel market is growing rapidly at +9.8% YoY, benefiting from a weak rand making the destination highly attractive to international visitors. The Southern Hemisphere summer (December–March) creates peak demand, and the city's wine region, Table Mountain, and coastal experiences support premium 5-star rates averaging $320."},{slug:"vienna",city:"Vienna",country:"Austria",countrySlug:"austria",region:"Europe",title:"Vienna Hotel Market Data 2026 — Rates, Occupancy & RevPAR | HotelPulse",metaDescription:"Vienna hotel market analytics for 2026. Average rates from €110 (3★) to €385 (5★), 79% occupancy, €154 RevPAR. Central European insights.",keywords:["vienna hotel rates","austria hotel market","vienna occupancy","vienna revpar","central europe hotel data"],relatedSlugs:["amsterdam","rome","barcelona","london","paris"],overview:"Vienna's hotel market combines cultural tourism with a strong congress and convention segment, maintaining 79% occupancy year-round. The city consistently ranks among the world's most livable, supporting steady tourism growth. Summer months (May–September) drive peak rates, while the Christmas market season provides a secondary peak."}],K3=[{slug:"usa",country:"USA",region:"North America",title:"USA Hotel Market Data 2026 — New York, Miami & More | HotelPulse",metaDescription:"Comprehensive US hotel market data for 2026. Compare rates, occupancy, and RevPAR across New York, Miami, and other major American cities.",keywords:["usa hotel market","american hotel rates","us hotel data","united states hotel occupancy"],overview:"The United States hotel market encompasses some of the world's most dynamic and competitive hospitality markets. From New York's year-round business travel to Miami's seasonal beach resort demand, the US offers diverse investment and operational opportunities across multiple segments and climate zones."},{slug:"france",country:"France",region:"Europe",title:"France Hotel Market Data 2026 — Paris & Beyond | HotelPulse",metaDescription:"France hotel market intelligence for 2026. Paris hotel rates, occupancy trends, and RevPAR analysis for the world's most-visited country.",keywords:["france hotel market","french hotel rates","paris hotel data","france tourism statistics"],overview:"France remains the world's most-visited country, and its hotel market reflects this status with premium pricing and strong occupancy. Paris dominates as the primary market, but regional destinations continue to gain attention from both tourists and investors."},{slug:"uk",country:"UK",region:"Europe",title:"UK Hotel Market Data 2026 — London Hotel Rates & Analytics | HotelPulse",metaDescription:"UK hotel market data for 2026. London hotel rates, occupancy, and RevPAR with comprehensive British hospitality market analysis.",keywords:["uk hotel market","london hotel rates","british hotel data","uk hotel occupancy"],overview:"The UK hotel market, anchored by London, maintains strong performance despite economic headwinds. London's position as a global financial center and tourism destination ensures consistent demand across all segments."},{slug:"japan",country:"Japan",region:"Asia Pacific",title:"Japan Hotel Market Data 2026 — Tokyo Rates & Trends | HotelPulse",metaDescription:"Japan hotel market data for 2026. Tokyo hotel rates, occupancy, RevPAR, and the impact of resurgent inbound tourism.",keywords:["japan hotel market","tokyo hotel rates","japanese hotel data","japan tourism growth"],overview:"Japan's hotel market is experiencing a dramatic resurgence with +8.5% YoY growth, driven by record inbound tourism and a favorable yen. Tokyo leads the market with strong performance across all star categories."},{slug:"uae",country:"UAE",region:"Middle East",title:"UAE Hotel Market Data 2026 — Dubai Rates & RevPAR | HotelPulse",metaDescription:"UAE hotel market intelligence for 2026. Dubai hotel rates, occupancy trends, and RevPAR analysis for the Middle East's leading market.",keywords:["uae hotel market","dubai hotel rates","emirates hotel data","middle east hotel occupancy"],overview:"The UAE, led by Dubai, continues to set ambitious tourism targets and invest heavily in hospitality infrastructure. The market's seasonal dynamics — peak winter and quiet summer — create unique pricing patterns."},{slug:"spain",country:"Spain",region:"Europe",title:"Spain Hotel Market Data 2026 — Barcelona & Resort Markets | HotelPulse",metaDescription:"Spain hotel market data for 2026. Barcelona hotel rates, coastal resort pricing, and Mediterranean tourism analytics.",keywords:["spain hotel market","barcelona hotel rates","spanish hotel data","mediterranean hotel pricing"],overview:"Spain's hotel market benefits from its Mediterranean climate and rich cultural heritage, with Barcelona serving as the primary urban market. Regulatory shifts around short-term rentals are reshaping market dynamics in favor of traditional hotels."},{slug:"italy",country:"Italy",region:"Europe",title:"Italy Hotel Market Data 2026 — Rome Hotel Intelligence | HotelPulse",metaDescription:"Italy hotel market data for 2026. Rome hotel rates, occupancy, and RevPAR with seasonal trend analysis across the Italian hospitality market.",keywords:["italy hotel market","rome hotel rates","italian hotel data","italy tourism statistics"],overview:"Italy's hotel market thrives on unmatched cultural heritage and culinary tourism, with Rome anchoring the country's hospitality sector. An extended peak season from spring through autumn supports strong performance."},{slug:"australia",country:"Australia",region:"Asia Pacific",title:"Australia Hotel Market Data 2026 — Sydney Rates & Trends | HotelPulse",metaDescription:"Australia hotel market data for 2026. Sydney hotel rates, occupancy, and RevPAR with comprehensive market analysis.",keywords:["australia hotel market","sydney hotel rates","australian hotel data","australia hotel occupancy"],overview:"Australia's hotel market, led by Sydney, delivers consistent performance driven by a mix of international tourism, domestic travel, and business demand. The Southern Hemisphere summer aligns peak tourism with the holiday season."},{slug:"singapore",country:"Singapore",region:"Asia Pacific",title:"Singapore Hotel Market Data 2026 — Rates & Occupancy | HotelPulse",metaDescription:"Singapore hotel market intelligence for 2026. Complete hotel rates, occupancy, and RevPAR data for Southeast Asia's premier market.",keywords:["singapore hotel market","singapore hotel rates","singapore hotel occupancy","southeast asia hotel data"],overview:"Singapore's compact hotel market delivers exceptional occupancy rates, underpinned by the city-state's position as Asia's premier business and convention hub. Consistent demand patterns make it one of the most stable markets globally."},{slug:"thailand",country:"Thailand",region:"Asia Pacific",title:"Thailand Hotel Market Data 2026 — Bangkok Rates & Trends | HotelPulse",metaDescription:"Thailand hotel market data for 2026. Bangkok hotel rates, occupancy, and growth trends in Southeast Asia's largest tourism market.",keywords:["thailand hotel market","bangkok hotel rates","thai hotel data","southeast asia hotel pricing"],overview:"Thailand's hotel market offers exceptional value with some of the lowest rates in Asia Pacific while delivering strong growth. Bangkok's expanding hospitality sector is diversifying beyond traditional leisure into medical tourism and digital nomad segments."},{slug:"turkey",country:"Turkey",region:"Europe",title:"Turkey Hotel Market Data 2026 — Istanbul & Growth Trends | HotelPulse",metaDescription:"Turkey hotel market data for 2026. Istanbul hotel rates, +12.4% YoY growth, and the fastest-growing hotel market in our coverage.",keywords:["turkey hotel market","istanbul hotel rates","turkish hotel data","turkey tourism growth"],overview:"Turkey's hotel market leads global growth at +12.4% YoY, driven by Istanbul's unique position bridging Europe and Asia. A favorable exchange rate and aggressive tourism promotion make Turkey one of the most compelling hospitality investment markets."},{slug:"portugal",country:"Portugal",region:"Europe",title:"Portugal Hotel Market Data 2026 — Lisbon Intelligence | HotelPulse",metaDescription:"Portugal hotel market data for 2026. Lisbon hotel rates, +8.9% YoY growth, and emerging European market analysis.",keywords:["portugal hotel market","lisbon hotel rates","portuguese hotel data","portugal tourism data"],overview:"Portugal's hotel market, anchored by Lisbon, continues to outperform with +8.9% YoY growth. The country's growing reputation as a tech hub, digital nomad destination, and cultural tourism hotspot drives sustained demand."},{slug:"mexico",country:"Mexico",region:"Latin America",title:"Mexico Hotel Market Data 2026 — Mexico City & Cancún | HotelPulse",metaDescription:"Mexico hotel market data for 2026. Mexico City and Cancún rates, occupancy, and RevPAR across the country's diverse hospitality markets.",keywords:["mexico hotel market","mexico city hotel rates","cancun hotel data","latin america hotel pricing"],overview:"Mexico's hotel market offers two distinct segments: Mexico City's urban business and cultural tourism, and Cancún's resort-driven leisure market. Together they represent Latin America's most important hospitality market with strong growth trajectories."},{slug:"morocco",country:"Morocco",region:"Africa",title:"Morocco Hotel Market Data 2026 — Marrakech & Insights | HotelPulse",metaDescription:"Morocco hotel market data for 2026. Marrakech hotel rates, +11.2% YoY growth, and North African market intelligence.",keywords:["morocco hotel market","marrakech hotel rates","moroccan hotel data","africa hotel market"],overview:"Morocco's hotel market, led by Marrakech, is experiencing rapid growth at +11.2% YoY. The unique riad segment, combined with growing luxury resort development, positions Morocco as Africa's premier hotel investment destination."},{slug:"south-korea",country:"South Korea",region:"Asia Pacific",title:"South Korea Hotel Market Data 2026 — Seoul Rates | HotelPulse",metaDescription:"South Korea hotel market data for 2026. Seoul hotel rates, occupancy, and the impact of Hallyu-driven cultural tourism.",keywords:["south korea hotel market","seoul hotel rates","korean hotel data","korea hotel occupancy"],overview:"South Korea's hotel market benefits from the Korean Wave (Hallyu), driving cultural tourism alongside strong corporate demand. Seoul's hotel sector is uniquely positioned with K-pop tourism and medical tourism as major demand drivers."},{slug:"netherlands",country:"Netherlands",region:"Europe",title:"Netherlands Hotel Market Data 2026 — Amsterdam Analytics | HotelPulse",metaDescription:"Netherlands hotel market data for 2026. Amsterdam hotel rates, 85% occupancy, and Dutch hospitality market analysis.",keywords:["netherlands hotel market","amsterdam hotel rates","dutch hotel data","amsterdam hotel occupancy"],overview:"The Netherlands hotel market, centered on Amsterdam, achieves continental Europe's highest occupancy at 85%. Regulatory constraints on new development and tourist taxes shape a supply-constrained, premium-priced market."},{slug:"south-africa",country:"South Africa",region:"Africa",title:"South Africa Hotel Market Data 2026 — Cape Town Insights | HotelPulse",metaDescription:"South Africa hotel market data for 2026. Cape Town hotel rates, +9.8% YoY growth, and African market intelligence.",keywords:["south africa hotel market","cape town hotel rates","south african hotel data","africa hotel pricing"],overview:"South Africa's hotel market, led by Cape Town, benefits from a favorable exchange rate making the destination highly attractive to international visitors. Strong growth at +9.8% YoY reflects increasing global interest in the country's unique tourism offerings."},{slug:"austria",country:"Austria",region:"Europe",title:"Austria Hotel Market Data 2026 — Vienna Market Data | HotelPulse",metaDescription:"Austria hotel market data for 2026. Vienna hotel rates, occupancy, and Central European hospitality market analysis.",keywords:["austria hotel market","vienna hotel rates","austrian hotel data","central europe hotel pricing"],overview:"Austria's hotel market, anchored by Vienna, combines cultural tourism with a strong congress and convention segment. The country's reputation for quality of life supports consistent tourism demand year-round."}];function Ffe(e){return e1.find(t=>t.slug===e)}function Bfe(e){return K3.find(t=>t.slug===e)}function Ufe(e){return e1.filter(t=>t.countrySlug===e)}const zfe=e1.slice(0,10),Hfe=K3.slice(0,10),Vfe=()=>d.jsx("footer",{className:"border-t bg-card pb-16 md:pb-0",children:d.jsxs("div",{className:"container mx-auto px-4 py-8 md:py-12",children:[d.jsxs("div",{className:"grid grid-cols-2 gap-6 md:grid-cols-4 md:gap-8",children:[d.jsxs("div",{children:[d.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[d.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-primary",children:d.jsx(f3,{className:"h-4 w-4 text-primary-foreground"})}),d.jsx("span",{className:"text-lg font-bold",style:{fontFamily:"'Space Grotesk', sans-serif"},children:"HotelPulse"})]}),d.jsx("p",{className:"text-sm text-muted-foreground",children:"Global hotel intelligence for smarter decisions. Pricing, occupancy, and market analytics across 120+ cities."})]}),d.jsxs("div",{children:[d.jsx("h4",{className:"mb-3 text-sm font-semibold",children:"Platform"}),d.jsxs("div",{className:"flex flex-col gap-2 text-sm text-muted-foreground",children:[d.jsx(At,{to:"/dashboard",className:"hover:text-foreground",children:"Dashboard"}),d.jsx(At,{to:"/explorer",className:"hover:text-foreground",children:"Market Explorer"}),d.jsx(At,{to:"/trends",className:"hover:text-foreground",children:"Trends"}),d.jsx(At,{to:"/compare",className:"hover:text-foreground",children:"City Comparison"})]})]}),d.jsxs("div",{children:[d.jsx("h4",{className:"mb-3 text-sm font-semibold",children:"Company"}),d.jsxs("div",{className:"flex flex-col gap-2 text-sm text-muted-foreground",children:[d.jsx(At,{to:"/pricing",className:"hover:text-foreground",children:"Pricing"}),d.jsx(At,{to:"/reports",className:"hover:text-foreground",children:"Reports"}),d.jsx("span",{className:"cursor-default",children:"API Docs"}),d.jsx("span",{className:"cursor-default",children:"Contact"})]})]}),d.jsxs("div",{children:[d.jsx("h4",{className:"mb-3 text-sm font-semibold",children:"Legal"}),d.jsxs("div",{className:"flex flex-col gap-2 text-sm text-muted-foreground",children:[d.jsx("span",{className:"cursor-default",children:"Privacy Policy"}),d.jsx("span",{className:"cursor-default",children:"Terms of Service"}),d.jsx("span",{className:"cursor-default",children:"Data Sources"})]})]})]}),d.jsxs("div",{className:"mt-8 grid grid-cols-2 gap-6 border-t pt-6 md:grid-cols-2",children:[d.jsxs("div",{children:[d.jsx("h4",{className:"mb-2 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Hotel Markets by City"}),d.jsx("div",{className:"flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground",children:zfe.map(e=>d.jsx(At,{to:`/city/${e.slug}`,className:"hover:text-foreground",children:e.city},e.slug))})]}),d.jsxs("div",{children:[d.jsx("h4",{className:"mb-2 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Hotel Markets by Country"}),d.jsx("div",{className:"flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground",children:Hfe.map(e=>d.jsx(At,{to:`/country/${e.slug}`,className:"hover:text-foreground",children:e.country},e.slug))})]})]}),d.jsxs("div",{className:"mt-6 border-t pt-4 text-center text-xs text-muted-foreground md:mt-10 md:pt-6",children:["© ",new Date().getFullYear()," HotelPulse. All rights reserved. Data for informational purposes only."]})]})}),qfe=[{label:"Dashboard",to:"/dashboard",icon:oc},{label:"Explorer",to:"/explorer",icon:Ay},{label:"Trends",to:"/trends",icon:ri},{label:"Reports",to:"/reports",icon:Kp}],Wfe=[{label:"Compare",to:"/compare"},{label:"Calculator",to:"/calculator"},{label:"AI Advisor",to:"/advisor"},{label:"Pricing",to:"/pricing"}],Gfe=()=>{const e=yc(),[t,r]=P.useState(!1),{user:n,signOut:i}=vs();return d.jsx("nav",{className:"fixed bottom-0 left-0 right-0 z-50 border-t bg-background/95 backdrop-blur-lg md:hidden pb-[env(safe-area-inset-bottom)]",children:d.jsxs("div",{className:"grid grid-cols-5 items-center",children:[qfe.map(a=>{const o=e.pathname===a.to;return d.jsxs(At,{to:a.to,className:`flex flex-col items-center justify-center gap-0.5 py-2 min-h-[52px] text-[10px] font-medium transition-colors ${o?"text-primary":"text-muted-foreground"}`,children:[d.jsx(a.icon,{className:`h-5 w-5 ${o?"text-primary":""}`}),a.label,o&&d.jsx("span",{className:"absolute top-0 left-1/2 -translate-x-1/2 h-0.5 w-8 rounded-b-full bg-primary"})]},a.to)}),d.jsxs(qH,{open:t,onOpenChange:r,children:[d.jsx(WH,{asChild:!0,children:d.jsxs("button",{className:"flex flex-col items-center justify-center gap-0.5 py-2 min-h-[52px] text-[10px] font-medium text-muted-foreground",children:[d.jsx(Rne,{className:"h-5 w-5"}),"More"]})}),d.jsxs(q3,{side:"bottom",className:"rounded-t-2xl pb-[env(safe-area-inset-bottom)]",children:[d.jsx(W3,{children:d.jsx(G3,{className:"text-left",children:"More"})}),d.jsx("nav",{className:"mt-2 flex flex-col gap-1",children:Wfe.map(a=>d.jsx(At,{to:a.to,onClick:()=>r(!1),className:`rounded-lg px-4 py-3 text-sm font-medium transition-colors ${e.pathname===a.to?"bg-secondary text-secondary-foreground":"text-foreground hover:bg-muted"}`,children:a.label},a.to))}),d.jsx("div",{className:"mt-4 border-t pt-4",children:n?d.jsxs("div",{className:"flex items-center justify-between px-4",children:[d.jsx("span",{className:"text-xs text-muted-foreground truncate max-w-[200px]",children:n.email}),d.jsx(pt,{variant:"ghost",size:"sm",onClick:()=>{i(),r(!1)},children:"Sign Out"})]}):d.jsxs("div",{className:"flex gap-2 px-4",children:[d.jsx(pt,{variant:"outline",size:"sm",className:"flex-1",asChild:!0,children:d.jsx(At,{to:"/auth",onClick:()=>r(!1),children:"Log In"})}),d.jsx(pt,{size:"sm",className:"flex-1",asChild:!0,children:d.jsx(At,{to:"/auth",onClick:()=>r(!1),children:"Sign Up"})})]})})]})]})]})})},ei=({children:e})=>d.jsxs("div",{className:"flex min-h-screen flex-col",children:[d.jsx(Dfe,{}),d.jsx("main",{className:"flex-1 pb-16 md:pb-0",children:e}),d.jsx(Vfe,{}),d.jsx(Gfe,{})]}),$e=P.forwardRef(({className:e,...t},r)=>d.jsx("div",{ref:r,className:lt("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));$e.displayName="Card";const er=P.forwardRef(({className:e,...t},r)=>d.jsx("div",{ref:r,className:lt("flex flex-col space-y-1.5 p-6",e),...t}));er.displayName="CardHeader";const tr=P.forwardRef(({className:e,...t},r)=>d.jsx("h3",{ref:r,className:lt("text-2xl font-semibold leading-none tracking-tight",e),...t}));tr.displayName="CardTitle";const Af=P.forwardRef(({className:e,...t},r)=>d.jsx("p",{ref:r,className:lt("text-sm text-muted-foreground",e),...t}));Af.displayName="CardDescription";const De=P.forwardRef(({className:e,...t},r)=>d.jsx("div",{ref:r,className:lt("p-6 pt-0",e),...t}));De.displayName="CardContent";const Kfe=P.forwardRef(({className:e,...t},r)=>d.jsx("div",{ref:r,className:lt("flex items-center p-6 pt-0",e),...t}));Kfe.displayName="CardFooter";const Yfe=G0("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 Nt({className:e,variant:t,...r}){return d.jsx("div",{className:lt(Yfe({variant:t}),e),...r})}var D5="Collapsible",[Xfe,KH]=Qa(D5),[Jfe,Y3]=Xfe(D5),YH=P.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:n,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[l,c]=Ga({prop:n,defaultProp:i??!1,onChange:o,caller:D5});return d.jsx(Jfe,{scope:r,disabled:a,contentId:_o(),open:l,onOpenToggle:P.useCallback(()=>c(u=>!u),[c]),children:d.jsx(ft.div,{"data-state":J3(l),"data-disabled":a?"":void 0,...s,ref:t})})});YH.displayName=D5;var XH="CollapsibleTrigger",JH=P.forwardRef((e,t)=>{const{__scopeCollapsible:r,...n}=e,i=Y3(XH,r);return d.jsx(ft.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":J3(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...n,ref:t,onClick:qe(e.onClick,i.onOpenToggle)})});JH.displayName=XH;var X3="CollapsibleContent",ZH=P.forwardRef((e,t)=>{const{forceMount:r,...n}=e,i=Y3(X3,e.__scopeCollapsible);return d.jsx(ms,{present:r||i.open,children:({present:a})=>d.jsx(Zfe,{...n,ref:t,present:a})})});ZH.displayName=X3;var Zfe=P.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:i,...a}=e,o=Y3(X3,r),[s,l]=P.useState(n),c=P.useRef(null),u=qt(t,c),f=P.useRef(0),p=f.current,h=P.useRef(0),g=h.current,m=o.open||s,v=P.useRef(m),y=P.useRef(void 0);return P.useEffect(()=>{const b=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(b)},[]),ti(()=>{const b=c.current;if(b){y.current=y.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const x=b.getBoundingClientRect();f.current=x.height,h.current=x.width,v.current||(b.style.transitionDuration=y.current.transitionDuration,b.style.animationName=y.current.animationName),l(n)}},[o.open,n]),d.jsx(ft.div,{"data-state":J3(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!m,...a,ref:u,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...e.style},children:m&&i})});function J3(e){return e?"open":"closed"}var Qfe=YH,ehe=JH,the=ZH,rhe=P.createContext(void 0);function t1(e){const t=P.useContext(rhe);return e||t||"ltr"}var bs="Accordion",nhe=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Z3,ihe,ahe]=V0(bs),[F5,sqe]=Qa(bs,[ahe,KH]),Q3=KH(),QH=K.forwardRef((e,t)=>{const{type:r,...n}=e,i=n,a=n;return d.jsx(Z3.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?d.jsx(che,{...a,ref:t}):d.jsx(lhe,{...i,ref:t})})});QH.displayName=bs;var[eV,ohe]=F5(bs),[tV,she]=F5(bs,{collapsible:!1}),lhe=K.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:i=()=>{},collapsible:a=!1,...o}=e,[s,l]=Ga({prop:r,defaultProp:n??"",onChange:i,caller:bs});return d.jsx(eV,{scope:e.__scopeAccordion,value:K.useMemo(()=>s?[s]:[],[s]),onItemOpen:l,onItemClose:K.useCallback(()=>a&&l(""),[a,l]),children:d.jsx(tV,{scope:e.__scopeAccordion,collapsible:a,children:d.jsx(rV,{...o,ref:t})})})}),che=K.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:i=()=>{},...a}=e,[o,s]=Ga({prop:r,defaultProp:n??[],onChange:i,caller:bs}),l=K.useCallback(u=>s((f=[])=>[...f,u]),[s]),c=K.useCallback(u=>s((f=[])=>f.filter(p=>p!==u)),[s]);return d.jsx(eV,{scope:e.__scopeAccordion,value:o,onItemOpen:l,onItemClose:c,children:d.jsx(tV,{scope:e.__scopeAccordion,collapsible:!0,children:d.jsx(rV,{...a,ref:t})})})}),[uhe,B5]=F5(bs),rV=K.forwardRef((e,t)=>{const{__scopeAccordion:r,disabled:n,dir:i,orientation:a="vertical",...o}=e,s=K.useRef(null),l=qt(s,t),c=ihe(r),f=t1(i)==="ltr",p=qe(e.onKeyDown,h=>{var O;if(!nhe.includes(h.key))return;const g=h.target,m=c().filter(R=>{var $;return!(($=R.ref.current)!=null&&$.disabled)}),v=m.findIndex(R=>R.ref.current===g),y=m.length;if(v===-1)return;h.preventDefault();let b=v;const x=0,S=y-1,_=()=>{b=v+1,b>S&&(b=x)},k=()=>{b=v-1,b{const{__scopeAccordion:r,value:n,...i}=e,a=B5(Cw,r),o=ohe(Cw,r),s=Q3(r),l=_o(),c=n&&o.value.includes(n)||!1,u=a.disabled||e.disabled;return d.jsx(dhe,{scope:r,open:c,disabled:u,triggerId:l,children:d.jsx(Qfe,{"data-orientation":a.orientation,"data-state":cV(c),...s,...i,ref:t,disabled:u,open:c,onOpenChange:f=>{f?o.onItemOpen(n):o.onItemClose(n)}})})});nV.displayName=Cw;var iV="AccordionHeader",aV=K.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,i=B5(bs,r),a=eT(iV,r);return d.jsx(ft.h3,{"data-orientation":i.orientation,"data-state":cV(a.open),"data-disabled":a.disabled?"":void 0,...n,ref:t})});aV.displayName=iV;var Dj="AccordionTrigger",oV=K.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,i=B5(bs,r),a=eT(Dj,r),o=she(Dj,r),s=Q3(r);return d.jsx(Z3.ItemSlot,{scope:r,children:d.jsx(ehe,{"aria-disabled":a.open&&!o.collapsible||void 0,"data-orientation":i.orientation,id:a.triggerId,...s,...n,ref:t})})});oV.displayName=Dj;var sV="AccordionContent",lV=K.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,i=B5(bs,r),a=eT(sV,r),o=Q3(r);return d.jsx(the,{role:"region","aria-labelledby":a.triggerId,"data-orientation":i.orientation,...o,...n,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});lV.displayName=sV;function cV(e){return e?"open":"closed"}var fhe=QH,hhe=nV,phe=aV,uV=oV,dV=lV;const fV=fhe,tT=P.forwardRef(({className:e,...t},r)=>d.jsx(hhe,{ref:r,className:lt("border-b",e),...t}));tT.displayName="AccordionItem";const rT=P.forwardRef(({className:e,children:t,...r},n)=>d.jsx(phe,{className:"flex",children:d.jsxs(uV,{ref:n,className:lt("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...r,children:[t,d.jsx(Y0,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));rT.displayName=uV.displayName;const nT=P.forwardRef(({className:e,children:t,...r},n)=>d.jsx(dV,{ref:n,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...r,children:d.jsx("div",{className:lt("pb-4 pt-0",e),children:t})}));nT.displayName=dV.displayName;const qm=P.forwardRef(({className:e,...t},r)=>d.jsx("div",{className:"relative w-full overflow-auto",children:d.jsx("table",{ref:r,className:lt("w-full caption-bottom text-sm",e),...t})}));qm.displayName="Table";const Wm=P.forwardRef(({className:e,...t},r)=>d.jsx("thead",{ref:r,className:lt("[&_tr]:border-b",e),...t}));Wm.displayName="TableHeader";const Gm=P.forwardRef(({className:e,...t},r)=>d.jsx("tbody",{ref:r,className:lt("[&_tr:last-child]:border-0",e),...t}));Gm.displayName="TableBody";const mhe=P.forwardRef(({className:e,...t},r)=>d.jsx("tfoot",{ref:r,className:lt("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));mhe.displayName="TableFooter";const Ba=P.forwardRef(({className:e,...t},r)=>d.jsx("tr",{ref:r,className:lt("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",e),...t}));Ba.displayName="TableRow";const ir=P.forwardRef(({className:e,...t},r)=>d.jsx("th",{ref:r,className:lt("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));ir.displayName="TableHead";const Vt=P.forwardRef(({className:e,...t},r)=>d.jsx("td",{ref:r,className:lt("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Vt.displayName="TableCell";const ghe=P.forwardRef(({className:e,...t},r)=>d.jsx("caption",{ref:r,className:lt("mt-4 text-sm text-muted-foreground",e),...t}));ghe.displayName="TableCaption";var vhe=Array.isArray,ya=vhe,yhe=typeof ib=="object"&&ib&&ib.Object===Object&&ib,hV=yhe,bhe=hV,xhe=typeof self=="object"&&self&&self.Object===Object&&self,whe=bhe||xhe||Function("return this")(),ll=whe,_he=ll,She=_he.Symbol,r1=She,R6=r1,pV=Object.prototype,Ahe=pV.hasOwnProperty,Phe=pV.toString,av=R6?R6.toStringTag:void 0;function khe(e){var t=Ahe.call(e,av),r=e[av];try{e[av]=void 0;var n=!0}catch{}var i=Phe.call(e);return n&&(t?e[av]=r:delete e[av]),i}var jhe=khe,Nhe=Object.prototype,Ehe=Nhe.toString;function Che(e){return Ehe.call(e)}var The=Che,L6=r1,Ohe=jhe,Rhe=The,Lhe="[object Null]",Ihe="[object Undefined]",I6=L6?L6.toStringTag:void 0;function Mhe(e){return e==null?e===void 0?Ihe:Lhe:I6&&I6 in Object(e)?Ohe(e):Rhe(e)}var xc=Mhe;function $he(e){return e!=null&&typeof e=="object"}var wc=$he,Dhe=xc,Fhe=wc,Bhe="[object Symbol]";function Uhe(e){return typeof e=="symbol"||Fhe(e)&&Dhe(e)==Bhe}var Km=Uhe,zhe=ya,Hhe=Km,Vhe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qhe=/^\w*$/;function Whe(e,t){if(zhe(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||Hhe(e)?!0:qhe.test(e)||!Vhe.test(e)||t!=null&&e in Object(t)}var iT=Whe;function Ghe(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Wu=Ghe;const Ym=ar(Wu);var Khe=xc,Yhe=Wu,Xhe="[object AsyncFunction]",Jhe="[object Function]",Zhe="[object GeneratorFunction]",Qhe="[object Proxy]";function epe(e){if(!Yhe(e))return!1;var t=Khe(e);return t==Jhe||t==Zhe||t==Xhe||t==Qhe}var aT=epe;const wt=ar(aT);var tpe=ll,rpe=tpe["__core-js_shared__"],npe=rpe,AA=npe,M6=function(){var e=/[^.]+$/.exec(AA&&AA.keys&&AA.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function ipe(e){return!!M6&&M6 in e}var ape=ipe,ope=Function.prototype,spe=ope.toString;function lpe(e){if(e!=null){try{return spe.call(e)}catch{}try{return e+""}catch{}}return""}var mV=lpe,cpe=aT,upe=ape,dpe=Wu,fpe=mV,hpe=/[\\^$.*+?()[\]{}|]/g,ppe=/^\[object .+?Constructor\]$/,mpe=Function.prototype,gpe=Object.prototype,vpe=mpe.toString,ype=gpe.hasOwnProperty,bpe=RegExp("^"+vpe.call(ype).replace(hpe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function xpe(e){if(!dpe(e)||upe(e))return!1;var t=cpe(e)?bpe:ppe;return t.test(fpe(e))}var wpe=xpe;function _pe(e,t){return e==null?void 0:e[t]}var Spe=_pe,Ape=wpe,Ppe=Spe;function kpe(e,t){var r=Ppe(e,t);return Ape(r)?r:void 0}var Ff=kpe,jpe=Ff,Npe=jpe(Object,"create"),U5=Npe,$6=U5;function Epe(){this.__data__=$6?$6(null):{},this.size=0}var Cpe=Epe;function Tpe(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Ope=Tpe,Rpe=U5,Lpe="__lodash_hash_undefined__",Ipe=Object.prototype,Mpe=Ipe.hasOwnProperty;function $pe(e){var t=this.__data__;if(Rpe){var r=t[e];return r===Lpe?void 0:r}return Mpe.call(t,e)?t[e]:void 0}var Dpe=$pe,Fpe=U5,Bpe=Object.prototype,Upe=Bpe.hasOwnProperty;function zpe(e){var t=this.__data__;return Fpe?t[e]!==void 0:Upe.call(t,e)}var Hpe=zpe,Vpe=U5,qpe="__lodash_hash_undefined__";function Wpe(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Vpe&&t===void 0?qpe:t,this}var Gpe=Wpe,Kpe=Cpe,Ype=Ope,Xpe=Dpe,Jpe=Hpe,Zpe=Gpe;function Xm(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t-1}var mme=pme,gme=z5;function vme(e,t){var r=this.__data__,n=gme(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var yme=vme,bme=tme,xme=cme,wme=fme,_me=mme,Sme=yme;function Jm(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t0?1:-1},Bd=function(t){return Pf(t)&&t.indexOf("%")===t.length-1},Le=function(t){return qge(t)&&!Qm(t)},Yge=function(t){return zt(t)},qn=function(t){return Le(t)||Pf(t)},Xge=0,n1=function(t){var r=++Xge;return"".concat(t||"").concat(r)},os=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Le(t)&&!Pf(t))return n;var a;if(Bd(t)){var o=t.indexOf("%");a=r*parseFloat(t.slice(0,o))/100}else a=+t;return Qm(a)&&(a=n),i&&a>r&&(a=r),a},nu=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},Jge=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ive(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Bj(e){"@babel/helpers - typeof";return Bj=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},Bj(e)}var V6={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Xl=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},q6=null,kA=null,mT=function e(t){if(t===q6&&Array.isArray(kA))return kA;var r=[];return P.Children.forEach(t,function(n){zt(n)||(Bge.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),kA=r,q6=t,r};function cs(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(i){return Xl(i)}):n=[Xl(t)],mT(e).forEach(function(i){var a=So(i,"type.displayName")||So(i,"type.name");n.indexOf(a)!==-1&&r.push(i)}),r}function Ra(e,t){var r=cs(e,t);return r&&r[0]}var W6=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,i=r.height;return!(!Le(n)||n<=0||!Le(i)||i<=0)},ave=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],ove=function(t){return t&&t.type&&Pf(t.type)&&ave.indexOf(t.type)>=0},sve=function(t){return t&&Bj(t)==="object"&&"clipDot"in t},lve=function(t,r,n,i){var a,o=(a=PA==null?void 0:PA[i])!==null&&a!==void 0?a:[];return r.startsWith("data-")||!wt(t)&&(i&&o.includes(r)||eve.includes(r))||n&&pT.includes(r)},dt=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(P.isValidElement(t)&&(i=t.props),!Ym(i))return null;var a={};return Object.keys(i).forEach(function(o){var s;lve((s=i)===null||s===void 0?void 0:s[o],o,r,n)&&(a[o]=i[o])}),a},Uj=function e(t,r){if(t===r)return!0;var n=P.Children.count(t);if(n!==P.Children.count(r))return!1;if(n===0)return!0;if(n===1)return G6(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function hve(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Hj(e){var t=e.children,r=e.width,n=e.height,i=e.viewBox,a=e.className,o=e.style,s=e.title,l=e.desc,c=fve(e,dve),u=i||{width:r,height:n,x:0,y:0},f=Ot("recharts-surface",a);return K.createElement("svg",zj({},dt(c,!0,"svg"),{className:f,width:r,height:n,style:o,viewBox:"".concat(u.x," ").concat(u.y," ").concat(u.width," ").concat(u.height)}),K.createElement("title",null,s),K.createElement("desc",null,l),t)}var pve=["children","className"];function Vj(){return Vj=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function gve(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var ur=K.forwardRef(function(e,t){var r=e.children,n=e.className,i=mve(e,pve),a=Ot("recharts-layer",n);return K.createElement("g",Vj({className:a},dt(i,!0),{ref:t}),r)}),Jl=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;ai?0:i+t),r=r>i?i:r,r<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(i);++n=n?e:bve(e,t,r)}var wve=xve,_ve="\\ud800-\\udfff",Sve="\\u0300-\\u036f",Ave="\\ufe20-\\ufe2f",Pve="\\u20d0-\\u20ff",kve=Sve+Ave+Pve,jve="\\ufe0e\\ufe0f",Nve="\\u200d",Eve=RegExp("["+Nve+_ve+kve+jve+"]");function Cve(e){return Eve.test(e)}var PV=Cve;function Tve(e){return e.split("")}var Ove=Tve,kV="\\ud800-\\udfff",Rve="\\u0300-\\u036f",Lve="\\ufe20-\\ufe2f",Ive="\\u20d0-\\u20ff",Mve=Rve+Lve+Ive,$ve="\\ufe0e\\ufe0f",Dve="["+kV+"]",qj="["+Mve+"]",Wj="\\ud83c[\\udffb-\\udfff]",Fve="(?:"+qj+"|"+Wj+")",jV="[^"+kV+"]",NV="(?:\\ud83c[\\udde6-\\uddff]){2}",EV="[\\ud800-\\udbff][\\udc00-\\udfff]",Bve="\\u200d",CV=Fve+"?",TV="["+$ve+"]?",Uve="(?:"+Bve+"(?:"+[jV,NV,EV].join("|")+")"+TV+CV+")*",zve=TV+CV+Uve,Hve="(?:"+[jV+qj+"?",qj,NV,EV,Dve].join("|")+")",Vve=RegExp(Wj+"(?="+Wj+")|"+Hve+zve,"g");function qve(e){return e.match(Vve)||[]}var Wve=qve,Gve=Ove,Kve=PV,Yve=Wve;function Xve(e){return Kve(e)?Yve(e):Gve(e)}var Jve=Xve,Zve=wve,Qve=PV,eye=Jve,tye=bV;function rye(e){return function(t){t=tye(t);var r=Qve(t)?eye(t):void 0,n=r?r[0]:t.charAt(0),i=r?Zve(r,1).join(""):t.slice(1);return n[e]()+i}}var nye=rye,iye=nye,aye=iye("toUpperCase"),oye=aye;const r_=ar(oye);function $r(e){return function(){return e}}const OV=Math.cos,Rw=Math.sin,xs=Math.sqrt,Lw=Math.PI,n_=2*Lw,Gj=Math.PI,Kj=2*Gj,jd=1e-6,sye=Kj-jd;function RV(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return RV;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;ijd)if(!(Math.abs(f*l-c*u)>jd)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let h=n-o,g=i-s,m=l*l+c*c,v=h*h+g*g,y=Math.sqrt(m),b=Math.sqrt(p),x=a*Math.tan((Gj-Math.acos((m+p-v)/(2*y*b)))/2),S=x/b,_=x/y;Math.abs(S-1)>jd&&this._append`L${t+S*u},${r+S*f}`,this._append`A${a},${a},0,0,${+(f*h>u*g)},${this._x1=t+_*l},${this._y1=r+_*c}`}}arc(t,r,n,i,a,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(i),l=n*Math.sin(i),c=t+s,u=r+l,f=1^o,p=o?i-a:a-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>jd||Math.abs(this._y1-u)>jd)&&this._append`L${c},${u}`,n&&(p<0&&(p=p%Kj+Kj),p>sye?this._append`A${n},${n},0,1,${f},${t-s},${r-l}A${n},${n},0,1,${f},${this._x1=c},${this._y1=u}`:p>jd&&this._append`A${n},${n},0,${+(p>=Gj)},${f},${this._x1=t+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function gT(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new cye(t)}function vT(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function LV(e){this._context=e}LV.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function i_(e){return new LV(e)}function IV(e){return e[0]}function MV(e){return e[1]}function $V(e,t){var r=$r(!0),n=null,i=i_,a=null,o=gT(s);e=typeof e=="function"?e:e===void 0?IV:$r(e),t=typeof t=="function"?t:t===void 0?MV:$r(t);function s(l){var c,u=(l=vT(l)).length,f,p=!1,h;for(n==null&&(a=i(h=o())),c=0;c<=u;++c)!(c=h;--g)s.point(x[g],S[g]);s.lineEnd(),s.areaEnd()}y&&(x[p]=+e(v,p,f),S[p]=+t(v,p,f),s.point(n?+n(v,p,f):x[p],r?+r(v,p,f):S[p]))}if(b)return s=null,b+""||null}function u(){return $V().defined(i).curve(o).context(a)}return c.x=function(f){return arguments.length?(e=typeof f=="function"?f:$r(+f),n=null,c):e},c.x0=function(f){return arguments.length?(e=typeof f=="function"?f:$r(+f),c):e},c.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:$r(+f),c):n},c.y=function(f){return arguments.length?(t=typeof f=="function"?f:$r(+f),r=null,c):t},c.y0=function(f){return arguments.length?(t=typeof f=="function"?f:$r(+f),c):t},c.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:$r(+f),c):r},c.lineX0=c.lineY0=function(){return u().x(e).y(t)},c.lineY1=function(){return u().x(e).y(r)},c.lineX1=function(){return u().x(n).y(t)},c.defined=function(f){return arguments.length?(i=typeof f=="function"?f:$r(!!f),c):i},c.curve=function(f){return arguments.length?(o=f,a!=null&&(s=o(a)),c):o},c.context=function(f){return arguments.length?(f==null?a=s=null:s=o(a=f),c):a},c}class DV{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function uye(e){return new DV(e,!0)}function dye(e){return new DV(e,!1)}const yT={draw(e,t){const r=xs(t/Lw);e.moveTo(r,0),e.arc(0,0,r,0,n_)}},fye={draw(e,t){const r=xs(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},FV=xs(1/3),hye=FV*2,pye={draw(e,t){const r=xs(t/hye),n=r*FV;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},mye={draw(e,t){const r=xs(t),n=-r/2;e.rect(n,n,r,r)}},gye=.8908130915292852,BV=Rw(Lw/10)/Rw(7*Lw/10),vye=Rw(n_/10)*BV,yye=-OV(n_/10)*BV,bye={draw(e,t){const r=xs(t*gye),n=vye*r,i=yye*r;e.moveTo(0,-r),e.lineTo(n,i);for(let a=1;a<5;++a){const o=n_*a/5,s=OV(o),l=Rw(o);e.lineTo(l*r,-s*r),e.lineTo(s*n-l*i,l*n+s*i)}e.closePath()}},jA=xs(3),xye={draw(e,t){const r=-xs(t/(jA*3));e.moveTo(0,r*2),e.lineTo(-jA*r,-r),e.lineTo(jA*r,-r),e.closePath()}},so=-.5,lo=xs(3)/2,Yj=1/xs(12),wye=(Yj/2+1)*3,_ye={draw(e,t){const r=xs(t/wye),n=r/2,i=r*Yj,a=n,o=r*Yj+r,s=-a,l=o;e.moveTo(n,i),e.lineTo(a,o),e.lineTo(s,l),e.lineTo(so*n-lo*i,lo*n+so*i),e.lineTo(so*a-lo*o,lo*a+so*o),e.lineTo(so*s-lo*l,lo*s+so*l),e.lineTo(so*n+lo*i,so*i-lo*n),e.lineTo(so*a+lo*o,so*o-lo*a),e.lineTo(so*s+lo*l,so*l-lo*s),e.closePath()}};function Sye(e,t){let r=null,n=gT(i);e=typeof e=="function"?e:$r(e||yT),t=typeof t=="function"?t:$r(t===void 0?64:+t);function i(){let a;if(r||(r=a=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),a)return r=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:$r(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:$r(+a),i):t},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function Iw(){}function Mw(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function UV(e){this._context=e}UV.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Mw(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Mw(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Aye(e){return new UV(e)}function zV(e){this._context=e}zV.prototype={areaStart:Iw,areaEnd:Iw,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Mw(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Pye(e){return new zV(e)}function HV(e){this._context=e}HV.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:Mw(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function kye(e){return new HV(e)}function VV(e){this._context=e}VV.prototype={areaStart:Iw,areaEnd:Iw,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function jye(e){return new VV(e)}function Y6(e){return e<0?-1:1}function X6(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),s=(a*i+o*n)/(n+i);return(Y6(a)+Y6(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function J6(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function NA(e,t,r){var n=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-n)/3;e._context.bezierCurveTo(n+s,i+s*t,a-s,o-s*r,a,o)}function $w(e){this._context=e}$w.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:NA(this,this._t0,J6(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,NA(this,J6(this,r=X6(this,e,t)),r);break;default:NA(this,this._t0,r=X6(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function qV(e){this._context=new WV(e)}(qV.prototype=Object.create($w.prototype)).point=function(e,t){$w.prototype.point.call(this,t,e)};function WV(e){this._context=e}WV.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}};function Nye(e){return new $w(e)}function Eye(e){return new qV(e)}function GV(e){this._context=e}GV.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=Z6(e),i=Z6(t),a=0,o=1;o=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function Tye(e){return new a_(e,.5)}function Oye(e){return new a_(e,0)}function Rye(e){return new a_(e,1)}function em(e,t){if((o=e.length)>1)for(var r=1,n,i,a=e[t[0]],o,s=a.length;r=0;)r[t]=t;return r}function Lye(e,t){return e[t]}function Iye(e){const t=[];return t.key=e,t}function Mye(){var e=$r([]),t=Xj,r=em,n=Lye;function i(a){var o=Array.from(e.apply(this,arguments),Iye),s,l=o.length,c=-1,u;for(const f of a)for(s=0,++c;s0){for(var r,n,i=0,a=e[0].length,o;i0){for(var r=0,n=e[t[0]],i,a=n.length;r0)||!((a=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,a,o;n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function qye(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var KV={symbolCircle:yT,symbolCross:fye,symbolDiamond:pye,symbolSquare:mye,symbolStar:bye,symbolTriangle:xye,symbolWye:_ye},Wye=Math.PI/180,Gye=function(t){var r="symbol".concat(r_(t));return KV[r]||yT},Kye=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*Wye;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},Yye=function(t,r){KV["symbol".concat(r_(t))]=r},bT=function(t){var r=t.type,n=r===void 0?"circle":r,i=t.size,a=i===void 0?64:i,o=t.sizeType,s=o===void 0?"area":o,l=Vye(t,Bye),c=eI(eI({},l),{},{type:n,size:a,sizeType:s}),u=function(){var v=Gye(n),y=Sye().type(v).size(Kye(a,s,n));return y()},f=c.className,p=c.cx,h=c.cy,g=dt(c,!0);return p===+p&&h===+h&&a===+a?K.createElement("path",Jj({},g,{className:Ot("recharts-symbols",f),transform:"translate(".concat(p,", ").concat(h,")"),d:u()})):null};bT.registerSymbol=Yye;function tm(e){"@babel/helpers - typeof";return tm=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},tm(e)}function Zj(){return Zj=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var b=h.inactive?c:h.color;return K.createElement("li",Zj({className:v,style:f,key:"legend-item-".concat(g)},Qp(n.props,h,g)),K.createElement(Hj,{width:o,height:o,viewBox:u,style:p},n.renderIcon(h)),K.createElement("span",{className:"recharts-legend-item-text",style:{color:b}},m?m(y,h,g):y))})}},{key:"render",value:function(){var n=this.props,i=n.payload,a=n.layout,o=n.align;if(!i||!i.length)return null;var s={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return K.createElement("ul",{className:"recharts-default-legend",style:s},this.renderItems())}}])}(P.PureComponent);By(xT,"displayName","Legend");By(xT,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var a0e=H5;function o0e(){this.__data__=new a0e,this.size=0}var s0e=o0e;function l0e(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var c0e=l0e;function u0e(e){return this.__data__.get(e)}var d0e=u0e;function f0e(e){return this.__data__.has(e)}var h0e=f0e,p0e=H5,m0e=sT,g0e=lT,v0e=200;function y0e(e,t){var r=this.__data__;if(r instanceof p0e){var n=r.__data__;if(!m0e||n.lengths))return!1;var c=a.get(e),u=a.get(t);if(c&&u)return c==t&&u==e;var f=-1,p=!0,h=r&B0e?new M0e:void 0;for(a.set(e,t),a.set(t,e);++f-1&&e%1==0&&e-1&&e%1==0&&e<=V1e}var AT=q1e,W1e=xc,G1e=AT,K1e=wc,Y1e="[object Arguments]",X1e="[object Array]",J1e="[object Boolean]",Z1e="[object Date]",Q1e="[object Error]",ebe="[object Function]",tbe="[object Map]",rbe="[object Number]",nbe="[object Object]",ibe="[object RegExp]",abe="[object Set]",obe="[object String]",sbe="[object WeakMap]",lbe="[object ArrayBuffer]",cbe="[object DataView]",ube="[object Float32Array]",dbe="[object Float64Array]",fbe="[object Int8Array]",hbe="[object Int16Array]",pbe="[object Int32Array]",mbe="[object Uint8Array]",gbe="[object Uint8ClampedArray]",vbe="[object Uint16Array]",ybe="[object Uint32Array]",Hr={};Hr[ube]=Hr[dbe]=Hr[fbe]=Hr[hbe]=Hr[pbe]=Hr[mbe]=Hr[gbe]=Hr[vbe]=Hr[ybe]=!0;Hr[Y1e]=Hr[X1e]=Hr[lbe]=Hr[J1e]=Hr[cbe]=Hr[Z1e]=Hr[Q1e]=Hr[ebe]=Hr[tbe]=Hr[rbe]=Hr[nbe]=Hr[ibe]=Hr[abe]=Hr[obe]=Hr[sbe]=!1;function bbe(e){return K1e(e)&&G1e(e.length)&&!!Hr[W1e(e)]}var xbe=bbe;function wbe(e){return function(t){return e(t)}}var aq=wbe,Uw={exports:{}};Uw.exports;(function(e,t){var r=hV,n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===n,o=a&&r.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}}();e.exports=s})(Uw,Uw.exports);var _be=Uw.exports,Sbe=xbe,Abe=aq,sI=_be,lI=sI&&sI.isTypedArray,Pbe=lI?Abe(lI):Sbe,oq=Pbe,kbe=E1e,jbe=_T,Nbe=ya,Ebe=iq,Cbe=ST,Tbe=oq,Obe=Object.prototype,Rbe=Obe.hasOwnProperty;function Lbe(e,t){var r=Nbe(e),n=!r&&jbe(e),i=!r&&!n&&Ebe(e),a=!r&&!n&&!i&&Tbe(e),o=r||n||i||a,s=o?kbe(e.length,String):[],l=s.length;for(var c in e)(t||Rbe.call(e,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||a&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Cbe(c,l)))&&s.push(c);return s}var Ibe=Lbe,Mbe=Object.prototype;function $be(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Mbe;return e===r}var Dbe=$be;function Fbe(e,t){return function(r){return e(t(r))}}var sq=Fbe,Bbe=sq,Ube=Bbe(Object.keys,Object),zbe=Ube,Hbe=Dbe,Vbe=zbe,qbe=Object.prototype,Wbe=qbe.hasOwnProperty;function Gbe(e){if(!Hbe(e))return Vbe(e);var t=[];for(var r in Object(e))Wbe.call(e,r)&&r!="constructor"&&t.push(r);return t}var Kbe=Gbe,Ybe=aT,Xbe=AT;function Jbe(e){return e!=null&&Xbe(e.length)&&!Ybe(e)}var i1=Jbe,Zbe=Ibe,Qbe=Kbe,exe=i1;function txe(e){return exe(e)?Zbe(e):Qbe(e)}var o_=txe,rxe=v1e,nxe=j1e,ixe=o_;function axe(e){return rxe(e,ixe,nxe)}var oxe=axe,cI=oxe,sxe=1,lxe=Object.prototype,cxe=lxe.hasOwnProperty;function uxe(e,t,r,n,i,a){var o=r&sxe,s=cI(e),l=s.length,c=cI(t),u=c.length;if(l!=u&&!o)return!1;for(var f=l;f--;){var p=s[f];if(!(o?p in t:cxe.call(t,p)))return!1}var h=a.get(e),g=a.get(t);if(h&&g)return h==t&&g==e;var m=!0;a.set(e,t),a.set(t,e);for(var v=o;++f-1}var l2e=s2e;function c2e(e,t,r){for(var n=-1,i=e==null?0:e.length;++n=A2e){var c=t?null:_2e(e);if(c)return S2e(c);o=!1,i=w2e,l=new y2e}else l=t?[]:s;e:for(;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function B2e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function U2e(e){return e.value}function z2e(e,t){if(K.isValidElement(e))return K.cloneElement(e,t);if(typeof e=="function")return K.createElement(e,t);t.ref;var r=F2e(t,T2e);return K.createElement(xT,r)}var PI=1,Zl=function(e){function t(){var r;O2e(this,t);for(var n=arguments.length,i=new Array(n),a=0;aPI||Math.abs(i.height-this.lastBoundingBox.height)>PI)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,n&&n(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?jl({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,a=i.layout,o=i.align,s=i.verticalAlign,l=i.margin,c=i.chartWidth,u=i.chartHeight,f,p;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&a==="vertical"){var h=this.getBBoxSnapshot();f={left:((c||0)-h.width)/2}}else f=o==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(s==="middle"){var g=this.getBBoxSnapshot();p={top:((u||0)-g.height)/2}}else p=s==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return jl(jl({},f),p)}},{key:"render",value:function(){var n=this,i=this.props,a=i.content,o=i.width,s=i.height,l=i.wrapperStyle,c=i.payloadUniqBy,u=i.payload,f=jl(jl({position:"absolute",width:o||"auto",height:s||"auto"},this.getDefaultPosition(l)),l);return K.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(h){n.wrapperNode=h}},z2e(a,jl(jl({},this.props),{},{payload:pq(u,c,U2e)})))}}],[{key:"getWithHeight",value:function(n,i){var a=jl(jl({},this.defaultProps),n.props),o=a.layout;return o==="vertical"&&Le(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||i}:null}}])}(P.PureComponent);s_(Zl,"displayName","Legend");s_(Zl,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var kI=r1,H2e=_T,V2e=ya,jI=kI?kI.isConcatSpreadable:void 0;function q2e(e){return V2e(e)||H2e(e)||!!(jI&&e&&e[jI])}var W2e=q2e,G2e=rq,K2e=W2e;function vq(e,t,r,n,i){var a=-1,o=e.length;for(r||(r=K2e),i||(i=[]);++a0&&r(s)?t>1?vq(s,t-1,r,n,i):G2e(i,s):n||(i[i.length]=s)}return i}var yq=vq;function Y2e(e){return function(t,r,n){for(var i=-1,a=Object(t),o=n(t),s=o.length;s--;){var l=o[e?s:++i];if(r(a[l],l,a)===!1)break}return t}}var X2e=Y2e,J2e=X2e,Z2e=J2e(),Q2e=Z2e,e5e=Q2e,t5e=o_;function r5e(e,t){return e&&e5e(e,t,t5e)}var bq=r5e,n5e=i1;function i5e(e,t){return function(r,n){if(r==null)return r;if(!n5e(r))return e(r,n);for(var i=r.length,a=t?i:-1,o=Object(r);(t?a--:++at||a&&o&&l&&!s&&!c||n&&o&&l||!r&&l||!i)return 1;if(!n&&!a&&!c&&e=s)return l;var c=r[n];return l*(c=="desc"?-1:1)}}return e.index-t.index}var y5e=v5e,OA=uT,b5e=dT,x5e=cl,w5e=xq,_5e=h5e,S5e=aq,A5e=y5e,P5e=rg,k5e=ya;function j5e(e,t,r){t.length?t=OA(t,function(a){return k5e(a)?function(o){return b5e(o,a.length===1?a[0]:a)}:a}):t=[P5e];var n=-1;t=OA(t,S5e(x5e));var i=w5e(e,function(a,o,s){var l=OA(t,function(c){return c(a)});return{criteria:l,index:++n,value:a}});return _5e(i,function(a,o){return A5e(a,o,r)})}var N5e=j5e;function E5e(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var C5e=E5e,T5e=C5e,EI=Math.max;function O5e(e,t,r){return t=EI(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=EI(n.length-t,0),o=Array(a);++i0){if(++t>=z5e)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var W5e=q5e,G5e=U5e,K5e=W5e,Y5e=K5e(G5e),X5e=Y5e,J5e=rg,Z5e=R5e,Q5e=X5e;function e_e(e,t){return Q5e(Z5e(e,t,J5e),e+"")}var t_e=e_e,r_e=oT,n_e=i1,i_e=ST,a_e=Wu;function o_e(e,t,r){if(!a_e(r))return!1;var n=typeof t;return(n=="number"?n_e(r)&&i_e(t,r.length):n=="string"&&t in r)?r_e(r[t],e):!1}var l_=o_e,s_e=yq,l_e=N5e,c_e=t_e,TI=l_,u_e=c_e(function(e,t){if(e==null)return[];var r=t.length;return r>1&&TI(e,t[0],t[1])?t=[]:r>2&&TI(t[0],t[1],t[2])&&(t=[t[0]]),l_e(e,s_e(t,1),[])}),d_e=u_e;const jT=ar(d_e);function Uy(e){"@babel/helpers - typeof";return Uy=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},Uy(e)}function oN(){return oN=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t.x),"".concat(ov,"-left"),Le(r)&&t&&Le(t.x)&&r=t.y),"".concat(ov,"-top"),Le(n)&&t&&Le(t.y)&&nm?Math.max(u,l[n]):Math.max(f,l[n])}function k_e(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function j_e(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,i=e.position,a=e.reverseDirection,o=e.tooltipBox,s=e.useTranslate3d,l=e.viewBox,c,u,f;return o.height>0&&o.width>0&&r?(u=LI({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:l,viewBoxDimension:l.width}),f=LI({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:l,viewBoxDimension:l.height}),c=k_e({translateX:u,translateY:f,useTranslate3d:s})):c=A_e,{cssProperties:c,cssClasses:P_e({translateX:u,translateY:f,coordinate:r})}}function nm(e){"@babel/helpers - typeof";return nm=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},nm(e)}function II(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function MI(e){for(var t=1;t$I||Math.abs(n.height-this.state.lastBoundingBox.height)>$I)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,s=i.animationDuration,l=i.animationEasing,c=i.children,u=i.coordinate,f=i.hasPayload,p=i.isAnimationActive,h=i.offset,g=i.position,m=i.reverseDirection,v=i.useTranslate3d,y=i.viewBox,b=i.wrapperStyle,x=j_e({allowEscapeViewBox:o,coordinate:u,offsetTopLeft:h,position:g,reverseDirection:m,tooltipBox:this.state.lastBoundingBox,useTranslate3d:v,viewBox:y}),S=x.cssClasses,_=x.cssProperties,k=MI(MI({transition:p&&a?"transform ".concat(s,"ms ").concat(l):void 0},_),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&f?"visible":"hidden",position:"absolute",top:0,left:0},b);return K.createElement("div",{tabIndex:-1,className:S,style:k,ref:function(O){n.wrapperNode=O}},c)}}])}(P.PureComponent),$_e=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Xs={isSsr:$_e(),get:function(t){return Xs[t]},set:function(t,r){if(typeof t=="string")Xs[t]=r;else{var n=Object.keys(t);n&&n.length&&n.forEach(function(i){Xs[i]=t[i]})}}};function im(e){"@babel/helpers - typeof";return im=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},im(e)}function DI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function FI(e){for(var t=1;t0;return K.createElement(M_e,{allowEscapeViewBox:o,animationDuration:s,animationEasing:l,isAnimationActive:p,active:a,coordinate:u,hasPayload:k,offset:h,position:v,reverseDirection:y,useTranslate3d:b,viewBox:x,wrapperStyle:S},G_e(c,FI(FI({},this.props),{},{payload:_})))}}])}(P.PureComponent);NT(En,"displayName","Tooltip");NT(En,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Xs.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var K_e=ll,Y_e=function(){return K_e.Date.now()},X_e=Y_e,J_e=/\s/;function Z_e(e){for(var t=e.length;t--&&J_e.test(e.charAt(t)););return t}var Q_e=Z_e,eSe=Q_e,tSe=/^\s+/;function rSe(e){return e&&e.slice(0,eSe(e)+1).replace(tSe,"")}var nSe=rSe,iSe=nSe,BI=Wu,aSe=Km,UI=NaN,oSe=/^[-+]0x[0-9a-f]+$/i,sSe=/^0b[01]+$/i,lSe=/^0o[0-7]+$/i,cSe=parseInt;function uSe(e){if(typeof e=="number")return e;if(aSe(e))return UI;if(BI(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=BI(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=iSe(e);var r=sSe.test(e);return r||lSe.test(e)?cSe(e.slice(2),r?2:8):oSe.test(e)?UI:+e}var kq=uSe,dSe=Wu,LA=X_e,zI=kq,fSe="Expected a function",hSe=Math.max,pSe=Math.min;function mSe(e,t,r){var n,i,a,o,s,l,c=0,u=!1,f=!1,p=!0;if(typeof e!="function")throw new TypeError(fSe);t=zI(t)||0,dSe(r)&&(u=!!r.leading,f="maxWait"in r,a=f?hSe(zI(r.maxWait)||0,t):a,p="trailing"in r?!!r.trailing:p);function h(k){var E=n,O=i;return n=i=void 0,c=k,o=e.apply(O,E),o}function g(k){return c=k,s=setTimeout(y,t),u?h(k):o}function m(k){var E=k-l,O=k-c,R=t-E;return f?pSe(R,a-O):R}function v(k){var E=k-l,O=k-c;return l===void 0||E>=t||E<0||f&&O>=a}function y(){var k=LA();if(v(k))return b(k);s=setTimeout(y,m(k))}function b(k){return s=void 0,p&&n?h(k):(n=i=void 0,o)}function x(){s!==void 0&&clearTimeout(s),c=0,n=l=i=s=void 0}function S(){return s===void 0?o:b(LA())}function _(){var k=LA(),E=v(k);if(n=arguments,i=this,l=k,E){if(s===void 0)return g(l);if(f)return clearTimeout(s),s=setTimeout(y,t),h(l)}return s===void 0&&(s=setTimeout(y,t)),o}return _.cancel=x,_.flush=S,_}var gSe=mSe,vSe=gSe,ySe=Wu,bSe="Expected a function";function xSe(e,t,r){var n=!0,i=!0;if(typeof e!="function")throw new TypeError(bSe);return ySe(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),vSe(e,t,{leading:n,maxWait:t,trailing:i})}var wSe=xSe;const jq=ar(wSe);function Hy(e){"@babel/helpers - typeof";return Hy=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},Hy(e)}function HI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function zb(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(D=jq(D,m,{trailing:!0,leading:!1}));var I=new ResizeObserver(D),G=_.current.getBoundingClientRect(),Y=G.width,Z=G.height;return N(Y,Z),I.observe(_.current),function(){I.disconnect()}},[N,m]);var C=P.useMemo(function(){var D=R.containerWidth,I=R.containerHeight;if(D<0||I<0)return null;Jl(Bd(o)||Bd(l),`The width(%s) and height(%s) are both fixed numbers, maybe you don't need to use a ResponsiveContainer.`,o,l),Jl(!r||r>0,"The aspect(%s) must be greater than zero.",r);var G=Bd(o)?D:o,Y=Bd(l)?I:l;r&&r>0&&(G?Y=G/r:Y&&(G=Y*r),p&&Y>p&&(Y=p)),Jl(G>0||Y>0,`The width(%s) and height(%s) of chart should be greater than 0, please check the style of container, or the props width(%s) and height(%s), or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the height and width.`,G,Y,o,l,u,f,r);var Z=!Array.isArray(h)&&Xl(h.type).endsWith("Chart");return K.Children.map(h,function(U){return K.isValidElement(U)?P.cloneElement(U,zb({width:G,height:Y},Z?{style:zb({height:"100%",width:"100%",maxHeight:Y,maxWidth:G},U.props.style)}:{})):U})},[r,h,l,p,f,u,R,o]);return K.createElement("div",{id:v?"".concat(v):void 0,className:Ot("recharts-responsive-container",y),style:zb(zb({},S),{},{width:o,height:l,minWidth:u,minHeight:f,maxHeight:p}),ref:_},C)}),Nq=function(t){return null};Nq.displayName="Cell";function Vy(e){"@babel/helpers - typeof";return Vy=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},Vy(e)}function qI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function uN(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Xs.isSsr)return{width:0,height:0};var n=ISe(r),i=JSON.stringify({text:t,copyStyle:n});if(mh.widthCache[i])return mh.widthCache[i];try{var a=document.getElementById(WI);a||(a=document.createElement("span"),a.setAttribute("id",WI),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=uN(uN({},LSe),n);Object.assign(a.style,o),a.textContent="".concat(t);var s=a.getBoundingClientRect(),l={width:s.width,height:s.height};return mh.widthCache[i]=l,++mh.cacheCount>RSe&&(mh.cacheCount=0,mh.widthCache={}),l}catch{return{width:0,height:0}}},MSe=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function qy(e){"@babel/helpers - typeof";return qy=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},qy(e)}function qw(e,t){return BSe(e)||FSe(e,t)||DSe(e,t)||$Se()}function $Se(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function DSe(e,t){if(e){if(typeof e=="string")return GI(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return GI(e,t)}}function GI(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function eAe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function QI(e,t){return iAe(e)||nAe(e,t)||rAe(e,t)||tAe()}function tAe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rAe(e,t){if(e){if(typeof e=="string")return eM(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return eM(e,t)}}function eM(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[];return G.reduce(function(Y,Z){var U=Z.word,X=Z.width,oe=Y[Y.length-1];if(oe&&(i==null||a||oe.width+X+nZ.width?Y:Z})};if(!u)return h;for(var m="…",v=function(G){var Y=f.slice(0,G),Z=Oq({breakAll:c,style:l,children:Y+m}).wordsWithComputedWidth,U=p(Z),X=U.length>o||g(U).width>Number(i);return[X,U]},y=0,b=f.length-1,x=0,S;y<=b&&x<=f.length-1;){var _=Math.floor((y+b)/2),k=_-1,E=v(k),O=QI(E,2),R=O[0],$=O[1],N=v(_),C=QI(N,1),D=C[0];if(!R&&!D&&(y=_+1),R&&D&&(b=_-1),!R&&D){S=$;break}x++}return S||h},tM=function(t){var r=zt(t)?[]:t.toString().split(Tq);return[{words:r}]},oAe=function(t){var r=t.width,n=t.scaleToFit,i=t.children,a=t.style,o=t.breakAll,s=t.maxLines;if((r||n)&&!Xs.isSsr){var l,c,u=Oq({breakAll:o,children:i,style:a});if(u){var f=u.wordsWithComputedWidth,p=u.spaceWidth;l=f,c=p}else return tM(i);return aAe({breakAll:o,children:i,maxLines:s,style:a},l,c,r,n)}return tM(i)},rM="#808080",am=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.lineHeight,s=o===void 0?"1em":o,l=t.capHeight,c=l===void 0?"0.71em":l,u=t.scaleToFit,f=u===void 0?!1:u,p=t.textAnchor,h=p===void 0?"start":p,g=t.verticalAnchor,m=g===void 0?"end":g,v=t.fill,y=v===void 0?rM:v,b=ZI(t,ZSe),x=P.useMemo(function(){return oAe({breakAll:b.breakAll,children:b.children,maxLines:b.maxLines,scaleToFit:f,style:b.style,width:b.width})},[b.breakAll,b.children,b.maxLines,f,b.style,b.width]),S=b.dx,_=b.dy,k=b.angle,E=b.className,O=b.breakAll,R=ZI(b,QSe);if(!qn(n)||!qn(a))return null;var $=n+(Le(S)?S:0),N=a+(Le(_)?_:0),C;switch(m){case"start":C=IA("calc(".concat(c,")"));break;case"middle":C=IA("calc(".concat((x.length-1)/2," * -").concat(s," + (").concat(c," / 2))"));break;default:C=IA("calc(".concat(x.length-1," * -").concat(s,")"));break}var D=[];if(f){var I=x[0].width,G=b.width;D.push("scale(".concat((Le(G)?G/I:1)/I,")"))}return k&&D.push("rotate(".concat(k,", ").concat($,", ").concat(N,")")),D.length&&(R.transform=D.join(" ")),K.createElement("text",dN({},dt(R,!0),{x:$,y:N,className:Ot("recharts-text",E),textAnchor:h,fill:y.includes("url")?rM:y}),x.map(function(Y,Z){var U=Y.words.join(O?"":" ");return K.createElement("tspan",{x:$,dy:Z===0?C:s,key:"".concat(U,"-").concat(Z)},U)}))};function Tu(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function sAe(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function ET(e){let t,r,n;e.length!==2?(t=Tu,r=(s,l)=>Tu(e(s),l),n=(s,l)=>e(s)-l):(t=e===Tu||e===sAe?e:lAe,r=e,n=e);function i(s,l,c=0,u=s.length){if(c>>1;r(s[f],l)<0?c=f+1:u=f}while(c>>1;r(s[f],l)<=0?c=f+1:u=f}while(cc&&n(s[f-1],l)>-n(s[f],l)?f-1:f}return{left:i,center:o,right:a}}function lAe(){return 0}function Rq(e){return e===null?NaN:+e}function*cAe(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const uAe=ET(Tu),a1=uAe.right;ET(Rq).center;class nM extends Map{constructor(t,r=hAe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(iM(this,t))}has(t){return super.has(iM(this,t))}set(t,r){return super.set(dAe(this,t),r)}delete(t){return super.delete(fAe(this,t))}}function iM({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function dAe({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function fAe({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function hAe(e){return e!==null&&typeof e=="object"?e.valueOf():e}function pAe(e=Tu){if(e===Tu)return Lq;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function Lq(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const mAe=Math.sqrt(50),gAe=Math.sqrt(10),vAe=Math.sqrt(2);function Ww(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),o=a>=mAe?10:a>=gAe?5:a>=vAe?2:1;let s,l,c;return i<0?(c=Math.pow(10,-i)/o,s=Math.round(e*c),l=Math.round(t*c),s/ct&&--l,c=-c):(c=Math.pow(10,i)*o,s=Math.round(e/c),l=Math.round(t/c),s*ct&&--l),l0))return[];if(e===t)return[e];const n=t=i))return[];const s=a-i+1,l=new Array(s);if(n)if(o<0)for(let c=0;c=n)&&(r=n);return r}function oM(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function Iq(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?Lq:pAe(i);n>r;){if(n-r>600){const l=n-r+1,c=t-r+1,u=Math.log(l),f=.5*Math.exp(2*u/3),p=.5*Math.sqrt(u*f*(l-f)/l)*(c-l/2<0?-1:1),h=Math.max(r,Math.floor(t-c*f/l+p)),g=Math.min(n,Math.floor(t+(l-c)*f/l+p));Iq(e,t,h,g,i)}const a=e[t];let o=r,s=n;for(sv(e,r,t),i(e[n],a)>0&&sv(e,r,n);o0;)--s}i(e[r],a)===0?sv(e,r,s):(++s,sv(e,s,n)),s<=t&&(r=s+1),t<=s&&(n=s-1)}return e}function sv(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function yAe(e,t,r){if(e=Float64Array.from(cAe(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return oM(e);if(t>=1)return aM(e);var n,i=(n-1)*t,a=Math.floor(i),o=aM(Iq(e,a).subarray(0,a+1)),s=oM(e.subarray(a+1));return o+(s-o)*(i-a)}}function bAe(e,t,r=Rq){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,a=Math.floor(i),o=+r(e[a],a,e),s=+r(e[a+1],a+1,e);return o+(s-o)*(i-a)}}function xAe(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(i);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Vb(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Vb(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=_Ae.exec(e))?new ua(t[1],t[2],t[3],1):(t=SAe.exec(e))?new ua(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=AAe.exec(e))?Vb(t[1],t[2],t[3],t[4]):(t=PAe.exec(e))?Vb(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=kAe.exec(e))?hM(t[1],t[2]/100,t[3]/100,1):(t=jAe.exec(e))?hM(t[1],t[2]/100,t[3]/100,t[4]):sM.hasOwnProperty(e)?uM(sM[e]):e==="transparent"?new ua(NaN,NaN,NaN,0):null}function uM(e){return new ua(e>>16&255,e>>8&255,e&255,1)}function Vb(e,t,r,n){return n<=0&&(e=t=r=NaN),new ua(e,t,r,n)}function CAe(e){return e instanceof o1||(e=Yy(e)),e?(e=e.rgb(),new ua(e.r,e.g,e.b,e.opacity)):new ua}function gN(e,t,r,n){return arguments.length===1?CAe(e):new ua(e,t,r,n??1)}function ua(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}TT(ua,gN,$q(o1,{brighter(e){return e=e==null?Gw:Math.pow(Gw,e),new ua(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Gy:Math.pow(Gy,e),new ua(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ua(df(this.r),df(this.g),df(this.b),Kw(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:dM,formatHex:dM,formatHex8:TAe,formatRgb:fM,toString:fM}));function dM(){return`#${Ud(this.r)}${Ud(this.g)}${Ud(this.b)}`}function TAe(){return`#${Ud(this.r)}${Ud(this.g)}${Ud(this.b)}${Ud((isNaN(this.opacity)?1:this.opacity)*255)}`}function fM(){const e=Kw(this.opacity);return`${e===1?"rgb(":"rgba("}${df(this.r)}, ${df(this.g)}, ${df(this.b)}${e===1?")":`, ${e})`}`}function Kw(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function df(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ud(e){return e=df(e),(e<16?"0":"")+e.toString(16)}function hM(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new ns(e,t,r,n)}function Dq(e){if(e instanceof ns)return new ns(e.h,e.s,e.l,e.opacity);if(e instanceof o1||(e=Yy(e)),!e)return new ns;if(e instanceof ns)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=NaN,s=a-i,l=(a+i)/2;return s?(t===a?o=(r-n)/s+(r0&&l<1?0:o,new ns(o,s,l,e.opacity)}function OAe(e,t,r,n){return arguments.length===1?Dq(e):new ns(e,t,r,n??1)}function ns(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}TT(ns,OAe,$q(o1,{brighter(e){return e=e==null?Gw:Math.pow(Gw,e),new ns(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Gy:Math.pow(Gy,e),new ns(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new ua(MA(e>=240?e-240:e+120,i,n),MA(e,i,n),MA(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new ns(pM(this.h),qb(this.s),qb(this.l),Kw(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Kw(this.opacity);return`${e===1?"hsl(":"hsla("}${pM(this.h)}, ${qb(this.s)*100}%, ${qb(this.l)*100}%${e===1?")":`, ${e})`}`}}));function pM(e){return e=(e||0)%360,e<0?e+360:e}function qb(e){return Math.max(0,Math.min(1,e||0))}function MA(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const OT=e=>()=>e;function RAe(e,t){return function(r){return e+r*t}}function LAe(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function IAe(e){return(e=+e)==1?Fq:function(t,r){return r-t?LAe(t,r,e):OT(isNaN(t)?r:t)}}function Fq(e,t){var r=t-e;return r?RAe(e,r):OT(isNaN(e)?t:e)}const mM=function e(t){var r=IAe(t);function n(i,a){var o=r((i=gN(i)).r,(a=gN(a)).r),s=r(i.g,a.g),l=r(i.b,a.b),c=Fq(i.opacity,a.opacity);return function(u){return i.r=o(u),i.g=s(u),i.b=l(u),i.opacity=c(u),i+""}}return n.gamma=e,n}(1);function MAe(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(a){for(i=0;ir&&(a=t.slice(r,a),s[o]?s[o]+=a:s[++o]=a),(n=n[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,l.push({i:o,x:Yw(n,i)})),r=$A.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function GAe(e,t,r){var n=e[0],i=e[1],a=t[0],o=t[1];return i2?KAe:GAe,l=c=null,f}function f(p){return p==null||isNaN(p=+p)?a:(l||(l=s(e.map(n),t,r)))(n(o(p)))}return f.invert=function(p){return o(i((c||(c=s(t,e.map(n),Yw)))(p)))},f.domain=function(p){return arguments.length?(e=Array.from(p,Xw),u()):e.slice()},f.range=function(p){return arguments.length?(t=Array.from(p),u()):t.slice()},f.rangeRound=function(p){return t=Array.from(p),r=RT,u()},f.clamp=function(p){return arguments.length?(o=p?!0:Wi,u()):o!==Wi},f.interpolate=function(p){return arguments.length?(r=p,u()):r},f.unknown=function(p){return arguments.length?(a=p,f):a},function(p,h){return n=p,i=h,u()}}function LT(){return c_()(Wi,Wi)}function YAe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Jw(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function om(e){return e=Jw(Math.abs(e)),e?e[1]:NaN}function XAe(e,t){return function(r,n){for(var i=r.length,a=[],o=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),a.push(r.substring(i-=s,i+s)),!((l+=s+1)>n));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function JAe(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var ZAe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Xy(e){if(!(t=ZAe.exec(e)))throw new Error("invalid format: "+e);var t;return new IT({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Xy.prototype=IT.prototype;function IT(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}IT.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function QAe(e){e:for(var t=e.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var Bq;function ePe(e,t){var r=Jw(e,t);if(!r)return e+"";var n=r[0],i=r[1],a=i-(Bq=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return a===o?n:a>o?n+new Array(a-o+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+Jw(e,Math.max(0,t+a-1))[0]}function vM(e,t){var r=Jw(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const yM={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:YAe,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>vM(e*100,t),r:vM,s:ePe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function bM(e){return e}var xM=Array.prototype.map,wM=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function tPe(e){var t=e.grouping===void 0||e.thousands===void 0?bM:XAe(xM.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?bM:JAe(xM.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function c(f){f=Xy(f);var p=f.fill,h=f.align,g=f.sign,m=f.symbol,v=f.zero,y=f.width,b=f.comma,x=f.precision,S=f.trim,_=f.type;_==="n"?(b=!0,_="g"):yM[_]||(x===void 0&&(x=12),S=!0,_="g"),(v||p==="0"&&h==="=")&&(v=!0,p="0",h="=");var k=m==="$"?r:m==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",E=m==="$"?n:/[%p]/.test(_)?o:"",O=yM[_],R=/[defgprs%]/.test(_);x=x===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function $(N){var C=k,D=E,I,G,Y;if(_==="c")D=O(N)+D,N="";else{N=+N;var Z=N<0||1/N<0;if(N=isNaN(N)?l:O(Math.abs(N),x),S&&(N=QAe(N)),Z&&+N==0&&g!=="+"&&(Z=!1),C=(Z?g==="("?g:s:g==="-"||g==="("?"":g)+C,D=(_==="s"?wM[8+Bq/3]:"")+D+(Z&&g==="("?")":""),R){for(I=-1,G=N.length;++IY||Y>57){D=(Y===46?i+N.slice(I+1):N.slice(I))+D,N=N.slice(0,I);break}}}b&&!v&&(N=t(N,1/0));var U=C.length+N.length+D.length,X=U>1)+C+N+D+X.slice(U);break;default:N=X+C+N+D;break}return a(N)}return $.toString=function(){return f+""},$}function u(f,p){var h=c((f=Xy(f),f.type="f",f)),g=Math.max(-8,Math.min(8,Math.floor(om(p)/3)))*3,m=Math.pow(10,-g),v=wM[8+g/3];return function(y){return h(m*y)+v}}return{format:c,formatPrefix:u}}var Wb,MT,Uq;rPe({thousands:",",grouping:[3],currency:["$",""]});function rPe(e){return Wb=tPe(e),MT=Wb.format,Uq=Wb.formatPrefix,Wb}function nPe(e){return Math.max(0,-om(Math.abs(e)))}function iPe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(om(t)/3)))*3-om(Math.abs(e)))}function aPe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,om(t)-om(e))+1}function zq(e,t,r,n){var i=pN(e,t,r),a;switch(n=Xy(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=iPe(i,o))&&(n.precision=a),Uq(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=aPe(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=nPe(i))&&(n.precision=a-(n.type==="%")*2);break}}return MT(n)}function Gu(e){var t=e.domain;return e.ticks=function(r){var n=t();return fN(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return zq(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,a=n.length-1,o=n[i],s=n[a],l,c,u=10;for(s0;){if(c=hN(o,s,r),c===l)return n[i]=o,n[a]=s,t(n);if(c>0)o=Math.floor(o/c)*c,s=Math.ceil(s/c)*c;else if(c<0)o=Math.ceil(o*c)/c,s=Math.floor(s*c)/c;else break;l=c}return e},e}function Zw(){var e=LT();return e.copy=function(){return s1(e,Zw())},Oo.apply(e,arguments),Gu(e)}function Hq(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,Xw),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return Hq(e).unknown(t)},e=arguments.length?Array.from(e,Xw):[0,1],Gu(r)}function Vq(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],a=e[n],o;return aMath.pow(e,t)}function uPe(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function AM(e){return(t,r)=>-e(-t,r)}function $T(e){const t=e(_M,SM),r=t.domain;let n=10,i,a;function o(){return i=uPe(n),a=cPe(n),r()[0]<0?(i=AM(i),a=AM(a),e(oPe,sPe)):e(_M,SM),t}return t.base=function(s){return arguments.length?(n=+s,o()):n},t.domain=function(s){return arguments.length?(r(s),o()):r()},t.ticks=s=>{const l=r();let c=l[0],u=l[l.length-1];const f=u0){for(;p<=h;++p)for(g=1;gu)break;y.push(m)}}else for(;p<=h;++p)for(g=n-1;g>=1;--g)if(m=p>0?g/a(-p):g*a(p),!(mu)break;y.push(m)}y.length*2{if(s==null&&(s=10),l==null&&(l=n===10?"s":","),typeof l!="function"&&(!(n%1)&&(l=Xy(l)).precision==null&&(l.trim=!0),l=MT(l)),s===1/0)return l;const c=Math.max(1,n*s/t.ticks().length);return u=>{let f=u/a(Math.round(i(u)));return f*nr(Vq(r(),{floor:s=>a(Math.floor(i(s))),ceil:s=>a(Math.ceil(i(s)))})),t}function qq(){const e=$T(c_()).domain([1,10]);return e.copy=()=>s1(e,qq()).base(e.base()),Oo.apply(e,arguments),e}function PM(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function kM(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function DT(e){var t=1,r=e(PM(t),kM(t));return r.constant=function(n){return arguments.length?e(PM(t=+n),kM(t)):t},Gu(r)}function Wq(){var e=DT(c_());return e.copy=function(){return s1(e,Wq()).constant(e.constant())},Oo.apply(e,arguments)}function jM(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function dPe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function fPe(e){return e<0?-e*e:e*e}function FT(e){var t=e(Wi,Wi),r=1;function n(){return r===1?e(Wi,Wi):r===.5?e(dPe,fPe):e(jM(r),jM(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},Gu(t)}function BT(){var e=FT(c_());return e.copy=function(){return s1(e,BT()).exponent(e.exponent())},Oo.apply(e,arguments),e}function hPe(){return BT.apply(null,arguments).exponent(.5)}function NM(e){return Math.sign(e)*e*e}function pPe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function Gq(){var e=LT(),t=[0,1],r=!1,n;function i(a){var o=pPe(e(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return e.invert(NM(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,Xw)).map(NM)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(r=!!a,i):r},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return Gq(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},Oo.apply(i,arguments),Gu(i)}function Kq(){var e=[],t=[],r=[],n;function i(){var o=0,s=Math.max(1,t.length);for(r=new Array(s-1);++o0?r[s-1]:e[0],s=r?[n[r-1],t]:[n[c-1],n[c]]},o.unknown=function(l){return arguments.length&&(a=l),o},o.thresholds=function(){return n.slice()},o.copy=function(){return Yq().domain([e,t]).range(i).unknown(a)},Oo.apply(Gu(o),arguments)}function Xq(){var e=[.5],t=[0,1],r,n=1;function i(a){return a!=null&&a<=a?t[a1(e,a,0,n)]:r}return i.domain=function(a){return arguments.length?(e=Array.from(a),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return Xq().domain(e).range(t).unknown(r)},Oo.apply(i,arguments)}const DA=new Date,FA=new Date;function Wn(e,t,r,n){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),s=i.ceil(a);return a-o(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,s)=>{const l=[];if(a=i.ceil(a),s=s==null?1:Math.floor(s),!(a0))return l;let c;do l.push(c=new Date(+a)),t(a,s),e(a);while(cWn(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,s)=>{if(o>=o)if(s<0)for(;++s<=0;)for(;t(o,-1),!a(o););else for(;--s>=0;)for(;t(o,1),!a(o););}),r&&(i.count=(a,o)=>(DA.setTime(+a),FA.setTime(+o),e(DA),e(FA),Math.floor(r(DA,FA))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?o=>n(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const Qw=Wn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Qw.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Wn(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Qw);Qw.range;const Hl=1e3,bo=Hl*60,Vl=bo*60,dc=Vl*24,UT=dc*7,EM=dc*30,BA=dc*365,zd=Wn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Hl)},(e,t)=>(t-e)/Hl,e=>e.getUTCSeconds());zd.range;const zT=Wn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Hl)},(e,t)=>{e.setTime(+e+t*bo)},(e,t)=>(t-e)/bo,e=>e.getMinutes());zT.range;const HT=Wn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*bo)},(e,t)=>(t-e)/bo,e=>e.getUTCMinutes());HT.range;const VT=Wn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Hl-e.getMinutes()*bo)},(e,t)=>{e.setTime(+e+t*Vl)},(e,t)=>(t-e)/Vl,e=>e.getHours());VT.range;const qT=Wn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Vl)},(e,t)=>(t-e)/Vl,e=>e.getUTCHours());qT.range;const l1=Wn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*bo)/dc,e=>e.getDate()-1);l1.range;const u_=Wn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/dc,e=>e.getUTCDate()-1);u_.range;const Jq=Wn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/dc,e=>Math.floor(e/dc));Jq.range;function Bf(e){return Wn(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*bo)/UT)}const d_=Bf(0),e2=Bf(1),mPe=Bf(2),gPe=Bf(3),sm=Bf(4),vPe=Bf(5),yPe=Bf(6);d_.range;e2.range;mPe.range;gPe.range;sm.range;vPe.range;yPe.range;function Uf(e){return Wn(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/UT)}const f_=Uf(0),t2=Uf(1),bPe=Uf(2),xPe=Uf(3),lm=Uf(4),wPe=Uf(5),_Pe=Uf(6);f_.range;t2.range;bPe.range;xPe.range;lm.range;wPe.range;_Pe.range;const WT=Wn(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());WT.range;const GT=Wn(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());GT.range;const fc=Wn(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());fc.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Wn(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});fc.range;const hc=Wn(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());hc.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Wn(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});hc.range;function Zq(e,t,r,n,i,a){const o=[[zd,1,Hl],[zd,5,5*Hl],[zd,15,15*Hl],[zd,30,30*Hl],[a,1,bo],[a,5,5*bo],[a,15,15*bo],[a,30,30*bo],[i,1,Vl],[i,3,3*Vl],[i,6,6*Vl],[i,12,12*Vl],[n,1,dc],[n,2,2*dc],[r,1,UT],[t,1,EM],[t,3,3*EM],[e,1,BA]];function s(c,u,f){const p=uv).right(o,p);if(h===o.length)return e.every(pN(c/BA,u/BA,f));if(h===0)return Qw.every(Math.max(pN(c,u,f),1));const[g,m]=o[p/o[h-1][2]53)return null;"w"in fe||(fe.w=1),"Z"in fe?(Te=zA(lv(fe.y,0,1)),Q=Te.getUTCDay(),Te=Q>4||Q===0?t2.ceil(Te):t2(Te),Te=u_.offset(Te,(fe.V-1)*7),fe.y=Te.getUTCFullYear(),fe.m=Te.getUTCMonth(),fe.d=Te.getUTCDate()+(fe.w+6)%7):(Te=UA(lv(fe.y,0,1)),Q=Te.getDay(),Te=Q>4||Q===0?e2.ceil(Te):e2(Te),Te=l1.offset(Te,(fe.V-1)*7),fe.y=Te.getFullYear(),fe.m=Te.getMonth(),fe.d=Te.getDate()+(fe.w+6)%7)}else("W"in fe||"U"in fe)&&("w"in fe||(fe.w="u"in fe?fe.u%7:"W"in fe?1:0),Q="Z"in fe?zA(lv(fe.y,0,1)).getUTCDay():UA(lv(fe.y,0,1)).getDay(),fe.m=0,fe.d="W"in fe?(fe.w+6)%7+fe.W*7-(Q+5)%7:fe.w+fe.U*7-(Q+6)%7);return"Z"in fe?(fe.H+=fe.Z/100|0,fe.M+=fe.Z%100,zA(fe)):UA(fe)}}function O(ae,de,ve,fe){for(var je=0,Te=de.length,Q=ve.length,Ce,Ke;je=Q)return-1;if(Ce=de.charCodeAt(je++),Ce===37){if(Ce=de.charAt(je++),Ke=_[Ce in CM?de.charAt(je++):Ce],!Ke||(fe=Ke(ae,ve,fe))<0)return-1}else if(Ce!=ve.charCodeAt(fe++))return-1}return fe}function R(ae,de,ve){var fe=c.exec(de.slice(ve));return fe?(ae.p=u.get(fe[0].toLowerCase()),ve+fe[0].length):-1}function $(ae,de,ve){var fe=h.exec(de.slice(ve));return fe?(ae.w=g.get(fe[0].toLowerCase()),ve+fe[0].length):-1}function N(ae,de,ve){var fe=f.exec(de.slice(ve));return fe?(ae.w=p.get(fe[0].toLowerCase()),ve+fe[0].length):-1}function C(ae,de,ve){var fe=y.exec(de.slice(ve));return fe?(ae.m=b.get(fe[0].toLowerCase()),ve+fe[0].length):-1}function D(ae,de,ve){var fe=m.exec(de.slice(ve));return fe?(ae.m=v.get(fe[0].toLowerCase()),ve+fe[0].length):-1}function I(ae,de,ve){return O(ae,t,de,ve)}function G(ae,de,ve){return O(ae,r,de,ve)}function Y(ae,de,ve){return O(ae,n,de,ve)}function Z(ae){return o[ae.getDay()]}function U(ae){return a[ae.getDay()]}function X(ae){return l[ae.getMonth()]}function oe(ae){return s[ae.getMonth()]}function ue(ae){return i[+(ae.getHours()>=12)]}function M(ae){return 1+~~(ae.getMonth()/3)}function W(ae){return o[ae.getUTCDay()]}function z(ae){return a[ae.getUTCDay()]}function ie(ae){return l[ae.getUTCMonth()]}function le(ae){return s[ae.getUTCMonth()]}function V(ae){return i[+(ae.getUTCHours()>=12)]}function se(ae){return 1+~~(ae.getUTCMonth()/3)}return{format:function(ae){var de=k(ae+="",x);return de.toString=function(){return ae},de},parse:function(ae){var de=E(ae+="",!1);return de.toString=function(){return ae},de},utcFormat:function(ae){var de=k(ae+="",S);return de.toString=function(){return ae},de},utcParse:function(ae){var de=E(ae+="",!0);return de.toString=function(){return ae},de}}}var CM={"-":"",_:" ",0:"0"},ni=/^\s*\d+/,NPe=/^%/,EPe=/[\\^$*+?|[\]().{}]/g;function dr(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a[t.toLowerCase(),r]))}function TPe(e,t,r){var n=ni.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function OPe(e,t,r){var n=ni.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function RPe(e,t,r){var n=ni.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function LPe(e,t,r){var n=ni.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function IPe(e,t,r){var n=ni.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function TM(e,t,r){var n=ni.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function OM(e,t,r){var n=ni.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function MPe(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function $Pe(e,t,r){var n=ni.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function DPe(e,t,r){var n=ni.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function RM(e,t,r){var n=ni.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function FPe(e,t,r){var n=ni.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function LM(e,t,r){var n=ni.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function BPe(e,t,r){var n=ni.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function UPe(e,t,r){var n=ni.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function zPe(e,t,r){var n=ni.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function HPe(e,t,r){var n=ni.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function VPe(e,t,r){var n=NPe.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function qPe(e,t,r){var n=ni.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function WPe(e,t,r){var n=ni.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function IM(e,t){return dr(e.getDate(),t,2)}function GPe(e,t){return dr(e.getHours(),t,2)}function KPe(e,t){return dr(e.getHours()%12||12,t,2)}function YPe(e,t){return dr(1+l1.count(fc(e),e),t,3)}function Qq(e,t){return dr(e.getMilliseconds(),t,3)}function XPe(e,t){return Qq(e,t)+"000"}function JPe(e,t){return dr(e.getMonth()+1,t,2)}function ZPe(e,t){return dr(e.getMinutes(),t,2)}function QPe(e,t){return dr(e.getSeconds(),t,2)}function eke(e){var t=e.getDay();return t===0?7:t}function tke(e,t){return dr(d_.count(fc(e)-1,e),t,2)}function eW(e){var t=e.getDay();return t>=4||t===0?sm(e):sm.ceil(e)}function rke(e,t){return e=eW(e),dr(sm.count(fc(e),e)+(fc(e).getDay()===4),t,2)}function nke(e){return e.getDay()}function ike(e,t){return dr(e2.count(fc(e)-1,e),t,2)}function ake(e,t){return dr(e.getFullYear()%100,t,2)}function oke(e,t){return e=eW(e),dr(e.getFullYear()%100,t,2)}function ske(e,t){return dr(e.getFullYear()%1e4,t,4)}function lke(e,t){var r=e.getDay();return e=r>=4||r===0?sm(e):sm.ceil(e),dr(e.getFullYear()%1e4,t,4)}function cke(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+dr(t/60|0,"0",2)+dr(t%60,"0",2)}function MM(e,t){return dr(e.getUTCDate(),t,2)}function uke(e,t){return dr(e.getUTCHours(),t,2)}function dke(e,t){return dr(e.getUTCHours()%12||12,t,2)}function fke(e,t){return dr(1+u_.count(hc(e),e),t,3)}function tW(e,t){return dr(e.getUTCMilliseconds(),t,3)}function hke(e,t){return tW(e,t)+"000"}function pke(e,t){return dr(e.getUTCMonth()+1,t,2)}function mke(e,t){return dr(e.getUTCMinutes(),t,2)}function gke(e,t){return dr(e.getUTCSeconds(),t,2)}function vke(e){var t=e.getUTCDay();return t===0?7:t}function yke(e,t){return dr(f_.count(hc(e)-1,e),t,2)}function rW(e){var t=e.getUTCDay();return t>=4||t===0?lm(e):lm.ceil(e)}function bke(e,t){return e=rW(e),dr(lm.count(hc(e),e)+(hc(e).getUTCDay()===4),t,2)}function xke(e){return e.getUTCDay()}function wke(e,t){return dr(t2.count(hc(e)-1,e),t,2)}function _ke(e,t){return dr(e.getUTCFullYear()%100,t,2)}function Ske(e,t){return e=rW(e),dr(e.getUTCFullYear()%100,t,2)}function Ake(e,t){return dr(e.getUTCFullYear()%1e4,t,4)}function Pke(e,t){var r=e.getUTCDay();return e=r>=4||r===0?lm(e):lm.ceil(e),dr(e.getUTCFullYear()%1e4,t,4)}function kke(){return"+0000"}function $M(){return"%"}function DM(e){return+e}function FM(e){return Math.floor(+e/1e3)}var gh,nW,iW;jke({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function jke(e){return gh=jPe(e),nW=gh.format,gh.parse,iW=gh.utcFormat,gh.utcParse,gh}function Nke(e){return new Date(e)}function Eke(e){return e instanceof Date?+e:+new Date(+e)}function KT(e,t,r,n,i,a,o,s,l,c){var u=LT(),f=u.invert,p=u.domain,h=c(".%L"),g=c(":%S"),m=c("%I:%M"),v=c("%I %p"),y=c("%a %d"),b=c("%b %d"),x=c("%B"),S=c("%Y");function _(k){return(l(k)t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,a)=>yAe(e,a/n))},r.copy=function(){return lW(t).domain(e)},_c.apply(r,arguments)}function p_(){var e=0,t=.5,r=1,n=1,i,a,o,s,l,c=Wi,u,f=!1,p;function h(m){return isNaN(m=+m)?p:(m=.5+((m=+u(m))-a)*(n*mt}var fW=Mke,$ke=m_,Dke=fW,Fke=rg;function Bke(e){return e&&e.length?$ke(e,Fke,Dke):void 0}var Uke=Bke;const gu=ar(Uke);function zke(e,t){return ee.e^a.s<0?1:-1;for(n=a.d.length,i=e.d.length,t=0,r=ne.d[t]^a.s<0?1:-1;return n===i?0:n>i^a.s<0?1:-1};ze.decimalPlaces=ze.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*Vr;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};ze.dividedBy=ze.div=function(e){return Ql(this,new this.constructor(e))};ze.dividedToIntegerBy=ze.idiv=function(e){var t=this,r=t.constructor;return Tr(Ql(t,new r(e),0,1),r.precision)};ze.equals=ze.eq=function(e){return!this.cmp(e)};ze.exponent=function(){return On(this)};ze.greaterThan=ze.gt=function(e){return this.cmp(e)>0};ze.greaterThanOrEqualTo=ze.gte=function(e){return this.cmp(e)>=0};ze.isInteger=ze.isint=function(){return this.e>this.d.length-2};ze.isNegative=ze.isneg=function(){return this.s<0};ze.isPositive=ze.ispos=function(){return this.s>0};ze.isZero=function(){return this.s===0};ze.lessThan=ze.lt=function(e){return this.cmp(e)<0};ze.lessThanOrEqualTo=ze.lte=function(e){return this.cmp(e)<1};ze.logarithm=ze.log=function(e){var t,r=this,n=r.constructor,i=n.precision,a=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq($a))throw Error(Eo+"NaN");if(r.s<1)throw Error(Eo+(r.s?"NaN":"-Infinity"));return r.eq($a)?new n(0):(Jr=!1,t=Ql(Jy(r,a),Jy(e,a),a),Jr=!0,Tr(t,i))};ze.minus=ze.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?vW(t,e):mW(t,(e.s=-e.s,e))};ze.modulo=ze.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(Eo+"NaN");return r.s?(Jr=!1,t=Ql(r,e,0,1).times(e),Jr=!0,r.minus(t)):Tr(new n(r),i)};ze.naturalExponential=ze.exp=function(){return gW(this)};ze.naturalLogarithm=ze.ln=function(){return Jy(this)};ze.negated=ze.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};ze.plus=ze.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?mW(t,e):vW(t,(e.s=-e.s,e))};ze.precision=ze.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(ff+e);if(t=On(i)+1,n=i.d.length-1,r=n*Vr+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};ze.squareRoot=ze.sqrt=function(){var e,t,r,n,i,a,o,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(Eo+"NaN")}for(e=On(s),Jr=!1,i=Math.sqrt(+s),i==0||i==1/0?(t=Hs(s.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=ag((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new l(t)):n=new l(i.toString()),r=l.precision,i=o=r+3;;)if(a=n,n=a.plus(Ql(s,a,o+2)).times(.5),Hs(a.d).slice(0,o)===(t=Hs(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(Tr(a,r+1,0),a.times(a).eq(s)){n=a;break}}else if(t!="9999")break;o+=4}return Jr=!0,Tr(n,r)};ze.times=ze.mul=function(e){var t,r,n,i,a,o,s,l,c,u=this,f=u.constructor,p=u.d,h=(e=new f(e)).d;if(!u.s||!e.s)return new f(0);for(e.s*=u.s,r=u.e+e.e,l=p.length,c=h.length,l=0;){for(t=0,i=l+n;i>n;)s=a[i]+h[n]*p[i-n-1]+t,a[i--]=s%Xn|0,t=s/Xn|0;a[i]=(a[i]+t)%Xn|0}for(;!a[--o];)a.pop();return t?++r:a.shift(),e.d=a,e.e=r,Jr?Tr(e,f.precision):e};ze.toDecimalPlaces=ze.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(nl(e,0,ig),t===void 0?t=n.rounding:nl(t,0,8),Tr(r,e+On(r)+1,t))};ze.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=kf(n,!0):(nl(e,0,ig),t===void 0?t=i.rounding:nl(t,0,8),n=Tr(new i(n),e+1,t),r=kf(n,!0,e+1)),r};ze.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?kf(i):(nl(e,0,ig),t===void 0?t=a.rounding:nl(t,0,8),n=Tr(new a(i),e+On(i)+1,t),r=kf(n.abs(),!1,e+On(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};ze.toInteger=ze.toint=function(){var e=this,t=e.constructor;return Tr(new t(e),On(e)+1,t.rounding)};ze.toNumber=function(){return+this};ze.toPower=ze.pow=function(e){var t,r,n,i,a,o,s=this,l=s.constructor,c=12,u=+(e=new l(e));if(!e.s)return new l($a);if(s=new l(s),!s.s){if(e.s<1)throw Error(Eo+"Infinity");return s}if(s.eq($a))return s;if(n=l.precision,e.eq($a))return Tr(s,n);if(t=e.e,r=e.d.length-1,o=t>=r,a=s.s,o){if((r=u<0?-u:u)<=pW){for(i=new l($a),t=Math.ceil(n/Vr+4),Jr=!1;r%2&&(i=i.times(s),zM(i.d,t)),r=ag(r/2),r!==0;)s=s.times(s),zM(s.d,t);return Jr=!0,e.s<0?new l($a).div(i):Tr(i,n)}}else if(a<0)throw Error(Eo+"NaN");return a=a<0&&e.d[Math.max(t,r)]&1?-1:1,s.s=1,Jr=!1,i=e.times(Jy(s,n+c)),Jr=!0,i=gW(i),i.s=a,i};ze.toPrecision=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?(r=On(i),n=kf(i,r<=a.toExpNeg||r>=a.toExpPos)):(nl(e,1,ig),t===void 0?t=a.rounding:nl(t,0,8),i=Tr(new a(i),e,t),r=On(i),n=kf(i,e<=r||r<=a.toExpNeg,e)),n};ze.toSignificantDigits=ze.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(nl(e,1,ig),t===void 0?t=n.rounding:nl(t,0,8)),Tr(new n(r),e,t)};ze.toString=ze.valueOf=ze.val=ze.toJSON=ze[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=On(e),r=e.constructor;return kf(e,t<=r.toExpNeg||t>=r.toExpPos)};function mW(e,t){var r,n,i,a,o,s,l,c,u=e.constructor,f=u.precision;if(!e.s||!t.s)return t.s||(t=new u(e)),Jr?Tr(t,f):t;if(l=e.d,c=t.d,o=e.e,i=t.e,l=l.slice(),a=o-i,a){for(a<0?(n=l,a=-a,s=c.length):(n=c,i=o,s=l.length),o=Math.ceil(f/Vr),s=o>s?o+1:s+1,a>s&&(a=s,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(s=l.length,a=c.length,s-a<0&&(a=s,n=c,c=l,l=n),r=0;a;)r=(l[--a]=l[a]+c[a]+r)/Xn|0,l[a]%=Xn;for(r&&(l.unshift(r),++i),s=l.length;l[--s]==0;)l.pop();return t.d=l,t.e=i,Jr?Tr(t,f):t}function nl(e,t,r){if(e!==~~e||er)throw Error(ff+e)}function Hs(e){var t,r,n,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;to?1:-1;else for(s=l=0;si[s]?1:-1;break}return l}function r(n,i,a){for(var o=0;a--;)n[a]-=o,o=n[a]1;)n.shift()}return function(n,i,a,o){var s,l,c,u,f,p,h,g,m,v,y,b,x,S,_,k,E,O,R=n.constructor,$=n.s==i.s?1:-1,N=n.d,C=i.d;if(!n.s)return new R(n);if(!i.s)throw Error(Eo+"Division by zero");for(l=n.e-i.e,E=C.length,_=N.length,h=new R($),g=h.d=[],c=0;C[c]==(N[c]||0);)++c;if(C[c]>(N[c]||0)&&--l,a==null?b=a=R.precision:o?b=a+(On(n)-On(i))+1:b=a,b<0)return new R(0);if(b=b/Vr+2|0,c=0,E==1)for(u=0,C=C[0],b++;(c<_||u)&&b--;c++)x=u*Xn+(N[c]||0),g[c]=x/C|0,u=x%C|0;else{for(u=Xn/(C[0]+1)|0,u>1&&(C=e(C,u),N=e(N,u),E=C.length,_=N.length),S=E,m=N.slice(0,E),v=m.length;v=Xn/2&&++k;do u=0,s=t(C,m,E,v),s<0?(y=m[0],E!=v&&(y=y*Xn+(m[1]||0)),u=y/k|0,u>1?(u>=Xn&&(u=Xn-1),f=e(C,u),p=f.length,v=m.length,s=t(f,m,p,v),s==1&&(u--,r(f,E16)throw Error(JT+On(e));if(!e.s)return new u($a);for(t==null?(Jr=!1,s=f):s=t,o=new u(.03125);e.abs().gte(.1);)e=e.times(o),c+=5;for(n=Math.log(Ed(2,c))/Math.LN10*2+5|0,s+=n,r=i=a=new u($a),u.precision=s;;){if(i=Tr(i.times(e),s),r=r.times(++l),o=a.plus(Ql(i,r,s)),Hs(o.d).slice(0,s)===Hs(a.d).slice(0,s)){for(;c--;)a=Tr(a.times(a),s);return u.precision=f,t==null?(Jr=!0,Tr(a,f)):a}a=o}}function On(e){for(var t=e.e*Vr,r=e.d[0];r>=10;r/=10)t++;return t}function HA(e,t,r){if(t>e.LN10.sd())throw Jr=!0,r&&(e.precision=r),Error(Eo+"LN10 precision limit exceeded");return Tr(new e(e.LN10),t)}function Qc(e){for(var t="";e--;)t+="0";return t}function Jy(e,t){var r,n,i,a,o,s,l,c,u,f=1,p=10,h=e,g=h.d,m=h.constructor,v=m.precision;if(h.s<1)throw Error(Eo+(h.s?"NaN":"-Infinity"));if(h.eq($a))return new m(0);if(t==null?(Jr=!1,c=v):c=t,h.eq(10))return t==null&&(Jr=!0),HA(m,c);if(c+=p,m.precision=c,r=Hs(g),n=r.charAt(0),a=On(h),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)h=h.times(e),r=Hs(h.d),n=r.charAt(0),f++;a=On(h),n>1?(h=new m("0."+r),a++):h=new m(n+"."+r.slice(1))}else return l=HA(m,c+2,v).times(a+""),h=Jy(new m(n+"."+r.slice(1)),c-p).plus(l),m.precision=v,t==null?(Jr=!0,Tr(h,v)):h;for(s=o=h=Ql(h.minus($a),h.plus($a),c),u=Tr(h.times(h),c),i=3;;){if(o=Tr(o.times(u),c),l=s.plus(Ql(o,new m(i),c)),Hs(l.d).slice(0,c)===Hs(s.d).slice(0,c))return s=s.times(2),a!==0&&(s=s.plus(HA(m,c+2,v).times(a+""))),s=Ql(s,new m(f),c),m.precision=v,t==null?(Jr=!0,Tr(s,v)):s;s=l,i+=2}}function UM(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=ag(r/Vr),e.d=[],n=(r+1)%Vr,r<0&&(n+=Vr),nr2||e.e<-r2))throw Error(JT+r)}else e.s=0,e.e=0,e.d=[0];return e}function Tr(e,t,r){var n,i,a,o,s,l,c,u,f=e.d;for(o=1,a=f[0];a>=10;a/=10)o++;if(n=t-o,n<0)n+=Vr,i=t,c=f[u=0];else{if(u=Math.ceil((n+1)/Vr),a=f.length,u>=a)return e;for(c=a=f[u],o=1;a>=10;a/=10)o++;n%=Vr,i=n-Vr+o}if(r!==void 0&&(a=Ed(10,o-i-1),s=c/a%10|0,l=t<0||f[u+1]!==void 0||c%a,l=r<4?(s||l)&&(r==0||r==(e.s<0?3:2)):s>5||s==5&&(r==4||l||r==6&&(n>0?i>0?c/Ed(10,o-i):0:f[u-1])%10&1||r==(e.s<0?8:7))),t<1||!f[0])return l?(a=On(e),f.length=1,t=t-a-1,f[0]=Ed(10,(Vr-t%Vr)%Vr),e.e=ag(-t/Vr)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(n==0?(f.length=u,a=1,u--):(f.length=u+1,a=Ed(10,Vr-n),f[u]=i>0?(c/Ed(10,o-i)%Ed(10,i)|0)*a:0),l)for(;;)if(u==0){(f[0]+=a)==Xn&&(f[0]=1,++e.e);break}else{if(f[u]+=a,f[u]!=Xn)break;f[u--]=0,a=1}for(n=f.length;f[--n]===0;)f.pop();if(Jr&&(e.e>r2||e.e<-r2))throw Error(JT+On(e));return e}function vW(e,t){var r,n,i,a,o,s,l,c,u,f,p=e.constructor,h=p.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new p(e),Jr?Tr(t,h):t;if(l=e.d,f=t.d,n=t.e,c=e.e,l=l.slice(),o=c-n,o){for(u=o<0,u?(r=l,o=-o,s=f.length):(r=f,n=c,s=l.length),i=Math.max(Math.ceil(h/Vr),s)+2,o>i&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for(i=l.length,s=f.length,u=i0;--i)l[s++]=0;for(i=f.length;i>o;){if(l[--i]0?a=a.charAt(0)+"."+a.slice(1)+Qc(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Qc(-i-1)+a,r&&(n=r-o)>0&&(a+=Qc(n))):i>=o?(a+=Qc(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+Qc(n))):((n=i+1)0&&(i+1===o&&(a+="."),a+=Qc(n))),e.s<0?"-"+a:a}function zM(e,t){if(e.length>t)return e.length=t,!0}function yW(e){var t,r,n;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(ff+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return UM(o,a.toString())}else if(typeof a!="string")throw Error(ff+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,cje.test(a))UM(o,a);else throw Error(ff+a)}if(i.prototype=ze,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=yW,i.config=i.set=uje,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(ff+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(ff+r+": "+n);return this}var ZT=yW(lje);$a=new ZT(1);const kr=ZT;function dje(e){return mje(e)||pje(e)||hje(e)||fje()}function fje(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hje(e,t){if(e){if(typeof e=="string")return bN(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return bN(e,t)}}function pje(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function mje(e){if(Array.isArray(e))return bN(e)}function bN(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t?r.apply(void 0,i):e(t-o,HM(function(){for(var s=arguments.length,l=new Array(s),c=0;ce.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(n=(s=o.next()).done)&&(r.push(s.value),!(t&&r.length===t));n=!0);}catch(l){i=!0,a=l}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw a}}return r}}function Cje(e){if(Array.isArray(e))return e}function SW(e){var t=Zy(e,2),r=t[0],n=t[1],i=r,a=n;return r>n&&(i=n,a=r),[i,a]}function AW(e,t,r){if(e.lte(0))return new kr(0);var n=y_.getDigitCount(e.toNumber()),i=new kr(10).pow(n),a=e.div(i),o=n!==1?.05:.1,s=new kr(Math.ceil(a.div(o).toNumber())).add(r).mul(o),l=s.mul(i);return t?l:new kr(Math.ceil(l))}function Tje(e,t,r){var n=1,i=new kr(e);if(!i.isint()&&r){var a=Math.abs(e);a<1?(n=new kr(10).pow(y_.getDigitCount(e)-1),i=new kr(Math.floor(i.div(n).toNumber())).mul(n)):a>1&&(i=new kr(Math.floor(e)))}else e===0?i=new kr(Math.floor((t-1)/2)):r||(i=new kr(Math.floor(e)));var o=Math.floor((t-1)/2),s=bje(yje(function(l){return i.add(new kr(l-o).mul(n)).toNumber()}),xN);return s(0,t)}function PW(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new kr(0),tickMin:new kr(0),tickMax:new kr(0)};var a=AW(new kr(t).sub(e).div(r-1),n,i),o;e<=0&&t>=0?o=new kr(0):(o=new kr(e).add(t).div(2),o=o.sub(new kr(o).mod(a)));var s=Math.ceil(o.sub(e).div(a).toNumber()),l=Math.ceil(new kr(t).sub(o).div(a).toNumber()),c=s+l+1;return c>r?PW(e,t,r,n,i+1):(c0?l+(r-c):l,s=t>0?s:s+(r-c)),{step:a,tickMin:o.sub(new kr(s).mul(a)),tickMax:o.add(new kr(l).mul(a))})}function Oje(e){var t=Zy(e,2),r=t[0],n=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),s=SW([r,n]),l=Zy(s,2),c=l[0],u=l[1];if(c===-1/0||u===1/0){var f=u===1/0?[c].concat(_N(xN(0,i-1).map(function(){return 1/0}))):[].concat(_N(xN(0,i-1).map(function(){return-1/0})),[u]);return r>n?wN(f):f}if(c===u)return Tje(c,i,a);var p=PW(c,u,o,a),h=p.step,g=p.tickMin,m=p.tickMax,v=y_.rangeStep(g,m.add(new kr(.1).mul(h)),h);return r>n?wN(v):v}function Rje(e,t){var r=Zy(e,2),n=r[0],i=r[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=SW([n,i]),s=Zy(o,2),l=s[0],c=s[1];if(l===-1/0||c===1/0)return[n,i];if(l===c)return[l];var u=Math.max(t,2),f=AW(new kr(c).sub(l).div(u-1),a,0),p=[].concat(_N(y_.rangeStep(new kr(l),new kr(c).sub(new kr(.99).mul(f)),f)),[c]);return n>i?wN(p):p}var Lje=wW(Oje),Ije=wW(Rje),Mje="Invariant failed";function jf(e,t){throw new Error(Mje)}var $je=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function um(e){"@babel/helpers - typeof";return um=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},um(e)}function n2(){return n2=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Vje(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function qje(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Wje(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=-1,s=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(s<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var l=a.range,c=0;c0?i[c-1].coordinate:i[s-1].coordinate,f=i[c].coordinate,p=c>=s-1?i[0].coordinate:i[c+1].coordinate,h=void 0;if(as(f-u)!==as(p-f)){var g=[];if(as(p-f)===as(l[1]-l[0])){h=p;var m=f+l[1]-l[0];g[0]=Math.min(m,(m+u)/2),g[1]=Math.max(m,(m+u)/2)}else{h=u;var v=p+l[1]-l[0];g[0]=Math.min(f,(v+f)/2),g[1]=Math.max(f,(v+f)/2)}var y=[Math.min(f,(h+f)/2),Math.max(f,(h+f)/2)];if(t>y[0]&&t<=y[1]||t>=g[0]&&t<=g[1]){o=i[c].index;break}}else{var b=Math.min(u,p),x=Math.max(u,p);if(t>(b+f)/2&&t<=(x+f)/2){o=i[c].index;break}}}else for(var S=0;S0&&S(n[S].coordinate+n[S-1].coordinate)/2&&t<=(n[S].coordinate+n[S+1].coordinate)/2||S===s-1&&t>(n[S].coordinate+n[S-1].coordinate)/2){o=n[S].index;break}return o},QT=function(t){var r,n=t,i=n.type.displayName,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?hn(hn({},t.type.defaultProps),t.props):t.props,o=a.stroke,s=a.fill,l;switch(i){case"Line":l=o;break;case"Area":case"Radar":l=o&&o!=="none"?o:s;break;default:l=s;break}return l},cNe=function(t){var r=t.barSize,n=t.totalSize,i=t.stackGroups,a=i===void 0?{}:i;if(!a)return{};for(var o={},s=Object.keys(a),l=0,c=s.length;l=0});if(y&&y.length){var b=y[0].type.defaultProps,x=b!==void 0?hn(hn({},b),y[0].props):y[0].props,S=x.barSize,_=x[v];o[_]||(o[_]=[]);var k=zt(S)?r:S;o[_].push({item:y[0],stackList:y.slice(1),barSize:zt(k)?void 0:os(k,n,0)})}}return o},uNe=function(t){var r=t.barGap,n=t.barCategoryGap,i=t.bandSize,a=t.sizeList,o=a===void 0?[]:a,s=t.maxBarSize,l=o.length;if(l<1)return null;var c=os(r,i,0,!0),u,f=[];if(o[0].barSize===+o[0].barSize){var p=!1,h=i/l,g=o.reduce(function(S,_){return S+_.barSize||0},0);g+=(l-1)*c,g>=i&&(g-=(l-1)*c,c=0),g>=i&&h>0&&(p=!0,h*=.9,g=l*h);var m=(i-g)/2>>0,v={offset:m-c,size:0};u=o.reduce(function(S,_){var k={item:_.item,position:{offset:v.offset+v.size+c,size:p?h:_.barSize}},E=[].concat(WM(S),[k]);return v=E[E.length-1].position,_.stackList&&_.stackList.length&&_.stackList.forEach(function(O){E.push({item:O,position:v})}),E},f)}else{var y=os(n,i,0,!0);i-2*y-(l-1)*c<=0&&(c=0);var b=(i-2*y-(l-1)*c)/l;b>1&&(b>>=0);var x=s===+s?Math.min(b,s):b;u=o.reduce(function(S,_,k){var E=[].concat(WM(S),[{item:_.item,position:{offset:y+(b+c)*k+(b-x)/2,size:x}}]);return _.stackList&&_.stackList.length&&_.stackList.forEach(function(O){E.push({item:O,position:E[E.length-1].position})}),E},f)}return u},dNe=function(t,r,n,i){var a=n.children,o=n.width,s=n.margin,l=o-(s.left||0)-(s.right||0),c=EW({children:a,legendWidth:l});if(c){var u=i||{},f=u.width,p=u.height,h=c.align,g=c.verticalAlign,m=c.layout;if((m==="vertical"||m==="horizontal"&&g==="middle")&&h!=="center"&&Le(t[h]))return hn(hn({},t),{},xp({},h,t[h]+(f||0)));if((m==="horizontal"||m==="vertical"&&h==="center")&&g!=="middle"&&Le(t[g]))return hn(hn({},t),{},xp({},g,t[g]+(p||0)))}return t},fNe=function(t,r,n){return zt(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},CW=function(t,r,n,i,a){var o=r.props.children,s=cs(o,b_).filter(function(c){return fNe(i,a,c.props.direction)});if(s&&s.length){var l=s.map(function(c){return c.props.dataKey});return t.reduce(function(c,u){var f=Zi(u,n);if(zt(f))return c;var p=Array.isArray(f)?[g_(f),gu(f)]:[f,f],h=l.reduce(function(g,m){var v=Zi(u,m,0),y=p[0]-Math.abs(Array.isArray(v)?v[0]:v),b=p[1]+Math.abs(Array.isArray(v)?v[1]:v);return[Math.min(y,g[0]),Math.max(b,g[1])]},[1/0,-1/0]);return[Math.min(h[0],c[0]),Math.max(h[1],c[1])]},[1/0,-1/0])}return null},hNe=function(t,r,n,i,a){var o=r.map(function(s){return CW(t,s,n,a,i)}).filter(function(s){return!zt(s)});return o&&o.length?o.reduce(function(s,l){return[Math.min(s[0],l[0]),Math.max(s[1],l[1])]},[1/0,-1/0]):null},TW=function(t,r,n,i,a){var o=r.map(function(l){var c=l.props.dataKey;return n==="number"&&c&&CW(t,l,c,i)||Wv(t,c,n,a)});if(n==="number")return o.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]);var s={};return o.reduce(function(l,c){for(var u=0,f=c.length;u=2?as(s[0]-s[1])*2*c:c,r&&(t.ticks||t.niceTicks)){var u=(t.ticks||t.niceTicks).map(function(f){var p=a?a.indexOf(f):f;return{coordinate:i(p)+c,value:f,offset:c}});return u.filter(function(f){return!Qm(f.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(f,p){return{coordinate:i(f)+c,value:f,index:p,offset:c}}):i.ticks&&!n?i.ticks(t.tickCount).map(function(f){return{coordinate:i(f)+c,value:f,offset:c}}):i.domain().map(function(f,p){return{coordinate:i(f)+c,value:a?a[f]:f,index:p,offset:c}})},VA=new WeakMap,Gb=function(t,r){if(typeof r!="function")return t;VA.has(t)||VA.set(t,new WeakMap);var n=VA.get(t);if(n.has(r))return n.get(r);var i=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,i),i},LW=function(t,r,n){var i=t.scale,a=t.type,o=t.layout,s=t.axisType;if(i==="auto")return o==="radial"&&s==="radiusAxis"?{scale:Wy(),realScaleType:"band"}:o==="radial"&&s==="angleAxis"?{scale:Zw(),realScaleType:"linear"}:a==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:qv(),realScaleType:"point"}:a==="category"?{scale:Wy(),realScaleType:"band"}:{scale:Zw(),realScaleType:"linear"};if(Pf(i)){var l="scale".concat(r_(i));return{scale:(BM[l]||qv)(),realScaleType:BM[l]?l:"point"}}return wt(i)?{scale:i}:{scale:qv(),realScaleType:"point"}},KM=1e-4,IW=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,i=t.range(),a=Math.min(i[0],i[1])-KM,o=Math.max(i[0],i[1])+KM,s=t(r[0]),l=t(r[n-1]);(so||lo)&&t.domain([r[0],r[n-1]])}},pNe=function(t,r){if(!t)return null;for(var n=0,i=t.length;ni)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]=0?(t[s][n][0]=a,t[s][n][1]=a+l,a=t[s][n][1]):(t[s][n][0]=o,t[s][n][1]=o+l,o=t[s][n][1])}},vNe=function(t){var r=t.length;if(!(r<=0))for(var n=0,i=t[0].length;n=0?(t[o][n][0]=a,t[o][n][1]=a+s,a=t[o][n][1]):(t[o][n][0]=0,t[o][n][1]=0)}},yNe={sign:gNe,expand:$ye,none:em,silhouette:Dye,wiggle:Fye,positive:vNe},bNe=function(t,r,n){var i=r.map(function(s){return s.props.dataKey}),a=yNe[n],o=Mye().keys(i).value(function(s,l){return+Zi(s,l,0)}).order(Xj).offset(a);return o(t)},xNe=function(t,r,n,i,a,o){if(!t)return null;var s=o?r.reverse():r,l={},c=s.reduce(function(f,p){var h,g=(h=p.type)!==null&&h!==void 0&&h.defaultProps?hn(hn({},p.type.defaultProps),p.props):p.props,m=g.stackId,v=g.hide;if(v)return f;var y=g[n],b=f[y]||{hasStack:!1,stackGroups:{}};if(qn(m)){var x=b.stackGroups[m]||{numericAxisId:n,cateAxisId:i,items:[]};x.items.push(p),b.hasStack=!0,b.stackGroups[m]=x}else b.stackGroups[n1("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[p]};return hn(hn({},f),{},xp({},y,b))},l),u={};return Object.keys(c).reduce(function(f,p){var h=c[p];if(h.hasStack){var g={};h.stackGroups=Object.keys(h.stackGroups).reduce(function(m,v){var y=h.stackGroups[v];return hn(hn({},m),{},xp({},v,{numericAxisId:n,cateAxisId:i,items:y.items,stackedData:bNe(t,y.items,a)}))},g)}return hn(hn({},f),{},xp({},p,h))},u)},MW=function(t,r){var n=r.realScaleType,i=r.type,a=r.tickCount,o=r.originalDomain,s=r.allowDecimals,l=n||r.scale;if(l!=="auto"&&l!=="linear")return null;if(a&&i==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var c=t.domain();if(!c.length)return null;var u=Lje(c,a,s);return t.domain([g_(u),gu(u)]),{niceTicks:u}}if(a&&i==="number"){var f=t.domain(),p=Ije(f,a,s);return{niceTicks:p}}return null};function YM(e){var t=e.axis,r=e.ticks,n=e.bandSize,i=e.entry,a=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!zt(i[t.dataKey])){var s=Tw(r,"value",i[t.dataKey]);if(s)return s.coordinate+n/2}return r[a]?r[a].coordinate+n/2:null}var l=Zi(i,zt(o)?t.dataKey:o);return zt(l)?null:t.scale(l)}var XM=function(t){var r=t.axis,n=t.ticks,i=t.offset,a=t.bandSize,o=t.entry,s=t.index;if(r.type==="category")return n[s]?n[s].coordinate+i:null;var l=Zi(o,r.dataKey,r.domain[s]);return zt(l)?null:r.scale(l)-a/2+i},wNe=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var i=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]);return i<=0&&a>=0?0:a<0?a:i}return n[0]},_Ne=function(t,r){var n,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?hn(hn({},t.type.defaultProps),t.props):t.props,a=i.stackId;if(qn(a)){var o=r[a];if(o){var s=o.items.indexOf(t);return s>=0?o.stackedData[s]:null}}return null},SNe=function(t){return t.reduce(function(r,n){return[g_(n.concat([r[0]]).filter(Le)),gu(n.concat([r[1]]).filter(Le))]},[1/0,-1/0])},$W=function(t,r,n){return Object.keys(t).reduce(function(i,a){var o=t[a],s=o.stackedData,l=s.reduce(function(c,u){var f=SNe(u.slice(r,n+1));return[Math.min(c[0],f[0]),Math.max(c[1],f[1])]},[1/0,-1/0]);return[Math.min(l[0],i[0]),Math.max(l[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},JM=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,ZM=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,kN=function(t,r,n){if(wt(t))return t(r,n);if(!Array.isArray(t))return r;var i=[];if(Le(t[0]))i[0]=n?t[0]:Math.min(t[0],r[0]);else if(JM.test(t[0])){var a=+JM.exec(t[0])[1];i[0]=r[0]-a}else wt(t[0])?i[0]=t[0](r[0]):i[0]=r[0];if(Le(t[1]))i[1]=n?t[1]:Math.max(t[1],r[1]);else if(ZM.test(t[1])){var o=+ZM.exec(t[1])[1];i[1]=r[1]+o}else wt(t[1])?i[1]=t[1](r[1]):i[1]=r[1];return i},a2=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!n||i>0)return i}if(t&&r&&r.length>=2){for(var a=jT(r,function(f){return f.coordinate}),o=1/0,s=1,l=a.length;se.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},RNe=function(t,r,n,i,a){var o=t.width,s=t.height,l=t.startAngle,c=t.endAngle,u=os(t.cx,o,o/2),f=os(t.cy,s,s/2),p=ONe(o,s,n),h=os(t.innerRadius,p,0),g=os(t.outerRadius,p,p*.8),m=Object.keys(r);return m.reduce(function(v,y){var b=r[y],x=b.domain,S=b.reversed,_;if(zt(b.range))i==="angleAxis"?_=[l,c]:i==="radiusAxis"&&(_=[h,g]),S&&(_=[_[1],_[0]]);else{_=b.range;var k=_,E=kNe(k,2);l=E[0],c=E[1]}var O=LW(b,a),R=O.realScaleType,$=O.scale;$.domain(x).range(_),IW($);var N=MW($,Rl(Rl({},b),{},{realScaleType:R})),C=Rl(Rl(Rl({},b),N),{},{range:_,radius:g,realScaleType:R,scale:$,cx:u,cy:f,innerRadius:h,outerRadius:g,startAngle:l,endAngle:c});return Rl(Rl({},v),{},FW({},y,C))},{})},LNe=function(t,r){var n=t.x,i=t.y,a=r.x,o=r.y;return Math.sqrt(Math.pow(n-a,2)+Math.pow(i-o,2))},INe=function(t,r){var n=t.x,i=t.y,a=r.cx,o=r.cy,s=LNe({x:n,y:i},{x:a,y:o});if(s<=0)return{radius:s};var l=(n-a)/s,c=Math.acos(l);return i>o&&(c=2*Math.PI-c),{radius:s,angle:TNe(c),angleInRadian:c}},MNe=function(t){var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),a=Math.floor(n/360),o=Math.min(i,a);return{startAngle:r-o*360,endAngle:n-o*360}},$Ne=function(t,r){var n=r.startAngle,i=r.endAngle,a=Math.floor(n/360),o=Math.floor(i/360),s=Math.min(a,o);return t+s*360},r8=function(t,r){var n=t.x,i=t.y,a=INe({x:n,y:i},r),o=a.radius,s=a.angle,l=r.innerRadius,c=r.outerRadius;if(oc)return!1;if(o===0)return!0;var u=MNe(r),f=u.startAngle,p=u.endAngle,h=s,g;if(f<=p){for(;h>p;)h-=360;for(;h=f&&h<=p}else{for(;h>f;)h-=360;for(;h=p&&h<=f}return g?Rl(Rl({},r),{},{radius:o,angle:$Ne(h,r)}):null},BW=function(t){return!P.isValidElement(t)&&!wt(t)&&typeof t!="boolean"?t.className:""};function r0(e){"@babel/helpers - typeof";return r0=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},r0(e)}var DNe=["offset"];function FNe(e){return HNe(e)||zNe(e)||UNe(e)||BNe()}function BNe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function UNe(e,t){if(e){if(typeof e=="string")return jN(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return jN(e,t)}}function zNe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function HNe(e){if(Array.isArray(e))return jN(e)}function jN(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function qNe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function n8(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Bn(e){for(var t=1;t=0?1:-1,x,S;i==="insideStart"?(x=h+b*o,S=m):i==="insideEnd"?(x=g-b*o,S=!m):i==="end"&&(x=g+b*o,S=m),S=y<=0?S:!S;var _=jr(c,u,v,x),k=jr(c,u,v,x+(S?1:-1)*359),E="M".concat(_.x,",").concat(_.y,` A`).concat(v,",").concat(v,",0,1,").concat(S?0:1,`, `).concat(k.x,",").concat(k.y),O=zt(t.id)?n1("recharts-radial-line-"):t.id;return K.createElement("text",n0({},n,{dominantBaseline:"central",className:Ot("recharts-radial-bar-label",s)}),K.createElement("defs",null,K.createElement("path",{id:O,d:E})),K.createElement("textPath",{xlinkHref:"#".concat(O)},r))},ZNe=function(t){var r=t.viewBox,n=t.offset,i=t.position,a=r,o=a.cx,s=a.cy,l=a.innerRadius,c=a.outerRadius,u=a.startAngle,f=a.endAngle,p=(u+f)/2;if(i==="outside"){var h=jr(o,s,c+n,p),g=h.x,m=h.y;return{x:g,y:m,textAnchor:g>=o?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"end"};var v=(l+c)/2,y=jr(o,s,v,p),b=y.x,x=y.y;return{x:b,y:x,textAnchor:"middle",verticalAnchor:"middle"}},QNe=function(t){var r=t.viewBox,n=t.parentViewBox,i=t.offset,a=t.position,o=r,s=o.x,l=o.y,c=o.width,u=o.height,f=u>=0?1:-1,p=f*i,h=f>0?"end":"start",g=f>0?"start":"end",m=c>=0?1:-1,v=m*i,y=m>0?"end":"start",b=m>0?"start":"end";if(a==="top"){var x={x:s+c/2,y:l-f*i,textAnchor:"middle",verticalAnchor:h};return Bn(Bn({},x),n?{height:Math.max(l-n.y,0),width:c}:{})}if(a==="bottom"){var S={x:s+c/2,y:l+u+p,textAnchor:"middle",verticalAnchor:g};return Bn(Bn({},S),n?{height:Math.max(n.y+n.height-(l+u),0),width:c}:{})}if(a==="left"){var _={x:s-v,y:l+u/2,textAnchor:y,verticalAnchor:"middle"};return Bn(Bn({},_),n?{width:Math.max(_.x-n.x,0),height:u}:{})}if(a==="right"){var k={x:s+c+v,y:l+u/2,textAnchor:b,verticalAnchor:"middle"};return Bn(Bn({},k),n?{width:Math.max(n.x+n.width-k.x,0),height:u}:{})}var E=n?{width:c,height:u}:{};return a==="insideLeft"?Bn({x:s+v,y:l+u/2,textAnchor:b,verticalAnchor:"middle"},E):a==="insideRight"?Bn({x:s+c-v,y:l+u/2,textAnchor:y,verticalAnchor:"middle"},E):a==="insideTop"?Bn({x:s+c/2,y:l+p,textAnchor:"middle",verticalAnchor:g},E):a==="insideBottom"?Bn({x:s+c/2,y:l+u-p,textAnchor:"middle",verticalAnchor:h},E):a==="insideTopLeft"?Bn({x:s+v,y:l+p,textAnchor:b,verticalAnchor:g},E):a==="insideTopRight"?Bn({x:s+c-v,y:l+p,textAnchor:y,verticalAnchor:g},E):a==="insideBottomLeft"?Bn({x:s+v,y:l+u-p,textAnchor:b,verticalAnchor:h},E):a==="insideBottomRight"?Bn({x:s+c-v,y:l+u-p,textAnchor:y,verticalAnchor:h},E):Ym(a)&&(Le(a.x)||Bd(a.x))&&(Le(a.y)||Bd(a.y))?Bn({x:s+os(a.x,c),y:l+os(a.y,u),textAnchor:"end",verticalAnchor:"end"},E):Bn({x:s+c/2,y:l+u/2,textAnchor:"middle",verticalAnchor:"middle"},E)},eEe=function(t){return"cx"in t&&Le(t.cx)};function yi(e){var t=e.offset,r=t===void 0?5:t,n=VNe(e,DNe),i=Bn({offset:r},n),a=i.viewBox,o=i.position,s=i.value,l=i.children,c=i.content,u=i.className,f=u===void 0?"":u,p=i.textBreakAll;if(!a||zt(s)&&zt(l)&&!P.isValidElement(c)&&!wt(c))return null;if(P.isValidElement(c))return P.cloneElement(c,i);var h;if(wt(c)){if(h=P.createElement(c,i),P.isValidElement(h))return h}else h=YNe(i);var g=eEe(a),m=dt(i,!0);if(g&&(o==="insideStart"||o==="insideEnd"||o==="end"))return JNe(i,h,m);var v=g?ZNe(i):QNe(i);return K.createElement(am,n0({className:Ot("recharts-label",f)},m,v,{breakAll:p}),h)}yi.displayName="Label";var UW=function(t){var r=t.cx,n=t.cy,i=t.angle,a=t.startAngle,o=t.endAngle,s=t.r,l=t.radius,c=t.innerRadius,u=t.outerRadius,f=t.x,p=t.y,h=t.top,g=t.left,m=t.width,v=t.height,y=t.clockWise,b=t.labelViewBox;if(b)return b;if(Le(m)&&Le(v)){if(Le(f)&&Le(p))return{x:f,y:p,width:m,height:v};if(Le(h)&&Le(g))return{x:h,y:g,width:m,height:v}}return Le(f)&&Le(p)?{x:f,y:p,width:0,height:0}:Le(r)&&Le(n)?{cx:r,cy:n,startAngle:a||i||0,endAngle:o||i||0,innerRadius:c||0,outerRadius:u||l||s||0,clockWise:y}:t.viewBox?t.viewBox:{}},tEe=function(t,r){return t?t===!0?K.createElement(yi,{key:"label-implicit",viewBox:r}):qn(t)?K.createElement(yi,{key:"label-implicit",viewBox:r,value:t}):P.isValidElement(t)?t.type===yi?P.cloneElement(t,{key:"label-implicit",viewBox:r}):K.createElement(yi,{key:"label-implicit",content:t,viewBox:r}):wt(t)?K.createElement(yi,{key:"label-implicit",content:t,viewBox:r}):Ym(t)?K.createElement(yi,n0({viewBox:r},t,{key:"label-implicit"})):null:null},rEe=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var i=t.children,a=UW(t),o=cs(i,yi).map(function(l,c){return P.cloneElement(l,{viewBox:r||a,key:"label-".concat(c)})});if(!n)return o;var s=tEe(t.label,r||a);return[s].concat(FNe(o))};yi.parseViewBox=UW;yi.renderCallByParent=rEe;function nEe(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var iEe=nEe;const zW=ar(iEe);function i0(e){"@babel/helpers - typeof";return i0=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},i0(e)}var aEe=["valueAccessor"],oEe=["data","dataKey","clockWise","id","textBreakAll"];function sEe(e){return dEe(e)||uEe(e)||cEe(e)||lEe()}function lEe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cEe(e,t){if(e){if(typeof e=="string")return NN(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return NN(e,t)}}function uEe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function dEe(e){if(Array.isArray(e))return NN(e)}function NN(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function mEe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var gEe=function(t){return Array.isArray(t.value)?zW(t.value):t.value};function ec(e){var t=e.valueAccessor,r=t===void 0?gEe:t,n=o8(e,aEe),i=n.data,a=n.dataKey,o=n.clockWise,s=n.id,l=n.textBreakAll,c=o8(n,oEe);return!i||!i.length?null:K.createElement(ur,{className:"recharts-label-list"},i.map(function(u,f){var p=zt(a)?r(u,f):Zi(u&&u.payload,a),h=zt(s)?{}:{id:"".concat(s,"-").concat(f)};return K.createElement(yi,s2({},dt(u,!0),c,h,{parentViewBox:u.parentViewBox,value:p,textBreakAll:l,viewBox:yi.parseViewBox(zt(o)?u:a8(a8({},u),{},{clockWise:o})),key:"label-".concat(f),index:f}))}))}ec.displayName="LabelList";function vEe(e,t){return e?e===!0?K.createElement(ec,{key:"labelList-implicit",data:t}):K.isValidElement(e)||wt(e)?K.createElement(ec,{key:"labelList-implicit",data:t,content:e}):Ym(e)?K.createElement(ec,s2({data:t},e,{key:"labelList-implicit"})):null:null}function yEe(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,i=cs(n,ec).map(function(o,s){return P.cloneElement(o,{data:t,key:"labelList-".concat(s)})});if(!r)return i;var a=vEe(e.label,t);return[a].concat(sEe(i))}ec.renderCallByParent=yEe;function a0(e){"@babel/helpers - typeof";return a0=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},a0(e)}function EN(){return EN=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(o>c),`, `).concat(f.x,",").concat(f.y,` `);if(i>0){var h=jr(r,n,i,o),g=jr(r,n,i,c);p+="L ".concat(g.x,",").concat(g.y,` A `).concat(i,",").concat(i,`,0, `).concat(+(Math.abs(l)>180),",").concat(+(o<=c),`, `).concat(h.x,",").concat(h.y," Z")}else p+="L ".concat(r,",").concat(n," Z");return p},SEe=function(t){var r=t.cx,n=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,s=t.forceCornerRadius,l=t.cornerIsExternal,c=t.startAngle,u=t.endAngle,f=as(u-c),p=Kb({cx:r,cy:n,radius:a,angle:c,sign:f,cornerRadius:o,cornerIsExternal:l}),h=p.circleTangency,g=p.lineTangency,m=p.theta,v=Kb({cx:r,cy:n,radius:a,angle:u,sign:-f,cornerRadius:o,cornerIsExternal:l}),y=v.circleTangency,b=v.lineTangency,x=v.theta,S=l?Math.abs(c-u):Math.abs(c-u)-m-x;if(S<0)return s?"M ".concat(g.x,",").concat(g.y,` a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0 a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0 `):HW({cx:r,cy:n,innerRadius:i,outerRadius:a,startAngle:c,endAngle:u});var _="M ".concat(g.x,",").concat(g.y,` A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(h.x,",").concat(h.y,` A`).concat(a,",").concat(a,",0,").concat(+(S>180),",").concat(+(f<0),",").concat(y.x,",").concat(y.y,` A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(b.x,",").concat(b.y,` `);if(i>0){var k=Kb({cx:r,cy:n,radius:i,angle:c,sign:f,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),E=k.circleTangency,O=k.lineTangency,R=k.theta,$=Kb({cx:r,cy:n,radius:i,angle:u,sign:-f,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),N=$.circleTangency,C=$.lineTangency,D=$.theta,I=l?Math.abs(c-u):Math.abs(c-u)-R-D;if(I<0&&o===0)return"".concat(_,"L").concat(r,",").concat(n,"Z");_+="L".concat(C.x,",").concat(C.y,` A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(N.x,",").concat(N.y,` A`).concat(i,",").concat(i,",0,").concat(+(I>180),",").concat(+(f>0),",").concat(E.x,",").concat(E.y,` A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(O.x,",").concat(O.y,"Z")}else _+="L".concat(r,",").concat(n,"Z");return _},AEe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},VW=function(t){var r=l8(l8({},AEe),t),n=r.cx,i=r.cy,a=r.innerRadius,o=r.outerRadius,s=r.cornerRadius,l=r.forceCornerRadius,c=r.cornerIsExternal,u=r.startAngle,f=r.endAngle,p=r.className;if(o0&&Math.abs(u-f)<360?v=SEe({cx:n,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(m,g/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:f}):v=HW({cx:n,cy:i,innerRadius:a,outerRadius:o,startAngle:u,endAngle:f}),K.createElement("path",EN({},dt(r,!0),{className:h,d:v,role:"img"}))};function o0(e){"@babel/helpers - typeof";return o0=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},o0(e)}function CN(){return CN=Object.assign?Object.assign.bind():function(e){for(var t=1;t0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function HEe(e,t){return zf(e.getTime(),t.getTime())}function VEe(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function qEe(e,t){return e===t}function g8(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var i=new Array(n),a=e.entries(),o,s,l=0;(o=a.next())&&!o.done;){for(var c=t.entries(),u=!1,f=0;(s=c.next())&&!s.done;){if(i[f]){f++;continue}var p=o.value,h=s.value;if(r.equals(p[0],h[0],l,f,e,t,r)&&r.equals(p[1],h[1],p[0],h[0],e,t,r)){u=i[f]=!0;break}f++}if(!u)return!1;l++}return!0}var WEe=zf;function GEe(e,t,r){var n=m8(e),i=n.length;if(m8(t).length!==i)return!1;for(;i-- >0;)if(!KW(e,t,r,n[i]))return!1;return!0}function hv(e,t,r){var n=h8(e),i=n.length;if(h8(t).length!==i)return!1;for(var a,o,s;i-- >0;)if(a=n[i],!KW(e,t,r,a)||(o=p8(e,a),s=p8(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function KEe(e,t){return zf(e.valueOf(),t.valueOf())}function YEe(e,t){return e.source===t.source&&e.flags===t.flags}function v8(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var i=new Array(n),a=e.values(),o,s;(o=a.next())&&!o.done;){for(var l=t.values(),c=!1,u=0;(s=l.next())&&!s.done;){if(!i[u]&&r.equals(o.value,s.value,o.value,s.value,e,t,r)){c=i[u]=!0;break}u++}if(!c)return!1}return!0}function XEe(e,t){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function JEe(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function KW(e,t,r,n){return(n===UEe||n===BEe||n===FEe)&&(e.$$typeof||t.$$typeof)?!0:DEe(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}var ZEe="[object Arguments]",QEe="[object Boolean]",eCe="[object Date]",tCe="[object Error]",rCe="[object Map]",nCe="[object Number]",iCe="[object Object]",aCe="[object RegExp]",oCe="[object Set]",sCe="[object String]",lCe="[object URL]",cCe=Array.isArray,y8=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,b8=Object.assign,uCe=Object.prototype.toString.call.bind(Object.prototype.toString);function dCe(e){var t=e.areArraysEqual,r=e.areDatesEqual,n=e.areErrorsEqual,i=e.areFunctionsEqual,a=e.areMapsEqual,o=e.areNumbersEqual,s=e.areObjectsEqual,l=e.arePrimitiveWrappersEqual,c=e.areRegExpsEqual,u=e.areSetsEqual,f=e.areTypedArraysEqual,p=e.areUrlsEqual;return function(g,m,v){if(g===m)return!0;if(g==null||m==null)return!1;var y=typeof g;if(y!==typeof m)return!1;if(y!=="object")return y==="number"?o(g,m,v):y==="function"?i(g,m,v):!1;var b=g.constructor;if(b!==m.constructor)return!1;if(b===Object)return s(g,m,v);if(cCe(g))return t(g,m,v);if(y8!=null&&y8(g))return f(g,m,v);if(b===Date)return r(g,m,v);if(b===RegExp)return c(g,m,v);if(b===Map)return a(g,m,v);if(b===Set)return u(g,m,v);var x=uCe(g);return x===eCe?r(g,m,v):x===aCe?c(g,m,v):x===rCe?a(g,m,v):x===oCe?u(g,m,v):x===iCe?typeof g.then!="function"&&typeof m.then!="function"&&s(g,m,v):x===lCe?p(g,m,v):x===tCe?n(g,m,v):x===ZEe?s(g,m,v):x===QEe||x===nCe||x===sCe?l(g,m,v):!1}}function fCe(e){var t=e.circular,r=e.createCustomConfig,n=e.strict,i={areArraysEqual:n?hv:zEe,areDatesEqual:HEe,areErrorsEqual:VEe,areFunctionsEqual:qEe,areMapsEqual:n?f8(g8,hv):g8,areNumbersEqual:WEe,areObjectsEqual:n?hv:GEe,arePrimitiveWrappersEqual:KEe,areRegExpsEqual:YEe,areSetsEqual:n?f8(v8,hv):v8,areTypedArraysEqual:n?hv:XEe,areUrlsEqual:JEe};if(r&&(i=b8({},i,r(i))),t){var a=Xb(i.areArraysEqual),o=Xb(i.areMapsEqual),s=Xb(i.areObjectsEqual),l=Xb(i.areSetsEqual);i=b8({},i,{areArraysEqual:a,areMapsEqual:o,areObjectsEqual:s,areSetsEqual:l})}return i}function hCe(e){return function(t,r,n,i,a,o,s){return e(t,r,s)}}function pCe(e){var t=e.circular,r=e.comparator,n=e.createState,i=e.equals,a=e.strict;if(n)return function(l,c){var u=n(),f=u.cache,p=f===void 0?t?new WeakMap:void 0:f,h=u.meta;return r(l,c,{cache:p,equals:i,meta:h,strict:a})};if(t)return function(l,c){return r(l,c,{cache:new WeakMap,equals:i,meta:void 0,strict:a})};var o={cache:void 0,equals:i,meta:void 0,strict:a};return function(l,c){return r(l,c,o)}}var mCe=Yu();Yu({strict:!0});Yu({circular:!0});Yu({circular:!0,strict:!0});Yu({createInternalComparator:function(){return zf}});Yu({strict:!0,createInternalComparator:function(){return zf}});Yu({circular:!0,createInternalComparator:function(){return zf}});Yu({circular:!0,createInternalComparator:function(){return zf},strict:!0});function Yu(e){e===void 0&&(e={});var t=e.circular,r=t===void 0?!1:t,n=e.createInternalComparator,i=e.createState,a=e.strict,o=a===void 0?!1:a,s=fCe(e),l=dCe(s),c=n?n(l):hCe(l);return pCe({circular:r,comparator:l,createState:i,equals:c,strict:o})}function gCe(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function x8(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function i(a){r<0&&(r=a),a-r>t?(e(a),r=-1):gCe(i)};requestAnimationFrame(n)}function TN(e){"@babel/helpers - typeof";return TN=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},TN(e)}function vCe(e){return wCe(e)||xCe(e)||bCe(e)||yCe()}function yCe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bCe(e,t){if(e){if(typeof e=="string")return w8(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return w8(e,t)}}function w8(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?1:y<0?0:y},m=function(y){for(var b=y>1?1:y,x=b,S=0;S<8;++S){var _=f(x)-b,k=h(x);if(Math.abs(_-b)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,i=t.damping,a=i===void 0?8:i,o=t.dt,s=o===void 0?17:o,l=function(u,f,p){var h=-(u-f)*n,g=p*a,m=p+(h-g)*s/1e3,v=p*s/1e3+u;return Math.abs(v-f)e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ZCe(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}function qA(e){return r3e(e)||t3e(e)||e3e(e)||QCe()}function QCe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function e3e(e,t){if(e){if(typeof e=="string")return MN(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return MN(e,t)}}function t3e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function r3e(e){if(Array.isArray(e))return MN(e)}function MN(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function u2(e){return u2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},u2(e)}var il=function(e){s3e(r,e);var t=l3e(r);function r(n,i){var a;n3e(this,r),a=t.call(this,n,i);var o=a.props,s=o.isActive,l=o.attributeName,c=o.from,u=o.to,f=o.steps,p=o.children,h=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(FN(a)),a.changeStyle=a.changeStyle.bind(FN(a)),!s||h<=0)return a.state={style:{}},typeof p=="function"&&(a.state={style:u}),DN(a);if(f&&f.length)a.state={style:f[0].style};else if(c){if(typeof p=="function")return a.state={style:c},DN(a);a.state={style:l?kv({},l,c):c}}else a.state={style:{}};return a}return a3e(r,[{key:"componentDidMount",value:function(){var i=this.props,a=i.isActive,o=i.canBegin;this.mounted=!0,!(!a||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var a=this.props,o=a.isActive,s=a.canBegin,l=a.attributeName,c=a.shouldReAnimate,u=a.to,f=a.from,p=this.state.style;if(s){if(!o){var h={style:l?kv({},l,u):u};this.state&&p&&(l&&p[l]!==u||!l&&p!==u)&&this.setState(h);return}if(!(mCe(i.to,u)&&i.canBegin&&i.isActive)){var g=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var m=g||c?f:i.to;if(this.state&&p){var v={style:l?kv({},l,m):m};(l&&p[l]!==m||!l&&p!==m)&&this.setState(v)}this.runAnimation(Ho(Ho({},this.props),{},{from:m,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var a=this,o=i.from,s=i.to,l=i.duration,c=i.easing,u=i.begin,f=i.onAnimationEnd,p=i.onAnimationStart,h=YCe(o,s,DCe(c),l,this.changeStyle),g=function(){a.stopJSAnimation=h()};this.manager.start([p,u,g,l,f])}},{key:"runStepAnimation",value:function(i){var a=this,o=i.steps,s=i.begin,l=i.onAnimationStart,c=o[0],u=c.style,f=c.duration,p=f===void 0?0:f,h=function(m,v,y){if(y===0)return m;var b=v.duration,x=v.easing,S=x===void 0?"ease":x,_=v.style,k=v.properties,E=v.onAnimationEnd,O=y>0?o[y-1]:v,R=k||Object.keys(_);if(typeof S=="function"||S==="spring")return[].concat(qA(m),[a.runJSAnimation.bind(a,{from:O.style,to:_,duration:b,easing:S}),b]);var $=A8(R,b,S),N=Ho(Ho(Ho({},O.style),_),{},{transition:$});return[].concat(qA(m),[N,b,E]).filter(kCe)};return this.manager.start([l].concat(qA(o.reduce(h,[u,Math.max(p,s)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=_Ce());var a=i.begin,o=i.duration,s=i.attributeName,l=i.to,c=i.easing,u=i.onAnimationStart,f=i.onAnimationEnd,p=i.steps,h=i.children,g=this.manager;if(this.unSubscribe=g.subscribe(this.handleStyleChange),typeof c=="function"||typeof h=="function"||c==="spring"){this.runJSAnimation(i);return}if(p.length>1){this.runStepAnimation(i);return}var m=s?kv({},s,l):l,v=A8(Object.keys(m),o,c);g.start([u,a,Ho(Ho({},m),{},{transition:v}),o,f])}},{key:"render",value:function(){var i=this.props,a=i.children;i.begin;var o=i.duration;i.attributeName,i.easing;var s=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var l=JCe(i,XCe),c=P.Children.count(a),u=this.state.style;if(typeof a=="function")return a(u);if(!s||c===0||o<=0)return a;var f=function(h){var g=h.props,m=g.style,v=m===void 0?{}:m,y=g.className,b=P.cloneElement(h,Ho(Ho({},l),{},{style:Ho(Ho({},v),u),className:y}));return b};return c===1?f(P.Children.only(a)):K.createElement("div",null,P.Children.map(a,function(p){return f(p)}))}}]),r}(P.PureComponent);il.displayName="Animate";il.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};il.propTypes={from:mr.oneOfType([mr.object,mr.string]),to:mr.oneOfType([mr.object,mr.string]),attributeName:mr.string,duration:mr.number,begin:mr.number,easing:mr.oneOfType([mr.string,mr.func]),steps:mr.arrayOf(mr.shape({duration:mr.number.isRequired,style:mr.object.isRequired,easing:mr.oneOfType([mr.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),mr.func]),properties:mr.arrayOf("string"),onAnimationEnd:mr.func})),children:mr.oneOfType([mr.node,mr.func]),isActive:mr.bool,canBegin:mr.bool,onAnimationEnd:mr.func,shouldReAnimate:mr.bool,onAnimationStart:mr.func,onAnimationReStart:mr.func};function c0(e){"@babel/helpers - typeof";return c0=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},c0(e)}function d2(){return d2=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0?1:-1,l=n>=0?1:-1,c=i>=0&&n>=0||i<0&&n<0?1:0,u;if(o>0&&a instanceof Array){for(var f=[0,0,0,0],p=0,h=4;po?o:a[p];u="M".concat(t,",").concat(r+s*f[0]),f[0]>0&&(u+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(c,",").concat(t+l*f[0],",").concat(r)),u+="L ".concat(t+n-l*f[1],",").concat(r),f[1]>0&&(u+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(c,`, `).concat(t+n,",").concat(r+s*f[1])),u+="L ".concat(t+n,",").concat(r+i-s*f[2]),f[2]>0&&(u+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(c,`, `).concat(t+n-l*f[2],",").concat(r+i)),u+="L ".concat(t+l*f[3],",").concat(r+i),f[3]>0&&(u+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(c,`, `).concat(t,",").concat(r+i-s*f[3])),u+="Z"}else if(o>0&&a===+a&&a>0){var g=Math.min(o,a);u="M ".concat(t,",").concat(r+s*g,` A `).concat(g,",").concat(g,",0,0,").concat(c,",").concat(t+l*g,",").concat(r,` L `).concat(t+n-l*g,",").concat(r,` A `).concat(g,",").concat(g,",0,0,").concat(c,",").concat(t+n,",").concat(r+s*g,` L `).concat(t+n,",").concat(r+i-s*g,` A `).concat(g,",").concat(g,",0,0,").concat(c,",").concat(t+n-l*g,",").concat(r+i,` L `).concat(t+l*g,",").concat(r+i,` A `).concat(g,",").concat(g,",0,0,").concat(c,",").concat(t,",").concat(r+i-s*g," Z")}else u="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(i," h ").concat(-n," Z");return u},y3e=function(t,r){if(!t||!r)return!1;var n=t.x,i=t.y,a=r.x,o=r.y,s=r.width,l=r.height;if(Math.abs(s)>0&&Math.abs(l)>0){var c=Math.min(a,a+s),u=Math.max(a,a+s),f=Math.min(o,o+l),p=Math.max(o,o+l);return n>=c&&n<=u&&i>=f&&i<=p}return!1},b3e={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},eO=function(t){var r=O8(O8({},b3e),t),n=P.useRef(),i=P.useState(-1),a=u3e(i,2),o=a[0],s=a[1];P.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var S=n.current.getTotalLength();S&&s(S)}catch{}},[]);var l=r.x,c=r.y,u=r.width,f=r.height,p=r.radius,h=r.className,g=r.animationEasing,m=r.animationDuration,v=r.animationBegin,y=r.isAnimationActive,b=r.isUpdateAnimationActive;if(l!==+l||c!==+c||u!==+u||f!==+f||u===0||f===0)return null;var x=Ot("recharts-rectangle",h);return b?K.createElement(il,{canBegin:o>0,from:{width:u,height:f,x:l,y:c},to:{width:u,height:f,x:l,y:c},duration:m,animationEasing:g,isActive:b},function(S){var _=S.width,k=S.height,E=S.x,O=S.y;return K.createElement(il,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:m,isActive:y,easing:g},K.createElement("path",d2({},dt(r,!0),{className:x,d:R8(E,O,_,k,p),ref:n})))}):K.createElement("path",d2({},dt(r,!0),{className:x,d:R8(l,c,u,f,p)}))},x3e=["points","className","baseLinePoints","connectNulls"];function Gh(){return Gh=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _3e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function L8(e){return k3e(e)||P3e(e)||A3e(e)||S3e()}function S3e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function A3e(e,t){if(e){if(typeof e=="string")return BN(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return BN(e,t)}}function P3e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function k3e(e){if(Array.isArray(e))return BN(e)}function BN(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(n){I8(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),I8(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},Yv=function(t,r){var n=j3e(t);r&&(n=[n.reduce(function(a,o){return[].concat(L8(a),L8(o))},[])]);var i=n.map(function(a){return a.reduce(function(o,s,l){return"".concat(o).concat(l===0?"M":"L").concat(s.x,",").concat(s.y)},"")}).join("");return n.length===1?"".concat(i,"Z"):i},N3e=function(t,r,n){var i=Yv(t,n);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(Yv(r.reverse(),n).slice(1))},tG=function(t){var r=t.points,n=t.className,i=t.baseLinePoints,a=t.connectNulls,o=w3e(t,x3e);if(!r||!r.length)return null;var s=Ot("recharts-polygon",n);if(i&&i.length){var l=o.stroke&&o.stroke!=="none",c=N3e(r,i,a);return K.createElement("g",{className:s},K.createElement("path",Gh({},dt(o,!0),{fill:c.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:c})),l?K.createElement("path",Gh({},dt(o,!0),{fill:"none",d:Yv(r,a)})):null,l?K.createElement("path",Gh({},dt(o,!0),{fill:"none",d:Yv(i,a)})):null)}var u=Yv(r,a);return K.createElement("path",Gh({},dt(o,!0),{fill:u.slice(-1)==="Z"?o.fill:"none",className:s,d:u}))};function UN(){return UN=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function I3e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var M3e=function(t,r,n,i,a,o){return"M".concat(t,",").concat(a,"v").concat(i,"M").concat(o,",").concat(r,"h").concat(n)},$3e=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.top,s=o===void 0?0:o,l=t.left,c=l===void 0?0:l,u=t.width,f=u===void 0?0:u,p=t.height,h=p===void 0?0:p,g=t.className,m=L3e(t,E3e),v=C3e({x:n,y:a,top:s,left:c,width:f,height:h},m);return!Le(n)||!Le(a)||!Le(f)||!Le(h)||!Le(s)||!Le(c)?null:K.createElement("path",zN({},dt(v,!0),{className:Ot("recharts-cross",g),d:M3e(n,a,f,h,s,c)}))},D3e=["cx","cy","innerRadius","outerRadius","gridType","radialLines"];function d0(e){"@babel/helpers - typeof";return d0=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},d0(e)}function F3e(e,t){if(e==null)return{};var r=B3e(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function B3e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function pc(){return pc=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function cTe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function uTe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function B8(e,t){for(var r=0;rH8?o=i==="outer"?"start":"end":a<-H8?o=i==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.cx,a=n.cy,o=n.radius,s=n.axisLine,l=n.axisLineType,c=wd(wd({},dt(this.props,!1)),{},{fill:"none"},dt(s,!1));if(l==="circle")return K.createElement(c1,Ld({className:"recharts-polar-angle-axis-line"},c,{cx:i,cy:a,r:o}));var u=this.props.ticks,f=u.map(function(p){return jr(i,a,o,p.coordinate)});return K.createElement(tG,Ld({className:"recharts-polar-angle-axis-line"},c,{points:f}))}},{key:"renderTicks",value:function(){var n=this,i=this.props,a=i.ticks,o=i.tick,s=i.tickLine,l=i.tickFormatter,c=i.stroke,u=dt(this.props,!1),f=dt(o,!1),p=wd(wd({},u),{},{fill:"none"},dt(s,!1)),h=a.map(function(g,m){var v=n.getTickLineCoord(g),y=n.getTickTextAnchor(g),b=wd(wd(wd({textAnchor:y},u),{},{stroke:"none",fill:c},f),{},{index:m,payload:g,x:v.x2,y:v.y2});return K.createElement(ur,Ld({className:Ot("recharts-polar-angle-axis-tick",BW(o)),key:"tick-".concat(g.coordinate)},Qp(n.props,g,m)),s&&K.createElement("line",Ld({className:"recharts-polar-angle-axis-tick-line"},p,v)),o&&t.renderTickItem(o,b,l?l(g.value,m):g.value))});return K.createElement(ur,{className:"recharts-polar-angle-axis-ticks"},h)}},{key:"render",value:function(){var n=this.props,i=n.ticks,a=n.radius,o=n.axisLine;return a<=0||!i||!i.length?null:K.createElement(ur,{className:Ot("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,i,a){var o;return K.isValidElement(n)?o=K.cloneElement(n,i):wt(n)?o=n(i):o=K.createElement(am,Ld({},i,{className:"recharts-polar-angle-axis-tick-value"}),a),o}}])}(P.PureComponent);__(u1,"displayName","PolarAngleAxis");__(u1,"axisType","angleAxis");__(u1,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var PTe=sq,kTe=PTe(Object.getPrototypeOf,Object),jTe=kTe,NTe=xc,ETe=jTe,CTe=wc,TTe="[object Object]",OTe=Function.prototype,RTe=Object.prototype,sG=OTe.toString,LTe=RTe.hasOwnProperty,ITe=sG.call(Object);function MTe(e){if(!CTe(e)||NTe(e)!=TTe)return!1;var t=ETe(e);if(t===null)return!0;var r=LTe.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&sG.call(r)==ITe}var $Te=MTe;const DTe=ar($Te);var FTe=xc,BTe=wc,UTe="[object Boolean]";function zTe(e){return e===!0||e===!1||BTe(e)&&FTe(e)==UTe}var HTe=zTe;const VTe=ar(HTe);function h0(e){"@babel/helpers - typeof";return h0=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},h0(e)}function p2(){return p2=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0,from:{upperWidth:0,lowerWidth:0,height:p,x:l,y:c},to:{upperWidth:u,lowerWidth:f,height:p,x:l,y:c},duration:m,animationEasing:g,isActive:y},function(x){var S=x.upperWidth,_=x.lowerWidth,k=x.height,E=x.x,O=x.y;return K.createElement(il,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:m,easing:g},K.createElement("path",p2({},dt(r,!0),{className:b,d:G8(E,O,S,_,k),ref:n})))}):K.createElement("g",null,K.createElement("path",p2({},dt(r,!0),{className:b,d:G8(l,c,u,f,p)})))},tOe=["option","shapeType","propTransformer","activeClassName","isActive"];function p0(e){"@babel/helpers - typeof";return p0=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},p0(e)}function rOe(e,t){if(e==null)return{};var r=nOe(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function nOe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function K8(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function m2(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function AOe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function g2(){return g2=Object.assign?Object.assign.bind():function(e){for(var t=1;t=2&&(l=!0),c.push(Vi(Vi({},jr(o,s,b,v)),{},{name:g,value:m,cx:o,cy:s,radius:b,angle:v,payload:p}))});var f=[];return l&&c.forEach(function(p){if(Array.isArray(p.value)){var h=wOe(p.value),g=zt(h)?void 0:t.scale(h);f.push(Vi(Vi({},p),{},{radius:g},jr(o,s,g,p.angle)))}else f.push(p)}),{points:c,isRange:l,baseLinePoints:f}});var OOe=Math.ceil,ROe=Math.max;function LOe(e,t,r,n){for(var i=-1,a=ROe(OOe((t-e)/(r||1)),0),o=Array(a);a--;)o[n?a:++i]=e,e+=r;return o}var IOe=LOe,MOe=kq,Z8=1/0,$Oe=17976931348623157e292;function DOe(e){if(!e)return e===0?e:0;if(e=MOe(e),e===Z8||e===-Z8){var t=e<0?-1:1;return t*$Oe}return e===e?e:0}var uG=DOe,FOe=IOe,BOe=l_,WA=uG;function UOe(e){return function(t,r,n){return n&&typeof n!="number"&&BOe(t,r,n)&&(r=n=void 0),t=WA(t),r===void 0?(r=t,t=0):r=WA(r),n=n===void 0?t0&&n.handleDrag(i.changedTouches[0])}),Ca(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=n.props,a=i.endIndex,o=i.onDragEnd,s=i.startIndex;o==null||o({endIndex:a,startIndex:s})}),n.detachDragEndListener()}),Ca(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),Ca(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),Ca(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),Ca(n,"handleSlideDragStart",function(i){var a=n$(i)?i.changedTouches[0]:i;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return t4e(t,e),JOe(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var i=n.startX,a=n.endX,o=this.state.scaleValues,s=this.props,l=s.gap,c=s.data,u=c.length-1,f=Math.min(i,a),p=Math.max(i,a),h=t.getIndexInRange(o,f),g=t.getIndexInRange(o,p);return{startIndex:h-h%l,endIndex:g===u?u:g-g%l}}},{key:"getTextOfTick",value:function(n){var i=this.props,a=i.data,o=i.tickFormatter,s=i.dataKey,l=Zi(a[n],s,n);return wt(o)?o(l,n):l}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var i=this.state,a=i.slideMoveStartX,o=i.startX,s=i.endX,l=this.props,c=l.x,u=l.width,f=l.travellerWidth,p=l.startIndex,h=l.endIndex,g=l.onChange,m=n.pageX-a;m>0?m=Math.min(m,c+u-f-s,c+u-f-o):m<0&&(m=Math.max(m,c-o,c-s));var v=this.getIndex({startX:o+m,endX:s+m});(v.startIndex!==p||v.endIndex!==h)&&g&&g(v),this.setState({startX:o+m,endX:s+m,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var a=n$(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var i=this.state,a=i.brushMoveStartX,o=i.movingTravellerId,s=i.endX,l=i.startX,c=this.state[o],u=this.props,f=u.x,p=u.width,h=u.travellerWidth,g=u.onChange,m=u.gap,v=u.data,y={startX:this.state.startX,endX:this.state.endX},b=n.pageX-a;b>0?b=Math.min(b,f+p-h-c):b<0&&(b=Math.max(b,f-c)),y[o]=c+b;var x=this.getIndex(y),S=x.startIndex,_=x.endIndex,k=function(){var O=v.length-1;return o==="startX"&&(s>l?S%m===0:_%m===0)||sl?_%m===0:S%m===0)||s>l&&_===O};this.setState(Ca(Ca({},o,c+b),"brushMoveStartX",n.pageX),function(){g&&k()&&g(x)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var a=this,o=this.state,s=o.scaleValues,l=o.startX,c=o.endX,u=this.state[i],f=s.indexOf(u);if(f!==-1){var p=f+n;if(!(p===-1||p>=s.length)){var h=s[p];i==="startX"&&h>=c||i==="endX"&&h<=l||this.setState(Ca({},i,h),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,s=n.height,l=n.fill,c=n.stroke;return K.createElement("rect",{stroke:c,fill:l,x:i,y:a,width:o,height:s})}},{key:"renderPanorama",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,s=n.height,l=n.data,c=n.children,u=n.padding,f=P.Children.only(c);return f?K.cloneElement(f,{x:i,y:a,width:o,height:s,margin:u,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(n,i){var a,o,s=this,l=this.props,c=l.y,u=l.travellerWidth,f=l.height,p=l.traveller,h=l.ariaLabel,g=l.data,m=l.startIndex,v=l.endIndex,y=Math.max(n,this.props.x),b=GA(GA({},dt(this.props,!1)),{},{x:y,y:c,width:u,height:f}),x=h||"Min value: ".concat((a=g[m])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=g[v])===null||o===void 0?void 0:o.name);return K.createElement(ur,{tabIndex:0,role:"slider","aria-label":x,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(_){["ArrowLeft","ArrowRight"].includes(_.key)&&(_.preventDefault(),_.stopPropagation(),s.handleTravellerMoveKeyboard(_.key==="ArrowRight"?1:-1,i))},onFocus:function(){s.setState({isTravellerFocused:!0})},onBlur:function(){s.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(p,b))}},{key:"renderSlide",value:function(n,i){var a=this.props,o=a.y,s=a.height,l=a.stroke,c=a.travellerWidth,u=Math.min(n,i)+c,f=Math.max(Math.abs(i-n)-c,0);return K.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:l,fillOpacity:.2,x:u,y:o,width:f,height:s})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,a=n.endIndex,o=n.y,s=n.height,l=n.travellerWidth,c=n.stroke,u=this.state,f=u.startX,p=u.endX,h=5,g={pointerEvents:"none",fill:c};return K.createElement(ur,{className:"recharts-brush-texts"},K.createElement(am,b2({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,p)-h,y:o+s/2},g),this.getTextOfTick(i)),K.createElement(am,b2({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,p)+l+h,y:o+s/2},g),this.getTextOfTick(a)))}},{key:"render",value:function(){var n=this.props,i=n.data,a=n.className,o=n.children,s=n.x,l=n.y,c=n.width,u=n.height,f=n.alwaysShowText,p=this.state,h=p.startX,g=p.endX,m=p.isTextActive,v=p.isSlideMoving,y=p.isTravellerMoving,b=p.isTravellerFocused;if(!i||!i.length||!Le(s)||!Le(l)||!Le(c)||!Le(u)||c<=0||u<=0)return null;var x=Ot("recharts-brush",a),S=K.Children.count(o)===1,_=YOe("userSelect","none");return K.createElement(ur,{className:x,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:_},this.renderBackground(),S&&this.renderPanorama(),this.renderSlide(h,g),this.renderTravellerLayer(h,"startX"),this.renderTravellerLayer(g,"endX"),(m||v||y||b||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,a=n.y,o=n.width,s=n.height,l=n.stroke,c=Math.floor(a+s/2)-1;return K.createElement(K.Fragment,null,K.createElement("rect",{x:i,y:a,width:o,height:s,fill:l,stroke:"none"}),K.createElement("line",{x1:i+1,y1:c,x2:i+o-1,y2:c,fill:"none",stroke:"#fff"}),K.createElement("line",{x1:i+1,y1:c+2,x2:i+o-1,y2:c+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var a;return K.isValidElement(n)?a=K.cloneElement(n,i):wt(n)?a=n(i):a=t.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(n,i){var a=n.data,o=n.width,s=n.x,l=n.travellerWidth,c=n.updateId,u=n.startIndex,f=n.endIndex;if(a!==i.prevData||c!==i.prevUpdateId)return GA({prevData:a,prevTravellerWidth:l,prevUpdateId:c,prevX:s,prevWidth:o},a&&a.length?n4e({data:a,width:o,x:s,travellerWidth:l,startIndex:u,endIndex:f}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||s!==i.prevX||l!==i.prevTravellerWidth)){i.scale.range([s,s+o-l]);var p=i.scale.domain().map(function(h){return i.scale(h)});return{prevData:a,prevTravellerWidth:l,prevUpdateId:c,prevX:s,prevWidth:o,startX:i.scale(n.startIndex),endX:i.scale(n.endIndex),scaleValues:p}}return null}},{key:"getIndexInRange",value:function(n,i){for(var a=n.length,o=0,s=a-1;s-o>1;){var l=Math.floor((o+s)/2);n[l]>i?s=l:o=l}return i>=n[s]?s:o}}])}(P.PureComponent);Ca(vm,"displayName","Brush");Ca(vm,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var i4e=kT;function a4e(e,t){var r;return i4e(e,function(n,i,a){return r=t(n,i,a),!r}),!!r}var o4e=a4e,s4e=QV,l4e=cl,c4e=o4e,u4e=ya,d4e=l_;function f4e(e,t,r){var n=u4e(e)?s4e:c4e;return r&&d4e(e,t,r)&&(t=void 0),n(e,l4e(t))}var h4e=f4e;const p4e=ar(h4e);var Zs=function(t,r){var n=t.alwaysShow,i=t.ifOverflow;return n&&(i="extendDomain"),i===r},i$=wq;function m4e(e,t,r){t=="__proto__"&&i$?i$(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var g4e=m4e,v4e=g4e,y4e=bq,b4e=cl;function x4e(e,t){var r={};return t=b4e(t),y4e(e,function(n,i,a){v4e(r,i,t(n,i,a))}),r}var w4e=x4e;const _4e=ar(w4e);function S4e(e,t){for(var r=-1,n=e==null?0:e.length;++r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function B4e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function U4e(e,t){var r=e.x,n=e.y,i=F4e(e,I4e),a="".concat(r),o=parseInt(a,10),s="".concat(n),l=parseInt(s,10),c="".concat(t.height||i.height),u=parseInt(c,10),f="".concat(t.width||i.width),p=parseInt(f,10);return pv(pv(pv(pv(pv({},t),i),o?{x:o}:{}),l?{y:l}:{}),{},{height:u,width:p,name:t.name,radius:t.radius})}function o$(e){return K.createElement(uOe,GN({shapeType:"rectangle",propTransformer:U4e,activeClassName:"recharts-active-bar"},e))}var z4e=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,i){if(typeof t=="number")return t;var a=Le(n)||Yge(n);return a?t(n,i):(a||jf(),r)}},H4e=["value","background"],mG;function ym(e){"@babel/helpers - typeof";return ym=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},ym(e)}function V4e(e,t){if(e==null)return{};var r=q4e(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function q4e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function w2(){return w2=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(G)0&&Math.abs(I)0&&(D=Math.min((z||0)-(I[ie-1]||0),D))}),Number.isFinite(D)){var G=D/C,Y=m.layout==="vertical"?n.height:n.width;if(m.padding==="gap"&&(E=G*Y/2),m.padding==="no-gap"){var Z=os(t.barCategoryGap,G*Y),U=G*Y/2;E=U-Z-(U-Z)/Y*Z}}}i==="xAxis"?O=[n.left+(x.left||0)+(E||0),n.left+n.width-(x.right||0)-(E||0)]:i==="yAxis"?O=l==="horizontal"?[n.top+n.height-(x.bottom||0),n.top+(x.top||0)]:[n.top+(x.top||0)+(E||0),n.top+n.height-(x.bottom||0)-(E||0)]:O=m.range,_&&(O=[O[1],O[0]]);var X=LW(m,a,p),oe=X.scale,ue=X.realScaleType;oe.domain(y).range(O),IW(oe);var M=MW(oe,ts(ts({},m),{},{realScaleType:ue}));i==="xAxis"?(N=v==="top"&&!S||v==="bottom"&&S,R=n.left,$=f[k]-N*m.height):i==="yAxis"&&(N=v==="left"&&!S||v==="right"&&S,R=f[k]-N*m.width,$=n.top);var W=ts(ts(ts({},m),M),{},{realScaleType:ue,x:R,y:$,scale:oe,width:i==="xAxis"?n.width:m.width,height:i==="yAxis"?n.height:m.height});return W.bandSize=a2(W,M),!m.hide&&i==="xAxis"?f[k]+=(N?-1:1)*W.height:m.hide||(f[k]+=(N?-1:1)*W.width),ts(ts({},h),{},P_({},g,W))},{})},xG=function(t,r){var n=t.x,i=t.y,a=r.x,o=r.y;return{x:Math.min(n,a),y:Math.min(i,o),width:Math.abs(a-n),height:Math.abs(o-i)}},rRe=function(t){var r=t.x1,n=t.y1,i=t.x2,a=t.y2;return xG({x:r,y:n},{x:i,y:a})},wG=function(){function e(t){Q4e(this,e),this.scale=t}return eRe(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.bandAware,a=n.position;if(r!==void 0){if(a)switch(a){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var s=this.bandwidth?this.bandwidth():0;return this.scale(r)+s}default:return this.scale(r)}if(i){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+l}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),i=n[0],a=n[n.length-1];return i<=a?r>=i&&r<=a:r>=a&&r<=i}}],[{key:"create",value:function(r){return new e(r)}}])}();P_(wG,"EPS",1e-4);var tO=function(t){var r=Object.keys(t).reduce(function(n,i){return ts(ts({},n),{},P_({},i,wG.create(t[i])))},{});return ts(ts({},r),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,s=a.position;return _4e(i,function(l,c){return r[c].apply(l,{bandAware:o,position:s})})},isInRange:function(i){return pG(i,function(a,o){return r[o].isInRange(a)})}})};function nRe(e){return(e%180+180)%180}var iRe=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=nRe(i),o=a*Math.PI/180,s=Math.atan(n/r),l=o>s&&o-1?i[a?t[o]:o]:void 0}}var cRe=lRe,uRe=uG;function dRe(e){var t=uRe(e),r=t%1;return t===t?r?t-r:t:0}var fRe=dRe,hRe=hq,pRe=cl,mRe=fRe,gRe=Math.max;function vRe(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var i=r==null?0:mRe(r);return i<0&&(i=gRe(n+i,0)),hRe(e,pRe(t),i)}var yRe=vRe,bRe=cRe,xRe=yRe,wRe=bRe(xRe),_Re=wRe;const SRe=ar(_Re);var ARe=Qme(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),rO=P.createContext(void 0),nO=P.createContext(void 0),_G=P.createContext(void 0),SG=P.createContext({}),AG=P.createContext(void 0),PG=P.createContext(0),kG=P.createContext(0),d$=function(t){var r=t.state,n=r.xAxisMap,i=r.yAxisMap,a=r.offset,o=t.clipPathId,s=t.children,l=t.width,c=t.height,u=ARe(a);return K.createElement(rO.Provider,{value:n},K.createElement(nO.Provider,{value:i},K.createElement(SG.Provider,{value:a},K.createElement(_G.Provider,{value:u},K.createElement(AG.Provider,{value:o},K.createElement(PG.Provider,{value:c},K.createElement(kG.Provider,{value:l},s)))))))},PRe=function(){return P.useContext(AG)},jG=function(t){var r=P.useContext(rO);r==null&&jf();var n=r[t];return n==null&&jf(),n},kRe=function(){var t=P.useContext(rO);return nu(t)},jRe=function(){var t=P.useContext(nO),r=SRe(t,function(n){return pG(n.domain,Number.isFinite)});return r||nu(t)},NG=function(t){var r=P.useContext(nO);r==null&&jf();var n=r[t];return n==null&&jf(),n},NRe=function(){var t=P.useContext(_G);return t},ERe=function(){return P.useContext(SG)},iO=function(){return P.useContext(kG)},aO=function(){return P.useContext(PG)};function bm(e){"@babel/helpers - typeof";return bm=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},bm(e)}function CRe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function TRe(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);re*i)return!1;var a=r();return e*(t-e*a/2-n)>=0&&e*(t+e*a/2-i)<=0}function fLe(e,t){return IG(e,t+1)}function hLe(e,t,r,n,i){for(var a=(n||[]).slice(),o=t.start,s=t.end,l=0,c=1,u=o,f=function(){var g=n==null?void 0:n[l];if(g===void 0)return{v:IG(n,c)};var m=l,v,y=function(){return v===void 0&&(v=r(g,m)),v},b=g.coordinate,x=l===0||k2(e,b,y,u,s);x||(l=0,u=o,c+=1),x&&(u=b+e*(y()/2+i),l+=c)},p;c<=a.length;)if(p=f(),p)return p.v;return[]}function b0(e){"@babel/helpers - typeof";return b0=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},b0(e)}function b$(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ti(e){for(var t=1;t0?h.coordinate-v*e:h.coordinate})}else a[p]=h=Ti(Ti({},h),{},{tickCoord:h.coordinate});var y=k2(e,h.tickCoord,m,s,l);y&&(l=h.tickCoord-e*(m()/2+i),a[p]=Ti(Ti({},h),{},{isShow:!0}))},u=o-1;u>=0;u--)c(u);return a}function yLe(e,t,r,n,i,a){var o=(n||[]).slice(),s=o.length,l=t.start,c=t.end;if(a){var u=n[s-1],f=r(u,s-1),p=e*(u.coordinate+e*f/2-c);o[s-1]=u=Ti(Ti({},u),{},{tickCoord:p>0?u.coordinate-p*e:u.coordinate});var h=k2(e,u.tickCoord,function(){return f},l,c);h&&(c=u.tickCoord-e*(f/2+i),o[s-1]=Ti(Ti({},u),{},{isShow:!0}))}for(var g=a?s-1:s,m=function(b){var x=o[b],S,_=function(){return S===void 0&&(S=r(x,b)),S};if(b===0){var k=e*(x.coordinate-e*_()/2-l);o[b]=x=Ti(Ti({},x),{},{tickCoord:k<0?x.coordinate-k*e:x.coordinate})}else o[b]=x=Ti(Ti({},x),{},{tickCoord:x.coordinate});var E=k2(e,x.tickCoord,_,l,c);E&&(l=x.tickCoord+e*(_()/2+i),o[b]=Ti(Ti({},x),{},{isShow:!0}))},v=0;v=2?as(i[1].coordinate-i[0].coordinate):1,y=dLe(a,v,h);return l==="equidistantPreserveStart"?hLe(v,y,m,i,o):(l==="preserveStart"||l==="preserveStartEnd"?p=yLe(v,y,m,i,o,l==="preserveStartEnd"):p=vLe(v,y,m,i,o),p.filter(function(b){return b.isShow}))}var bLe=["viewBox"],xLe=["viewBox"],wLe=["ticks"];function _m(e){"@babel/helpers - typeof";return _m=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},_m(e)}function Kh(){return Kh=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _Le(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function SLe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function w$(e,t){for(var r=0;r0?l(this.props):l(h)),o<=0||s<=0||!g||!g.length?null:K.createElement(ur,{className:Ot("recharts-cartesian-axis",c),ref:function(v){n.layerReference=v}},a&&this.renderAxisLine(),this.renderTicks(g,this.state.fontSize,this.state.letterSpacing),yi.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,a){var o,s=Ot(i.className,"recharts-cartesian-axis-tick-value");return K.isValidElement(n)?o=K.cloneElement(n,Fn(Fn({},i),{},{className:s})):wt(n)?o=n(Fn(Fn({},i),{},{className:s})):o=K.createElement(am,Kh({},i,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])}(P.Component);cO(og,"displayName","CartesianAxis");cO(og,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var CLe=["x1","y1","x2","y2","key"],TLe=["offset"];function Nf(e){"@babel/helpers - typeof";return Nf=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},Nf(e)}function _$(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Li(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ILe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var MLe=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,i=t.x,a=t.y,o=t.width,s=t.height,l=t.ry;return K.createElement("rect",{x:i,y:a,ry:l,width:o,height:s,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function DG(e,t){var r;if(K.isValidElement(e))r=K.cloneElement(e,t);else if(wt(e))r=e(t);else{var n=t.x1,i=t.y1,a=t.x2,o=t.y2,s=t.key,l=S$(t,CLe),c=dt(l,!1);c.offset;var u=S$(c,TLe);r=K.createElement("line",Hd({},u,{x1:n,y1:i,x2:a,y2:o,fill:"none",key:s}))}return r}function $Le(e){var t=e.x,r=e.width,n=e.horizontal,i=n===void 0?!0:n,a=e.horizontalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(s,l){var c=Li(Li({},e),{},{x1:t,y1:s,x2:t+r,y2:s,key:"line-".concat(l),index:l});return DG(i,c)});return K.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function DLe(e){var t=e.y,r=e.height,n=e.vertical,i=n===void 0?!0:n,a=e.verticalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(s,l){var c=Li(Li({},e),{},{x1:s,y1:t,x2:s,y2:t+r,key:"line-".concat(l),index:l});return DG(i,c)});return K.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function FLe(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,i=e.y,a=e.width,o=e.height,s=e.horizontalPoints,l=e.horizontal,c=l===void 0?!0:l;if(!c||!t||!t.length)return null;var u=s.map(function(p){return Math.round(p+i-i)}).sort(function(p,h){return p-h});i!==u[0]&&u.unshift(0);var f=u.map(function(p,h){var g=!u[h+1],m=g?i+o-p:u[h+1]-p;if(m<=0)return null;var v=h%t.length;return K.createElement("rect",{key:"react-".concat(h),y:p,x:n,height:m,width:a,stroke:"none",fill:t[v],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return K.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function BLe(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,i=e.fillOpacity,a=e.x,o=e.y,s=e.width,l=e.height,c=e.verticalPoints;if(!r||!n||!n.length)return null;var u=c.map(function(p){return Math.round(p+a-a)}).sort(function(p,h){return p-h});a!==u[0]&&u.unshift(0);var f=u.map(function(p,h){var g=!u[h+1],m=g?a+s-p:u[h+1]-p;if(m<=0)return null;var v=h%n.length;return K.createElement("rect",{key:"react-".concat(h),x:p,y:o,width:m,height:l,stroke:"none",fill:n[v],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return K.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var ULe=function(t,r){var n=t.xAxis,i=t.width,a=t.height,o=t.offset;return RW(lO(Li(Li(Li({},og.defaultProps),n),{},{ticks:ql(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.left,o.left+o.width,r)},zLe=function(t,r){var n=t.yAxis,i=t.width,a=t.height,o=t.offset;return RW(lO(Li(Li(Li({},og.defaultProps),n),{},{ticks:ql(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.top,o.top+o.height,r)},vh={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function al(e){var t,r,n,i,a,o,s=iO(),l=aO(),c=ERe(),u=Li(Li({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:vh.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:vh.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:vh.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:vh.horizontalFill,vertical:(a=e.vertical)!==null&&a!==void 0?a:vh.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:vh.verticalFill,x:Le(e.x)?e.x:c.left,y:Le(e.y)?e.y:c.top,width:Le(e.width)?e.width:c.width,height:Le(e.height)?e.height:c.height}),f=u.x,p=u.y,h=u.width,g=u.height,m=u.syncWithTicks,v=u.horizontalValues,y=u.verticalValues,b=kRe(),x=jRe();if(!Le(h)||h<=0||!Le(g)||g<=0||!Le(f)||f!==+f||!Le(p)||p!==+p)return null;var S=u.verticalCoordinatesGenerator||ULe,_=u.horizontalCoordinatesGenerator||zLe,k=u.horizontalPoints,E=u.verticalPoints;if((!k||!k.length)&&wt(_)){var O=v&&v.length,R=_({yAxis:x?Li(Li({},x),{},{ticks:O?v:x.ticks}):void 0,width:s,height:l,offset:c},O?!0:m);Jl(Array.isArray(R),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Nf(R),"]")),Array.isArray(R)&&(k=R)}if((!E||!E.length)&&wt(S)){var $=y&&y.length,N=S({xAxis:b?Li(Li({},b),{},{ticks:$?y:b.ticks}):void 0,width:s,height:l,offset:c},$?!0:m);Jl(Array.isArray(N),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Nf(N),"]")),Array.isArray(N)&&(E=N)}return K.createElement("g",{className:"recharts-cartesian-grid"},K.createElement(MLe,{fill:u.fill,fillOpacity:u.fillOpacity,x:u.x,y:u.y,width:u.width,height:u.height,ry:u.ry}),K.createElement($Le,Hd({},u,{offset:c,horizontalPoints:k,xAxis:b,yAxis:x})),K.createElement(DLe,Hd({},u,{offset:c,verticalPoints:E,xAxis:b,yAxis:x})),K.createElement(FLe,Hd({},u,{horizontalPoints:k})),K.createElement(BLe,Hd({},u,{verticalPoints:E})))}al.displayName="CartesianGrid";var HLe=["layout","type","stroke","connectNulls","isRange","ref"],VLe=["key"],FG;function Sm(e){"@babel/helpers - typeof";return Sm=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},Sm(e)}function BG(e,t){if(e==null)return{};var r=qLe(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function qLe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Vd(){return Vd=Object.assign?Object.assign.bind():function(e){for(var t=1;t0||!cm(u,o)||!cm(f,s))?this.renderAreaWithAnimation(n,i):this.renderAreaStatically(o,s,n,i)}},{key:"render",value:function(){var n,i=this.props,a=i.hide,o=i.dot,s=i.points,l=i.className,c=i.top,u=i.left,f=i.xAxis,p=i.yAxis,h=i.width,g=i.height,m=i.isAnimationActive,v=i.id;if(a||!s||!s.length)return null;var y=this.state.isAnimationFinished,b=s.length===1,x=Ot("recharts-area",l),S=f&&f.allowDataOverflow,_=p&&p.allowDataOverflow,k=S||_,E=zt(v)?this.id:v,O=(n=dt(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},R=O.r,$=R===void 0?3:R,N=O.strokeWidth,C=N===void 0?2:N,D=sve(o)?o:{},I=D.clipDot,G=I===void 0?!0:I,Y=$*2+C;return K.createElement(ur,{className:x},S||_?K.createElement("defs",null,K.createElement("clipPath",{id:"clipPath-".concat(E)},K.createElement("rect",{x:S?u:u-h/2,y:_?c:c-g/2,width:S?h:h*2,height:_?g:g*2})),!G&&K.createElement("clipPath",{id:"clipPath-dots-".concat(E)},K.createElement("rect",{x:u-Y/2,y:c-Y/2,width:h+Y,height:g+Y}))):null,b?null:this.renderArea(k,E),(o||b)&&this.renderDots(k,G,E),(!m||y)&&ec.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,curBaseLine:n.baseLine,prevPoints:i.curPoints,prevBaseLine:i.curBaseLine}:n.points!==i.curPoints||n.baseLine!==i.curBaseLine?{curPoints:n.points,curBaseLine:n.baseLine}:null}}])}(P.PureComponent);FG=xi;Vs(xi,"displayName","Area");Vs(xi,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!Xs.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});Vs(xi,"getBaseValue",function(e,t,r,n){var i=e.layout,a=e.baseValue,o=t.props.baseValue,s=o??a;if(Le(s)&&typeof s=="number")return s;var l=i==="horizontal"?n:r,c=l.scale.domain();if(l.type==="number"){var u=Math.max(c[0],c[1]),f=Math.min(c[0],c[1]);return s==="dataMin"?f:s==="dataMax"||u<0?u:Math.max(Math.min(c[0],c[1]),0)}return s==="dataMin"?c[0]:s==="dataMax"?c[1]:c[0]});Vs(xi,"getComposedData",function(e){var t=e.props,r=e.item,n=e.xAxis,i=e.yAxis,a=e.xAxisTicks,o=e.yAxisTicks,s=e.bandSize,l=e.dataKey,c=e.stackedData,u=e.dataStartIndex,f=e.displayedData,p=e.offset,h=t.layout,g=c&&c.length,m=FG.getBaseValue(t,r,n,i),v=h==="horizontal",y=!1,b=f.map(function(S,_){var k;g?k=c[u+_]:(k=Zi(S,l),Array.isArray(k)?y=!0:k=[m,k]);var E=k[1]==null||g&&Zi(S,l)==null;return v?{x:YM({axis:n,ticks:a,bandSize:s,entry:S,index:_}),y:E?null:i.scale(k[1]),value:k,payload:S}:{x:E?null:n.scale(k[1]),y:YM({axis:i,ticks:o,bandSize:s,entry:S,index:_}),value:k,payload:S}}),x;return g||y?x=b.map(function(S){var _=Array.isArray(S.value)?S.value[0]:null;return v?{x:S.x,y:_!=null&&S.y!=null?i.scale(_):null}:{x:_!=null?n.scale(_):null,y:S.y}}):x=v?i.scale(m):n.scale(m),Gc({points:b,baseLine:x,layout:h,isRange:y},p)});Vs(xi,"renderDotItem",function(e,t){var r;if(K.isValidElement(e))r=K.cloneElement(e,t);else if(wt(e))r=e(t);else{var n=Ot("recharts-area-dot",typeof e!="boolean"?e.className:""),i=t.key,a=BG(t,VLe);r=K.createElement(c1,Vd({},a,{key:i,className:n}))}return r});function Am(e){"@babel/helpers - typeof";return Am=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},Am(e)}function QLe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function e6e(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function B6e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function U6e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function z6e(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?o:t&&t.length&&Le(i)&&Le(a)?t.slice(i,a+1):[]};function rK(e){return e==="number"?[0,"auto"]:void 0}var dE=function(t,r,n,i){var a=t.graphicalItems,o=t.tooltipAxis,s=C_(r,t);return n<0||!a||!a.length||n>=s.length?null:a.reduce(function(l,c){var u,f=(u=c.props.data)!==null&&u!==void 0?u:r;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var p;if(o.dataKey&&!o.allowDuplicatedCategory){var h=f===void 0?s:f;p=Tw(h,o.dataKey,i)}else p=f&&f[n]||s[n];return p?[].concat(jm(l),[DW(c,p)]):l},[])},T$=function(t,r,n,i){var a=i||{x:t.chartX,y:t.chartY},o=eIe(a,n),s=t.orderedTooltipTicks,l=t.tooltipAxis,c=t.tooltipTicks,u=lNe(o,s,c,l);if(u>=0&&c){var f=c[u]&&c[u].value,p=dE(t,r,u,f),h=tIe(n,s,u,a);return{activeTooltipIndex:u,activeLabel:f,activePayload:p,activeCoordinate:h}}return null},rIe=function(t,r){var n=r.axes,i=r.graphicalItems,a=r.axisType,o=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,c=r.dataEndIndex,u=t.layout,f=t.children,p=t.stackOffset,h=OW(u,a);return n.reduce(function(g,m){var v,y=m.type.defaultProps!==void 0?_e(_e({},m.type.defaultProps),m.props):m.props,b=y.type,x=y.dataKey,S=y.allowDataOverflow,_=y.allowDuplicatedCategory,k=y.scale,E=y.ticks,O=y.includeHidden,R=y[o];if(g[R])return g;var $=C_(t.data,{graphicalItems:i.filter(function(M){var W,z=o in M.props?M.props[o]:(W=M.type.defaultProps)===null||W===void 0?void 0:W[o];return z===R}),dataStartIndex:l,dataEndIndex:c}),N=$.length,C,D,I;N6e(y.domain,S,b)&&(C=kN(y.domain,null,S),h&&(b==="number"||k!=="auto")&&(I=Wv($,x,"category")));var G=rK(b);if(!C||C.length===0){var Y,Z=(Y=y.domain)!==null&&Y!==void 0?Y:G;if(x){if(C=Wv($,x,b),b==="category"&&h){var U=Jge(C);_&&U?(D=C,C=y2(0,N)):_||(C=QM(Z,C,m).reduce(function(M,W){return M.indexOf(W)>=0?M:[].concat(jm(M),[W])},[]))}else if(b==="category")_?C=C.filter(function(M){return M!==""&&!zt(M)}):C=QM(Z,C,m).reduce(function(M,W){return M.indexOf(W)>=0||W===""||zt(W)?M:[].concat(jm(M),[W])},[]);else if(b==="number"){var X=hNe($,i.filter(function(M){var W,z,ie=o in M.props?M.props[o]:(W=M.type.defaultProps)===null||W===void 0?void 0:W[o],le="hide"in M.props?M.props.hide:(z=M.type.defaultProps)===null||z===void 0?void 0:z.hide;return ie===R&&(O||!le)}),x,a,u);X&&(C=X)}h&&(b==="number"||k!=="auto")&&(I=Wv($,x,"category"))}else h?C=y2(0,N):s&&s[R]&&s[R].hasStack&&b==="number"?C=p==="expand"?[0,1]:$W(s[R].stackGroups,l,c):C=TW($,i.filter(function(M){var W=o in M.props?M.props[o]:M.type.defaultProps[o],z="hide"in M.props?M.props.hide:M.type.defaultProps.hide;return W===R&&(O||!z)}),b,u,!0);if(b==="number")C=lE(f,C,R,a,E),Z&&(C=kN(Z,C,S));else if(b==="category"&&Z){var oe=Z,ue=C.every(function(M){return oe.indexOf(M)>=0});ue&&(C=oe)}}return _e(_e({},g),{},yt({},R,_e(_e({},y),{},{axisType:a,domain:C,categoricalDomain:I,duplicateDomain:D,originalDomain:(v=y.domain)!==null&&v!==void 0?v:G,isCategorical:h,layout:u})))},{})},nIe=function(t,r){var n=r.graphicalItems,i=r.Axis,a=r.axisType,o=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,c=r.dataEndIndex,u=t.layout,f=t.children,p=C_(t.data,{graphicalItems:n,dataStartIndex:l,dataEndIndex:c}),h=p.length,g=OW(u,a),m=-1;return n.reduce(function(v,y){var b=y.type.defaultProps!==void 0?_e(_e({},y.type.defaultProps),y.props):y.props,x=b[o],S=rK("number");if(!v[x]){m++;var _;return g?_=y2(0,h):s&&s[x]&&s[x].hasStack?(_=$W(s[x].stackGroups,l,c),_=lE(f,_,x,a)):(_=kN(S,TW(p,n.filter(function(k){var E,O,R=o in k.props?k.props[o]:(E=k.type.defaultProps)===null||E===void 0?void 0:E[o],$="hide"in k.props?k.props.hide:(O=k.type.defaultProps)===null||O===void 0?void 0:O.hide;return R===x&&!$}),"number",u),i.defaultProps.allowDataOverflow),_=lE(f,_,x,a)),_e(_e({},v),{},yt({},x,_e(_e({axisType:a},i.defaultProps),{},{hide:!0,orientation:So(Z6e,"".concat(a,".").concat(m%2),null),domain:_,originalDomain:S,isCategorical:g,layout:u})))}return v},{})},iIe=function(t,r){var n=r.axisType,i=n===void 0?"xAxis":n,a=r.AxisComp,o=r.graphicalItems,s=r.stackGroups,l=r.dataStartIndex,c=r.dataEndIndex,u=t.children,f="".concat(i,"Id"),p=cs(u,a),h={};return p&&p.length?h=rIe(t,{axes:p,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:c}):o&&o.length&&(h=nIe(t,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:c})),h},aIe=function(t){var r=nu(t),n=ql(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:jT(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:a2(r,n)}},O$=function(t){var r=t.children,n=t.defaultShowTooltip,i=Ra(r,vm),a=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(a=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},oIe=function(t){return!t||!t.length?!1:t.some(function(r){var n=Xl(r&&r.type);return n&&n.indexOf("Bar")>=0})},R$=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},sIe=function(t,r){var n=t.props,i=t.graphicalItems,a=t.xAxisMap,o=a===void 0?{}:a,s=t.yAxisMap,l=s===void 0?{}:s,c=n.width,u=n.height,f=n.children,p=n.margin||{},h=Ra(f,vm),g=Ra(f,Zl),m=Object.keys(l).reduce(function(_,k){var E=l[k],O=E.orientation;return!E.mirror&&!E.hide?_e(_e({},_),{},yt({},O,_[O]+E.width)):_},{left:p.left||0,right:p.right||0}),v=Object.keys(o).reduce(function(_,k){var E=o[k],O=E.orientation;return!E.mirror&&!E.hide?_e(_e({},_),{},yt({},O,So(_,"".concat(O))+E.height)):_},{top:p.top||0,bottom:p.bottom||0}),y=_e(_e({},v),m),b=y.bottom;h&&(y.bottom+=h.props.height||vm.defaultProps.height),g&&r&&(y=dNe(y,i,n,r));var x=c-y.left-y.right,S=u-y.top-y.bottom;return _e(_e({brushBottom:b},y),{},{width:Math.max(x,0),height:Math.max(S,0)})},lIe=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},uO=function(t){var r=t.chartName,n=t.GraphicalChild,i=t.defaultTooltipEventType,a=i===void 0?"axis":i,o=t.validateTooltipEventTypes,s=o===void 0?["axis"]:o,l=t.axisComponents,c=t.legendContent,u=t.formatAxisMap,f=t.defaultProps,p=function(y,b){var x=b.graphicalItems,S=b.stackGroups,_=b.offset,k=b.updateId,E=b.dataStartIndex,O=b.dataEndIndex,R=y.barSize,$=y.layout,N=y.barGap,C=y.barCategoryGap,D=y.maxBarSize,I=R$($),G=I.numericAxisName,Y=I.cateAxisName,Z=oIe(x),U=[];return x.forEach(function(X,oe){var ue=C_(y.data,{graphicalItems:[X],dataStartIndex:E,dataEndIndex:O}),M=X.type.defaultProps!==void 0?_e(_e({},X.type.defaultProps),X.props):X.props,W=M.dataKey,z=M.maxBarSize,ie=M["".concat(G,"Id")],le=M["".concat(Y,"Id")],V={},se=l.reduce(function(Me,Ye){var Be=b["".concat(Ye.axisType,"Map")],Yt=M["".concat(Ye.axisType,"Id")];Be&&Be[Yt]||Ye.axisType==="zAxis"||jf();var Dt=Be[Yt];return _e(_e({},Me),{},yt(yt({},Ye.axisType,Dt),"".concat(Ye.axisType,"Ticks"),ql(Dt)))},V),ae=se[Y],de=se["".concat(Y,"Ticks")],ve=S&&S[ie]&&S[ie].hasStack&&_Ne(X,S[ie].stackGroups),fe=Xl(X.type).indexOf("Bar")>=0,je=a2(ae,de),Te=[],Q=Z&&cNe({barSize:R,stackGroups:S,totalSize:lIe(se,Y)});if(fe){var Ce,Ke,Fe=zt(z)?D:z,ke=(Ce=(Ke=a2(ae,de,!0))!==null&&Ke!==void 0?Ke:Fe)!==null&&Ce!==void 0?Ce:0;Te=uNe({barGap:N,barCategoryGap:C,bandSize:ke!==je?ke:je,sizeList:Q[le],maxBarSize:Fe}),ke!==je&&(Te=Te.map(function(Me){return _e(_e({},Me),{},{position:_e(_e({},Me.position),{},{offset:Me.position.offset-ke/2})})}))}var rt=X&&X.type&&X.type.getComposedData;rt&&U.push({props:_e(_e({},rt(_e(_e({},se),{},{displayedData:ue,props:y,dataKey:W,item:X,bandSize:je,barPosition:Te,offset:_,stackedData:ve,layout:$,dataStartIndex:E,dataEndIndex:O}))),{},yt(yt(yt({key:X.key||"item-".concat(oe)},G,se[G]),Y,se[Y]),"animationId",k)),childIndex:uve(X,y.children),item:X})}),U},h=function(y,b){var x=y.props,S=y.dataStartIndex,_=y.dataEndIndex,k=y.updateId;if(!W6({props:x}))return null;var E=x.children,O=x.layout,R=x.stackOffset,$=x.data,N=x.reverseStackOrder,C=R$(O),D=C.numericAxisName,I=C.cateAxisName,G=cs(E,n),Y=xNe($,G,"".concat(D,"Id"),"".concat(I,"Id"),R,N),Z=l.reduce(function(M,W){var z="".concat(W.axisType,"Map");return _e(_e({},M),{},yt({},z,iIe(x,_e(_e({},W),{},{graphicalItems:G,stackGroups:W.axisType===D&&Y,dataStartIndex:S,dataEndIndex:_}))))},{}),U=sIe(_e(_e({},Z),{},{props:x,graphicalItems:G}),b==null?void 0:b.legendBBox);Object.keys(Z).forEach(function(M){Z[M]=u(x,Z[M],U,M.replace("Map",""),r)});var X=Z["".concat(I,"Map")],oe=aIe(X),ue=p(x,_e(_e({},Z),{},{dataStartIndex:S,dataEndIndex:_,updateId:k,graphicalItems:G,stackGroups:Y,offset:U}));return _e(_e({formattedGraphicalItems:ue,graphicalItems:G,offset:U,stackGroups:Y},oe),Z)},g=function(v){function y(b){var x,S,_;return U6e(this,y),_=V6e(this,y,[b]),yt(_,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),yt(_,"accessibilityManager",new j6e),yt(_,"handleLegendBBoxUpdate",function(k){if(k){var E=_.state,O=E.dataStartIndex,R=E.dataEndIndex,$=E.updateId;_.setState(_e({legendBBox:k},h({props:_.props,dataStartIndex:O,dataEndIndex:R,updateId:$},_e(_e({},_.state),{},{legendBBox:k}))))}}),yt(_,"handleReceiveSyncEvent",function(k,E,O){if(_.props.syncId===k){if(O===_.eventEmitterSymbol&&typeof _.props.syncMethod!="function")return;_.applySyncEvent(E)}}),yt(_,"handleBrushChange",function(k){var E=k.startIndex,O=k.endIndex;if(E!==_.state.dataStartIndex||O!==_.state.dataEndIndex){var R=_.state.updateId;_.setState(function(){return _e({dataStartIndex:E,dataEndIndex:O},h({props:_.props,dataStartIndex:E,dataEndIndex:O,updateId:R},_.state))}),_.triggerSyncEvent({dataStartIndex:E,dataEndIndex:O})}}),yt(_,"handleMouseEnter",function(k){var E=_.getMouseInfo(k);if(E){var O=_e(_e({},E),{},{isTooltipActive:!0});_.setState(O),_.triggerSyncEvent(O);var R=_.props.onMouseEnter;wt(R)&&R(O,k)}}),yt(_,"triggeredAfterMouseMove",function(k){var E=_.getMouseInfo(k),O=E?_e(_e({},E),{},{isTooltipActive:!0}):{isTooltipActive:!1};_.setState(O),_.triggerSyncEvent(O);var R=_.props.onMouseMove;wt(R)&&R(O,k)}),yt(_,"handleItemMouseEnter",function(k){_.setState(function(){return{isTooltipActive:!0,activeItem:k,activePayload:k.tooltipPayload,activeCoordinate:k.tooltipPosition||{x:k.cx,y:k.cy}}})}),yt(_,"handleItemMouseLeave",function(){_.setState(function(){return{isTooltipActive:!1}})}),yt(_,"handleMouseMove",function(k){k.persist(),_.throttleTriggeredAfterMouseMove(k)}),yt(_,"handleMouseLeave",function(k){_.throttleTriggeredAfterMouseMove.cancel();var E={isTooltipActive:!1};_.setState(E),_.triggerSyncEvent(E);var O=_.props.onMouseLeave;wt(O)&&O(E,k)}),yt(_,"handleOuterEvent",function(k){var E=cve(k),O=So(_.props,"".concat(E));if(E&&wt(O)){var R,$;/.*touch.*/i.test(E)?$=_.getMouseInfo(k.changedTouches[0]):$=_.getMouseInfo(k),O((R=$)!==null&&R!==void 0?R:{},k)}}),yt(_,"handleClick",function(k){var E=_.getMouseInfo(k);if(E){var O=_e(_e({},E),{},{isTooltipActive:!0});_.setState(O),_.triggerSyncEvent(O);var R=_.props.onClick;wt(R)&&R(O,k)}}),yt(_,"handleMouseDown",function(k){var E=_.props.onMouseDown;if(wt(E)){var O=_.getMouseInfo(k);E(O,k)}}),yt(_,"handleMouseUp",function(k){var E=_.props.onMouseUp;if(wt(E)){var O=_.getMouseInfo(k);E(O,k)}}),yt(_,"handleTouchMove",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&_.throttleTriggeredAfterMouseMove(k.changedTouches[0])}),yt(_,"handleTouchStart",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&_.handleMouseDown(k.changedTouches[0])}),yt(_,"handleTouchEnd",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&_.handleMouseUp(k.changedTouches[0])}),yt(_,"handleDoubleClick",function(k){var E=_.props.onDoubleClick;if(wt(E)){var O=_.getMouseInfo(k);E(O,k)}}),yt(_,"handleContextMenu",function(k){var E=_.props.onContextMenu;if(wt(E)){var O=_.getMouseInfo(k);E(O,k)}}),yt(_,"triggerSyncEvent",function(k){_.props.syncId!==void 0&&YA.emit(XA,_.props.syncId,k,_.eventEmitterSymbol)}),yt(_,"applySyncEvent",function(k){var E=_.props,O=E.layout,R=E.syncMethod,$=_.state.updateId,N=k.dataStartIndex,C=k.dataEndIndex;if(k.dataStartIndex!==void 0||k.dataEndIndex!==void 0)_.setState(_e({dataStartIndex:N,dataEndIndex:C},h({props:_.props,dataStartIndex:N,dataEndIndex:C,updateId:$},_.state)));else if(k.activeTooltipIndex!==void 0){var D=k.chartX,I=k.chartY,G=k.activeTooltipIndex,Y=_.state,Z=Y.offset,U=Y.tooltipTicks;if(!Z)return;if(typeof R=="function")G=R(U,k);else if(R==="value"){G=-1;for(var X=0;X=0){var ve,fe;if(D.dataKey&&!D.allowDuplicatedCategory){var je=typeof D.dataKey=="function"?de:"payload.".concat(D.dataKey.toString());ve=Tw(X,je,G),fe=oe&&ue&&Tw(ue,je,G)}else ve=X==null?void 0:X[I],fe=oe&&ue&&ue[I];if(le||ie){var Te=k.props.activeIndex!==void 0?k.props.activeIndex:I;return[P.cloneElement(k,_e(_e(_e({},R.props),se),{},{activeIndex:Te})),null,null]}if(!zt(ve))return[ae].concat(jm(_.renderActivePoints({item:R,activePoint:ve,basePoint:fe,childIndex:I,isRange:oe})))}else{var Q,Ce=(Q=_.getItemByXY(_.state.activeCoordinate))!==null&&Q!==void 0?Q:{graphicalItem:ae},Ke=Ce.graphicalItem,Fe=Ke.item,ke=Fe===void 0?k:Fe,rt=Ke.childIndex,Me=_e(_e(_e({},R.props),se),{},{activeIndex:rt});return[P.cloneElement(ke,Me),null,null]}return oe?[ae,null,null]:[ae,null]}),yt(_,"renderCustomized",function(k,E,O){return P.cloneElement(k,_e(_e({key:"recharts-customized-".concat(O)},_.props),_.state))}),yt(_,"renderMap",{CartesianGrid:{handler:Zb,once:!0},ReferenceArea:{handler:_.renderReferenceElement},ReferenceLine:{handler:Zb},ReferenceDot:{handler:_.renderReferenceElement},XAxis:{handler:Zb},YAxis:{handler:Zb},Brush:{handler:_.renderBrush,once:!0},Bar:{handler:_.renderGraphicChild},Line:{handler:_.renderGraphicChild},Area:{handler:_.renderGraphicChild},Radar:{handler:_.renderGraphicChild},RadialBar:{handler:_.renderGraphicChild},Scatter:{handler:_.renderGraphicChild},Pie:{handler:_.renderGraphicChild},Funnel:{handler:_.renderGraphicChild},Tooltip:{handler:_.renderCursor,once:!0},PolarGrid:{handler:_.renderPolarGrid,once:!0},PolarAngleAxis:{handler:_.renderPolarAxis},PolarRadiusAxis:{handler:_.renderPolarAxis},Customized:{handler:_.renderCustomized}}),_.clipPathId="".concat((x=b.id)!==null&&x!==void 0?x:n1("recharts"),"-clip"),_.throttleTriggeredAfterMouseMove=jq(_.triggeredAfterMouseMove,(S=b.throttleDelay)!==null&&S!==void 0?S:1e3/60),_.state={},_}return G6e(y,v),H6e(y,[{key:"componentDidMount",value:function(){var x,S;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(x=this.props.margin.left)!==null&&x!==void 0?x:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var x=this.props,S=x.children,_=x.data,k=x.height,E=x.layout,O=Ra(S,En);if(O){var R=O.props.defaultIndex;if(!(typeof R!="number"||R<0||R>this.state.tooltipTicks.length-1)){var $=this.state.tooltipTicks[R]&&this.state.tooltipTicks[R].value,N=dE(this.state,_,R,$),C=this.state.tooltipTicks[R].coordinate,D=(this.state.offset.top+k)/2,I=E==="horizontal",G=I?{x:C,y:D}:{y:C,x:D},Y=this.state.formattedGraphicalItems.find(function(U){var X=U.item;return X.type.name==="Scatter"});Y&&(G=_e(_e({},G),Y.props.points[R].tooltipPosition),N=Y.props.points[R].tooltipPayload);var Z={activeTooltipIndex:R,isTooltipActive:!0,activeLabel:$,activePayload:N,activeCoordinate:G};this.setState(Z),this.renderCursor(O),this.accessibilityManager.setIndex(R)}}}},{key:"getSnapshotBeforeUpdate",value:function(x,S){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==S.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==x.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==x.margin){var _,k;this.accessibilityManager.setDetails({offset:{left:(_=this.props.margin.left)!==null&&_!==void 0?_:0,top:(k=this.props.margin.top)!==null&&k!==void 0?k:0}})}return null}},{key:"componentDidUpdate",value:function(x){Uj([Ra(x.children,En)],[Ra(this.props.children,En)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var x=Ra(this.props.children,En);if(x&&typeof x.props.shared=="boolean"){var S=x.props.shared?"axis":"item";return s.indexOf(S)>=0?S:a}return a}},{key:"getMouseInfo",value:function(x){if(!this.container)return null;var S=this.container,_=S.getBoundingClientRect(),k=MSe(_),E={chartX:Math.round(x.pageX-k.left),chartY:Math.round(x.pageY-k.top)},O=_.width/S.offsetWidth||1,R=this.inRange(E.chartX,E.chartY,O);if(!R)return null;var $=this.state,N=$.xAxisMap,C=$.yAxisMap,D=this.getTooltipEventType(),I=T$(this.state,this.props.data,this.props.layout,R);if(D!=="axis"&&N&&C){var G=nu(N).scale,Y=nu(C).scale,Z=G&&G.invert?G.invert(E.chartX):null,U=Y&&Y.invert?Y.invert(E.chartY):null;return _e(_e({},E),{},{xValue:Z,yValue:U},I)}return I?_e(_e({},E),I):null}},{key:"inRange",value:function(x,S){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,k=this.props.layout,E=x/_,O=S/_;if(k==="horizontal"||k==="vertical"){var R=this.state.offset,$=E>=R.left&&E<=R.left+R.width&&O>=R.top&&O<=R.top+R.height;return $?{x:E,y:O}:null}var N=this.state,C=N.angleAxisMap,D=N.radiusAxisMap;if(C&&D){var I=nu(C);return r8({x:E,y:O},I)}return null}},{key:"parseEventsOfWrapper",value:function(){var x=this.props.children,S=this.getTooltipEventType(),_=Ra(x,En),k={};_&&S==="axis"&&(_.props.trigger==="click"?k={onClick:this.handleClick}:k={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var E=Ow(this.props,this.handleOuterEvent);return _e(_e({},E),k)}},{key:"addListener",value:function(){YA.on(XA,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){YA.removeListener(XA,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(x,S,_){for(var k=this.state.formattedGraphicalItems,E=0,O=k.length;E-1&&e.splice(r,1)}const ol=(e,t,r)=>r>t?t:r{},Nm=()=>{};const mc={},aK=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function oK(e){return typeof e=="object"&&e!==null}const sK=e=>/^0[^.\s]+$/u.test(e);function lK(e){let t;return()=>(t===void 0&&(t=e()),t)}const Ao=e=>e,fIe=(e,t)=>r=>t(e(r)),d1=(...e)=>e.reduce(fIe),_0=(e,t,r)=>{const n=t-e;return n===0?1:(r-e)/n};class pO{constructor(){this.subscriptions=[]}add(t){return hO(this.subscriptions,t),()=>O2(this.subscriptions,t)}notify(t,r,n){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,r,n);else for(let a=0;ae*1e3,xo=e=>e/1e3;function cK(e,t){return t?e*(1e3/t):0}const uK=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,hIe=1e-7,pIe=12;function mIe(e,t,r,n,i){let a,o,s=0;do o=t+(r-t)/2,a=uK(o,n,i)-e,a>0?r=o:t=o;while(Math.abs(a)>hIe&&++smIe(a,0,1,e,r);return a=>a===0||a===1?a:uK(i(a),t,n)}const dK=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,fK=e=>t=>1-e(1-t),hK=f1(.33,1.53,.69,.99),mO=fK(hK),pK=dK(mO),mK=e=>(e*=2)<1?.5*mO(e):.5*(2-Math.pow(2,-10*(e-1))),gO=e=>1-Math.sin(Math.acos(e)),gK=fK(gO),vK=dK(gO),gIe=f1(.42,0,1,1),vIe=f1(0,0,.58,1),yK=f1(.42,0,.58,1),yIe=e=>Array.isArray(e)&&typeof e[0]!="number",bK=e=>Array.isArray(e)&&typeof e[0]=="number",L$={linear:Ao,easeIn:gIe,easeInOut:yK,easeOut:vIe,circIn:gO,circInOut:vK,circOut:gK,backIn:mO,backInOut:pK,backOut:hK,anticipate:mK},bIe=e=>typeof e=="string",I$=e=>{if(bK(e)){Nm(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,r,n,i]=e;return f1(t,r,n,i)}else if(bIe(e))return Nm(L$[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),L$[e];return e},ex=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],M$={value:null,addProjectionMetrics:null};function xIe(e,t){let r=new Set,n=new Set,i=!1,a=!1;const o=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1},l=0;function c(f){o.has(f)&&(u.schedule(f),e()),l++,f(s)}const u={schedule:(f,p=!1,h=!1)=>{const m=h&&i?r:n;return p&&o.add(f),m.has(f)||m.add(f),f},cancel:f=>{n.delete(f),o.delete(f)},process:f=>{if(s=f,i){a=!0;return}i=!0,[r,n]=[n,r],r.forEach(c),t&&M$.value&&M$.value.frameloop[t].push(l),l=0,r.clear(),i=!1,a&&(a=!1,u.process(f))}};return u}const wIe=40;function xK(e,t){let r=!1,n=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>r=!0,o=ex.reduce((x,S)=>(x[S]=xIe(a,t?S:void 0),x),{}),{setup:s,read:l,resolveKeyframes:c,preUpdate:u,update:f,preRender:p,render:h,postRender:g}=o,m=()=>{const x=mc.useManualTiming?i.timestamp:performance.now();r=!1,mc.useManualTiming||(i.delta=n?1e3/60:Math.max(Math.min(x-i.timestamp,wIe),1)),i.timestamp=x,i.isProcessing=!0,s.process(i),l.process(i),c.process(i),u.process(i),f.process(i),p.process(i),h.process(i),g.process(i),i.isProcessing=!1,r&&t&&(n=!1,e(m))},v=()=>{r=!0,n=!0,i.isProcessing||e(m)};return{schedule:ex.reduce((x,S)=>{const _=o[S];return x[S]=(k,E=!1,O=!1)=>(r||v(),_.schedule(k,E,O)),x},{}),cancel:x=>{for(let S=0;S(Ix===void 0&&Gi.set(gi.isProcessing||mc.useManualTiming?gi.timestamp:performance.now()),Ix),set:e=>{Ix=e,queueMicrotask(_Ie)}},wK=e=>t=>typeof t=="string"&&t.startsWith(e),_K=wK("--"),SIe=wK("var(--"),vO=e=>SIe(e)?AIe.test(e.split("/*")[0].trim()):!1,AIe=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function $$(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const ug={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},S0={...ug,transform:e=>ol(0,1,e)},tx={...ug,default:1},Jv=e=>Math.round(e*1e5)/1e5,yO=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function PIe(e){return e==null}const kIe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,bO=(e,t)=>r=>!!(typeof r=="string"&&kIe.test(r)&&r.startsWith(e)||t&&!PIe(r)&&Object.prototype.hasOwnProperty.call(r,t)),SK=(e,t,r)=>n=>{if(typeof n!="string")return n;const[i,a,o,s]=n.match(yO);return{[e]:parseFloat(i),[t]:parseFloat(a),[r]:parseFloat(o),alpha:s!==void 0?parseFloat(s):1}},jIe=e=>ol(0,255,e),QA={...ug,transform:e=>Math.round(jIe(e))},qd={test:bO("rgb","red"),parse:SK("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+QA.transform(e)+", "+QA.transform(t)+", "+QA.transform(r)+", "+Jv(S0.transform(n))+")"};function NIe(e){let t="",r="",n="",i="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),n=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),n=e.substring(3,4),i=e.substring(4,5),t+=t,r+=r,n+=n,i+=i),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}const fE={test:bO("#"),parse:NIe,transform:qd.transform},h1=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Kc=h1("deg"),Qs=h1("%"),We=h1("px"),EIe=h1("vh"),CIe=h1("vw"),D$={...Qs,parse:e=>Qs.parse(e)/100,transform:e=>Qs.transform(e*100)},Xh={test:bO("hsl","hue"),parse:SK("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+Qs.transform(Jv(t))+", "+Qs.transform(Jv(r))+", "+Jv(S0.transform(n))+")"},Nn={test:e=>qd.test(e)||fE.test(e)||Xh.test(e),parse:e=>qd.test(e)?qd.parse(e):Xh.test(e)?Xh.parse(e):fE.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?qd.transform(e):Xh.transform(e),getAnimatableNone:e=>{const t=Nn.parse(e);return t.alpha=0,Nn.transform(t)}},TIe=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function OIe(e){var t,r;return isNaN(e)&&typeof e=="string"&&(((t=e.match(yO))==null?void 0:t.length)||0)+(((r=e.match(TIe))==null?void 0:r.length)||0)>0}const AK="number",PK="color",RIe="var",LIe="var(",F$="${}",IIe=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function A0(e){const t=e.toString(),r=[],n={color:[],number:[],var:[]},i=[];let a=0;const s=t.replace(IIe,l=>(Nn.test(l)?(n.color.push(a),i.push(PK),r.push(Nn.parse(l))):l.startsWith(LIe)?(n.var.push(a),i.push(RIe),r.push(l)):(n.number.push(a),i.push(AK),r.push(parseFloat(l))),++a,F$)).split(F$);return{values:r,split:s,indexes:n,types:i}}function kK(e){return A0(e).values}function jK(e){const{split:t,types:r}=A0(e),n=t.length;return i=>{let a="";for(let o=0;otypeof e=="number"?0:Nn.test(e)?Nn.getAnimatableNone(e):e;function $Ie(e){const t=kK(e);return jK(e)(t.map(MIe))}const us={test:OIe,parse:kK,createTransformer:jK,getAnimatableNone:$Ie};function eP(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function DIe({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,t/=100,r/=100;let i=0,a=0,o=0;if(!t)i=a=o=r;else{const s=r<.5?r*(1+t):r+t-r*t,l=2*r-s;i=eP(l,s,e+1/3),a=eP(l,s,e),o=eP(l,s,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:n}}function R2(e,t){return r=>r>0?t:e}const tn=(e,t,r)=>e+(t-e)*r,tP=(e,t,r)=>{const n=e*e,i=r*(t*t-n)+n;return i<0?0:Math.sqrt(i)},FIe=[fE,qd,Xh],BIe=e=>FIe.find(t=>t.test(e));function B$(e){const t=BIe(e);if(O_(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let r=t.parse(e);return t===Xh&&(r=DIe(r)),r}const U$=(e,t)=>{const r=B$(e),n=B$(t);if(!r||!n)return R2(e,t);const i={...r};return a=>(i.red=tP(r.red,n.red,a),i.green=tP(r.green,n.green,a),i.blue=tP(r.blue,n.blue,a),i.alpha=tn(r.alpha,n.alpha,a),qd.transform(i))},hE=new Set(["none","hidden"]);function UIe(e,t){return hE.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}function zIe(e,t){return r=>tn(e,t,r)}function xO(e){return typeof e=="number"?zIe:typeof e=="string"?vO(e)?R2:Nn.test(e)?U$:qIe:Array.isArray(e)?NK:typeof e=="object"?Nn.test(e)?U$:HIe:R2}function NK(e,t){const r=[...e],n=r.length,i=e.map((a,o)=>xO(a)(a,t[o]));return a=>{for(let o=0;o{for(const a in n)r[a]=n[a](i);return r}}function VIe(e,t){const r=[],n={color:0,var:0,number:0};for(let i=0;i{const r=us.createTransformer(t),n=A0(e),i=A0(t);return n.indexes.var.length===i.indexes.var.length&&n.indexes.color.length===i.indexes.color.length&&n.indexes.number.length>=i.indexes.number.length?hE.has(e)&&!i.values.length||hE.has(t)&&!n.values.length?UIe(e,t):d1(NK(VIe(n,i),i.values),r):(O_(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),R2(e,t))};function EK(e,t,r){return typeof e=="number"&&typeof t=="number"&&typeof r=="number"?tn(e,t,r):xO(e)(e,t)}const WIe=e=>{const t=({timestamp:r})=>e(r);return{start:(r=!0)=>Fr.update(t,r),stop:()=>Bu(t),now:()=>gi.isProcessing?gi.timestamp:Gi.now()}},CK=(e,t,r=10)=>{let n="";const i=Math.max(Math.round(t/r),2);for(let a=0;a=L2?1/0:t}function GIe(e,t=100,r){const n=r({...e,keyframes:[0,t]}),i=Math.min(wO(n),L2);return{type:"keyframes",ease:a=>n.next(i*a).value/t,duration:xo(i)}}const KIe=5;function TK(e,t,r){const n=Math.max(t-KIe,0);return cK(r-e(n),t-n)}const Qr={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},rP=.001;function YIe({duration:e=Qr.duration,bounce:t=Qr.bounce,velocity:r=Qr.velocity,mass:n=Qr.mass}){let i,a;O_(e<=Po(Qr.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-t;o=ol(Qr.minDamping,Qr.maxDamping,o),e=ol(Qr.minDuration,Qr.maxDuration,xo(e)),o<1?(i=c=>{const u=c*o,f=u*e,p=u-r,h=pE(c,o),g=Math.exp(-f);return rP-p/h*g},a=c=>{const f=c*o*e,p=f*r+r,h=Math.pow(o,2)*Math.pow(c,2)*e,g=Math.exp(-f),m=pE(Math.pow(c,2),o);return(-i(c)+rP>0?-1:1)*((p-h)*g)/m}):(i=c=>{const u=Math.exp(-c*e),f=(c-r)*e+1;return-rP+u*f},a=c=>{const u=Math.exp(-c*e),f=(r-c)*(e*e);return u*f});const s=5/e,l=JIe(i,a,s);if(e=Po(e),isNaN(l))return{stiffness:Qr.stiffness,damping:Qr.damping,duration:e};{const c=Math.pow(l,2)*n;return{stiffness:c,damping:o*2*Math.sqrt(n*c),duration:e}}}const XIe=12;function JIe(e,t,r){let n=r;for(let i=1;ie[r]!==void 0)}function eMe(e){let t={velocity:Qr.velocity,stiffness:Qr.stiffness,damping:Qr.damping,mass:Qr.mass,isResolvedFromDuration:!1,...e};if(!z$(e,QIe)&&z$(e,ZIe))if(t.velocity=0,e.visualDuration){const r=e.visualDuration,n=2*Math.PI/(r*1.2),i=n*n,a=2*ol(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Qr.mass,stiffness:i,damping:a}}else{const r=YIe({...e,velocity:0});t={...t,...r,mass:Qr.mass},t.isResolvedFromDuration=!0}return t}function I2(e=Qr.visualDuration,t=Qr.bounce){const r=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:n,restDelta:i}=r;const a=r.keyframes[0],o=r.keyframes[r.keyframes.length-1],s={done:!1,value:a},{stiffness:l,damping:c,mass:u,duration:f,velocity:p,isResolvedFromDuration:h}=eMe({...r,velocity:-xo(r.velocity||0)}),g=p||0,m=c/(2*Math.sqrt(l*u)),v=o-a,y=xo(Math.sqrt(l/u)),b=Math.abs(v)<5;n||(n=b?Qr.restSpeed.granular:Qr.restSpeed.default),i||(i=b?Qr.restDelta.granular:Qr.restDelta.default);let x;if(m<1){const _=pE(y,m);x=k=>{const E=Math.exp(-m*y*k);return o-E*((g+m*y*v)/_*Math.sin(_*k)+v*Math.cos(_*k))}}else if(m===1)x=_=>o-Math.exp(-y*_)*(v+(g+y*v)*_);else{const _=y*Math.sqrt(m*m-1);x=k=>{const E=Math.exp(-m*y*k),O=Math.min(_*k,300);return o-E*((g+m*y*v)*Math.sinh(O)+_*v*Math.cosh(O))/_}}const S={calculatedDuration:h&&f||null,next:_=>{const k=x(_);if(h)s.done=_>=f;else{let E=_===0?g:0;m<1&&(E=_===0?Po(g):TK(x,_,k));const O=Math.abs(E)<=n,R=Math.abs(o-k)<=i;s.done=O&&R}return s.value=s.done?o:k,s},toString:()=>{const _=Math.min(wO(S),L2),k=CK(E=>S.next(_*E).value,_,30);return _+"ms "+k},toTransition:()=>{}};return S}I2.applyToOptions=e=>{const t=GIe(e,100,I2);return e.ease=t.ease,e.duration=Po(t.duration),e.type="keyframes",e};function mE({keyframes:e,velocity:t=0,power:r=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:l,restDelta:c=.5,restSpeed:u}){const f=e[0],p={done:!1,value:f},h=O=>s!==void 0&&Ol,g=O=>s===void 0?l:l===void 0||Math.abs(s-O)-m*Math.exp(-O/n),x=O=>y+b(O),S=O=>{const R=b(O),$=x(O);p.done=Math.abs(R)<=c,p.value=p.done?y:$};let _,k;const E=O=>{h(p.value)&&(_=O,k=I2({keyframes:[p.value,g(p.value)],velocity:TK(x,O,p.value),damping:i,stiffness:a,restDelta:c,restSpeed:u}))};return E(0),{calculatedDuration:null,next:O=>{let R=!1;return!k&&_===void 0&&(R=!0,S(O),E(O)),_!==void 0&&O>=_?k.next(O-_):(!R&&S(O),p)}}}function tMe(e,t,r){const n=[],i=r||mc.mix||EK,a=e.length-1;for(let o=0;ot[0];if(a===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=tMe(t,n,i),l=s.length,c=u=>{if(o&&u1)for(;fc(ol(e[0],e[a-1],u)):c}function nMe(e,t){const r=e[e.length-1];for(let n=1;n<=t;n++){const i=_0(0,t,n);e.push(tn(r,1,i))}}function iMe(e){const t=[0];return nMe(t,e.length-1),t}function aMe(e,t){return e.map(r=>r*t)}function oMe(e,t){return e.map(()=>t||yK).splice(0,e.length-1)}function Zv({duration:e=300,keyframes:t,times:r,ease:n="easeInOut"}){const i=yIe(n)?n.map(I$):I$(n),a={done:!1,value:t[0]},o=aMe(r&&r.length===t.length?r:iMe(t),e),s=rMe(o,t,{ease:Array.isArray(i)?i:oMe(t,i)});return{calculatedDuration:e,next:l=>(a.value=s(l),a.done=l>=e,a)}}const sMe=e=>e!==null;function _O(e,{repeat:t,repeatType:r="loop"},n,i=1){const a=e.filter(sMe),s=i<0||t&&r!=="loop"&&t%2===1?0:a.length-1;return!s||n===void 0?a[s]:n}const lMe={decay:mE,inertia:mE,tween:Zv,keyframes:Zv,spring:I2};function OK(e){typeof e.type=="string"&&(e.type=lMe[e.type])}class SO{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,r){return this.finished.then(t,r)}}const cMe=e=>e/100;class AO extends SO{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var n,i;const{motionValue:r}=this.options;r&&r.updatedAt!==Gi.now()&&this.tick(Gi.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(n=this.options).onStop)==null||i.call(n))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;OK(t);const{type:r=Zv,repeat:n=0,repeatDelay:i=0,repeatType:a,velocity:o=0}=t;let{keyframes:s}=t;const l=r||Zv;l!==Zv&&typeof s[0]!="number"&&(this.mixKeyframes=d1(cMe,EK(s[0],s[1])),s=[0,100]);const c=l({...t,keyframes:s});a==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...s].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=wO(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=c}updateTime(t){const r=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=r}tick(t,r=!1){const{generator:n,totalDuration:i,mixKeyframes:a,mirroredGenerator:o,resolvedDuration:s,calculatedDuration:l}=this;if(this.startTime===null)return n.next(0);const{delay:c=0,keyframes:u,repeat:f,repeatType:p,repeatDelay:h,type:g,onUpdate:m,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),r?this.currentTime=t:this.updateTime(t);const y=this.currentTime-c*(this.playbackSpeed>=0?1:-1),b=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let x=this.currentTime,S=n;if(f){const O=Math.min(this.currentTime,i)/s;let R=Math.floor(O),$=O%1;!$&&O>=1&&($=1),$===1&&R--,R=Math.min(R,f+1),!!(R%2)&&(p==="reverse"?($=1-$,h&&($-=h/s)):p==="mirror"&&(S=o)),x=ol(0,1,$)*s}const _=b?{done:!1,value:u[0]}:S.next(x);a&&(_.value=a(_.value));let{done:k}=_;!b&&l!==null&&(k=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const E=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&k);return E&&g!==mE&&(_.value=_O(u,this.options,v,this.speed)),m&&m(_.value),E&&this.finish(),_}then(t,r){return this.finished.then(t,r)}get duration(){return xo(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+xo(t)}get time(){return xo(this.currentTime)}set time(t){var r;t=Po(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(r=this.driver)==null||r.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Gi.now());const r=this.playbackSpeed!==t;this.playbackSpeed=t,r&&(this.time=xo(this.currentTime))}play(){var i,a;if(this.isStopped)return;const{driver:t=WIe,startTime:r}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),(a=(i=this.options).onPlay)==null||a.call(i);const n=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=n):this.holdTime!==null?this.startTime=n-this.holdTime:this.startTime||(this.startTime=r??n),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Gi.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,r;this.notifyFinished(),this.teardown(),this.state="finished",(r=(t=this.options).onComplete)==null||r.call(t)}cancel(){var t,r;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(r=(t=this.options).onCancel)==null||r.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var r;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(r=this.driver)==null||r.stop(),t.observe(this)}}function uMe(e){for(let t=1;te*180/Math.PI,gE=e=>{const t=Wd(Math.atan2(e[1],e[0]));return vE(t)},dMe={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:gE,rotateZ:gE,skewX:e=>Wd(Math.atan(e[1])),skewY:e=>Wd(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},vE=e=>(e=e%360,e<0&&(e+=360),e),H$=gE,V$=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),q$=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),fMe={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:V$,scaleY:q$,scale:e=>(V$(e)+q$(e))/2,rotateX:e=>vE(Wd(Math.atan2(e[6],e[5]))),rotateY:e=>vE(Wd(Math.atan2(-e[2],e[0]))),rotateZ:H$,rotate:H$,skewX:e=>Wd(Math.atan(e[4])),skewY:e=>Wd(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function yE(e){return e.includes("scale")?1:0}function bE(e,t){if(!e||e==="none")return yE(t);const r=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,i;if(r)n=fMe,i=r;else{const s=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=dMe,i=s}if(!i)return yE(t);const a=n[t],o=i[1].split(",").map(pMe);return typeof a=="function"?a(o):o[a]}const hMe=(e,t)=>{const{transform:r="none"}=getComputedStyle(e);return bE(r,t)};function pMe(e){return parseFloat(e.trim())}const dg=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],fg=new Set(dg),W$=e=>e===ug||e===We,mMe=new Set(["x","y","z"]),gMe=dg.filter(e=>!mMe.has(e));function vMe(e){const t=[];return gMe.forEach(r=>{const n=e.getValue(r);n!==void 0&&(t.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),t}const yu={width:({x:e},{paddingLeft:t="0",paddingRight:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),height:({y:e},{paddingTop:t="0",paddingBottom:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>bE(t,"x"),y:(e,{transform:t})=>bE(t,"y")};yu.translateX=yu.x;yu.translateY=yu.y;const hf=new Set;let xE=!1,wE=!1,_E=!1;function RK(){if(wE){const e=Array.from(hf).filter(n=>n.needsMeasurement),t=new Set(e.map(n=>n.element)),r=new Map;t.forEach(n=>{const i=vMe(n);i.length&&(r.set(n,i),n.render())}),e.forEach(n=>n.measureInitialState()),t.forEach(n=>{n.render();const i=r.get(n);i&&i.forEach(([a,o])=>{var s;(s=n.getValue(a))==null||s.set(o)})}),e.forEach(n=>n.measureEndState()),e.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}wE=!1,xE=!1,hf.forEach(e=>e.complete(_E)),hf.clear()}function LK(){hf.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(wE=!0)})}function yMe(){_E=!0,LK(),RK(),_E=!1}class PO{constructor(t,r,n,i,a,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=r,this.name=n,this.motionValue=i,this.element=a,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(hf.add(this),xE||(xE=!0,Fr.read(LK),Fr.resolveKeyframes(RK))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:r,element:n,motionValue:i}=this;if(t[0]===null){const a=i==null?void 0:i.get(),o=t[t.length-1];if(a!==void 0)t[0]=a;else if(n&&r){const s=n.readValue(r,o);s!=null&&(t[0]=s)}t[0]===void 0&&(t[0]=o),i&&a===void 0&&i.set(t[0])}uMe(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),hf.delete(this)}cancel(){this.state==="scheduled"&&(hf.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const bMe=e=>e.startsWith("--");function xMe(e,t,r){bMe(t)?e.style.setProperty(t,r):e.style[t]=r}const wMe={};function IK(e,t){const r=lK(e);return()=>wMe[t]??r()}const _Me=IK(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),MK=IK(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),jv=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`,G$={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:jv([0,.65,.55,1]),circOut:jv([.55,0,1,.45]),backIn:jv([.31,.01,.66,-.59]),backOut:jv([.33,1.53,.69,.99])};function $K(e,t){if(e)return typeof e=="function"?MK()?CK(e,t):"ease-out":bK(e)?jv(e):Array.isArray(e)?e.map(r=>$K(r,t)||G$.easeOut):G$[e]}function SMe(e,t,r,{delay:n=0,duration:i=300,repeat:a=0,repeatType:o="loop",ease:s="easeOut",times:l}={},c=void 0){const u={[t]:r};l&&(u.offset=l);const f=$K(s,i);Array.isArray(f)&&(u.easing=f);const p={delay:n,duration:i,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:a+1,direction:o==="reverse"?"alternate":"normal"};return c&&(p.pseudoElement=c),e.animate(u,p)}function DK(e){return typeof e=="function"&&"applyToOptions"in e}function AMe({type:e,...t}){return DK(e)&&MK()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class FK extends SO{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:r,name:n,keyframes:i,pseudoElement:a,allowFlatten:o=!1,finalKeyframe:s,onComplete:l}=t;this.isPseudoElement=!!a,this.allowFlatten=o,this.options=t,Nm(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const c=AMe(t);this.animation=SMe(r,n,i,c,a),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const u=_O(i,this.options,s,this.speed);this.updateMotionValue?this.updateMotionValue(u):xMe(r,n,u),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,r;(r=(t=this.animation).finish)==null||r.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var r,n,i;const t=(r=this.options)==null?void 0:r.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((i=(n=this.animation).commitStyles)==null||i.call(n))}get duration(){var r,n;const t=((n=(r=this.animation.effect)==null?void 0:r.getComputedTiming)==null?void 0:n.call(r).duration)||0;return xo(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+xo(t)}get time(){return xo(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Po(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:r}){var n;return this.allowFlatten&&((n=this.animation.effect)==null||n.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&_Me()?(this.animation.timeline=t,Ao):r(this)}}const BK={anticipate:mK,backInOut:pK,circInOut:vK};function PMe(e){return e in BK}function kMe(e){typeof e.ease=="string"&&PMe(e.ease)&&(e.ease=BK[e.ease])}const nP=10;class jMe extends FK{constructor(t){kMe(t),OK(t),super(t),t.startTime!==void 0&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:r,onUpdate:n,onComplete:i,element:a,...o}=this.options;if(!r)return;if(t!==void 0){r.set(t);return}const s=new AO({...o,autoplay:!1}),l=Math.max(nP,Gi.now()-this.startTime),c=ol(0,nP,l-nP);r.setWithVelocity(s.sample(Math.max(0,l-c)).value,s.sample(l).value,c),s.stop()}}const K$=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(us.test(e)||e==="0")&&!e.startsWith("url("));function NMe(e){const t=e[0];if(e.length===1)return!0;for(let r=0;rObject.hasOwnProperty.call(Element.prototype,"animate"));function OMe(e){var u;const{motionValue:t,name:r,repeatDelay:n,repeatType:i,damping:a,type:o}=e;if(!(((u=t==null?void 0:t.owner)==null?void 0:u.current)instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=t.owner.getProps();return TMe()&&r&&CMe.has(r)&&(r!=="transform"||!c)&&!l&&!n&&i!=="mirror"&&a!==0&&o!=="inertia"}const RMe=40;class LMe extends SO{constructor({autoplay:t=!0,delay:r=0,type:n="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:o="loop",keyframes:s,name:l,motionValue:c,element:u,...f}){var g;super(),this.stop=()=>{var m,v;this._animation&&(this._animation.stop(),(m=this.stopTimeline)==null||m.call(this)),(v=this.keyframeResolver)==null||v.cancel()},this.createdAt=Gi.now();const p={autoplay:t,delay:r,type:n,repeat:i,repeatDelay:a,repeatType:o,name:l,motionValue:c,element:u,...f},h=(u==null?void 0:u.KeyframeResolver)||PO;this.keyframeResolver=new h(s,(m,v,y)=>this.onKeyframesResolved(m,v,p,!y),l,c,u),(g=this.keyframeResolver)==null||g.scheduleResolve()}onKeyframesResolved(t,r,n,i){var v,y;this.keyframeResolver=void 0;const{name:a,type:o,velocity:s,delay:l,isHandoff:c,onUpdate:u}=n;this.resolvedAt=Gi.now(),EMe(t,a,o,s)||((mc.instantAnimations||!l)&&(u==null||u(_O(t,n,r))),t[0]=t[t.length-1],SE(n),n.repeat=0);const p={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>RMe?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:r,...n,keyframes:t},h=!c&&OMe(p),g=(y=(v=p.motionValue)==null?void 0:v.owner)==null?void 0:y.current,m=h?new jMe({...p,element:g}):new AO(p);m.finished.then(()=>{this.notifyFinished()}).catch(Ao),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(t,r){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),yMe()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}function UK(e,t,r,n=0,i=1){const a=Array.from(e).sort((c,u)=>c.sortNodePosition(u)).indexOf(t),o=e.size,s=(o-1)*n;return typeof r=="function"?r(a,o):i===1?a*n:s-a*n}const IMe=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function MMe(e){const t=IMe.exec(e);if(!t)return[,];const[,r,n,i]=t;return[`--${r??n}`,i]}const $Me=4;function zK(e,t,r=1){Nm(r<=$Me,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[n,i]=MMe(e);if(!n)return;const a=window.getComputedStyle(t).getPropertyValue(n);if(a){const o=a.trim();return aK(o)?parseFloat(o):o}return vO(i)?zK(i,t,r+1):i}const DMe={type:"spring",stiffness:500,damping:25,restSpeed:10},FMe=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),BMe={type:"keyframes",duration:.8},UMe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},zMe=(e,{keyframes:t})=>t.length>2?BMe:fg.has(e)?e.startsWith("scale")?FMe(t[1]):DMe:UMe,HMe=e=>e!==null;function VMe(e,{repeat:t,repeatType:r="loop"},n){const i=e.filter(HMe),a=t&&r!=="loop"&&t%2===1?0:i.length-1;return!a||n===void 0?i[a]:n}function HK(e,t){if(e!=null&&e.inherit&&t){const{inherit:r,...n}=e;return{...t,...n}}return e}function kO(e,t){const r=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return r!==e?HK(r,e):r}function qMe({when:e,delay:t,delayChildren:r,staggerChildren:n,staggerDirection:i,repeat:a,repeatType:o,repeatDelay:s,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const jO=(e,t,r,n={},i,a)=>o=>{const s=kO(n,e)||{},l=s.delay||n.delay||0;let{elapsed:c=0}=n;c=c-Po(l);const u={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:t.getVelocity(),...s,delay:-c,onUpdate:p=>{t.set(p),s.onUpdate&&s.onUpdate(p)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};qMe(s)||Object.assign(u,zMe(e,u)),u.duration&&(u.duration=Po(u.duration)),u.repeatDelay&&(u.repeatDelay=Po(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let f=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(SE(u),u.delay===0&&(f=!0)),(mc.instantAnimations||mc.skipAnimations||i!=null&&i.shouldSkipAnimations)&&(f=!0,SE(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,f&&!a&&t.get()!==void 0){const p=VMe(u.keyframes,s);if(p!==void 0){Fr.update(()=>{u.onUpdate(p),u.onComplete()});return}}return s.isSync?new AO(u):new LMe(u)};function Y$(e){const t=[{},{}];return e==null||e.values.forEach((r,n)=>{t[0][n]=r.get(),t[1][n]=r.getVelocity()}),t}function NO(e,t,r,n){if(typeof t=="function"){const[i,a]=Y$(n);t=t(r!==void 0?r:e.custom,i,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,a]=Y$(n);t=t(r!==void 0?r:e.custom,i,a)}return t}function wp(e,t,r){const n=e.getProps();return NO(n,t,r!==void 0?r:n.custom,e)}const VK=new Set(["width","height","top","left","right","bottom",...dg]),X$=30,WMe=e=>!isNaN(parseFloat(e));class GMe{constructor(t,r={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=n=>{var a;const i=Gi.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&((a=this.events.change)==null||a.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=r.owner}setCurrent(t){this.current=t,this.updatedAt=Gi.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=WMe(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,r){this.events[t]||(this.events[t]=new pO);const n=this.events[t].add(r);return t==="change"?()=>{n(),Fr.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,r){this.passiveEffect=t,this.stopPassiveEffect=r}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,r,n){this.set(r),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,r=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,r&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Gi.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>X$)return 0;const r=Math.min(this.updatedAt-this.prevUpdatedAt,X$);return cK(parseFloat(this.current)-parseFloat(this.prevFrameValue),r)}start(t){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=t(r),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,r;(t=this.dependents)==null||t.clear(),(r=this.events.destroy)==null||r.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Em(e,t){return new GMe(e,t)}const AE=e=>Array.isArray(e);function KMe(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,Em(r))}function YMe(e){return AE(e)?e[e.length-1]||0:e}function XMe(e,t){const r=wp(e,t);let{transitionEnd:n={},transition:i={},...a}=r||{};a={...a,...n};for(const o in a){const s=YMe(a[o]);KMe(e,o,s)}}const Ii=e=>!!(e&&e.getVelocity);function JMe(e){return!!(Ii(e)&&e.add)}function PE(e,t){const r=e.getValue("willChange");if(JMe(r))return r.add(t);if(!r&&mc.WillChange){const n=new mc.WillChange("auto");e.addValue("willChange",n),n.add(t)}}function EO(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const ZMe="framerAppearId",qK="data-"+EO(ZMe);function WK(e){return e.props[qK]}function QMe({protectedKeys:e,needsAnimating:t},r){const n=e.hasOwnProperty(r)&&t[r]!==!0;return t[r]=!1,n}function GK(e,t,{delay:r=0,transitionOverride:n,type:i}={}){let{transition:a,transitionEnd:o,...s}=t;const l=e.getDefaultTransition();a=a?HK(a,l):l;const c=a==null?void 0:a.reduceMotion;n&&(a=n);const u=[],f=i&&e.animationState&&e.animationState.getState()[i];for(const p in s){const h=e.getValue(p,e.latestValues[p]??null),g=s[p];if(g===void 0||f&&QMe(f,p))continue;const m={delay:r,...kO(a||{},p)},v=h.get();if(v!==void 0&&!h.isAnimating&&!Array.isArray(g)&&g===v&&!m.velocity)continue;let y=!1;if(window.MotionHandoffAnimation){const S=WK(e);if(S){const _=window.MotionHandoffAnimation(S,p,Fr);_!==null&&(m.startTime=_,y=!0)}}PE(e,p);const b=c??e.shouldReduceMotion;h.start(jO(p,h,g,b&&VK.has(p)?{type:!1}:m,e,y));const x=h.animation;x&&u.push(x)}if(o){const p=()=>Fr.update(()=>{o&&XMe(e,o)});u.length?Promise.all(u).then(p):p()}return u}function kE(e,t,r={}){var l;const n=wp(e,t,r.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=n||{};r.transitionOverride&&(i=r.transitionOverride);const a=n?()=>Promise.all(GK(e,n,r)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:p}=i;return e8e(e,t,c,u,f,p,r)}:()=>Promise.resolve(),{when:s}=i;if(s){const[c,u]=s==="beforeChildren"?[a,o]:[o,a];return c().then(()=>u())}else return Promise.all([a(),o(r.delay)])}function e8e(e,t,r=0,n=0,i=0,a=1,o){const s=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),s.push(kE(l,t,{...o,delay:r+(typeof n=="function"?0:n)+UK(e.variantChildren,l,n,i,a)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(s)}function t8e(e,t,r={}){e.notify("AnimationStart",t);let n;if(Array.isArray(t)){const i=t.map(a=>kE(e,a,r));n=Promise.all(i)}else if(typeof t=="string")n=kE(e,t,r);else{const i=typeof t=="function"?wp(e,t,r.custom):t;n=Promise.all(GK(e,i,r))}return n.then(()=>{e.notify("AnimationComplete",t)})}const r8e={test:e=>e==="auto",parse:e=>e},KK=e=>t=>t.test(e),YK=[ug,We,Qs,Kc,CIe,EIe,r8e],J$=e=>YK.find(KK(e));function n8e(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||sK(e):!0}const i8e=new Set(["brightness","contrast","saturate","opacity"]);function a8e(e){const[t,r]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[n]=r.match(yO)||[];if(!n)return e;const i=r.replace(n,"");let a=i8e.has(t)?1:0;return n!==r&&(a*=100),t+"("+a+i+")"}const o8e=/\b([a-z-]*)\(.*?\)/gu,jE={...us,getAnimatableNone:e=>{const t=e.match(o8e);return t?t.map(a8e).join(" "):e}},NE={...us,getAnimatableNone:e=>{const t=us.parse(e);return us.createTransformer(e)(t.map(n=>typeof n=="number"?0:typeof n=="object"?{...n,alpha:1}:n))}},Z$={...ug,transform:Math.round},s8e={rotate:Kc,rotateX:Kc,rotateY:Kc,rotateZ:Kc,scale:tx,scaleX:tx,scaleY:tx,scaleZ:tx,skew:Kc,skewX:Kc,skewY:Kc,distance:We,translateX:We,translateY:We,translateZ:We,x:We,y:We,z:We,perspective:We,transformPerspective:We,opacity:S0,originX:D$,originY:D$,originZ:We},CO={borderWidth:We,borderTopWidth:We,borderRightWidth:We,borderBottomWidth:We,borderLeftWidth:We,borderRadius:We,borderTopLeftRadius:We,borderTopRightRadius:We,borderBottomRightRadius:We,borderBottomLeftRadius:We,width:We,maxWidth:We,height:We,maxHeight:We,top:We,right:We,bottom:We,left:We,inset:We,insetBlock:We,insetBlockStart:We,insetBlockEnd:We,insetInline:We,insetInlineStart:We,insetInlineEnd:We,padding:We,paddingTop:We,paddingRight:We,paddingBottom:We,paddingLeft:We,paddingBlock:We,paddingBlockStart:We,paddingBlockEnd:We,paddingInline:We,paddingInlineStart:We,paddingInlineEnd:We,margin:We,marginTop:We,marginRight:We,marginBottom:We,marginLeft:We,marginBlock:We,marginBlockStart:We,marginBlockEnd:We,marginInline:We,marginInlineStart:We,marginInlineEnd:We,fontSize:We,backgroundPositionX:We,backgroundPositionY:We,...s8e,zIndex:Z$,fillOpacity:S0,strokeOpacity:S0,numOctaves:Z$},l8e={...CO,color:Nn,backgroundColor:Nn,outlineColor:Nn,fill:Nn,stroke:Nn,borderColor:Nn,borderTopColor:Nn,borderRightColor:Nn,borderBottomColor:Nn,borderLeftColor:Nn,filter:jE,WebkitFilter:jE,mask:NE,WebkitMask:NE},XK=e=>l8e[e],c8e=new Set([jE,NE]);function JK(e,t){let r=XK(e);return c8e.has(r)||(r=us),r.getAnimatableNone?r.getAnimatableNone(t):void 0}const u8e=new Set(["auto","none","0"]);function d8e(e,t,r){let n=0,i;for(;n{t.getValue(l).set(c)}),this.resolveNoneKeyframes()}}const h8e=new Set(["opacity","clipPath","filter","transform"]);function ZK(e,t,r){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){const i=document.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(n=>n!=null)}const QK=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function EE(e){return oK(e)&&"offsetHeight"in e}const{schedule:TO,cancel:lqe}=xK(queueMicrotask,!1),Go={x:!1,y:!1};function eY(){return Go.x||Go.y}function p8e(e){return e==="x"||e==="y"?Go[e]?null:(Go[e]=!0,()=>{Go[e]=!1}):Go.x||Go.y?null:(Go.x=Go.y=!0,()=>{Go.x=Go.y=!1})}function tY(e,t){const r=ZK(e),n=new AbortController,i={passive:!0,...t,signal:n.signal};return[r,i,()=>n.abort()]}function m8e(e){return!(e.pointerType==="touch"||eY())}function g8e(e,t,r={}){const[n,i,a]=tY(e,r);return n.forEach(o=>{let s=!1,l=!1,c;const u=()=>{o.removeEventListener("pointerleave",g)},f=v=>{c&&(c(v),c=void 0),u()},p=v=>{s=!1,window.removeEventListener("pointerup",p),window.removeEventListener("pointercancel",p),l&&(l=!1,f(v))},h=()=>{s=!0,window.addEventListener("pointerup",p,i),window.addEventListener("pointercancel",p,i)},g=v=>{if(v.pointerType!=="touch"){if(s){l=!0;return}f(v)}},m=v=>{if(!m8e(v))return;l=!1;const y=t(o,v);typeof y=="function"&&(c=y,o.addEventListener("pointerleave",g,i))};o.addEventListener("pointerenter",m,i),o.addEventListener("pointerdown",h,i)}),a}const rY=(e,t)=>t?e===t?!0:rY(e,t.parentElement):!1,OO=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,v8e=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function y8e(e){return v8e.has(e.tagName)||e.isContentEditable===!0}const b8e=new Set(["INPUT","SELECT","TEXTAREA"]);function x8e(e){return b8e.has(e.tagName)||e.isContentEditable===!0}const Mx=new WeakSet;function Q$(e){return t=>{t.key==="Enter"&&e(t)}}function iP(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const w8e=(e,t)=>{const r=e.currentTarget;if(!r)return;const n=Q$(()=>{if(Mx.has(r))return;iP(r,"down");const i=Q$(()=>{iP(r,"up")}),a=()=>iP(r,"cancel");r.addEventListener("keyup",i,t),r.addEventListener("blur",a,t)});r.addEventListener("keydown",n,t),r.addEventListener("blur",()=>r.removeEventListener("keydown",n),t)};function eD(e){return OO(e)&&!eY()}const tD=new WeakSet;function _8e(e,t,r={}){const[n,i,a]=tY(e,r),o=s=>{const l=s.currentTarget;if(!eD(s)||tD.has(s))return;Mx.add(l),r.stopPropagation&&tD.add(s);const c=t(l,s),u=(h,g)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",p),Mx.has(l)&&Mx.delete(l),eD(h)&&typeof c=="function"&&c(h,{success:g})},f=h=>{u(h,l===window||l===document||r.useGlobalTarget||rY(l,h.target))},p=h=>{u(h,!1)};window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",p,i)};return n.forEach(s=>{(r.useGlobalTarget?window:s).addEventListener("pointerdown",o,i),EE(s)&&(s.addEventListener("focus",c=>w8e(c,i)),!y8e(s)&&!s.hasAttribute("tabindex")&&(s.tabIndex=0))}),a}function RO(e){return oK(e)&&"ownerSVGElement"in e}const $x=new WeakMap;let Yc;const nY=(e,t,r)=>(n,i)=>i&&i[0]?i[0][e+"Size"]:RO(n)&&"getBBox"in n?n.getBBox()[t]:n[r],S8e=nY("inline","width","offsetWidth"),A8e=nY("block","height","offsetHeight");function P8e({target:e,borderBoxSize:t}){var r;(r=$x.get(e))==null||r.forEach(n=>{n(e,{get width(){return S8e(e,t)},get height(){return A8e(e,t)}})})}function k8e(e){e.forEach(P8e)}function j8e(){typeof ResizeObserver>"u"||(Yc=new ResizeObserver(k8e))}function N8e(e,t){Yc||j8e();const r=ZK(e);return r.forEach(n=>{let i=$x.get(n);i||(i=new Set,$x.set(n,i)),i.add(t),Yc==null||Yc.observe(n)}),()=>{r.forEach(n=>{const i=$x.get(n);i==null||i.delete(t),i!=null&&i.size||Yc==null||Yc.unobserve(n)})}}const Dx=new Set;let Jh;function E8e(){Jh=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Dx.forEach(t=>t(e))},window.addEventListener("resize",Jh)}function C8e(e){return Dx.add(e),Jh||E8e(),()=>{Dx.delete(e),!Dx.size&&typeof Jh=="function"&&(window.removeEventListener("resize",Jh),Jh=void 0)}}function rD(e,t){return typeof e=="function"?C8e(e):N8e(e,t)}function T8e(e){return RO(e)&&e.tagName==="svg"}const O8e=[...YK,Nn,us],R8e=e=>O8e.find(KK(e)),nD=()=>({translate:0,scale:1,origin:0,originPoint:0}),Zh=()=>({x:nD(),y:nD()}),iD=()=>({min:0,max:0}),zn=()=>({x:iD(),y:iD()}),L8e=new WeakMap;function R_(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function P0(e){return typeof e=="string"||Array.isArray(e)}const LO=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],IO=["initial",...LO];function L_(e){return R_(e.animate)||IO.some(t=>P0(e[t]))}function iY(e){return!!(L_(e)||e.variants)}function I8e(e,t,r){for(const n in t){const i=t[n],a=r[n];if(Ii(i))e.addValue(n,i);else if(Ii(a))e.addValue(n,Em(i,{owner:e}));else if(a!==i)if(e.hasValue(n)){const o=e.getValue(n);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=e.getStaticValue(n);e.addValue(n,Em(o!==void 0?o:i,{owner:e}))}}for(const n in r)t[n]===void 0&&e.removeValue(n);return t}const CE={current:null},aY={current:!1},M8e=typeof window<"u";function $8e(){if(aY.current=!0,!!M8e)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>CE.current=e.matches;e.addEventListener("change",t),t()}else CE.current=!1}const aD=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let M2={};function oY(e){M2=e}function D8e(){return M2}class F8e{scrapeMotionValuesFromProps(t,r,n){return{}}constructor({parent:t,props:r,presenceContext:n,reducedMotionConfig:i,skipAnimations:a,blockInitialAnimation:o,visualState:s},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=PO,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const h=Gi.now();this.renderScheduledAtthis.bindToMotionValue(a,i)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(aY.current||$8e(),this.shouldReduceMotion=CE.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),Bu(this.notifyUpdate),Bu(this.render),this.valueSubscriptions.forEach(r=>r()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const r in this.events)this.events[r].clear();for(const r in this.features){const n=this.features[r];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,r){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),r.accelerate&&h8e.has(t)&&this.current instanceof HTMLElement){const{factory:o,keyframes:s,times:l,ease:c,duration:u}=r.accelerate,f=new FK({element:this.current,name:t,keyframes:s,times:l,ease:c,duration:Po(u)}),p=o(f);this.valueSubscriptions.set(t,()=>{p(),f.cancel()});return}const n=fg.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=r.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&Fr.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let a;typeof window<"u"&&window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,r)),this.valueSubscriptions.set(t,()=>{i(),a&&a(),r.owner&&r.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in M2){const r=M2[t];if(!r)continue;const{isEnabled:n,Feature:i}=r;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):zn()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,r){this.latestValues[t]=r}update(t,r){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=r;for(let n=0;nr.variantChildren.delete(t)}addValue(t,r){const n=this.values.get(t);r!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,r),this.values.set(t,r),this.latestValues[t]=r.get())}removeValue(t){this.values.delete(t);const r=this.valueSubscriptions.get(t);r&&(r(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,r){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return n===void 0&&r!==void 0&&(n=Em(r===null?void 0:r,{owner:this}),this.addValue(t,n)),n}readValue(t,r){let n=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return n!=null&&(typeof n=="string"&&(aK(n)||sK(n))?n=parseFloat(n):!R8e(n)&&us.test(r)&&(n=JK(t,r)),this.setBaseTarget(t,Ii(n)?n.get():n)),Ii(n)?n.get():n}setBaseTarget(t,r){this.baseTarget[t]=r}getBaseTarget(t){var a;const{initial:r}=this.props;let n;if(typeof r=="string"||typeof r=="object"){const o=NO(this.props,r,(a=this.presenceContext)==null?void 0:a.custom);o&&(n=o[t])}if(r&&n!==void 0)return n;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!Ii(i)?i:this.initialValues[t]!==void 0&&n===void 0?void 0:this.baseTarget[t]}on(t,r){return this.events[t]||(this.events[t]=new pO),this.events[t].add(r)}notify(t,...r){this.events[t]&&this.events[t].notify(...r)}scheduleRenderMicrotask(){TO.render(this.render)}}class sY extends F8e{constructor(){super(...arguments),this.KeyframeResolver=f8e}sortInstanceNodePosition(t,r){return t.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(t,r){const n=t.style;return n?n[r]:void 0}removeValueFromRenderState(t,{vars:r,style:n}){delete r[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ii(t)&&(this.childSubscription=t.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}}class Xu{constructor(t){this.isMounted=!1,this.node=t}update(){}}function lY({top:e,left:t,right:r,bottom:n}){return{x:{min:t,max:r},y:{min:e,max:n}}}function B8e({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function U8e(e,t){if(!t)return e;const r=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}function aP(e){return e===void 0||e===1}function TE({scale:e,scaleX:t,scaleY:r}){return!aP(e)||!aP(t)||!aP(r)}function Cd(e){return TE(e)||cY(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function cY(e){return oD(e.x)||oD(e.y)}function oD(e){return e&&e!=="0%"}function $2(e,t,r){const n=e-r,i=t*n;return r+i}function sD(e,t,r,n,i){return i!==void 0&&(e=$2(e,i,n)),$2(e,r,n)+t}function OE(e,t=0,r=1,n,i){e.min=sD(e.min,t,r,n,i),e.max=sD(e.max,t,r,n,i)}function uY(e,{x:t,y:r}){OE(e.x,t.translate,t.scale,t.originPoint),OE(e.y,r.translate,r.scale,r.originPoint)}const lD=.999999999999,cD=1.0000000000001;function z8e(e,t,r,n=!1){const i=r.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;slD&&(t.x=1),t.ylD&&(t.y=1)}function Qh(e,t){e.min=e.min+t,e.max=e.max+t}function uD(e,t,r,n,i=.5){const a=tn(e.min,e.max,i);OE(e,t,r,a,n)}function ep(e,t){uD(e.x,t.x,t.scaleX,t.scale,t.originX),uD(e.y,t.y,t.scaleY,t.scale,t.originY)}function dY(e,t){return lY(U8e(e.getBoundingClientRect(),t))}function H8e(e,t,r){const n=dY(e,r),{scroll:i}=t;return i&&(Qh(n.x,i.offset.x),Qh(n.y,i.offset.y)),n}const V8e={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},q8e=dg.length;function W8e(e,t,r){let n="",i=!0;for(let a=0;a{if(!t.target)return e;if(typeof e=="string")if(We.test(e))e=parseFloat(e);else return e;const r=dD(e,t.target.x),n=dD(e,t.target.y);return`${r}% ${n}%`}},G8e={correct:(e,{treeScale:t,projectionDelta:r})=>{const n=e,i=us.parse(e);if(i.length>5)return n;const a=us.createTransformer(e),o=typeof i[0]!="number"?1:0,s=r.x.scale*t.x,l=r.y.scale*t.y;i[0+o]/=s,i[1+o]/=l;const c=tn(s,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=c),typeof i[3+o]=="number"&&(i[3+o]/=c),a(i)}},RE={borderRadius:{...mv,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:mv,borderTopRightRadius:mv,borderBottomLeftRadius:mv,borderBottomRightRadius:mv,boxShadow:G8e};function hY(e,{layout:t,layoutId:r}){return fg.has(e)||e.startsWith("origin")||(t||r!==void 0)&&(!!RE[e]||e==="opacity")}function $O(e,t,r){var o;const n=e.style,i=t==null?void 0:t.style,a={};if(!n)return a;for(const s in n)(Ii(n[s])||i&&Ii(i[s])||hY(s,e)||((o=r==null?void 0:r.getValue(s))==null?void 0:o.liveStyle)!==void 0)&&(a[s]=n[s]);return a}function K8e(e){return window.getComputedStyle(e)}class Y8e extends sY{constructor(){super(...arguments),this.type="html",this.renderInstance=fY}readValueFromInstance(t,r){var n;if(fg.has(r))return(n=this.projection)!=null&&n.isProjecting?yE(r):hMe(t,r);{const i=K8e(t),a=(_K(r)?i.getPropertyValue(r):i[r])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(t,{transformPagePoint:r}){return dY(t,r)}build(t,r,n){MO(t,r,n.transformTemplate)}scrapeMotionValuesFromProps(t,r,n){return $O(t,r,n)}}const X8e={offset:"stroke-dashoffset",array:"stroke-dasharray"},J8e={offset:"strokeDashoffset",array:"strokeDasharray"};function Z8e(e,t,r=1,n=0,i=!0){e.pathLength=1;const a=i?X8e:J8e;e[a.offset]=`${-n}`,e[a.array]=`${t} ${r}`}const Q8e=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function pY(e,{attrX:t,attrY:r,attrScale:n,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},l,c,u){if(MO(e,s,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:p}=e;f.transform&&(p.transform=f.transform,delete f.transform),(p.transform||f.transformOrigin)&&(p.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),p.transform&&(p.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete f.transformBox);for(const h of Q8e)f[h]!==void 0&&(p[h]=f[h],delete f[h]);t!==void 0&&(f.x=t),r!==void 0&&(f.y=r),n!==void 0&&(f.scale=n),i!==void 0&&Z8e(f,i,a,o,!1)}const mY=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),gY=e=>typeof e=="string"&&e.toLowerCase()==="svg";function e$e(e,t,r,n){fY(e,t,void 0,n);for(const i in t.attrs)e.setAttribute(mY.has(i)?i:EO(i),t.attrs[i])}function vY(e,t,r){const n=$O(e,t,r);for(const i in e)if(Ii(e[i])||Ii(t[i])){const a=dg.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;n[a]=e[i]}return n}class t$e extends sY{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=zn}getBaseTargetFromProps(t,r){return t[r]}readValueFromInstance(t,r){if(fg.has(r)){const n=XK(r);return n&&n.default||0}return r=mY.has(r)?r:EO(r),t.getAttribute(r)}scrapeMotionValuesFromProps(t,r,n){return vY(t,r,n)}build(t,r,n){pY(t,r,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,r,n,i){e$e(t,r,n,i)}mount(t){this.isSVGTag=gY(t.tagName),super.mount(t)}}const r$e=IO.length;function yY(e){if(!e)return;if(!e.isControllingVariants){const r=e.parent?yY(e.parent)||{}:{};return e.props.initial!==void 0&&(r.initial=e.props.initial),r}const t={};for(let r=0;rPromise.all(t.map(({animation:r,options:n})=>t8e(e,r,n)))}function o$e(e){let t=a$e(e),r=fD(),n=!0;const i=l=>(c,u)=>{var p;const f=wp(e,u,l==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);if(f){const{transition:h,transitionEnd:g,...m}=f;c={...c,...m,...g}}return c};function a(l){t=l(e)}function o(l){const{props:c}=e,u=yY(e.parent)||{},f=[],p=new Set;let h={},g=1/0;for(let v=0;vg&&S,R=!1;const $=Array.isArray(x)?x:[x];let N=$.reduce(i(y),{});_===!1&&(N={});const{prevResolvedValues:C={}}=b,D={...C,...N},I=Z=>{O=!0,p.has(Z)&&(R=!0,p.delete(Z)),b.needsAnimating[Z]=!0;const U=e.getValue(Z);U&&(U.liveStyle=!1)};for(const Z in D){const U=N[Z],X=C[Z];if(h.hasOwnProperty(Z))continue;let oe=!1;AE(U)&&AE(X)?oe=!bY(U,X):oe=U!==X,oe?U!=null?I(Z):p.add(Z):U!==void 0&&p.has(Z)?I(Z):b.protectedKeys[Z]=!0}b.prevProp=x,b.prevResolvedValues=N,b.isActive&&(h={...h,...N}),n&&e.blockInitialAnimation&&(O=!1);const G=k&&E;O&&(!G||R)&&f.push(...$.map(Z=>{const U={type:y};if(typeof Z=="string"&&n&&!G&&e.manuallyAnimateOnMount&&e.parent){const{parent:X}=e,oe=wp(X,Z);if(X.enteringChildren&&oe){const{delayChildren:ue}=oe.transition||{};U.delay=UK(X.enteringChildren,e,ue)}}return{animation:Z,options:U}}))}if(p.size){const v={};if(typeof c.initial!="boolean"){const y=wp(e,Array.isArray(c.initial)?c.initial[0]:c.initial);y&&y.transition&&(v.transition=y.transition)}p.forEach(y=>{const b=e.getBaseTarget(y),x=e.getValue(y);x&&(x.liveStyle=!0),v[y]=b??null}),f.push({animation:v})}let m=!!f.length;return n&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(m=!1),n=!1,m?t(f):Promise.resolve()}function s(l,c){var f;if(r[l].isActive===c)return Promise.resolve();(f=e.variantChildren)==null||f.forEach(p=>{var h;return(h=p.animationState)==null?void 0:h.setActive(l,c)}),r[l].isActive=c;const u=o(l);for(const p in r)r[p].protectedKeys={};return u}return{animateChanges:o,setActive:s,setAnimateFunction:a,getState:()=>r,reset:()=>{r=fD()}}}function s$e(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!bY(t,e):!1}function _d(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function fD(){return{animate:_d(!0),whileInView:_d(),whileHover:_d(),whileTap:_d(),whileDrag:_d(),whileFocus:_d(),exit:_d()}}function hD(e,t){e.min=t.min,e.max=t.max}function Vo(e,t){hD(e.x,t.x),hD(e.y,t.y)}function pD(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const xY=1e-4,l$e=1-xY,c$e=1+xY,wY=.01,u$e=0-wY,d$e=0+wY;function Ki(e){return e.max-e.min}function f$e(e,t,r){return Math.abs(e-t)<=r}function mD(e,t,r,n=.5){e.origin=n,e.originPoint=tn(t.min,t.max,e.origin),e.scale=Ki(r)/Ki(t),e.translate=tn(r.min,r.max,e.origin)-e.originPoint,(e.scale>=l$e&&e.scale<=c$e||isNaN(e.scale))&&(e.scale=1),(e.translate>=u$e&&e.translate<=d$e||isNaN(e.translate))&&(e.translate=0)}function Qv(e,t,r,n){mD(e.x,t.x,r.x,n?n.originX:void 0),mD(e.y,t.y,r.y,n?n.originY:void 0)}function gD(e,t,r){e.min=r.min+t.min,e.max=e.min+Ki(t)}function h$e(e,t,r){gD(e.x,t.x,r.x),gD(e.y,t.y,r.y)}function vD(e,t,r){e.min=t.min-r.min,e.max=e.min+Ki(t)}function D2(e,t,r){vD(e.x,t.x,r.x),vD(e.y,t.y,r.y)}function yD(e,t,r,n,i){return e-=t,e=$2(e,1/r,n),i!==void 0&&(e=$2(e,1/i,n)),e}function p$e(e,t=0,r=1,n=.5,i,a=e,o=e){if(Qs.test(t)&&(t=parseFloat(t),t=tn(o.min,o.max,t/100)-o.min),typeof t!="number")return;let s=tn(a.min,a.max,n);e===a&&(s-=t),e.min=yD(e.min,t,r,s,i),e.max=yD(e.max,t,r,s,i)}function bD(e,t,[r,n,i],a,o){p$e(e,t[r],t[n],t[i],t.scale,a,o)}const m$e=["x","scaleX","originX"],g$e=["y","scaleY","originY"];function xD(e,t,r,n){bD(e.x,t,m$e,r?r.x:void 0,n?n.x:void 0),bD(e.y,t,g$e,r?r.y:void 0,n?n.y:void 0)}function wD(e){return e.translate===0&&e.scale===1}function _Y(e){return wD(e.x)&&wD(e.y)}function _D(e,t){return e.min===t.min&&e.max===t.max}function v$e(e,t){return _D(e.x,t.x)&&_D(e.y,t.y)}function SD(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function SY(e,t){return SD(e.x,t.x)&&SD(e.y,t.y)}function AD(e){return Ki(e.x)/Ki(e.y)}function PD(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Is(e){return[e("x"),e("y")]}function y$e(e,t,r){let n="";const i=e.x.translate/t.x,a=e.y.translate/t.y,o=(r==null?void 0:r.z)||0;if((i||a||o)&&(n=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),r){const{transformPerspective:c,rotate:u,rotateX:f,rotateY:p,skewX:h,skewY:g}=r;c&&(n=`perspective(${c}px) ${n}`),u&&(n+=`rotate(${u}deg) `),f&&(n+=`rotateX(${f}deg) `),p&&(n+=`rotateY(${p}deg) `),h&&(n+=`skewX(${h}deg) `),g&&(n+=`skewY(${g}deg) `)}const s=e.x.scale*t.x,l=e.y.scale*t.y;return(s!==1||l!==1)&&(n+=`scale(${s}, ${l})`),n||"none"}const AY=["TopLeft","TopRight","BottomLeft","BottomRight"],b$e=AY.length,kD=e=>typeof e=="string"?parseFloat(e):e,jD=e=>typeof e=="number"||We.test(e);function x$e(e,t,r,n,i,a){i?(e.opacity=tn(0,r.opacity??1,w$e(n)),e.opacityExit=tn(t.opacity??1,0,_$e(n))):a&&(e.opacity=tn(t.opacity??1,r.opacity??1,n));for(let o=0;ont?1:r(_0(e,t,n))}function S$e(e,t,r){const n=Ii(e)?e:Em(e);return n.start(jO("",n,t,r)),n.animation}function k0(e,t,r,n={passive:!0}){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r)}const A$e=(e,t)=>e.depth-t.depth;class P$e{constructor(){this.children=[],this.isDirty=!1}add(t){hO(this.children,t),this.isDirty=!0}remove(t){O2(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(A$e),this.isDirty=!1,this.children.forEach(t)}}function k$e(e,t){const r=Gi.now(),n=({timestamp:i})=>{const a=i-r;a>=t&&(Bu(n),e(a-t))};return Fr.setup(n,!0),()=>Bu(n)}function Fx(e){return Ii(e)?e.get():e}class j$e{constructor(){this.members=[]}add(t){hO(this.members,t);for(let r=this.members.length-1;r>=0;r--){const n=this.members[r];if(n===t||n===this.lead||n===this.prevLead)continue;const i=n.instance;i&&i.isConnected===!1&&n.isPresent!==!1&&!n.snapshot&&O2(this.members,n)}t.scheduleRender()}remove(t){if(O2(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(t){const r=this.members.findIndex(i=>t===i);if(r===0)return!1;let n;for(let i=r;i>=0;i--){const a=this.members[i],o=a.instance;if(a.isPresent!==!1&&(!o||o.isConnected!==!1)){n=a;break}}return n?(this.promote(n),!0):!1}promote(t,r){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender();const i=n.options.layoutDependency,a=t.options.layoutDependency;if(!(i!==void 0&&a!==void 0&&i===a)){const l=n.instance;l&&l.isConnected===!1&&!n.snapshot||(t.resumeFrom=n,r&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0))}const{crossfade:s}=t.options;s===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:r,resumingFrom:n}=t;r.onExitComplete&&r.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Bx={hasAnimatedSinceResize:!0,hasEverUpdated:!1},oP=["","X","Y","Z"],N$e=1e3;let E$e=0;function sP(e,t,r,n){const{latestValues:i}=t;i[e]&&(r[e]=i[e],t.setStaticValue(e,0),n&&(n[e]=0))}function kY(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const r=WK(t);if(window.MotionHasOptimisedAnimation(r,"transform")){const{layout:i,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(r,"transform",Fr,!(i||a))}const{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&kY(n)}function jY({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(o={},s=t==null?void 0:t()){this.id=E$e++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(O$e),this.nodes.forEach(M$e),this.nodes.forEach($$e),this.nodes.forEach(R$e)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=s?s.root||s:this,this.path=s?[...s.path,s]:[],this.parent=s,this.depth=s?s.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;Fr.read(()=>{f=window.innerWidth}),e(o,()=>{const h=window.innerWidth;h!==f&&(f=h,this.root.updateBlockedByResize=!0,u&&u(),u=k$e(p,250),Bx.hasAnimatedSinceResize&&(Bx.hasAnimatedSinceResize=!1,this.nodes.forEach(TD)))})}s&&this.root.registerSharedNode(s,this),this.options.animate!==!1&&c&&(s||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:f,hasRelativeLayoutChanged:p,layout:h})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||c.getDefaultTransition()||z$e,{onLayoutAnimationStart:m,onLayoutAnimationComplete:v}=c.getProps(),y=!this.targetLayout||!SY(this.targetLayout,h),b=!f&&p;if(this.options.layoutRoot||this.resumeFrom||b||f&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const x={...kO(g,"layout"),onPlay:m,onComplete:v};(c.shouldReduceMotion||this.options.layoutRoot)&&(x.delay=0,x.type=!1),this.startAnimation(x),this.setAnimationOrigin(u,b)}else f||TD(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=h})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Bu(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(D$e),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&kY(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Ki(this.snapshot.measuredBox.x)&&!Ki(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const _=S/1e3;OD(f.x,o.x,_),OD(f.y,o.y,_),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(D2(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),B$e(this.relativeTarget,this.relativeTargetOrigin,p,_),x&&v$e(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=zn()),Vo(x,this.relativeTarget)),m&&(this.animationValues=u,x$e(u,c,this.latestValues,_,b,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=_},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var s,l,c;this.notifyListeners("animationStart"),(s=this.currentAnimation)==null||s.stop(),(c=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||c.stop(),this.pendingAnimation&&(Bu(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Fr.update(()=>{Bx.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Em(0)),this.motionValue.jump(0,!1),this.currentAnimation=S$e(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),o.onUpdate&&o.onUpdate(u)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(N$e),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:s,target:l,layout:c,latestValues:u}=o;if(!(!s||!l||!c)){if(this!==o&&this.layout&&c&&NY(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||zn();const f=Ki(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+f;const p=Ki(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+p}Vo(s,l),ep(s,u),Qv(this.projectionDeltaWithTransform,this.layoutCorrected,s,u)}}registerSharedNode(o,s){this.sharedNodes.has(o)||this.sharedNodes.set(o,new j$e),this.sharedNodes.get(o).add(s);const c=s.options.initialPromotionConfig;s.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(s):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var s;const{layoutId:o}=this.options;return o?((s=this.getStack())==null?void 0:s.lead)||this:this}getPrevLead(){var s;const{layoutId:o}=this.options;return o?(s=this.getStack())==null?void 0:s.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:s,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),s&&this.setOptions({transition:s})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let s=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(s=!0),!s)return;const c={};l.z&&sP("z",o,c,this.animationValues);for(let u=0;u{var s;return(s=o.currentAnimation)==null?void 0:s.stop()}),this.root.nodes.forEach(ED),this.root.sharedNodes.clear()}}}function C$e(e){e.updateLayout()}function T$e(e){var r;const t=((r=e.resumeFrom)==null?void 0:r.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=e.layout,{animationType:a}=e.options,o=t.source!==e.layout.source;a==="size"?Is(f=>{const p=o?t.measuredBox[f]:t.layoutBox[f],h=Ki(p);p.min=n[f].min,p.max=p.min+h}):NY(a,t.layoutBox,n)&&Is(f=>{const p=o?t.measuredBox[f]:t.layoutBox[f],h=Ki(n[f]);p.max=p.min+h,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+h)});const s=Zh();Qv(s,n,t.layoutBox);const l=Zh();o?Qv(l,e.applyTransform(i,!0),t.measuredBox):Qv(l,n,t.layoutBox);const c=!_Y(s);let u=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:p,layout:h}=f;if(p&&h){const g=zn();D2(g,t.layoutBox,p.layoutBox);const m=zn();D2(m,n,h.layoutBox),SY(g,m)||(u=!0),f.options.layoutRoot&&(e.relativeTarget=m,e.relativeTargetOrigin=g,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:l,layoutDelta:s,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function O$e(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function R$e(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function L$e(e){e.clearSnapshot()}function ED(e){e.clearMeasurements()}function CD(e){e.isLayoutDirty=!1}function I$e(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function TD(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function M$e(e){e.resolveTargetDelta()}function $$e(e){e.calcProjection()}function D$e(e){e.resetSkewAndRotation()}function F$e(e){e.removeLeadSnapshot()}function OD(e,t,r){e.translate=tn(t.translate,0,r),e.scale=tn(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function RD(e,t,r,n){e.min=tn(t.min,r.min,n),e.max=tn(t.max,r.max,n)}function B$e(e,t,r,n){RD(e.x,t.x,r.x,n),RD(e.y,t.y,r.y,n)}function U$e(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const z$e={duration:.45,ease:[.4,0,.1,1]},LD=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),ID=LD("applewebkit/")&&!LD("chrome/")?Math.round:Ao;function MD(e){e.min=ID(e.min),e.max=ID(e.max)}function H$e(e){MD(e.x),MD(e.y)}function NY(e,t,r){return e==="position"||e==="preserve-aspect"&&!f$e(AD(t),AD(r),.2)}function V$e(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const q$e=jY({attachResizeListener:(e,t)=>k0(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),lP={current:void 0},EY=jY({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!lP.current){const e=new q$e({});e.mount(window),e.setOptions({layoutScroll:!0}),lP.current=e}return lP.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),DO=P.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function $D(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function W$e(...e){return t=>{let r=!1;const n=e.map(i=>{const a=$D(i,t);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let i=0;i{const{width:h,height:g,top:m,left:v,right:y,bottom:b}=l.current;if(t||a===!1||!s.current||!h||!g)return;const x=r==="left"?`left: ${v}`:`right: ${y}`,S=n==="bottom"?`bottom: ${b}`:`top: ${m}`;s.current.dataset.motionPopId=o;const _=document.createElement("style");c&&(_.nonce=c);const k=i??document.head;return k.appendChild(_),_.sheet&&_.sheet.insertRule(` [data-motion-pop-id="${o}"] { position: absolute !important; width: ${h}px !important; height: ${g}px !important; ${x}px !important; ${S}px !important; } `),()=>{k.contains(_)&&k.removeChild(_)}},[t]),d.jsx(K$e,{isPresent:t,childRef:s,sizeRef:l,pop:a,children:a===!1?e:P.cloneElement(e,{ref:f})})}const X$e=({children:e,initial:t,isPresent:r,onExitComplete:n,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:l,root:c})=>{const u=fO(J$e),f=P.useId();let p=!0,h=P.useMemo(()=>(p=!1,{id:f,initial:t,isPresent:r,custom:i,onExitComplete:g=>{u.set(g,!0);for(const m of u.values())if(!m)return;n&&n()},register:g=>(u.set(g,!1),()=>u.delete(g))}),[r,u,n]);return a&&p&&(h={...h}),P.useMemo(()=>{u.forEach((g,m)=>u.set(m,!1))},[r]),P.useEffect(()=>{!r&&!u.size&&n&&n()},[r]),e=d.jsx(Y$e,{pop:o==="popLayout",isPresent:r,anchorX:s,anchorY:l,root:c,children:e}),d.jsx(T_.Provider,{value:h,children:e})};function J$e(){return new Map}function CY(e=!0){const t=P.useContext(T_);if(t===null)return[!0,null];const{isPresent:r,onExitComplete:n,register:i}=t,a=P.useId();P.useEffect(()=>{if(e)return i(a)},[e]);const o=P.useCallback(()=>e&&n&&n(a),[a,n,e]);return!r&&n?[!1,o]:[!0]}const rx=e=>e.key||"";function DD(e){const t=[];return P.Children.forEach(e,r=>{P.isValidElement(r)&&t.push(r)}),t}const Z$e=({children:e,custom:t,initial:r=!0,onExitComplete:n,presenceAffectsLayout:i=!0,mode:a="sync",propagate:o=!1,anchorX:s="left",anchorY:l="top",root:c})=>{const[u,f]=CY(o),p=P.useMemo(()=>DD(e),[e]),h=o&&!u?[]:p.map(rx),g=P.useRef(!0),m=P.useRef(p),v=fO(()=>new Map),y=P.useRef(new Set),[b,x]=P.useState(p),[S,_]=P.useState(p);iK(()=>{g.current=!1,m.current=p;for(let O=0;O{const R=rx(O),$=o&&!u?!1:p===S||h.includes(R),N=()=>{if(y.current.has(R))return;if(y.current.add(R),v.has(R))v.set(R,!0);else return;let C=!0;v.forEach(D=>{D||(C=!1)}),C&&(E==null||E(),_(m.current),o&&(f==null||f()),n&&n())};return d.jsx(X$e,{isPresent:$,initial:!g.current||r?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:c,onExitComplete:$?void 0:N,anchorX:s,anchorY:l,children:O},R)})})},TY=P.createContext({strict:!1}),FD={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let BD=!1;function Q$e(){if(BD)return;const e={};for(const t in FD)e[t]={isEnabled:r=>FD[t].some(n=>!!r[n])};oY(e),BD=!0}function OY(){return Q$e(),D8e()}function eDe(e){const t=OY();for(const r in e)t[r]={...t[r],...e[r]};oY(t)}const tDe=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function F2(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||tDe.has(e)}let RY=e=>!F2(e);function rDe(e){typeof e=="function"&&(RY=t=>t.startsWith("on")?!F2(t):e(t))}try{rDe(require("@emotion/is-prop-valid").default)}catch{}function nDe(e,t,r){const n={};for(const i in e)i==="values"&&typeof e.values=="object"||(RY(i)||r===!0&&F2(i)||!t&&!F2(i)||e.draggable&&i.startsWith("onDrag"))&&(n[i]=e[i]);return n}const I_=P.createContext({});function iDe(e,t){if(L_(e)){const{initial:r,animate:n}=e;return{initial:r===!1||P0(r)?r:void 0,animate:P0(n)?n:void 0}}return e.inherit!==!1?t:{}}function aDe(e){const{initial:t,animate:r}=iDe(e,P.useContext(I_));return P.useMemo(()=>({initial:t,animate:r}),[UD(t),UD(r)])}function UD(e){return Array.isArray(e)?e.join(" "):e}const FO=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function LY(e,t,r){for(const n in t)!Ii(t[n])&&!hY(n,r)&&(e[n]=t[n])}function oDe({transformTemplate:e},t){return P.useMemo(()=>{const r=FO();return MO(r,t,e),Object.assign({},r.vars,r.style)},[t])}function sDe(e,t){const r=e.style||{},n={};return LY(n,r,e),Object.assign(n,oDe(e,t)),n}function lDe(e,t){const r={},n=sDe(e,t);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=n,r}const IY=()=>({...FO(),attrs:{}});function cDe(e,t,r,n){const i=P.useMemo(()=>{const a=IY();return pY(a,t,gY(n),e.transformTemplate,e.style),{...a.attrs,style:{...a.style}}},[t]);if(e.style){const a={};LY(a,e.style,e),i.style={...a,...i.style}}return i}const uDe=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function BO(e){return typeof e!="string"||e.includes("-")?!1:!!(uDe.indexOf(e)>-1||/[A-Z]/u.test(e))}function dDe(e,t,r,{latestValues:n},i,a=!1,o){const l=(o??BO(e)?cDe:lDe)(t,n,i,e),c=nDe(t,typeof e=="string",a),u=e!==P.Fragment?{...c,...l,ref:r}:{},{children:f}=t,p=P.useMemo(()=>Ii(f)?f.get():f,[f]);return P.createElement(e,{...u,children:p})}function fDe({scrapeMotionValuesFromProps:e,createRenderState:t},r,n,i){return{latestValues:hDe(r,n,i,e),renderState:t()}}function hDe(e,t,r,n){const i={},a=n(e,{});for(const p in a)i[p]=Fx(a[p]);let{initial:o,animate:s}=e;const l=L_(e),c=iY(e);t&&c&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=r?r.initial===!1:!1;u=u||o===!1;const f=u?s:o;if(f&&typeof f!="boolean"&&!R_(f)){const p=Array.isArray(f)?f:[f];for(let h=0;h(t,r)=>{const n=P.useContext(I_),i=P.useContext(T_),a=()=>fDe(e,t,n,i);return r?a():fO(a)},pDe=MY({scrapeMotionValuesFromProps:$O,createRenderState:FO}),mDe=MY({scrapeMotionValuesFromProps:vY,createRenderState:IY}),gDe=Symbol.for("motionComponentSymbol");function vDe(e,t,r){const n=P.useRef(r);P.useInsertionEffect(()=>{n.current=r});const i=P.useRef(null);return P.useCallback(a=>{var s;a&&((s=e.onMount)==null||s.call(e,a)),t&&(a?t.mount(a):t.unmount());const o=n.current;if(typeof o=="function")if(a){const l=o(a);typeof l=="function"&&(i.current=l)}else i.current?(i.current(),i.current=null):o(a);else o&&(o.current=a)},[t])}const $Y=P.createContext({});function Ch(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function yDe(e,t,r,n,i,a){var x,S;const{visualElement:o}=P.useContext(I_),s=P.useContext(TY),l=P.useContext(T_),c=P.useContext(DO),u=c.reducedMotion,f=c.skipAnimations,p=P.useRef(null),h=P.useRef(!1);n=n||s.renderer,!p.current&&n&&(p.current=n(e,{visualState:t,parent:o,props:r,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:u,skipAnimations:f,isSVG:a}),h.current&&p.current&&(p.current.manuallyAnimateOnMount=!0));const g=p.current,m=P.useContext($Y);g&&!g.projection&&i&&(g.type==="html"||g.type==="svg")&&bDe(p.current,r,i,m);const v=P.useRef(!1);P.useInsertionEffect(()=>{g&&v.current&&g.update(r,l)});const y=r[qK],b=P.useRef(!!y&&!((x=window.MotionHandoffIsComplete)!=null&&x.call(window,y))&&((S=window.MotionHasOptimisedAnimation)==null?void 0:S.call(window,y)));return iK(()=>{h.current=!0,g&&(v.current=!0,window.MotionIsMounted=!0,g.updateFeatures(),g.scheduleRenderMicrotask(),b.current&&g.animationState&&g.animationState.animateChanges())}),P.useEffect(()=>{g&&(!b.current&&g.animationState&&g.animationState.animateChanges(),b.current&&(queueMicrotask(()=>{var _;(_=window.MotionHandoffMarkAsComplete)==null||_.call(window,y)}),b.current=!1),g.enteringChildren=void 0)}),g}function bDe(e,t,r,n){const{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:l,layoutRoot:c,layoutCrossfade:u}=t;e.projection=new r(e.latestValues,t["data-framer-portal-id"]?void 0:DY(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&Ch(s),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:n,crossfade:u,layoutScroll:l,layoutRoot:c})}function DY(e){if(e)return e.options.allowProjection!==!1?e.projection:DY(e.parent)}function cP(e,{forwardMotionProps:t=!1,type:r}={},n,i){n&&eDe(n);const a=r?r==="svg":BO(e),o=a?mDe:pDe;function s(c,u){let f;const p={...P.useContext(DO),...c,layoutId:xDe(c)},{isStatic:h}=p,g=aDe(c),m=o(c,h);if(!h&&nK){wDe();const v=_De(p);f=v.MeasureLayout,g.visualElement=yDe(e,m,p,i,v.ProjectionNode,a)}return d.jsxs(I_.Provider,{value:g,children:[f&&g.visualElement?d.jsx(f,{visualElement:g.visualElement,...p}):null,dDe(e,c,vDe(m,g.visualElement,u),m,h,t,a)]})}s.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const l=P.forwardRef(s);return l[gDe]=e,l}function xDe({layoutId:e}){const t=P.useContext(dO).id;return t&&e!==void 0?t+"-"+e:e}function wDe(e,t){P.useContext(TY).strict}function _De(e){const t=OY(),{drag:r,layout:n}=t;if(!r&&!n)return{};const i={...r,...n};return{MeasureLayout:r!=null&&r.isEnabled(e)||n!=null&&n.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function SDe(e,t){if(typeof Proxy>"u")return cP;const r=new Map,n=(a,o)=>cP(a,o,e,t),i=(a,o)=>n(a,o);return new Proxy(i,{get:(a,o)=>o==="create"?n:(r.has(o)||r.set(o,cP(o,void 0,e,t)),r.get(o))})}const ADe=(e,t)=>t.isSVG??BO(e)?new t$e(t):new Y8e(t,{allowProjection:e!==P.Fragment});class PDe extends Xu{constructor(t){super(t),t.animationState||(t.animationState=o$e(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();R_(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:r}=this.node.prevProps||{};t!==r&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let kDe=0;class jDe extends Xu{constructor(){super(...arguments),this.id=kDe++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:r}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;const i=this.node.animationState.setActive("exit",!t);r&&!t&&i.then(()=>{r(this.id)})}mount(){const{register:t,onExitComplete:r}=this.node.presenceContext||{};r&&r(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const NDe={animation:{Feature:PDe},exit:{Feature:jDe}};function p1(e){return{point:{x:e.pageX,y:e.pageY}}}const EDe=e=>t=>OO(t)&&e(t,p1(t));function ey(e,t,r,n){return k0(e,t,EDe(r),n)}const FY=({current:e})=>e?e.ownerDocument.defaultView:null,zD=(e,t)=>Math.abs(e-t);function CDe(e,t){const r=zD(e.x,t.x),n=zD(e.y,t.y);return Math.sqrt(r**2+n**2)}const HD=new Set(["auto","scroll"]);class BY{constructor(t,r,{transformPagePoint:n,contextWindow:i=window,dragSnapToOrigin:a=!1,distanceThreshold:o=3,element:s}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=h=>{this.handleScroll(h.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const h=dP(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,m=CDe(h.offset,{x:0,y:0})>=this.distanceThreshold;if(!g&&!m)return;const{point:v}=h,{timestamp:y}=gi;this.history.push({...v,timestamp:y});const{onStart:b,onMove:x}=this.handlers;g||(b&&b(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),x&&x(this.lastMoveEvent,h)},this.handlePointerMove=(h,g)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=uP(g,this.transformPagePoint),Fr.update(this.updatePoint,!0)},this.handlePointerUp=(h,g)=>{this.end();const{onEnd:m,onSessionEnd:v,resumeAnimation:y}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=dP(h.type==="pointercancel"?this.lastMoveEventInfo:uP(g,this.transformPagePoint),this.history);this.startEvent&&m&&m(h,b),v&&v(h,b)},!OO(t))return;this.dragSnapToOrigin=a,this.handlers=r,this.transformPagePoint=n,this.distanceThreshold=o,this.contextWindow=i||window;const l=p1(t),c=uP(l,this.transformPagePoint),{point:u}=c,{timestamp:f}=gi;this.history=[{...u,timestamp:f}];const{onSessionStart:p}=r;p&&p(t,dP(c,this.history)),this.removeListeners=d1(ey(this.contextWindow,"pointermove",this.handlePointerMove),ey(this.contextWindow,"pointerup",this.handlePointerUp),ey(this.contextWindow,"pointercancel",this.handlePointerUp)),s&&this.startScrollTracking(s)}startScrollTracking(t){let r=t.parentElement;for(;r;){const n=getComputedStyle(r);(HD.has(n.overflowX)||HD.has(n.overflowY))&&this.scrollPositions.set(r,{x:r.scrollLeft,y:r.scrollTop}),r=r.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const r=this.scrollPositions.get(t);if(!r)return;const n=t===window,i=n?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},a={x:i.x-r.x,y:i.y-r.y};a.x===0&&a.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=a.x,this.lastMoveEventInfo.point.y+=a.y):this.history.length>0&&(this.history[0].x-=a.x,this.history[0].y-=a.y),this.scrollPositions.set(t,i),Fr.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Bu(this.updatePoint)}}function uP(e,t){return t?{point:t(e.point)}:e}function VD(e,t){return{x:e.x-t.x,y:e.y-t.y}}function dP({point:e},t){return{point:e,delta:VD(e,UY(t)),offset:VD(e,TDe(t)),velocity:ODe(t,.1)}}function TDe(e){return e[0]}function UY(e){return e[e.length-1]}function ODe(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,n=null;const i=UY(e);for(;r>=0&&(n=e[r],!(i.timestamp-n.timestamp>Po(t)));)r--;if(!n)return{x:0,y:0};n===e[0]&&e.length>2&&i.timestamp-n.timestamp>Po(t)*2&&(n=e[1]);const a=xo(i.timestamp-n.timestamp);if(a===0)return{x:0,y:0};const o={x:(i.x-n.x)/a,y:(i.y-n.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function RDe(e,{min:t,max:r},n){return t!==void 0&&er&&(e=n?tn(r,e,n.max):Math.min(e,r)),e}function qD(e,t,r){return{min:t!==void 0?e.min+t:void 0,max:r!==void 0?e.max+r-(e.max-e.min):void 0}}function LDe(e,{top:t,left:r,bottom:n,right:i}){return{x:qD(e.x,r,i),y:qD(e.y,t,n)}}function WD(e,t){let r=t.min-e.min,n=t.max-e.max;return t.max-t.minn?r=_0(t.min,t.max-n,e.min):n>i&&(r=_0(e.min,e.max-i,t.min)),ol(0,1,r)}function $De(e,t){const r={};return t.min!==void 0&&(r.min=t.min-e.min),t.max!==void 0&&(r.max=t.max-e.min),r}const LE=.35;function DDe(e=LE){return e===!1?e=0:e===!0&&(e=LE),{x:GD(e,"left","right"),y:GD(e,"top","bottom")}}function GD(e,t,r){return{min:KD(e,t),max:KD(e,r)}}function KD(e,t){return typeof e=="number"?e:e[t]||0}const FDe=new WeakMap;class BDe{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=zn(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:r=!1,distanceThreshold:n}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const a=f=>{r&&this.snapToCursor(p1(f).point),this.stopAnimation()},o=(f,p)=>{const{drag:h,dragPropagation:g,onDragStart:m}=this.getProps();if(h&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=p8e(h),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=p,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Is(y=>{let b=this.getAxisMotionValue(y).get()||0;if(Qs.test(b)){const{projection:x}=this.visualElement;if(x&&x.layout){const S=x.layout.layoutBox[y];S&&(b=Ki(S)*(parseFloat(b)/100))}}this.originPoint[y]=b}),m&&Fr.update(()=>m(f,p),!1,!0),PE(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},s=(f,p)=>{this.latestPointerEvent=f,this.latestPanInfo=p;const{dragPropagation:h,dragDirectionLock:g,onDirectionLock:m,onDrag:v}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:y}=p;if(g&&this.currentDirection===null){this.currentDirection=zDe(y),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",p.point,y),this.updateAxis("y",p.point,y),this.visualElement.render(),v&&Fr.update(()=>v(f,p),!1,!0)},l=(f,p)=>{this.latestPointerEvent=f,this.latestPanInfo=p,this.stop(f,p),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{const{dragSnapToOrigin:f}=this.getProps();(f||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:u}=this.getProps();this.panSession=new BY(t,{onSessionStart:a,onStart:o,onMove:s,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:n,contextWindow:FY(this.visualElement),element:this.visualElement.current})}stop(t,r){const n=t||this.latestPointerEvent,i=r||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!i||!n)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:s}=this.getProps();s&&Fr.postRender(()=>s(n,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:r}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),r&&r.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,r,n){const{drag:i}=this.getProps();if(!n||!nx(t,i,this.currentDirection))return;const a=this.getAxisMotionValue(t);let o=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(o=RDe(o,this.constraints[t],this.elastic[t])),a.set(o)}resolveConstraints(){var a;const{dragConstraints:t,dragElastic:r}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(a=this.visualElement.projection)==null?void 0:a.layout,i=this.constraints;t&&Ch(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&n?this.constraints=LDe(n.layoutBox,t):this.constraints=!1,this.elastic=DDe(r),i!==this.constraints&&!Ch(t)&&n&&this.constraints&&!this.hasMutatedConstraints&&Is(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=$De(n.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:r}=this.getProps();if(!t||!Ch(t))return!1;const n=t.current;Nm(n!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const a=H8e(n,i.root,this.visualElement.getTransformPagePoint());let o=IDe(i.layout.layoutBox,a);if(r){const s=r(B8e(o));this.hasMutatedConstraints=!!s,s&&(o=lY(s))}return o}startAnimation(t){const{drag:r,dragMomentum:n,dragElastic:i,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:s}=this.getProps(),l=this.constraints||{},c=Is(u=>{if(!nx(u,r,this.currentDirection))return;let f=l&&l[u]||{};o&&(f={min:0,max:0});const p=i?200:1e6,h=i?40:1e7,g={type:"inertia",velocity:n?t[u]:0,bounceStiffness:p,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...a,...f};return this.startAxisValueAnimation(u,g)});return Promise.all(c).then(s)}startAxisValueAnimation(t,r){const n=this.getAxisMotionValue(t);return PE(this.visualElement,t),n.start(jO(t,n,0,r,this.visualElement,!1))}stopAnimation(){Is(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const r=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps(),i=n[r];return i||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){Is(r=>{const{drag:n}=this.getProps();if(!nx(r,n,this.currentDirection))return;const{projection:i}=this.visualElement,a=this.getAxisMotionValue(r);if(i&&i.layout){const{min:o,max:s}=i.layout.layoutBox[r],l=a.get()||0;a.set(t[r]-tn(o,s,.5)+l)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:r}=this.getProps(),{projection:n}=this.visualElement;if(!Ch(r)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Is(o=>{const s=this.getAxisMotionValue(o);if(s&&this.constraints!==!1){const l=s.get();i[o]=MDe({min:l,max:l},this.constraints[o])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Is(o=>{if(!nx(o,t,null))return;const s=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];s.set(tn(l,c,i[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;FDe.set(this.visualElement,this);const t=this.visualElement.current,r=ey(t,"pointerdown",c=>{const{drag:u,dragListener:f=!0}=this.getProps(),p=c.target,h=p!==t&&x8e(p);u&&f&&!h&&this.start(c)});let n;const i=()=>{const{dragConstraints:c}=this.getProps();Ch(c)&&c.current&&(this.constraints=this.resolveRefConstraints(),n||(n=UDe(t,c.current,()=>this.scalePositionWithinConstraints())))},{projection:a}=this.visualElement,o=a.addEventListener("measure",i);a&&!a.layout&&(a.root&&a.root.updateScroll(),a.updateLayout()),Fr.read(i);const s=k0(window,"resize",()=>this.scalePositionWithinConstraints()),l=a.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Is(f=>{const p=this.getAxisMotionValue(f);p&&(this.originPoint[f]+=c[f].translate,p.set(p.get()+c[f].translate))}),this.visualElement.render())});return()=>{s(),r(),o(),l&&l(),n&&n()}}getProps(){const t=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:a=!1,dragElastic:o=LE,dragMomentum:s=!0}=t;return{...t,drag:r,dragDirectionLock:n,dragPropagation:i,dragConstraints:a,dragElastic:o,dragMomentum:s}}}function YD(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function UDe(e,t,r){const n=rD(e,YD(r)),i=rD(t,YD(r));return()=>{n(),i()}}function nx(e,t,r){return(t===!0||t===e)&&(r===null||r===e)}function zDe(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}class HDe extends Xu{constructor(t){super(t),this.removeGroupControls=Ao,this.removeListeners=Ao,this.controls=new BDe(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ao}update(){const{dragControls:t}=this.node.getProps(),{dragControls:r}=this.node.prevProps||{};t!==r&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const fP=e=>(t,r)=>{e&&Fr.update(()=>e(t,r),!1,!0)};class VDe extends Xu{constructor(){super(...arguments),this.removePointerDownListener=Ao}onPointerDown(t){this.session=new BY(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:FY(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:r,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:fP(t),onStart:fP(r),onMove:fP(n),onEnd:(a,o)=>{delete this.session,i&&Fr.postRender(()=>i(a,o))}}}mount(){this.removePointerDownListener=ey(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let hP=!1;class qDe extends P.Component{componentDidMount(){const{visualElement:t,layoutGroup:r,switchLayoutGroup:n,layoutId:i}=this.props,{projection:a}=t;a&&(r.group&&r.group.add(a),n&&n.register&&i&&n.register(a),hP&&a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Bx.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:r,visualElement:n,drag:i,isPresent:a}=this.props,{projection:o}=n;return o&&(o.isPresent=a,t.layoutDependency!==r&&o.setOptions({...o.options,layoutDependency:r}),hP=!0,i||t.layoutDependency!==r||r===void 0||t.isPresent!==a?o.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?o.promote():o.relegate()||Fr.postRender(()=>{const s=o.getStack();(!s||!s.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),TO.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:r,switchLayoutGroup:n}=this.props,{projection:i}=t;hP=!0,i&&(i.scheduleCheckAfterUnmount(),r&&r.group&&r.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function zY(e){const[t,r]=CY(),n=P.useContext(dO);return d.jsx(qDe,{...e,layoutGroup:n,switchLayoutGroup:P.useContext($Y),isPresent:t,safeToRemove:r})}const WDe={pan:{Feature:VDe},drag:{Feature:HDe,ProjectionNode:EY,MeasureLayout:zY}};function XD(e,t,r){const{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover",r==="Start");const i="onHover"+r,a=n[i];a&&Fr.postRender(()=>a(t,p1(t)))}class GDe extends Xu{mount(){const{current:t}=this.node;t&&(this.unmount=g8e(t,(r,n)=>(XD(this.node,n,"Start"),i=>XD(this.node,i,"End"))))}unmount(){}}class KDe extends Xu{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=d1(k0(this.node.current,"focus",()=>this.onFocus()),k0(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function JD(e,t,r){const{props:n}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&n.whileTap&&e.animationState.setActive("whileTap",r==="Start");const i="onTap"+(r==="End"?"":r),a=n[i];a&&Fr.postRender(()=>a(t,p1(t)))}class YDe extends Xu{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:r,propagate:n}=this.node.props;this.unmount=_8e(t,(i,a)=>(JD(this.node,a,"Start"),(o,{success:s})=>JD(this.node,o,s?"End":"Cancel")),{useGlobalTarget:r,stopPropagation:(n==null?void 0:n.tap)===!1})}unmount(){}}const IE=new WeakMap,pP=new WeakMap,XDe=e=>{const t=IE.get(e.target);t&&t(e)},JDe=e=>{e.forEach(XDe)};function ZDe({root:e,...t}){const r=e||document;pP.has(r)||pP.set(r,{});const n=pP.get(r),i=JSON.stringify(t);return n[i]||(n[i]=new IntersectionObserver(JDe,{root:e,...t})),n[i]}function QDe(e,t,r){const n=ZDe(t);return IE.set(e,r),n.observe(e),()=>{IE.delete(e),n.unobserve(e)}}const e7e={some:0,all:1};class t7e extends Xu{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:r,margin:n,amount:i="some",once:a}=t,o={root:r?r.current:void 0,rootMargin:n,threshold:typeof i=="number"?i:e7e[i]},s=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,a&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:f}=this.node.getProps(),p=c?u:f;p&&p(l)};return QDe(this.node.current,o,s)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:r}=this.node;["amount","margin","root"].some(r7e(t,r))&&this.startObserver()}unmount(){}}function r7e({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}const n7e={inView:{Feature:t7e},tap:{Feature:YDe},focus:{Feature:KDe},hover:{Feature:GDe}},i7e={layout:{ProjectionNode:EY,MeasureLayout:zY}},a7e={...NDe,...n7e,...WDe,...i7e},br=SDe(a7e,ADe);function B2(e,[t,r]){return Math.min(r,Math.max(t,e))}function UO(e){const t=P.useRef({value:e,previous:e});return P.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var o7e=[" ","Enter","ArrowUp","ArrowDown"],s7e=[" ","Enter"],Ef="Select",[M_,$_,l7e]=V0(Ef),[hg,uqe]=Qa(Ef,[l7e,Um]),D_=Um(),[c7e,Ju]=hg(Ef),[u7e,d7e]=hg(Ef),HY=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:l,dir:c,name:u,autoComplete:f,disabled:p,required:h,form:g}=e,m=D_(t),[v,y]=P.useState(null),[b,x]=P.useState(null),[S,_]=P.useState(!1),k=t1(c),[E,O]=Ga({prop:n,defaultProp:i??!1,onChange:a,caller:Ef}),[R,$]=Ga({prop:o,defaultProp:s,onChange:l,caller:Ef}),N=P.useRef(null),C=v?g||!!v.closest("form"):!0,[D,I]=P.useState(new Set),G=Array.from(D).map(Y=>Y.props.value).join(";");return d.jsx(k3,{...m,children:d.jsxs(c7e,{required:h,scope:t,trigger:v,onTriggerChange:y,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:_,contentId:_o(),value:R,onValueChange:$,open:E,onOpenChange:O,dir:k,triggerPointerDownPosRef:N,disabled:p,children:[d.jsx(M_.Provider,{scope:t,children:d.jsx(u7e,{scope:e.__scopeSelect,onNativeOptionAdd:P.useCallback(Y=>{I(Z=>new Set(Z).add(Y))},[]),onNativeOptionRemove:P.useCallback(Y=>{I(Z=>{const U=new Set(Z);return U.delete(Y),U})},[]),children:r})}),C?d.jsxs(hX,{"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:f,value:R,onChange:Y=>$(Y.target.value),disabled:p,form:g,children:[R===void 0?d.jsx("option",{value:""}):null,Array.from(D)]},G):null]})})};HY.displayName=Ef;var VY="SelectTrigger",qY=P.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...i}=e,a=D_(r),o=Ju(VY,r),s=o.disabled||n,l=qt(t,o.onTriggerChange),c=$_(r),u=P.useRef("touch"),[f,p,h]=mX(m=>{const v=c().filter(x=>!x.disabled),y=v.find(x=>x.value===o.value),b=gX(v,m,y);b!==void 0&&o.onValueChange(b.value)}),g=m=>{s||(o.onOpenChange(!0),h()),m&&(o.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return d.jsx(w5,{asChild:!0,...a,children:d.jsx(ft.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":pX(o.value)?"":void 0,...i,ref:l,onClick:qe(i.onClick,m=>{m.currentTarget.focus(),u.current!=="mouse"&&g(m)}),onPointerDown:qe(i.onPointerDown,m=>{u.current=m.pointerType;const v=m.target;v.hasPointerCapture(m.pointerId)&&v.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(g(m),m.preventDefault())}),onKeyDown:qe(i.onKeyDown,m=>{const v=f.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&p(m.key),!(v&&m.key===" ")&&o7e.includes(m.key)&&(g(),m.preventDefault())})})})});qY.displayName=VY;var WY="SelectValue",GY=P.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:i,children:a,placeholder:o="",...s}=e,l=Ju(WY,r),{onValueNodeHasChildrenChange:c}=l,u=a!==void 0,f=qt(t,l.onValueNodeChange);return ti(()=>{c(u)},[c,u]),d.jsx(ft.span,{...s,ref:f,style:{pointerEvents:"none"},children:pX(l.value)?d.jsx(d.Fragment,{children:o}):a})});GY.displayName=WY;var f7e="SelectIcon",KY=P.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...i}=e;return d.jsx(ft.span,{"aria-hidden":!0,...i,ref:t,children:n||"▼"})});KY.displayName=f7e;var h7e="SelectPortal",YY=e=>d.jsx(q0,{asChild:!0,...e});YY.displayName=h7e;var Cf="SelectContent",XY=P.forwardRef((e,t)=>{const r=Ju(Cf,e.__scopeSelect),[n,i]=P.useState();if(ti(()=>{i(new DocumentFragment)},[]),!r.open){const a=n;return a?$f.createPortal(d.jsx(JY,{scope:e.__scopeSelect,children:d.jsx(M_.Slot,{scope:e.__scopeSelect,children:d.jsx("div",{children:e.children})})}),a):null}return d.jsx(ZY,{...e,ref:t})});XY.displayName=Cf;var Ko=10,[JY,Zu]=hg(Cf),p7e="SelectContentImpl",m7e=xf("SelectContent.RemoveScroll"),ZY=P.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:g,hideWhenDetached:m,avoidCollisions:v,...y}=e,b=Ju(Cf,r),[x,S]=P.useState(null),[_,k]=P.useState(null),E=qt(t,V=>S(V)),[O,R]=P.useState(null),[$,N]=P.useState(null),C=$_(r),[D,I]=P.useState(!1),G=P.useRef(!1);P.useEffect(()=>{if(x)return U3(x)},[x]),B3();const Y=P.useCallback(V=>{const[se,...ae]=C().map(fe=>fe.ref.current),[de]=ae.slice(-1),ve=document.activeElement;for(const fe of V)if(fe===ve||(fe==null||fe.scrollIntoView({block:"nearest"}),fe===se&&_&&(_.scrollTop=0),fe===de&&_&&(_.scrollTop=_.scrollHeight),fe==null||fe.focus(),document.activeElement!==ve))return},[C,_]),Z=P.useCallback(()=>Y([O,x]),[Y,O,x]);P.useEffect(()=>{D&&Z()},[D,Z]);const{onOpenChange:U,triggerPointerDownPosRef:X}=b;P.useEffect(()=>{if(x){let V={x:0,y:0};const se=de=>{var ve,fe;V={x:Math.abs(Math.round(de.pageX)-(((ve=X.current)==null?void 0:ve.x)??0)),y:Math.abs(Math.round(de.pageY)-(((fe=X.current)==null?void 0:fe.y)??0))}},ae=de=>{V.x<=10&&V.y<=10?de.preventDefault():x.contains(de.target)||U(!1),document.removeEventListener("pointermove",se),X.current=null};return X.current!==null&&(document.addEventListener("pointermove",se),document.addEventListener("pointerup",ae,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",se),document.removeEventListener("pointerup",ae,{capture:!0})}}},[x,U,X]),P.useEffect(()=>{const V=()=>U(!1);return window.addEventListener("blur",V),window.addEventListener("resize",V),()=>{window.removeEventListener("blur",V),window.removeEventListener("resize",V)}},[U]);const[oe,ue]=mX(V=>{const se=C().filter(ve=>!ve.disabled),ae=se.find(ve=>ve.ref.current===document.activeElement),de=gX(se,V,ae);de&&setTimeout(()=>de.ref.current.focus())}),M=P.useCallback((V,se,ae)=>{const de=!G.current&&!ae;(b.value!==void 0&&b.value===se||de)&&(R(V),de&&(G.current=!0))},[b.value]),W=P.useCallback(()=>x==null?void 0:x.focus(),[x]),z=P.useCallback((V,se,ae)=>{const de=!G.current&&!ae;(b.value!==void 0&&b.value===se||de)&&N(V)},[b.value]),ie=n==="popper"?ME:QY,le=ie===ME?{side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:g,hideWhenDetached:m,avoidCollisions:v}:{};return d.jsx(JY,{scope:r,content:x,viewport:_,onViewportChange:k,itemRefCallback:M,selectedItem:O,onItemLeave:W,itemTextRefCallback:z,focusSelectedItem:Z,selectedItemText:$,position:n,isPositioned:D,searchRef:oe,children:d.jsx(O5,{as:m7e,allowPinchZoom:!0,children:d.jsx(C5,{asChild:!0,trapped:b.open,onMountAutoFocus:V=>{V.preventDefault()},onUnmountAutoFocus:qe(i,V=>{var se;(se=b.trigger)==null||se.focus({preventScroll:!0}),V.preventDefault()}),children:d.jsx($m,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:V=>V.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:d.jsx(ie,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:V=>V.preventDefault(),...y,...le,onPlaced:()=>I(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:qe(y.onKeyDown,V=>{const se=V.ctrlKey||V.altKey||V.metaKey;if(V.key==="Tab"&&V.preventDefault(),!se&&V.key.length===1&&ue(V.key),["ArrowUp","ArrowDown","Home","End"].includes(V.key)){let de=C().filter(ve=>!ve.disabled).map(ve=>ve.ref.current);if(["ArrowUp","End"].includes(V.key)&&(de=de.slice().reverse()),["ArrowUp","ArrowDown"].includes(V.key)){const ve=V.target,fe=de.indexOf(ve);de=de.slice(fe+1)}setTimeout(()=>Y(de)),V.preventDefault()}})})})})})})});ZY.displayName=p7e;var g7e="SelectItemAlignedPosition",QY=P.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...i}=e,a=Ju(Cf,r),o=Zu(Cf,r),[s,l]=P.useState(null),[c,u]=P.useState(null),f=qt(t,E=>u(E)),p=$_(r),h=P.useRef(!1),g=P.useRef(!0),{viewport:m,selectedItem:v,selectedItemText:y,focusSelectedItem:b}=o,x=P.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&c&&m&&v&&y){const E=a.trigger.getBoundingClientRect(),O=c.getBoundingClientRect(),R=a.valueNode.getBoundingClientRect(),$=y.getBoundingClientRect();if(a.dir!=="rtl"){const ve=$.left-O.left,fe=R.left-ve,je=E.left-fe,Te=E.width+je,Q=Math.max(Te,O.width),Ce=window.innerWidth-Ko,Ke=B2(fe,[Ko,Math.max(Ko,Ce-Q)]);s.style.minWidth=Te+"px",s.style.left=Ke+"px"}else{const ve=O.right-$.right,fe=window.innerWidth-R.right-ve,je=window.innerWidth-E.right-fe,Te=E.width+je,Q=Math.max(Te,O.width),Ce=window.innerWidth-Ko,Ke=B2(fe,[Ko,Math.max(Ko,Ce-Q)]);s.style.minWidth=Te+"px",s.style.right=Ke+"px"}const N=p(),C=window.innerHeight-Ko*2,D=m.scrollHeight,I=window.getComputedStyle(c),G=parseInt(I.borderTopWidth,10),Y=parseInt(I.paddingTop,10),Z=parseInt(I.borderBottomWidth,10),U=parseInt(I.paddingBottom,10),X=G+Y+D+U+Z,oe=Math.min(v.offsetHeight*5,X),ue=window.getComputedStyle(m),M=parseInt(ue.paddingTop,10),W=parseInt(ue.paddingBottom,10),z=E.top+E.height/2-Ko,ie=C-z,le=v.offsetHeight/2,V=v.offsetTop+le,se=G+Y+V,ae=X-se;if(se<=z){const ve=N.length>0&&v===N[N.length-1].ref.current;s.style.bottom="0px";const fe=c.clientHeight-m.offsetTop-m.offsetHeight,je=Math.max(ie,le+(ve?W:0)+fe+Z),Te=se+je;s.style.height=Te+"px"}else{const ve=N.length>0&&v===N[0].ref.current;s.style.top="0px";const je=Math.max(z,G+m.offsetTop+(ve?M:0)+le)+ae;s.style.height=je+"px",m.scrollTop=se-z+m.offsetTop}s.style.margin=`${Ko}px 0`,s.style.minHeight=oe+"px",s.style.maxHeight=C+"px",n==null||n(),requestAnimationFrame(()=>h.current=!0)}},[p,a.trigger,a.valueNode,s,c,m,v,y,a.dir,n]);ti(()=>x(),[x]);const[S,_]=P.useState();ti(()=>{c&&_(window.getComputedStyle(c).zIndex)},[c]);const k=P.useCallback(E=>{E&&g.current===!0&&(x(),b==null||b(),g.current=!1)},[x,b]);return d.jsx(y7e,{scope:r,contentWrapper:s,shouldExpandOnScrollRef:h,onScrollButtonChange:k,children:d.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:d.jsx(ft.div,{...i,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});QY.displayName=g7e;var v7e="SelectPopperPosition",ME=P.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:i=Ko,...a}=e,o=D_(r);return d.jsx(j3,{...o,...a,ref:t,align:n,collisionPadding:i,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ME.displayName=v7e;var[y7e,zO]=hg(Cf,{}),$E="SelectViewport",eX=P.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...i}=e,a=Zu($E,r),o=zO($E,r),s=qt(t,a.onViewportChange),l=P.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),d.jsx(M_.Slot,{scope:r,children:d.jsx(ft.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:qe(i.onScroll,c=>{const u=c.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:p}=o;if(p!=null&&p.current&&f){const h=Math.abs(l.current-u.scrollTop);if(h>0){const g=window.innerHeight-Ko*2,m=parseFloat(f.style.minHeight),v=parseFloat(f.style.height),y=Math.max(m,v);if(y0?S:0,f.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});eX.displayName=$E;var tX="SelectGroup",[b7e,x7e]=hg(tX),w7e=P.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=_o();return d.jsx(b7e,{scope:r,id:i,children:d.jsx(ft.div,{role:"group","aria-labelledby":i,...n,ref:t})})});w7e.displayName=tX;var rX="SelectLabel",nX=P.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=x7e(rX,r);return d.jsx(ft.div,{id:i.id,...n,ref:t})});nX.displayName=rX;var U2="SelectItem",[_7e,iX]=hg(U2),aX=P.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:i=!1,textValue:a,...o}=e,s=Ju(U2,r),l=Zu(U2,r),c=s.value===n,[u,f]=P.useState(a??""),[p,h]=P.useState(!1),g=qt(t,b=>{var x;return(x=l.itemRefCallback)==null?void 0:x.call(l,b,n,i)}),m=_o(),v=P.useRef("touch"),y=()=>{i||(s.onValueChange(n),s.onOpenChange(!1))};if(n==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(_7e,{scope:r,value:n,disabled:i,textId:m,isSelected:c,onItemTextChange:P.useCallback(b=>{f(x=>x||((b==null?void 0:b.textContent)??"").trim())},[]),children:d.jsx(M_.ItemSlot,{scope:r,value:n,disabled:i,textValue:u,children:d.jsx(ft.div,{role:"option","aria-labelledby":m,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...o,ref:g,onFocus:qe(o.onFocus,()=>h(!0)),onBlur:qe(o.onBlur,()=>h(!1)),onClick:qe(o.onClick,()=>{v.current!=="mouse"&&y()}),onPointerUp:qe(o.onPointerUp,()=>{v.current==="mouse"&&y()}),onPointerDown:qe(o.onPointerDown,b=>{v.current=b.pointerType}),onPointerMove:qe(o.onPointerMove,b=>{var x;v.current=b.pointerType,i?(x=l.onItemLeave)==null||x.call(l):v.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:qe(o.onPointerLeave,b=>{var x;b.currentTarget===document.activeElement&&((x=l.onItemLeave)==null||x.call(l))}),onKeyDown:qe(o.onKeyDown,b=>{var S;((S=l.searchRef)==null?void 0:S.current)!==""&&b.key===" "||(s7e.includes(b.key)&&y(),b.key===" "&&b.preventDefault())})})})})});aX.displayName=U2;var Nv="SelectItemText",oX=P.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:i,...a}=e,o=Ju(Nv,r),s=Zu(Nv,r),l=iX(Nv,r),c=d7e(Nv,r),[u,f]=P.useState(null),p=qt(t,y=>f(y),l.onItemTextChange,y=>{var b;return(b=s.itemTextRefCallback)==null?void 0:b.call(s,y,l.value,l.disabled)}),h=u==null?void 0:u.textContent,g=P.useMemo(()=>d.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:m,onNativeOptionRemove:v}=c;return ti(()=>(m(g),()=>v(g)),[m,v,g]),d.jsxs(d.Fragment,{children:[d.jsx(ft.span,{id:l.textId,...a,ref:p}),l.isSelected&&o.valueNode&&!o.valueNodeHasChildren?$f.createPortal(a.children,o.valueNode):null]})});oX.displayName=Nv;var sX="SelectItemIndicator",lX=P.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return iX(sX,r).isSelected?d.jsx(ft.span,{"aria-hidden":!0,...n,ref:t}):null});lX.displayName=sX;var DE="SelectScrollUpButton",cX=P.forwardRef((e,t)=>{const r=Zu(DE,e.__scopeSelect),n=zO(DE,e.__scopeSelect),[i,a]=P.useState(!1),o=qt(t,n.onScrollButtonChange);return ti(()=>{if(r.viewport&&r.isPositioned){let s=function(){const c=l.scrollTop>0;a(c)};const l=r.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[r.viewport,r.isPositioned]),i?d.jsx(dX,{...e,ref:o,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=r;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}}):null});cX.displayName=DE;var FE="SelectScrollDownButton",uX=P.forwardRef((e,t)=>{const r=Zu(FE,e.__scopeSelect),n=zO(FE,e.__scopeSelect),[i,a]=P.useState(!1),o=qt(t,n.onScrollButtonChange);return ti(()=>{if(r.viewport&&r.isPositioned){let s=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)l.removeEventListener("scroll",s)}},[r.viewport,r.isPositioned]),i?d.jsx(dX,{...e,ref:o,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=r;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}}):null});uX.displayName=FE;var dX=P.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...i}=e,a=Zu("SelectScrollButton",r),o=P.useRef(null),s=$_(r),l=P.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return P.useEffect(()=>()=>l(),[l]),ti(()=>{var u;const c=s().find(f=>f.ref.current===document.activeElement);(u=c==null?void 0:c.ref.current)==null||u.scrollIntoView({block:"nearest"})},[s]),d.jsx(ft.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:qe(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(n,50))}),onPointerMove:qe(i.onPointerMove,()=>{var c;(c=a.onItemLeave)==null||c.call(a),o.current===null&&(o.current=window.setInterval(n,50))}),onPointerLeave:qe(i.onPointerLeave,()=>{l()})})}),S7e="SelectSeparator",fX=P.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return d.jsx(ft.div,{"aria-hidden":!0,...n,ref:t})});fX.displayName=S7e;var BE="SelectArrow",A7e=P.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=D_(r),a=Ju(BE,r),o=Zu(BE,r);return a.open&&o.position==="popper"?d.jsx(N3,{...i,...n,ref:t}):null});A7e.displayName=BE;var P7e="SelectBubbleInput",hX=P.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const i=P.useRef(null),a=qt(n,i),o=UO(t);return P.useEffect(()=>{const s=i.current;if(!s)return;const l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(o!==t&&u){const f=new Event("change",{bubbles:!0});u.call(s,t),s.dispatchEvent(f)}},[o,t]),d.jsx(ft.select,{...r,style:{...hU,...r.style},ref:a,defaultValue:t})});hX.displayName=P7e;function pX(e){return e===""||e===void 0}function mX(e){const t=No(e),r=P.useRef(""),n=P.useRef(0),i=P.useCallback(o=>{const s=r.current+o;t(s),function l(c){r.current=c,window.clearTimeout(n.current),c!==""&&(n.current=window.setTimeout(()=>l(""),1e3))}(s)},[t]),a=P.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return P.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,i,a]}function gX(e,t,r){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,a=r?e.indexOf(r):-1;let o=k7e(e,Math.max(a,0));i.length===1&&(o=o.filter(c=>c!==r));const l=o.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==r?l:void 0}function k7e(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var j7e=HY,vX=qY,N7e=GY,E7e=KY,C7e=YY,yX=XY,T7e=eX,bX=nX,xX=aX,O7e=oX,R7e=lX,wX=cX,_X=uX,SX=fX;const Ya=j7e,Xa=N7e,ga=P.forwardRef(({className:e,children:t,...r},n)=>d.jsxs(vX,{ref:n,className:lt("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,d.jsx(E7e,{asChild:!0,children:d.jsx(Y0,{className:"h-4 w-4 opacity-50"})})]}));ga.displayName=vX.displayName;const AX=P.forwardRef(({className:e,...t},r)=>d.jsx(wX,{ref:r,className:lt("flex cursor-default items-center justify-center py-1",e),...t,children:d.jsx(IU,{className:"h-4 w-4"})}));AX.displayName=wX.displayName;const PX=P.forwardRef(({className:e,...t},r)=>d.jsx(_X,{ref:r,className:lt("flex cursor-default items-center justify-center py-1",e),...t,children:d.jsx(Y0,{className:"h-4 w-4"})}));PX.displayName=_X.displayName;const va=P.forwardRef(({className:e,children:t,position:r="popper",...n},i)=>d.jsx(C7e,{children:d.jsxs(yX,{ref:i,className:lt("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[d.jsx(AX,{}),d.jsx(T7e,{className:lt("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),d.jsx(PX,{})]})}));va.displayName=yX.displayName;const L7e=P.forwardRef(({className:e,...t},r)=>d.jsx(bX,{ref:r,className:lt("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));L7e.displayName=bX.displayName;const Mi=P.forwardRef(({className:e,children:t,...r},n)=>d.jsxs(xX,{ref:n,className:lt("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...r,children:[d.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:d.jsx(R7e,{children:d.jsx(Sy,{className:"h-4 w-4"})})}),d.jsx(O7e,{children:t})]}));Mi.displayName=xX.displayName;const I7e=P.forwardRef(({className:e,...t},r)=>d.jsx(SX,{ref:r,className:lt("-mx-1 my-1 h-px bg-muted",e),...t}));I7e.displayName=SX.displayName;cg.filter(e=>tc[e.city]);const yh=cg,M7e=()=>{const[e,t]=P.useState("Paris"),[r,n]=P.useState("Paris"),[i,a]=P.useState(!1),{user:o}=vs(),s=gs(),l=yh.find(p=>p.city===e)??yh[0],c=yh.find(p=>p.city===r)??yh[0],u=tc[e],f=async()=>{if(!o){s("/auth");return}a(!0);try{const{data:p,error:h}=await wr.functions.invoke("create-report-payment",{body:{reportType:"city_deep_dive",cities:[r]}});if(h)throw h;p!=null&&p.url&&window.open(p.url,"_blank")}catch(p){xr.error(p.message||"Failed to start checkout")}finally{a(!1)}};return d.jsxs("section",{className:"container mx-auto px-4 py-16",children:[d.jsxs("div",{className:"mb-8 flex flex-col items-start justify-between gap-4 sm:flex-row sm:items-center",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-3xl font-bold",children:"City Market Intelligence"}),d.jsx("p",{className:"text-muted-foreground",children:"Select a city to explore detailed hotel market data"})]}),d.jsxs(Ya,{value:e,onValueChange:p=>{t(p),n(p)},children:[d.jsxs(ga,{className:"w-[220px] bg-card",children:[d.jsx(Yl,{className:"mr-2 h-4 w-4 text-primary"}),d.jsx(Xa,{placeholder:"Choose a city"})]}),d.jsx(va,{className:"z-50 bg-popover",children:yh.map(p=>d.jsxs(Mi,{value:p.city,children:[p.city,", ",p.country]},p.city))})]})]}),d.jsx(Z$e,{mode:"wait",children:d.jsxs(br.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:-12},transition:{duration:.3},children:[d.jsx($e,{className:"mb-6 overflow-hidden border-primary/20",children:d.jsx(De,{className:"p-0",children:d.jsx("div",{className:"bg-gradient-to-r from-primary/10 via-primary/5 to-transparent p-6",children:d.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[d.jsxs("div",{children:[d.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[d.jsx("h3",{className:"text-2xl font-bold",children:l.city}),d.jsx(Nt,{variant:"outline",className:"text-xs",children:l.country})]}),d.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-sm text-muted-foreground",children:[d.jsxs("span",{className:"flex items-center gap-1",children:[d.jsx(Yl,{className:"h-3.5 w-3.5"})," ",l.region]}),d.jsxs("span",{className:"flex items-center gap-1",children:[d.jsx(Jk,{className:"h-3.5 w-3.5"})," Peak: ",l.peakSeason]}),d.jsxs(Nt,{variant:l.competitionLevel==="Very High"||l.competitionLevel==="High"?"destructive":"secondary",className:"text-xs",children:[l.competitionLevel," Competition"]})]})]}),d.jsx("div",{className:"flex items-center gap-2",children:d.jsxs(Nt,{className:"gap-1 text-sm",variant:l.yoyGrowth>0?"default":"destructive",children:[l.yoyGrowth>0?d.jsx(Kl,{className:"h-3.5 w-3.5"}):d.jsx(lp,{className:"h-3.5 w-3.5"}),l.yoyGrowth>0?"+":"",l.yoyGrowth,"% YoY"]})})]})})})}),d.jsx("div",{className:"mb-6 grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-6",children:[{label:"3★ Avg Rate",value:`$${l.avgRate3Star}`,icon:cp,color:"text-yellow-500"},{label:"4★ Avg Rate",value:`$${l.avgRate4Star}`,icon:cp,color:"text-primary"},{label:"5★ Avg Rate",value:`$${l.avgRate5Star}`,icon:cp,color:"text-purple-500"},{label:"Occupancy",value:`${l.occupancyPct}%`,icon:Dl,color:"text-emerald-500"},{label:"RevPAR",value:`$${l.revPAR}`,icon:Ia,color:"text-blue-500"},{label:"YoY Growth",value:`${l.yoyGrowth>0?"+":""}${l.yoyGrowth}%`,icon:ri,color:l.yoyGrowth>0?"text-emerald-500":"text-destructive"}].map(p=>d.jsx($e,{children:d.jsxs(De,{className:"p-4",children:[d.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[d.jsx(p.icon,{className:`h-4 w-4 ${p.color}`}),d.jsx("span",{className:"text-xs text-muted-foreground",children:p.label})]}),d.jsx("p",{className:"text-xl font-bold",children:p.value})]})},p.label))}),d.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[u?d.jsxs($e,{children:[d.jsx(er,{className:"pb-2",children:d.jsx(tr,{className:"text-base",children:"12-Month Rate & RevPAR Trends"})}),d.jsx(De,{children:d.jsx("div",{className:"h-[280px]",children:d.jsx(Ka,{width:"100%",height:"100%",children:d.jsxs(lg,{data:u,children:[d.jsx(al,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),d.jsx(Qi,{dataKey:"month",tick:{fontSize:11},stroke:"hsl(var(--muted-foreground))"}),d.jsx(ma,{tick:{fontSize:11},stroke:"hsl(var(--muted-foreground))"}),d.jsx(En,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"8px",fontSize:12}}),d.jsx(xi,{type:"monotone",dataKey:"avgRate",stroke:"hsl(var(--primary))",fill:"hsl(var(--primary) / 0.15)",strokeWidth:2,name:"Avg Rate ($)"}),d.jsx(xi,{type:"monotone",dataKey:"revPAR",stroke:"hsl(var(--accent-foreground))",fill:"hsl(var(--accent) / 0.1)",strokeWidth:2,name:"RevPAR ($)"})]})})})})]}):d.jsxs($e,{children:[d.jsx(er,{className:"pb-2",children:d.jsx(tr,{className:"text-base",children:"Seasonal Rate Range"})}),d.jsx(De,{children:d.jsx("div",{className:"flex h-[280px] flex-col justify-center gap-6",children:[{label:"Peak Season",rate:l.peakRate,season:l.peakSeason,color:"bg-destructive/20 text-destructive"},{label:"Shoulder Season",rate:l.shoulderRate,season:"Transition",color:"bg-primary/20 text-primary"},{label:"Low Season",rate:l.lowRate,season:"Off-peak",color:"bg-emerald-500/20 text-emerald-600"}].map(p=>d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsx(Nt,{variant:"outline",className:`w-[120px] justify-center ${p.color}`,children:p.label}),d.jsxs("div",{className:"flex-1",children:[d.jsxs("div",{className:"mb-1 flex items-baseline justify-between",children:[d.jsxs("span",{className:"text-lg font-bold",children:["$",p.rate]}),d.jsx("span",{className:"text-xs text-muted-foreground",children:p.season})]}),d.jsx("div",{className:"h-2 w-full rounded-full bg-muted",children:d.jsx("div",{className:"h-2 rounded-full bg-primary/60",style:{width:`${p.rate/l.peakRate*100}%`}})})]})]},p.label))})})]}),d.jsxs($e,{children:[d.jsx(er,{className:"pb-2",children:d.jsx(tr,{className:"text-base",children:"Market Summary"})}),d.jsx(De,{children:d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{className:"rounded-lg bg-muted/50 p-3",children:[d.jsxs("div",{className:"mb-1 flex items-center gap-1.5 text-xs text-muted-foreground",children:[d.jsx(f3,{className:"h-3.5 w-3.5"})," Competition"]}),d.jsx("p",{className:"font-semibold",children:l.competitionLevel})]}),d.jsxs("div",{className:"rounded-lg bg-muted/50 p-3",children:[d.jsxs("div",{className:"mb-1 flex items-center gap-1.5 text-xs text-muted-foreground",children:[d.jsx(Jk,{className:"h-3.5 w-3.5"})," Peak Season"]}),d.jsx("p",{className:"font-semibold",children:l.peakSeason})]}),d.jsxs("div",{className:"rounded-lg bg-muted/50 p-3",children:[d.jsxs("div",{className:"mb-1 flex items-center gap-1.5 text-xs text-muted-foreground",children:[d.jsx(oc,{className:"h-3.5 w-3.5"})," Rate Range"]}),d.jsxs("p",{className:"font-semibold",children:["$",l.lowRate," – $",l.peakRate]})]}),d.jsxs("div",{className:"rounded-lg bg-muted/50 p-3",children:[d.jsxs("div",{className:"mb-1 flex items-center gap-1.5 text-xs text-muted-foreground",children:[d.jsx(g5,{className:"h-3.5 w-3.5"})," Region"]}),d.jsx("p",{className:"font-semibold",children:l.region})]})]}),d.jsxs("div",{children:[d.jsx("p",{className:"mb-3 text-xs font-medium text-muted-foreground",children:"Rate by Star Category"}),d.jsx("div",{className:"space-y-2",children:[{stars:"3★",rate:l.avgRate3Star,max:l.avgRate5Star},{stars:"4★",rate:l.avgRate4Star,max:l.avgRate5Star},{stars:"5★",rate:l.avgRate5Star,max:l.avgRate5Star}].map(p=>d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("span",{className:"w-8 text-sm font-medium",children:p.stars}),d.jsx("div",{className:"flex-1",children:d.jsx("div",{className:"h-6 w-full rounded bg-muted",children:d.jsxs("div",{className:"flex h-6 items-center rounded bg-primary/70 px-2 text-xs font-medium text-primary-foreground",style:{width:`${Math.max(p.rate/p.max*100,15)}%`},children:["$",p.rate]})})})]},p.stars))})]})]})})]})]}),d.jsxs($e,{className:"mt-8 overflow-hidden border-primary/20 relative",children:[d.jsxs("div",{className:"pointer-events-none select-none blur-sm opacity-50 p-6",children:[d.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[{label:"Tourism Arrivals",value:`${(c.occupancyPct*.12).toFixed(1)}M`},{label:"Tourism GDP %",value:`${(c.revPAR*.03).toFixed(1)}%`},{label:"Market Opp. Score",value:`${Math.min(99,Math.round(c.yoyGrowth*5+c.occupancyPct*.5))}/100`},{label:"AI Rate Forecast",value:`↑ ${(c.yoyGrowth+2.1).toFixed(1)}%`}].map(p=>d.jsxs("div",{className:"rounded-lg border p-3 text-center",children:[d.jsx("p",{className:"text-lg font-bold",children:p.value}),d.jsx("p",{className:"text-xs text-muted-foreground",children:p.label})]},p.label))}),d.jsxs("div",{className:"mt-4 grid grid-cols-2 gap-3",children:[d.jsxs("div",{className:"rounded-lg border p-3",children:[d.jsx("p",{className:"text-sm font-medium",children:"Competition Analysis"}),d.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Detailed breakdown of competitive landscape, supply pipeline, and market saturation metrics for investment decision-making."})]}),d.jsxs("div",{className:"rounded-lg border p-3",children:[d.jsx("p",{className:"text-sm font-medium",children:"Revenue Projections"}),d.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"5-year revenue forecast with conservative, moderate, and aggressive scenarios based on AI market analysis."})]})]})]}),d.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-background/70 backdrop-blur-[2px] p-6",children:[d.jsx("div",{className:"flex h-14 w-14 items-center justify-center rounded-full bg-primary/10 mb-4",children:d.jsx(Kp,{className:"h-7 w-7 text-primary"})}),d.jsx("h3",{className:"text-xl font-bold mb-1",children:"Get the Full City Report"}),d.jsx("p",{className:"text-sm text-muted-foreground mb-4 text-center max-w-md",children:"Unlock deep-dive analytics, AI forecasts, competition analysis, and revenue projections for any city."}),d.jsxs("div",{className:"flex flex-col sm:flex-row items-center gap-3 mb-3",children:[d.jsxs(Ya,{value:r,onValueChange:n,children:[d.jsxs(ga,{className:"w-[200px] bg-card",children:[d.jsx(Yl,{className:"mr-2 h-4 w-4 text-primary"}),d.jsx(Xa,{})]}),d.jsx(va,{className:"z-50 bg-popover",children:yh.map(p=>d.jsxs(Mi,{value:p.city,children:[p.city,", ",p.country]},p.city))})]}),d.jsxs(pt,{size:"lg",onClick:f,disabled:i,className:"gap-2",children:[i?d.jsx(Va,{className:"h-4 w-4 animate-spin"}):d.jsx(v5,{className:"h-4 w-4"}),i?"Loading…":"Buy Full Report — $49"]})]}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"One-time payment · Instant PDF delivery"})]})]})]},e)})]})},ia={hidden:{opacity:0,y:30},visible:{opacity:1,y:0,transition:{duration:.6,ease:[.25,.46,.45,.94]}}},ix={visible:{transition:{staggerChildren:.1}}},ZD=cg.slice(0,6);tc.Paris;const $7e=[{market:"USA",bookings:24},{market:"UK",bookings:18},{market:"Germany",bookings:14},{market:"France",bookings:12},{market:"China",bookings:10},{market:"Japan",bookings:8}],D7e=[{icon:oc,title:"Pricing Dashboard",desc:"Real-time average rates by city, star rating, and season with YoY comparisons."},{icon:Ay,title:"Market Explorer",desc:"Search and filter 120+ cities with granular hotel pricing data."},{icon:ri,title:"Trends Radar",desc:"Spot rising markets, demand shifts, and booking pattern changes before competitors."},{icon:Lne,title:"City Comparison",desc:"Side-by-side comparison of cities across pricing, occupancy, and growth metrics."},{icon:K0,title:"Occupancy Analytics",desc:"Track occupancy rates, RevPAR, and seasonal demand curves globally."},{icon:Kp,title:"Executive Reports",desc:"AI-generated summaries and exportable KPI scorecards per city or region."}],F7e=[{icon:g5,title:"Hotel Chains",desc:"Benchmark pricing across your portfolio vs. local competition."},{icon:Yp,title:"Investors",desc:"Identify high-growth hospitality markets for portfolio allocation."},{icon:ri,title:"Entrepreneurs",desc:"Validate hotel concepts with real market data before investing."},{icon:Dl,title:"Revenue Managers",desc:"Optimize ADR and RevPAR with granular competitive intelligence."}],B7e=[{q:"Where does HotelPulse data come from?",a:"We aggregate data from multiple sources including booking platforms, industry reports, government tourism statistics, and proprietary data partnerships — providing a comprehensive, real-time view of global hotel markets."},{q:"How often is the data updated?",a:"Core pricing and occupancy data updates daily for major markets. Trend analysis and market summaries refresh weekly. Historical data goes back 3+ years for most cities."},{q:"How many cities do you cover?",a:"Currently 120+ major cities across all continents. We're adding 10-15 new cities monthly, with priority based on user demand and data availability."},{q:"Can I export reports and data?",a:"Yes — Pro users can export CSV/PDF reports. Business and Enterprise users get full API access, white-label reports, and custom data exports."},{q:"Is this suitable for small hotel owners?",a:"Absolutely. Our Free and Pro tiers are designed for independent hoteliers and small chains to understand their competitive landscape without enterprise budgets."}],U7e=({value:e,suffix:t=""})=>d.jsxs(br.div,{className:"text-2xl font-bold text-primary md:text-3xl",initial:{opacity:0,scale:.5},whileInView:{opacity:1,scale:1},viewport:{once:!0},transition:{duration:.5,type:"spring"},children:[e,t]}),z7e=()=>d.jsxs(ei,{children:[d.jsx("section",{className:"relative overflow-hidden border-b bg-gradient-to-br from-secondary via-background to-secondary/50",children:d.jsx("div",{className:"container mx-auto px-4 py-12 md:py-20 lg:py-28",children:d.jsxs(br.div,{className:"mx-auto max-w-3xl text-center",initial:"hidden",animate:"visible",variants:ix,children:[d.jsx(br.div,{variants:ia,children:d.jsxs(Nt,{variant:"secondary",className:"mb-4 px-3 py-1 text-xs font-medium",children:[d.jsx(sc,{className:"mr-1.5 h-3 w-3"})," Covering 120+ cities worldwide"]})}),d.jsxs(br.h1,{variants:ia,className:"mb-4 text-3xl font-bold leading-tight tracking-tight md:mb-5 md:text-5xl lg:text-6xl",children:["Global Hotel Pricing Intelligence,"," ",d.jsx("span",{className:"text-primary",children:"In Real Time"})]}),d.jsx(br.p,{variants:ia,className:"mb-6 text-base text-muted-foreground md:mb-8 md:text-xl",children:"Global hotel pricing intelligence, occupancy trends, and market analytics for hotel chains, investors, and hospitality executives."}),d.jsxs(br.div,{variants:ia,className:"flex flex-wrap items-center justify-center gap-3",children:[d.jsx(pt,{size:"lg",asChild:!0,children:d.jsx(At,{to:"/pricing",children:"Get Started Free"})}),d.jsx(pt,{size:"lg",variant:"outline",asChild:!0,children:d.jsxs(At,{to:"/dashboard",children:["Explore Demo ",d.jsx(Gp,{className:"ml-1 h-4 w-4"})]})})]})]})})}),d.jsx("section",{className:"border-b bg-card",children:d.jsx("div",{className:"container mx-auto grid grid-cols-2 gap-4 px-4 py-6 md:grid-cols-4",children:[{label:"Cities Covered",value:Qb.citiesCovered+"+"},{label:"Hotels Tracked",value:Qb.hotelsTracked.toLocaleString()+"+"},{label:"Data Points",value:Qb.dataPoints+"+"},{label:"Avg. Cost Savings",value:Qb.avgSavings}].map((e,t)=>d.jsxs(br.div,{className:"text-center",initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{delay:t*.1,duration:.5},children:[d.jsx(U7e,{value:e.value}),d.jsx("div",{className:"text-xs text-muted-foreground",children:e.label})]},e.label))})}),d.jsx(M7e,{}),d.jsx(br.section,{className:"border-y bg-card",initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:ia,children:d.jsxs("div",{className:"container mx-auto px-4 py-10 md:py-16",children:[d.jsxs("div",{className:"mb-6 flex items-center justify-between md:mb-8",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-xl font-bold md:text-2xl",children:"City Leaderboard"}),d.jsx("p",{className:"text-xs text-muted-foreground md:text-sm",children:"Top cities by average nightly rate (4★ hotels)"})]}),d.jsx(pt,{variant:"outline",size:"sm",asChild:!0,children:d.jsxs(At,{to:"/explorer",children:["View All ",d.jsx(Gp,{className:"ml-1 h-3 w-3"})]})})]}),d.jsx("div",{className:"flex gap-3 overflow-x-auto pb-2 -mx-4 px-4 snap-x snap-mandatory md:hidden scrollbar-hide",children:ZD.map(e=>d.jsxs("div",{className:"min-w-[200px] snap-start rounded-lg border bg-background p-3 flex-shrink-0",children:[d.jsx("p",{className:"font-semibold text-sm",children:e.city}),d.jsx("p",{className:"text-[10px] text-muted-foreground mb-2",children:e.country}),d.jsxs("div",{className:"grid grid-cols-2 gap-y-1.5 text-xs",children:[d.jsxs("div",{children:[d.jsx("span",{className:"text-muted-foreground",children:"4★ "}),d.jsxs("span",{className:"font-bold",children:["$",e.avgRate4Star]})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-muted-foreground",children:"Occ. "}),d.jsxs("span",{className:"font-medium",children:[e.occupancyPct,"%"]})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-muted-foreground",children:"RevPAR "}),d.jsxs("span",{className:"font-medium",children:["$",e.revPAR]})]}),d.jsx("div",{children:d.jsxs("span",{className:`font-medium ${e.yoyGrowth>0?"text-primary":"text-destructive"}`,children:[e.yoyGrowth>0?"+":"",e.yoyGrowth,"% YoY"]})})]})]},e.city))}),d.jsx("div",{className:"hidden md:block overflow-auto rounded-lg border",children:d.jsxs(qm,{children:[d.jsx(Wm,{children:d.jsxs(Ba,{className:"bg-muted/50",children:[d.jsx(ir,{children:"City"}),d.jsx(ir,{className:"text-right",children:"3★ Avg."}),d.jsx(ir,{className:"text-right",children:"4★ Avg."}),d.jsx(ir,{className:"text-right",children:"5★ Avg."}),d.jsx(ir,{className:"text-right",children:"Occupancy"}),d.jsx(ir,{className:"text-right",children:"YoY"})]})}),d.jsx(Gm,{children:ZD.map(e=>d.jsxs(Ba,{children:[d.jsxs(Vt,{className:"font-medium",children:[e.city,d.jsx("span",{className:"ml-1.5 text-xs text-muted-foreground",children:e.country})]}),d.jsxs(Vt,{className:"text-right",children:["$",e.avgRate3Star]}),d.jsxs(Vt,{className:"text-right font-medium",children:["$",e.avgRate4Star]}),d.jsxs(Vt,{className:"text-right",children:["$",e.avgRate5Star]}),d.jsxs(Vt,{className:"text-right",children:[e.occupancyPct,"%"]}),d.jsx(Vt,{className:"text-right",children:d.jsxs("span",{className:e.yoyGrowth>0?"text-primary":"text-destructive",children:[e.yoyGrowth>0?"+":"",e.yoyGrowth,"%"]})})]},e.city))})]})})]})}),d.jsxs("section",{className:"container mx-auto px-4 py-16",children:[d.jsxs(br.div,{className:"mb-10 text-center",initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:ia,children:[d.jsx("h2",{className:"mb-2 text-3xl font-bold",children:"Trending Markets"}),d.jsx("p",{className:"text-muted-foreground",children:"Fastest-growing hotel markets worldwide"})]}),d.jsxs(br.div,{className:"grid gap-6 md:grid-cols-2",initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:ix,children:[d.jsxs(br.div,{variants:ia,children:[d.jsxs("h3",{className:"mb-4 flex items-center gap-2 text-lg font-semibold text-primary",children:[d.jsx(Kl,{className:"h-5 w-5"})," Rising Markets"]}),d.jsx("div",{className:"space-y-3",children:uIe.map(e=>d.jsx($e,{children:d.jsxs(De,{className:"flex items-center justify-between p-4",children:[d.jsxs("div",{children:[d.jsxs("p",{className:"font-medium",children:[e.city,", ",e.country]}),d.jsx("p",{className:"text-xs text-muted-foreground",children:e.metric})]}),d.jsxs(Nt,{className:"gap-1",children:[d.jsx(Kl,{className:"h-3 w-3"})," +",e.change,"%"]})]})},e.city))})]}),d.jsxs(br.div,{variants:ia,children:[d.jsx("h3",{className:"mb-4 text-lg font-semibold",children:"Top Source Markets"}),d.jsx($e,{children:d.jsx(De,{className:"p-4",children:d.jsx("div",{className:"h-[260px]",children:d.jsx(Ka,{width:"100%",height:"100%",children:d.jsxs(sg,{data:$7e,layout:"vertical",children:[d.jsx(al,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),d.jsx(Qi,{type:"number",tick:{fontSize:12},stroke:"hsl(var(--muted-foreground))"}),d.jsx(ma,{dataKey:"market",type:"category",tick:{fontSize:12},stroke:"hsl(var(--muted-foreground))",width:60}),d.jsx(En,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"8px",fontSize:12}}),d.jsx(Ji,{dataKey:"bookings",fill:"hsl(var(--primary))",radius:[0,4,4,0],name:"Booking Share %"})]})})})})})]})]})]}),d.jsx("section",{className:"border-y bg-card",children:d.jsxs("div",{className:"container mx-auto px-4 py-16",children:[d.jsxs(br.div,{className:"mb-10 text-center",initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:ia,children:[d.jsx("h2",{className:"mb-2 text-3xl font-bold",children:"Everything You Need for Hotel Market Intelligence"}),d.jsx("p",{className:"text-muted-foreground",children:"Powerful tools for data-driven hospitality decisions"})]}),d.jsx(br.div,{className:"grid gap-6 sm:grid-cols-2 lg:grid-cols-3",initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:ix,children:D7e.map(e=>d.jsx(br.div,{variants:ia,children:d.jsx($e,{className:"h-full transition-shadow hover:shadow-md",children:d.jsxs(De,{className:"p-6",children:[d.jsx("div",{className:"mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-primary/10",children:d.jsx(e.icon,{className:"h-5 w-5 text-primary"})}),d.jsx("h3",{className:"mb-1.5 font-semibold",children:e.title}),d.jsx("p",{className:"text-sm text-muted-foreground",children:e.desc})]})})},e.title))})]})}),d.jsxs("section",{className:"container mx-auto px-4 py-16",children:[d.jsxs(br.div,{className:"mb-10 text-center",initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:ia,children:[d.jsx("h2",{className:"mb-2 text-3xl font-bold",children:"Built For Hospitality Leaders"}),d.jsx("p",{className:"text-muted-foreground",children:"From independent owners to global chains"})]}),d.jsx(br.div,{className:"grid gap-6 sm:grid-cols-2 lg:grid-cols-4",initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:ix,children:F7e.map(e=>d.jsx(br.div,{variants:ia,children:d.jsx($e,{className:"h-full text-center",children:d.jsxs(De,{className:"p-6",children:[d.jsx("div",{className:"mx-auto mb-3 flex h-12 w-12 items-center justify-center rounded-full bg-secondary",children:d.jsx(e.icon,{className:"h-6 w-6 text-secondary-foreground"})}),d.jsx("h3",{className:"mb-1 font-semibold",children:e.title}),d.jsx("p",{className:"text-sm text-muted-foreground",children:e.desc})]})})},e.title))})]}),d.jsx("section",{className:"border-t bg-card",children:d.jsxs("div",{className:"container mx-auto max-w-3xl px-4 py-16",children:[d.jsx(br.h2,{className:"mb-8 text-center text-3xl font-bold",initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:ia,children:"Frequently Asked Questions"}),d.jsx(fV,{type:"single",collapsible:!0,className:"w-full",children:B7e.map((e,t)=>d.jsxs(tT,{value:`faq-${t}`,children:[d.jsx(rT,{className:"text-left",children:e.q}),d.jsx(nT,{className:"text-muted-foreground",children:e.a})]},t))})]})}),d.jsx("section",{className:"border-t bg-card",children:d.jsxs("div",{className:"container mx-auto px-4 py-12",children:[d.jsxs(br.div,{className:"mb-8 text-center",initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:ia,children:[d.jsx("h2",{className:"mb-2 text-2xl font-bold",children:"Browse Hotel Markets"}),d.jsx("p",{className:"text-muted-foreground",children:"Explore detailed hotel market data by city or country"})]}),d.jsxs("div",{className:"grid gap-8 md:grid-cols-2",children:[d.jsxs("div",{children:[d.jsxs("h3",{className:"mb-3 flex items-center gap-2 text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:[d.jsx(Yl,{className:"h-4 w-4"})," By City"]}),d.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3",children:e1.map(e=>d.jsx(At,{to:`/city/${e.slug}`,className:"rounded-md border px-3 py-2 text-sm hover:bg-accent hover:text-accent-foreground transition-colors",children:e.city},e.slug))})]}),d.jsxs("div",{children:[d.jsxs("h3",{className:"mb-3 flex items-center gap-2 text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:[d.jsx(sc,{className:"h-4 w-4"})," By Country"]}),d.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3",children:K3.map(e=>d.jsx(At,{to:`/country/${e.slug}`,className:"rounded-md border px-3 py-2 text-sm hover:bg-accent hover:text-accent-foreground transition-colors",children:e.country},e.slug))})]})]})]})}),d.jsx(br.section,{className:"bg-gradient-to-r from-primary to-primary/80",initial:{opacity:0},whileInView:{opacity:1},viewport:{once:!0},transition:{duration:.8},children:d.jsxs("div",{className:"container mx-auto px-4 py-16 text-center",children:[d.jsx("h2",{className:"mb-3 text-3xl font-bold text-primary-foreground",children:"Start Making Smarter Hotel Decisions Today"}),d.jsx("p",{className:"mb-6 text-primary-foreground/80",children:"Join thousands of hospitality professionals using HotelPulse to stay ahead of the market."}),d.jsxs("div",{className:"flex flex-wrap justify-center gap-3",children:[d.jsx(pt,{size:"lg",variant:"secondary",asChild:!0,children:d.jsx(At,{to:"/pricing",children:"Get Started Free"})}),d.jsx(pt,{size:"lg",variant:"outline",className:"border-primary-foreground/30 text-primary-foreground hover:bg-primary-foreground/10",asChild:!0,children:d.jsx(At,{to:"/dashboard",children:"View Demo"})})]})]})})]}),kX=zH,H7e=HH,jX=P.forwardRef(({className:e,...t},r)=>d.jsx(L5,{ref:r,className:lt("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}));jX.displayName=L5.displayName;const HO=P.forwardRef(({className:e,children:t,...r},n)=>d.jsxs(H7e,{children:[d.jsx(jX,{}),d.jsxs(I5,{ref:n,className:lt("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,d.jsxs(VH,{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:[d.jsx(Xp,{className:"h-4 w-4"}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));HO.displayName=I5.displayName;const NX=({className:e,...t})=>d.jsx("div",{className:lt("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});NX.displayName="DialogHeader";const EX=P.forwardRef(({className:e,...t},r)=>d.jsx(M5,{ref:r,className:lt("text-lg font-semibold leading-none tracking-tight",e),...t}));EX.displayName=M5.displayName;const CX=P.forwardRef(({className:e,...t},r)=>d.jsx($5,{ref:r,className:lt("text-sm text-muted-foreground",e),...t}));CX.displayName=$5.displayName;const V7e="https://cefnrlcowzpdlfmevmwq.supabase.co",QD="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImNlZm5ybGNvd3pwZGxmbWV2bXdxIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzE5NzE1MTYsImV4cCI6MjA4NzU0NzUxNn0.IhRFsa5YZnoEBVnWUWa0lf_ZS3xanbiOi7lsS8mrX1A";function q7e(e){var n;const t=(n=e.world_bank_data)==null?void 0:n.computed;if(!t)return null;const r=[];if(t.avg_spend_per_tourist!=null&&r.push(Math.min(t.avg_spend_per_tourist/2e3,1)*100),t.arrivals_yoy_pct!=null&&r.push(Math.min(Math.max((t.arrivals_yoy_pct+10)/40,0),1)*100),t.gdp_growth_pct!=null&&r.push(Math.min(Math.max((t.gdp_growth_pct+2)/12,0),1)*100),t.arrivals_millions!=null&&t.country_population!=null&&t.country_population>0){const i=t.arrivals_millions*1e6/t.country_population;r.push(Math.min(i/3,1)*100)}return e.occupancy_pct!=null&&r.push(e.occupancy_pct),r.length<2?null:Math.round(r.reduce((i,a)=>i+a,0)/r.length)}function W7e(e){var n;const t=e.avg_rate_4star??0,r=(n=e.world_bank_data)==null?void 0:n.computed;return{city:e.city,country:e.country,region:e.region,avgRate3Star:e.avg_rate_3star??Math.round(t*.65),avgRate4Star:t,avgRate5Star:e.avg_rate_5star??Math.round(t*1.8),occupancyPct:e.occupancy_pct??75,revPAR:e.revpar??Math.round(t*.75),yoyGrowth:e.yoy_growth??0,competitionLevel:e.competition_level||"Medium",peakSeason:e.peak_season??"—",peakRate:e.max_rate??Math.round(t*1.3),shoulderRate:t,lowRate:e.min_rate??Math.round(t*.6),hotelCount:e.hotel_count,aiInsights:e.ai_insights,isLive:!0,tourismArrivals:e.tourism_arrivals_millions,tourismGdpPct:e.tourism_gdp_pct,tourismRevenue:e.tourism_revenue_billions,tourismArrivalsYoy:e.tourism_arrivals_yoy,marketNews:e.market_news,regulatoryNotes:e.regulatory_notes,perplexityInsights:e.perplexity_insights,scrapedData:e.scraped_data,worldBankData:e.world_bank_data,dataSourcesUpdatedAt:e.data_sources_updated_at,hotelCount3Star:e.hotel_count_3star??0,hotelCount4Star:e.hotel_count_4star??0,hotelCount5Star:e.hotel_count_5star??0,aiPredictions:e.ai_predictions??null,exchangeRateUsd:e.exchange_rate_usd??null,costOfLivingIndex:e.cost_of_living_index??null,currencyCode:e.currency_code??null,eventsData:e.events_data??null,strData:e.str_data??null,population:e.population??null,cityCoordinates:e.city_coordinates??null,unescoSites:e.unesco_sites??[],eurostatData:e.eurostat_data??null,gdpGrowth:(r==null?void 0:r.gdp_growth_pct)??null,gdpPerCapita:(r==null?void 0:r.gdp_per_capita_usd)??null,inflationRate:(r==null?void 0:r.inflation_cpi_pct)??null,countryPopulation:(r==null?void 0:r.country_population)??null,avgSpendPerTourist:(r==null?void 0:r.avg_spend_per_tourist)??null,tourismRevenuePerCapita:(r==null?void 0:r.tourism_revenue_per_capita)??null,tourismReceiptsPctExports:(r==null?void 0:r.tourism_receipts_pct_exports)??null,tourismDepartures:(r==null?void 0:r.tourism_departures)??null,tourismValueIndex:q7e(e)}}function Sc(){return fp({queryKey:["city-market-data"],queryFn:async()=>{const{data:e,error:t}=await wr.from("city_market_data").select("*").order("city");if(t)throw t;return e&&e.length>0?e.map(W7e):cg.map(r=>({...r,hotelCount:0,aiInsights:null,isLive:!1,tourismArrivals:null,tourismGdpPct:null,tourismRevenue:null,tourismArrivalsYoy:null,marketNews:null,regulatoryNotes:null,perplexityInsights:null,scrapedData:null,worldBankData:null,dataSourcesUpdatedAt:null,hotelCount3Star:0,hotelCount4Star:0,hotelCount5Star:0,aiPredictions:null,exchangeRateUsd:null,costOfLivingIndex:null,currencyCode:null,eventsData:null,strData:null,population:null,cityCoordinates:null,unescoSites:[],eurostatData:null,gdpGrowth:null,gdpPerCapita:null,inflationRate:null,countryPopulation:null,avgSpendPerTourist:null,tourismRevenuePerCapita:null,tourismReceiptsPctExports:null,tourismDepartures:null,tourismValueIndex:null}))},staleTime:1e3*60*10})}function TX(){return{refresh:async(t=5,r=0)=>{const{data:n,error:i}=await wr.functions.invoke("aggregate-city-data",{body:{batch_size:t,offset:r}});if(i)throw i;return n}}}function G7e(){return{generate:async(t=10)=>{const{data:r,error:n}=await wr.functions.invoke("generate-city-insights",{body:{batch_size:t}});if(n)throw n;return r}}}function OX(){return{enrich:async(t=5,r=0,n=["perplexity","firecrawl","world_bank","exchange_rates","events","str","wikidata","eurostat"])=>{const i=new AbortController,a=setTimeout(()=>i.abort(),18e4);try{const o=await fetch(`${V7e}/functions/v1/batch-enrich-cities`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${QD}`,apikey:QD},body:JSON.stringify({batch_size:t,offset:r,sources:n}),signal:i.signal});if(clearTimeout(a),!o.ok){const s=await o.json().catch(()=>({error:o.statusText}));throw new Error(s.error||`Enrichment failed (${o.status})`)}return await o.json()}catch(o){throw clearTimeout(a),o.name==="AbortError"?new Error("Enrichment timed out — but it may still be running in the background. Refresh in a minute."):o}}}}function K7e(){return{generate:async(t,r,n)=>{const{data:i,error:a}=await wr.functions.invoke("generate-report",{body:{report_type:t,cities:r,region:n}});if(a)throw a;return i}}}var mP="rovingFocusGroup.onEntryFocus",Y7e={bubbles:!1,cancelable:!0},m1="RovingFocusGroup",[UE,RX,X7e]=V0(m1),[J7e,LX]=Qa(m1,[X7e]),[Z7e,Q7e]=J7e(m1),IX=P.forwardRef((e,t)=>d.jsx(UE.Provider,{scope:e.__scopeRovingFocusGroup,children:d.jsx(UE.Slot,{scope:e.__scopeRovingFocusGroup,children:d.jsx(eFe,{...e,ref:t})})}));IX.displayName=m1;var eFe=P.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...f}=e,p=P.useRef(null),h=qt(t,p),g=t1(a),[m,v]=Ga({prop:o,defaultProp:s??null,onChange:l,caller:m1}),[y,b]=P.useState(!1),x=No(c),S=RX(r),_=P.useRef(!1),[k,E]=P.useState(0);return P.useEffect(()=>{const O=p.current;if(O)return O.addEventListener(mP,x),()=>O.removeEventListener(mP,x)},[x]),d.jsx(Z7e,{scope:r,orientation:n,dir:g,loop:i,currentTabStopId:m,onItemFocus:P.useCallback(O=>v(O),[v]),onItemShiftTab:P.useCallback(()=>b(!0),[]),onFocusableItemAdd:P.useCallback(()=>E(O=>O+1),[]),onFocusableItemRemove:P.useCallback(()=>E(O=>O-1),[]),children:d.jsx(ft.div,{tabIndex:y||k===0?-1:0,"data-orientation":n,...f,ref:h,style:{outline:"none",...e.style},onMouseDown:qe(e.onMouseDown,()=>{_.current=!0}),onFocus:qe(e.onFocus,O=>{const R=!_.current;if(O.target===O.currentTarget&&R&&!y){const $=new CustomEvent(mP,Y7e);if(O.currentTarget.dispatchEvent($),!$.defaultPrevented){const N=S().filter(Y=>Y.focusable),C=N.find(Y=>Y.active),D=N.find(Y=>Y.id===m),G=[C,D,...N].filter(Boolean).map(Y=>Y.ref.current);DX(G,u)}}_.current=!1}),onBlur:qe(e.onBlur,()=>b(!1))})})}),MX="RovingFocusGroupItem",$X=P.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:a,children:o,...s}=e,l=_o(),c=a||l,u=Q7e(MX,r),f=u.currentTabStopId===c,p=RX(r),{onFocusableItemAdd:h,onFocusableItemRemove:g,currentTabStopId:m}=u;return P.useEffect(()=>{if(n)return h(),()=>g()},[n,h,g]),d.jsx(UE.ItemSlot,{scope:r,id:c,focusable:n,active:i,children:d.jsx(ft.span,{tabIndex:f?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:qe(e.onMouseDown,v=>{n?u.onItemFocus(c):v.preventDefault()}),onFocus:qe(e.onFocus,()=>u.onItemFocus(c)),onKeyDown:qe(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){u.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const y=nFe(v,u.orientation,u.dir);if(y!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let x=p().filter(S=>S.focusable).map(S=>S.ref.current);if(y==="last")x.reverse();else if(y==="prev"||y==="next"){y==="prev"&&x.reverse();const S=x.indexOf(v.currentTarget);x=u.loop?iFe(x,S+1):x.slice(S+1)}setTimeout(()=>DX(x))}}),children:typeof o=="function"?o({isCurrentTabStop:f,hasTabStop:m!=null}):o})})});$X.displayName=MX;var tFe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function rFe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function nFe(e,t,r){const n=rFe(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return tFe[n]}function DX(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function iFe(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var aFe=IX,oFe=$X,F_="Tabs",[sFe,dqe]=Qa(F_,[LX]),FX=LX(),[lFe,VO]=sFe(F_),BX=P.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:i,defaultValue:a,orientation:o="horizontal",dir:s,activationMode:l="automatic",...c}=e,u=t1(s),[f,p]=Ga({prop:n,onChange:i,defaultProp:a??"",caller:F_});return d.jsx(lFe,{scope:r,baseId:_o(),value:f,onValueChange:p,orientation:o,dir:u,activationMode:l,children:d.jsx(ft.div,{dir:u,"data-orientation":o,...c,ref:t})})});BX.displayName=F_;var UX="TabsList",zX=P.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...i}=e,a=VO(UX,r),o=FX(r);return d.jsx(aFe,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:n,children:d.jsx(ft.div,{role:"tablist","aria-orientation":a.orientation,...i,ref:t})})});zX.displayName=UX;var HX="TabsTrigger",VX=P.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:i=!1,...a}=e,o=VO(HX,r),s=FX(r),l=GX(o.baseId,n),c=KX(o.baseId,n),u=n===o.value;return d.jsx(oFe,{asChild:!0,...s,focusable:!i,active:u,children:d.jsx(ft.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:l,...a,ref:t,onMouseDown:qe(e.onMouseDown,f=>{!i&&f.button===0&&f.ctrlKey===!1?o.onValueChange(n):f.preventDefault()}),onKeyDown:qe(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&o.onValueChange(n)}),onFocus:qe(e.onFocus,()=>{const f=o.activationMode!=="manual";!u&&!i&&f&&o.onValueChange(n)})})})});VX.displayName=HX;var qX="TabsContent",WX=P.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:i,children:a,...o}=e,s=VO(qX,r),l=GX(s.baseId,n),c=KX(s.baseId,n),u=n===s.value,f=P.useRef(u);return P.useEffect(()=>{const p=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(p)},[]),d.jsx(ms,{present:i||u,children:({present:p})=>d.jsx(ft.div,{"data-state":u?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:c,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:p&&a})})});WX.displayName=qX;function GX(e,t){return`${e}-trigger-${t}`}function KX(e,t){return`${e}-content-${t}`}var cFe=BX,YX=zX,XX=VX,JX=WX;const ZX=cFe,qO=P.forwardRef(({className:e,...t},r)=>d.jsx(YX,{ref:r,className:lt("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));qO.displayName=YX.displayName;const Gd=P.forwardRef(({className:e,...t},r)=>d.jsx(XX,{ref:r,className:lt("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",e),...t}));Gd.displayName=XX.displayName;const Kd=P.forwardRef(({className:e,...t},r)=>d.jsx(JX,{ref:r,className:lt("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Kd.displayName=JX.displayName;const e7={free:0,pro:1,business:2,enterprise:3},uFe={pro:"price_1T4UKWRbfixZ0wCpcOLMGsWk",business:"price_1T4UKXRbfixZ0wCpzkBVuP0y",enterprise:"price_1T4UKZRbfixZ0wCpsfX33MWv"},dFe={pro:{name:"Pro",price:"$99/mo"},business:{name:"Business",price:"$249/mo"},enterprise:{name:"Enterprise",price:"$599/mo"}},Da=({requiredTier:e,featureName:t,children:r,preview:n=!1})=>{const{user:i,subscriptionTier:a}=vs(),o=gs(),[s,l]=P.useState(!1);if(i&&e7[a]>=e7[e])return d.jsx(d.Fragment,{children:r});const u=dFe[e],f=async()=>{if(!i){o("/pricing");return}l(!0);try{const{data:h,error:g}=await wr.functions.invoke("create-checkout",{body:{priceId:uFe[e],tier:e}});if(g)throw g;h!=null&&h.url&&window.open(h.url,"_blank")}catch(h){xr.error(h.message||"Failed to start checkout")}finally{l(!1)}},p=d.jsx($e,{className:"border-dashed border-2 border-primary/30 bg-muted/30",children:d.jsxs(De,{className:"flex flex-col items-center gap-3 py-5 px-4 text-center",children:[d.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-primary/10",children:d.jsx(v5,{className:"h-4 w-4 text-primary"})}),d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-semibold sm:text-base",children:t}),d.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground sm:text-sm",children:i?`Upgrade to ${u.name} to unlock`:"Sign in to unlock"})]}),d.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[d.jsx(pt,{size:"sm",onClick:f,disabled:s,children:s?"Loading...":i?`${u.name} — ${u.price}`:"Sign in"}),i&&d.jsx(pt,{variant:"ghost",size:"sm",onClick:()=>o("/pricing"),children:"Compare plans"})]})]})});return n?d.jsxs("div",{className:"relative overflow-hidden rounded-lg",children:[d.jsx("div",{className:"pointer-events-none select-none blur-sm opacity-40 max-h-24 overflow-hidden",children:r}),d.jsx("div",{className:"mt-2",children:p})]}):p},gP="https://cefnrlcowzpdlfmevmwq.supabase.co",bh="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImNlZm5ybGNvd3pwZGxmbWV2bXdxIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzE5NzE1MTYsImV4cCI6MjA4NzU0NzUxNn0.IhRFsa5YZnoEBVnWUWa0lf_ZS3xanbiOi7lsS8mrX1A",fFe=e=>{const t={Low:25,Medium:15,High:5,"Very High":0};return Math.min(100,Math.max(0,Math.round(e.yoyGrowth*3+e.occupancyPct*.4+(t[e.competitionLevel]??10))))},hFe=e=>{if(!e.aiPredictions)return"N/A";const t=e.aiPredictions;return t.rate_direction?`${t.rate_direction==="up"?"↑":t.rate_direction==="down"?"↓":"→"} ${t.rate_change_pct??""}%`:t.momentum_score!=null?`Score: ${t.momentum_score}`:"N/A"},QX=({city:e,onClose:t,onEnriched:r})=>{var g,m,v,y,b,x,S;const{isAdmin:n,subscriptionTier:i,user:a}=vs(),o=["pro","business","enterprise"].includes(i),[s,l]=P.useState(!1),c=e.perplexityInsights&&Object.keys(e.perplexityInsights).length>0,u=e.worldBankData&&Object.keys(e.worldBankData).length>0,f=e.scrapedData&&Object.keys(e.scrapedData).length>0&&((g=e.scrapedData.search_results)==null?void 0:g.length)>0,p=async()=>{l(!0);try{const _=[fetch(`${gP}/functions/v1/enrich-city-perplexity`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${bh}`,apikey:bh},body:JSON.stringify({city:e.city,country:e.country})}),fetch(`${gP}/functions/v1/scrape-tourism-data`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${bh}`,apikey:bh},body:JSON.stringify({city:e.city,country:e.country})}),fetch(`${gP}/functions/v1/fetch-world-bank-data`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${bh}`,apikey:bh},body:JSON.stringify({city:e.city,country:e.country})})];await Promise.all(_),xr.success(`Enriched ${e.city} successfully`),r==null||r()}catch(_){xr.error(_.message||"Enrichment failed")}finally{l(!1)}},h=()=>d.jsxs("div",{className:"text-center py-4 space-y-3",children:[d.jsxs("p",{className:"text-sm text-muted-foreground",children:["No data available for ",e.city," yet."]}),n&&d.jsxs(pt,{size:"sm",variant:"outline",onClick:p,disabled:s,children:[s?d.jsx(Va,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):d.jsx(lc,{className:"mr-1.5 h-3.5 w-3.5"}),s?"Enriching…":`Enrich ${e.city}`]})]});return d.jsxs($e,{className:"border-primary/20 overflow-hidden",children:[d.jsx(er,{className:"pb-3 px-3 sm:px-6",children:d.jsxs("div",{className:"flex items-start justify-between gap-2",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsxs(tr,{className:"text-base sm:text-lg leading-tight",children:[e.city,", ",e.country]}),d.jsx("span",{className:"text-xs sm:text-sm text-muted-foreground",children:e.region})]}),d.jsx("button",{onClick:t,className:"text-muted-foreground hover:text-foreground text-sm shrink-0 mt-0.5",children:"✕"})]})}),d.jsx(De,{className:"px-3 sm:px-6",children:d.jsxs(ZX,{defaultValue:"overview",children:[d.jsxs(qO,{className:"mb-4 w-full flex overflow-x-auto",children:[d.jsx(Gd,{value:"overview",className:"text-xs sm:text-sm flex-1",children:"Overview"}),d.jsx(Gd,{value:"tourism",className:"text-xs sm:text-sm flex-1",children:"Tourism"}),d.jsx(Gd,{value:"news",className:"text-xs sm:text-sm flex-1",children:"News"}),d.jsx(Gd,{value:"sources",className:"text-xs sm:text-sm flex-1",children:"Sources"})]}),d.jsxs(Kd,{value:"overview",children:[d.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-4",children:[d.jsx(Ir,{icon:Ia,label:"4★ Avg Rate",value:`$${e.avgRate4Star}`}),d.jsx(Ir,{icon:Dl,label:"Occupancy",value:`${e.occupancyPct}%`}),d.jsx(Ir,{icon:ri,label:"RevPAR",value:`$${e.revPAR}`}),d.jsx(Ir,{icon:oc,label:"YoY Growth",value:`${e.yoyGrowth>0?"+":""}${e.yoyGrowth}%`})]}),d.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-4",children:[d.jsx(Ir,{icon:Dl,label:"Population",value:e.population?e.population.toLocaleString():"—"}),d.jsx(Ir,{icon:sc,label:"Tourist Arrivals",value:e.tourismArrivals?`${e.tourismArrivals}M`:"—"}),d.jsx(Ir,{icon:Sne,label:"Exchange Rate",value:e.exchangeRateUsd&&e.currencyCode?`1 USD = ${e.exchangeRateUsd} ${e.currencyCode}`:"—"}),d.jsx(Ir,{icon:oc,label:"Cost of Living",value:e.costOfLivingIndex?`${e.costOfLivingIndex}`:"—"})]}),(e.gdpGrowth!=null||e.inflationRate!=null||e.gdpPerCapita!=null)&&d.jsxs("div",{className:"mt-4",children:[d.jsxs("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-3 flex items-center gap-1.5",children:[d.jsx(K0,{className:"h-3.5 w-3.5"})," ",e.country," Economy"]}),d.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3",children:[e.gdpGrowth!=null&&d.jsx(Ir,{icon:ri,label:"GDP Growth",value:`${e.gdpGrowth>0?"+":""}${e.gdpGrowth.toFixed(1)}%`}),e.inflationRate!=null&&d.jsx(Ir,{icon:yw,label:"Inflation",value:`${e.inflationRate.toFixed(1)}%`}),e.gdpPerCapita!=null&&d.jsx(Ir,{icon:Ia,label:"GDP/Capita",value:`$${(e.gdpPerCapita/1e3).toFixed(1)}K`})]})]}),(e.avgSpendPerTourist!=null||e.tourismRevenuePerCapita!=null||e.tourismValueIndex!=null)&&d.jsxs("div",{className:"mt-4",children:[d.jsxs("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-3 flex items-center gap-1.5",children:[d.jsx(Ia,{className:"h-3.5 w-3.5"})," Tourism Spend"]}),d.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3",children:[e.avgSpendPerTourist!=null&&d.jsx(Ir,{icon:Ia,label:"Avg Spend/Tourist",value:`$${Math.round(e.avgSpendPerTourist).toLocaleString()}`}),e.tourismRevenuePerCapita!=null&&d.jsx(Ir,{icon:Dl,label:"Revenue/Capita",value:`$${Math.round(e.tourismRevenuePerCapita).toLocaleString()}`}),e.tourismReceiptsPctExports!=null&&d.jsx(Ir,{icon:yw,label:"% of Exports",value:`${e.tourismReceiptsPctExports.toFixed(1)}%`})]}),e.tourismValueIndex!=null&&d.jsx("div",{className:"mt-2 flex items-center gap-2",children:d.jsxs(Nt,{variant:"default",className:"text-xs",children:["Tourism Value Index™: ",e.tourismValueIndex,"/100"]})})]}),d.jsxs("div",{className:"mt-4",children:[d.jsx("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-3",children:"Premium Insights"}),d.jsx(Da,{requiredTier:"pro",featureName:"Pro Market Metrics",preview:!0,children:d.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[d.jsx(Ir,{icon:cp,label:"3★ Avg Rate",value:`$${e.avgRate3Star}`}),d.jsx(Ir,{icon:cp,label:"5★ Avg Rate",value:`$${e.avgRate5Star}`}),d.jsx(Ir,{icon:Bne,label:"Peak Rate",value:`$${e.peakRate}`}),d.jsx(Ir,{icon:Yp,label:"Opportunity",value:`${fFe(e)}/100`})]})}),d.jsx("div",{className:"mt-3",children:d.jsx(Da,{requiredTier:"business",featureName:"Business Intelligence",preview:!0,children:d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsx(Ir,{icon:$U,label:"Competition",value:e.competitionLevel}),d.jsx(Ir,{icon:Pne,label:"AI Forecast",value:hFe(e)})]})})})]}),e.aiInsights&&d.jsxs("div",{className:"rounded-lg bg-muted/50 p-3 mt-2",children:[d.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-1",children:"AI Analysis"}),d.jsx("p",{className:"text-sm",children:e.aiInsights})]})]}),d.jsx(Kd,{value:"tourism",children:o?d.jsxs(d.Fragment,{children:[c&&e.perplexityInsights.stats_summary?d.jsxs("div",{className:"space-y-4",children:[d.jsx("div",{className:"prose prose-sm max-w-none dark:prose-invert",children:d.jsx("div",{className:"whitespace-pre-wrap text-sm text-muted-foreground",children:e.perplexityInsights.stats_summary})}),((m=e.perplexityInsights.citations)==null?void 0:m.length)>0&&d.jsxs("div",{className:"mt-3",children:[d.jsxs("p",{className:"text-xs font-medium text-muted-foreground mb-1",children:["Sources (",e.perplexityInsights.citations.length,")"]}),d.jsx("div",{className:"flex flex-wrap gap-1",children:e.perplexityInsights.citations.slice(0,8).map((_,k)=>d.jsxs("a",{href:_,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline truncate max-w-[200px]",children:["[",k+1,"] ",new URL(_).hostname]},k))})]})]}):u?d.jsxs("div",{className:"space-y-3",children:[d.jsxs("p",{className:"text-sm text-muted-foreground",children:["Tourism indicators for ",e.country,":"]}),((y=(v=e.worldBankData.arrivals)==null?void 0:v.timeseries)==null?void 0:y.length)>0&&d.jsxs("div",{className:"rounded-lg border p-3",children:[d.jsx("p",{className:"text-xs font-medium mb-2",children:"International Arrivals (by year)"}),d.jsx("div",{className:"flex gap-4 overflow-x-auto",children:e.worldBankData.arrivals.timeseries.slice(0,5).map(_=>d.jsxs("div",{className:"text-center shrink-0",children:[d.jsxs("p",{className:"text-lg font-bold",children:[(_.value/1e6).toFixed(1),"M"]}),d.jsx("p",{className:"text-xs text-muted-foreground",children:_.year})]},_.year))})]})]}):d.jsx(h,{}),e.eurostatData&&(e.eurostatData.nights_spent||e.eurostatData.bed_places)&&d.jsxs("div",{className:"mt-4",children:[d.jsxs("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-2 flex items-center gap-1.5",children:[d.jsx(Ex,{className:"h-3.5 w-3.5"})," Eurostat Accommodation Stats"]}),d.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.eurostatData.nights_spent&&d.jsx(Ir,{icon:Dl,label:`Nights Spent (${e.eurostatData.nights_spent_year||""})`,value:e.eurostatData.nights_spent.toLocaleString()}),e.eurostatData.bed_places&&d.jsx(Ir,{icon:Ex,label:`Bed Places (${e.eurostatData.bed_places_year||""})`,value:e.eurostatData.bed_places.toLocaleString()})]})]}),e.unescoSites&&e.unescoSites.length>0&&d.jsxs("div",{className:"mt-4",children:[d.jsxs("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-2 flex items-center gap-1.5",children:[d.jsx(Mne,{className:"h-3.5 w-3.5"})," UNESCO World Heritage Sites (",e.unescoSites.length,")"]}),d.jsxs("div",{className:"space-y-1.5",children:[e.unescoSites.slice(0,10).map((_,k)=>d.jsx("div",{className:"rounded-lg border p-2 flex items-center justify-between gap-2",children:d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"text-sm font-medium truncate",children:_.name}),d.jsxs("p",{className:"text-xs text-muted-foreground",children:[_.type,_.year_inscribed?` · ${_.year_inscribed}`:""]})]})},k)),e.unescoSites.length>10&&d.jsxs("p",{className:"text-xs text-muted-foreground text-center",children:["+",e.unescoSites.length-10," more sites"]})]})]}),((x=(b=e.eventsData)==null?void 0:b.events)==null?void 0:x.length)>0&&d.jsxs("div",{className:"mt-4",children:[d.jsxs("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-2 flex items-center gap-1.5",children:[d.jsx(jne,{className:"h-3.5 w-3.5"})," Upcoming Events"]}),d.jsx("div",{className:"space-y-2",children:e.eventsData.events.slice(0,6).map((_,k)=>d.jsxs("div",{className:"rounded-lg border p-2.5 flex items-start justify-between gap-2",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx("p",{className:"text-sm font-medium truncate",children:_.name}),d.jsxs("p",{className:"text-xs text-muted-foreground",children:[_.date_start,_.date_end&&_.date_end!==_.date_start?` → ${_.date_end}`:"",_.type&&d.jsx(Nt,{variant:"outline",className:"ml-2 text-[10px] py-0",children:_.type})]})]}),_.impact&&d.jsx(Nt,{variant:_.impact==="high"?"destructive":_.impact==="medium"?"default":"secondary",className:"text-[10px] shrink-0",children:_.impact})]},k))})]})]}):d.jsx(Da,{requiredTier:"pro",featureName:"Tourism Intelligence",preview:!0,children:d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[d.jsx(Ir,{icon:Dl,label:"Tourist Arrivals",value:e.tourismArrivals?`${e.tourismArrivals}M`:"—"}),d.jsx(Ir,{icon:Ex,label:"Bed Places",value:"—"})]}),d.jsx("div",{className:"rounded-lg border p-3 h-20"}),d.jsx("div",{className:"rounded-lg border p-3 h-16"})]})})}),d.jsx(Kd,{value:"news",children:d.jsx(Da,{requiredTier:"pro",featureName:"Market News & STR Data",preview:!0,children:d.jsxs("div",{className:"space-y-3",children:[e.marketNews?d.jsx("div",{className:"whitespace-pre-wrap text-sm text-muted-foreground",children:e.marketNews}):d.jsxs("div",{className:"text-sm text-muted-foreground text-center py-4",children:["No market news yet for ",e.city,"."]}),e.strData&&e.strData.estimated_listings&&d.jsxs("div",{className:"mt-4",children:[d.jsxs("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-2 flex items-center gap-1.5",children:[d.jsx(dL,{className:"h-3.5 w-3.5"})," Short-Term Rental Market"]}),d.jsxs("div",{className:"grid grid-cols-2 gap-2 mb-3",children:[d.jsx(Ir,{icon:dL,label:"Est. Listings",value:((S=e.strData.estimated_listings)==null?void 0:S.toLocaleString())||"—"}),d.jsx(Ir,{icon:Ia,label:"Avg Nightly Rate",value:e.strData.avg_nightly_rate_usd?`$${e.strData.avg_nightly_rate_usd}`:"—"})]}),e.strData.regulation_summary&&d.jsxs("div",{className:"rounded-lg bg-muted/50 p-2.5",children:[d.jsx("div",{className:"flex items-center gap-1.5 mb-1",children:d.jsx(Nt,{variant:e.strData.regulation_status==="regulated"?"default":e.strData.regulation_status==="banned"?"destructive":"secondary",className:"text-[10px]",children:e.strData.regulation_status})}),d.jsx("p",{className:"text-xs text-muted-foreground",children:e.strData.regulation_summary})]})]})]})})}),d.jsx(Kd,{value:"sources",children:d.jsx(Da,{requiredTier:"business",featureName:"Data Sources & Research",preview:!0,children:d.jsx("div",{className:"space-y-3",children:f?d.jsxs(d.Fragment,{children:[e.scrapedData.search_results.map((_,k)=>d.jsxs("div",{className:"rounded-lg border p-3",children:[d.jsx("a",{href:_.url,target:"_blank",rel:"noopener noreferrer",className:"text-sm font-medium text-primary hover:underline",children:_.title||_.url}),_.description&&d.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:_.description})]},k)),e.scrapedData.tourism_board&&d.jsxs("div",{className:"rounded-lg border border-primary/20 p-3",children:[d.jsx(Nt,{variant:"outline",className:"text-xs mb-2",children:"Official Tourism Board"}),d.jsx("a",{href:e.scrapedData.tourism_board.url,target:"_blank",rel:"noopener noreferrer",className:"text-sm font-medium text-primary hover:underline block",children:e.scrapedData.tourism_board.title||e.scrapedData.tourism_board.url}),e.scrapedData.tourism_board.summary&&d.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:e.scrapedData.tourism_board.summary})]})]}):d.jsxs("div",{className:"text-sm text-muted-foreground text-center py-4",children:["No source data yet for ",e.city,"."]})})})})]})})]})},Ir=({icon:e,label:t,value:r})=>d.jsxs("div",{className:"rounded-lg border p-2.5 text-center",children:[d.jsx(e,{className:"h-3.5 w-3.5 mx-auto text-muted-foreground mb-1"}),d.jsx("p",{className:"text-lg font-bold leading-tight",children:r}),d.jsx("p",{className:"text-[10px] text-muted-foreground",children:t})]}),pFe=10,mFe=999;function gFe(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}`}function eJ(){const{user:e,subscriptionTier:t}=vs(),[r,n]=P.useState([]),[i,a]=P.useState(!0),o=gFe(),s=["pro","business","enterprise"].includes(t),l=s?mFe:pFe,c=Math.max(0,l-r.length),u=c<=0&&!s,f=P.useCallback(async()=>{if(!e){n([]),a(!1);return}try{const{data:h,error:g}=await wr.from("city_usage").select("city").eq("user_id",e.id).eq("month_key",o);if(g)throw g;n((h||[]).map(m=>m.city))}catch(h){console.error("Failed to fetch city usage:",h)}finally{a(!1)}},[e,o]);P.useEffect(()=>{f()},[f]);const p=P.useCallback(async h=>{if(!e)return!1;if(i||r.includes(h))return!0;if(u)return!1;try{const{error:g}=await wr.from("city_usage").upsert({user_id:e.id,city:h,month_key:o},{onConflict:"user_id,city,month_key"});if(g)throw g;return n(m=>[...m,h]),!0}catch(g){return console.error("Failed to record city usage:",g),!0}},[e,r,u,o]);return{usedCities:r,usedCount:r.length,remaining:c,limit:l,isExhausted:u,isPaid:s,loading:i,recordCity:p,refresh:f}}const vP=768;function vFe(){const[e,t]=P.useState(void 0);return P.useEffect(()=>{const r=window.matchMedia(`(max-width: ${vP-1}px)`),n=()=>{t(window.innerWidthr.removeEventListener("change",n)},[]),!!e}const yFe=()=>{const{user:e}=vs(),{data:t,isLoading:r}=Sc(),{refresh:n}=TX(),{generate:i}=G7e(),{enrich:a}=OX(),o=P5(),s=vFe(),[l,c]=P.useState(!1),[u,f]=P.useState(!1),[p,h]=P.useState(!1),[g,m]=P.useState(10),[v,y]=P.useState("Paris"),[b,x]=P.useState(null),[S,_]=P.useState("avgRate4Star"),[k,E]=P.useState("desc"),{recordCity:O}=eJ(),R=P.useCallback(async z=>{e&&await O(z.city),x(z)},[O,e]),$=tc[v]||tc.Paris,N=Object.keys(tc),C=t&&t.length>0&&t[0].isLive,D=t&&t.length>0?{avgRate:Math.round(t.reduce((z,ie)=>z+ie.avgRate4Star,0)/t.length),avgOccupancy:+(t.reduce((z,ie)=>z+ie.occupancyPct,0)/t.length).toFixed(1),avgRevPAR:Math.round(t.reduce((z,ie)=>z+ie.revPAR,0)/t.length),citiesTracked:t.length,yoyGrowth:+(t.reduce((z,ie)=>z+ie.yoyGrowth,0)/t.length).toFixed(1)}:dIe,I=[{label:"Global Avg. Rate",value:`$${D.avgRate}`,change:C?"Live":"+6.2%",up:!0,icon:Ia},{label:"Avg. Occupancy",value:`${D.avgOccupancy}%`,change:C?"Estimated":"+2.1%",up:!0,icon:Ex},{label:"Avg. RevPAR",value:`$${D.avgRevPAR}`,change:C?"Live":"+8.4%",up:!0,icon:ri},{label:"Cities Tracked",value:D.citiesTracked.toString(),change:C?"Live data":"+15 new",up:!0,icon:sc},{label:"YoY Growth",value:`${D.yoyGrowth}%`,change:C?"AI est.":"+1.1pp",up:!0,icon:yw}],G=async()=>{c(!0);try{const z=await n(5,0);xr.success(`Refreshed ${z.processed} cities. ${z.has_more?`${z.total_cities-z.next_offset} remaining.`:"All done!"}`),o.invalidateQueries({queryKey:["city-market-data"]})}catch(z){xr.error(z.message||"Refresh failed")}finally{c(!1)}},Y=async()=>{f(!0);try{const z=await i(10);xr.success(`Generated insights for ${z.processed} cities`),o.invalidateQueries({queryKey:["city-market-data"]})}catch(z){xr.error(z.message||"Insights generation failed")}finally{f(!1)}},Z=async()=>{h(!0);try{const z=await a(3,0);xr.success(`Enriched ${z.processed} cities from all data sources`),o.invalidateQueries({queryKey:["city-market-data"]})}catch(z){xr.error(z.message||"Enrichment failed")}finally{h(!1)}},U=z=>{S===z?E(ie=>ie==="asc"?"desc":"asc"):(_(z),E(z==="city"?"asc":"desc"))},X=P.useMemo(()=>{const z=[...t||[]],ie=k==="asc"?1:-1;return z.sort((le,V)=>{const se=le[S],ae=V[S];return typeof se=="string"&&typeof ae=="string"?se.localeCompare(ae)*ie:(se-ae)*ie}),z},[t,S,k]),oe=X.slice(0,g),ue=gS!==z?d.jsx(Nne,{className:"h-3 w-3 opacity-40"}):k==="asc"?d.jsx(IU,{className:"h-3 w-3"}):d.jsx(Y0,{className:"h-3 w-3"}),W=[{key:"avgRate4Star",label:"4★ Rate"},{key:"revPAR",label:"RevPAR"},{key:"yoyGrowth",label:"YoY Growth"},{key:"occupancyPct",label:"Occupancy"},{key:"hotelCount",label:"Hotels"},{key:"city",label:"City A-Z"}];return d.jsx(ei,{children:d.jsxs("div",{className:"container mx-auto px-4 py-8",children:[d.jsxs("div",{className:"mb-6 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx("h1",{className:"text-2xl font-bold sm:text-3xl",children:"Dashboard"}),d.jsxs("p",{className:"text-muted-foreground",children:["Global hotel market overview",C&&d.jsx(Nt,{variant:"default",className:"ml-2 text-xs",children:"Live Data"})]})]}),d.jsxs("div",{className:"flex flex-wrap gap-2",children:[d.jsxs(pt,{variant:"outline",size:"sm",onClick:G,disabled:l,children:[l?d.jsx(Va,{className:"mr-1 h-3 w-3 animate-spin"}):d.jsx(h3,{className:"mr-1 h-3 w-3"}),"Refresh Data"]}),d.jsxs(pt,{variant:"outline",size:"sm",onClick:Z,disabled:p,children:[p?d.jsx(Va,{className:"mr-1 h-3 w-3 animate-spin"}):d.jsx(Tne,{className:"mr-1 h-3 w-3"}),"Enrich All"]}),d.jsxs(pt,{variant:"outline",size:"sm",onClick:Y,disabled:u,children:[u?d.jsx(Va,{className:"mr-1 h-3 w-3 animate-spin"}):d.jsx(lc,{className:"mr-1 h-3 w-3"}),"AI Insights"]})]})]}),d.jsx("div",{className:"mb-8 flex gap-3 overflow-x-auto pb-2 -mx-4 px-4 snap-x snap-mandatory md:mx-0 md:px-0 md:grid md:grid-cols-5 md:overflow-visible md:pb-0 scrollbar-hide",children:I.map(z=>d.jsx($e,{className:"min-w-[160px] flex-shrink-0 snap-start md:min-w-0",children:d.jsxs(De,{className:"p-4 md:p-5",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx(z.icon,{className:"h-4 w-4 text-muted-foreground"}),d.jsxs(Nt,{variant:z.up?"default":"destructive",className:"gap-1 text-[10px] md:text-xs",children:[z.up?d.jsx(Kl,{className:"h-3 w-3"}):d.jsx(lp,{className:"h-3 w-3"}),z.change]})]}),d.jsx("p",{className:"mt-2 text-xl font-bold md:text-2xl",children:r?"...":z.value}),d.jsx("p",{className:"text-[10px] text-muted-foreground md:text-xs",children:z.label})]})},z.label))}),d.jsxs($e,{className:"mb-8",children:[d.jsxs(er,{className:"flex-row items-center justify-between pb-2",children:[d.jsx(tr,{className:"text-base",children:"12-Month Pricing Trends"}),d.jsxs(Ya,{value:v,onValueChange:y,children:[d.jsx(ga,{className:"w-40",children:d.jsx(Xa,{})}),d.jsxs(va,{children:[N.map(z=>d.jsx(Mi,{value:z,children:z},z)),d.jsx("div",{className:"border-t mx-1 my-1"}),d.jsxs(At,{to:"/pricing",className:"flex items-center gap-2 px-2 py-2 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[d.jsx(v5,{className:"h-3 w-3"}),d.jsxs("span",{children:["100+ more cities — ",d.jsx("span",{className:"text-primary font-medium",children:"Subscribe"})]})]})]})]})]}),d.jsx(De,{children:d.jsx("div",{className:"h-[320px]",children:d.jsx(Ka,{width:"100%",height:"100%",children:d.jsxs(lg,{data:$,children:[d.jsx(al,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),d.jsx(Qi,{dataKey:"month",tick:{fontSize:12},stroke:"hsl(var(--muted-foreground))"}),d.jsx(ma,{tick:{fontSize:12},stroke:"hsl(var(--muted-foreground))"}),d.jsx(En,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"8px",fontSize:12}}),d.jsx(xi,{type:"monotone",dataKey:"avgRate",stroke:"hsl(var(--primary))",fill:"hsl(var(--primary) / 0.15)",strokeWidth:2,name:"Avg. Rate ($)"}),d.jsx(xi,{type:"monotone",dataKey:"occupancy",stroke:"hsl(var(--accent))",fill:"hsl(var(--accent) / 0.1)",strokeWidth:2,name:"Occupancy (%)"}),d.jsx(xi,{type:"monotone",dataKey:"revPAR",stroke:"hsl(var(--chart-3))",fill:"hsl(var(--chart-3) / 0.1)",strokeWidth:2,name:"RevPAR ($)"})]})})})})]}),d.jsxs($e,{children:[d.jsxs(er,{className:"flex-row items-center justify-between",children:[d.jsx(tr,{className:"text-base",children:"City Rankings"}),s&&d.jsxs(Ya,{value:S,onValueChange:z=>{U(z)},children:[d.jsx(ga,{className:"w-32 h-8 text-xs",children:d.jsx(Xa,{placeholder:"Sort by"})}),d.jsx(va,{children:W.map(z=>d.jsx(Mi,{value:z.key,className:"text-xs",children:z.label},z.key))})]})]}),d.jsxs(De,{className:"px-2 sm:px-6",children:[s?d.jsx("div",{className:"space-y-2",children:oe.map((z,ie)=>d.jsxs("div",{className:"flex items-center gap-3 rounded-lg border p-3 cursor-pointer hover:bg-muted/50 active:scale-[0.98] transition-all",onClick:()=>R(z),children:[d.jsx("span",{className:"text-xs font-mono text-muted-foreground w-5 shrink-0",children:ie+1}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("p",{className:"font-medium text-sm truncate",children:[z.city,", ",z.country]}),d.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[d.jsx("span",{className:"text-xs text-muted-foreground",children:z.region}),d.jsx(Nt,{variant:"secondary",className:"text-[10px] px-1.5 py-0",children:z.competitionLevel})]})]}),d.jsxs("div",{className:"text-right shrink-0",children:[d.jsx("p",{className:"font-bold text-sm",children:S==="revPAR"?`$${z.revPAR}`:S==="occupancyPct"?`${z.occupancyPct}%`:S==="yoyGrowth"?`${z.yoyGrowth>0?"+":""}${z.yoyGrowth}%`:S==="hotelCount"?z.hotelCount.toLocaleString():`$${z.avgRate4Star}`}),d.jsx("p",{className:"text-[10px] text-muted-foreground",children:S==="revPAR"?"RevPAR":S==="occupancyPct"?"Occupancy":S==="yoyGrowth"?"YoY Growth":S==="hotelCount"?"Hotels":"4★ Rate"})]}),d.jsx("span",{className:`text-xs font-medium shrink-0 ${z.yoyGrowth>5?"text-primary":z.yoyGrowth<0?"text-destructive":"text-muted-foreground"}`,children:S!=="yoyGrowth"&&d.jsxs(d.Fragment,{children:[z.yoyGrowth>0?d.jsx(Kl,{className:"h-3 w-3 inline"}):d.jsx(lp,{className:"h-3 w-3 inline"}),z.yoyGrowth>0?"+":"",z.yoyGrowth,"%"]})})]},z.city))}):d.jsx("div",{className:"overflow-auto",children:d.jsxs(qm,{children:[d.jsx(Wm,{children:d.jsxs(Ba,{className:"bg-muted/50",children:[d.jsx(ir,{className:"cursor-pointer select-none",onClick:()=>U("city"),children:d.jsxs("span",{className:"flex items-center gap-1",children:["City ",d.jsx(M,{field:"city"})]})}),d.jsx(ir,{children:"Region"}),d.jsx(ir,{className:"text-right",children:"3★"}),d.jsx(ir,{className:"text-right cursor-pointer select-none",onClick:()=>U("avgRate4Star"),children:d.jsxs("span",{className:"flex items-center justify-end gap-1",children:["4★ ",d.jsx(M,{field:"avgRate4Star"})]})}),d.jsx(ir,{className:"text-right",children:"5★"}),d.jsx(ir,{className:"text-right cursor-pointer select-none",onClick:()=>U("occupancyPct"),children:d.jsxs("span",{className:"flex items-center justify-end gap-1",children:["Occ. ",d.jsx(M,{field:"occupancyPct"})]})}),d.jsx(ir,{className:"text-right cursor-pointer select-none",onClick:()=>U("revPAR"),children:d.jsxs("span",{className:"flex items-center justify-end gap-1",children:["RevPAR ",d.jsx(M,{field:"revPAR"})]})}),d.jsx(ir,{className:"text-right cursor-pointer select-none",onClick:()=>U("yoyGrowth"),children:d.jsxs("span",{className:"flex items-center justify-end gap-1",children:["YoY ",d.jsx(M,{field:"yoyGrowth"})]})}),d.jsx(ir,{className:"cursor-pointer select-none",onClick:()=>U("competitionLevel"),children:d.jsxs("span",{className:"flex items-center gap-1",children:["Competition ",d.jsx(M,{field:"competitionLevel"})]})}),C&&d.jsx(ir,{className:"text-right cursor-pointer select-none",onClick:()=>U("hotelCount"),children:d.jsxs("span",{className:"flex items-center justify-end gap-1",children:["Hotels ",d.jsx(M,{field:"hotelCount"})]})})]})}),d.jsx(Gm,{children:oe.map(z=>d.jsxs(Ba,{className:"cursor-pointer hover:bg-muted/60 transition-colors",onClick:()=>R(z),children:[d.jsxs(Vt,{className:"font-medium",children:[z.city,", ",z.country]}),d.jsx(Vt,{className:"text-muted-foreground text-sm",children:z.region}),d.jsxs(Vt,{className:"text-right",children:["$",z.avgRate3Star]}),d.jsxs(Vt,{className:"text-right font-medium",children:["$",z.avgRate4Star]}),d.jsxs(Vt,{className:"text-right",children:["$",z.avgRate5Star]}),d.jsxs(Vt,{className:"text-right",children:[z.occupancyPct,"%"]}),d.jsxs(Vt,{className:"text-right",children:["$",z.revPAR]}),d.jsx(Vt,{className:"text-right",children:d.jsxs("span",{className:z.yoyGrowth>5?"text-primary font-medium":"",children:[z.yoyGrowth>0?"+":"",z.yoyGrowth,"%"]})}),d.jsx(Vt,{children:d.jsx(Nt,{variant:"secondary",className:"text-xs",children:z.competitionLevel})}),C&&d.jsx(Vt,{className:"text-right text-sm text-muted-foreground",children:z.hotelCount})]},z.city))})]})}),ue&&d.jsx("div",{className:"flex justify-center pt-4 pb-2",children:d.jsxs(pt,{variant:"outline",size:"sm",onClick:()=>m(z=>z+10),children:["Show more cities (",X.length-g," remaining)"]})})]})]}),d.jsx(kX,{open:!!b,onOpenChange:z=>!z&&x(null),children:d.jsx(HO,{className:"max-w-lg p-0 overflow-hidden",children:b&&d.jsx(QX,{city:b,onClose:()=>x(null),onEnriched:()=>o.invalidateQueries({queryKey:["city-market-data"]})})})})]})})},qs=P.forwardRef(({className:e,type:t,...r},n)=>d.jsx("input",{type:t,className:lt("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...r}));qs.displayName="Input";var B_="Popover",[tJ,fqe]=Qa(B_,[Um]),g1=Um(),[bFe,Qu]=tJ(B_),rJ=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=g1(t),l=P.useRef(null),[c,u]=P.useState(!1),[f,p]=Ga({prop:n,defaultProp:i??!1,onChange:a,caller:B_});return d.jsx(k3,{...s,children:d.jsx(bFe,{scope:t,contentId:_o(),triggerRef:l,open:f,onOpenChange:p,onOpenToggle:P.useCallback(()=>p(h=>!h),[p]),hasCustomAnchor:c,onCustomAnchorAdd:P.useCallback(()=>u(!0),[]),onCustomAnchorRemove:P.useCallback(()=>u(!1),[]),modal:o,children:r})})};rJ.displayName=B_;var nJ="PopoverAnchor",xFe=P.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,i=Qu(nJ,r),a=g1(r),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return P.useEffect(()=>(o(),()=>s()),[o,s]),d.jsx(w5,{...a,...n,ref:t})});xFe.displayName=nJ;var iJ="PopoverTrigger",aJ=P.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,i=Qu(iJ,r),a=g1(r),o=qt(t,i.triggerRef),s=d.jsx(ft.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":uJ(i.open),...n,ref:o,onClick:qe(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:d.jsx(w5,{asChild:!0,...a,children:s})});aJ.displayName=iJ;var WO="PopoverPortal",[wFe,_Fe]=tJ(WO,{forceMount:void 0}),oJ=e=>{const{__scopePopover:t,forceMount:r,children:n,container:i}=e,a=Qu(WO,t);return d.jsx(wFe,{scope:t,forceMount:r,children:d.jsx(ms,{present:r||a.open,children:d.jsx(q0,{asChild:!0,container:i,children:n})})})};oJ.displayName=WO;var Cm="PopoverContent",sJ=P.forwardRef((e,t)=>{const r=_Fe(Cm,e.__scopePopover),{forceMount:n=r.forceMount,...i}=e,a=Qu(Cm,e.__scopePopover);return d.jsx(ms,{present:n||a.open,children:a.modal?d.jsx(AFe,{...i,ref:t}):d.jsx(PFe,{...i,ref:t})})});sJ.displayName=Cm;var SFe=xf("PopoverContent.RemoveScroll"),AFe=P.forwardRef((e,t)=>{const r=Qu(Cm,e.__scopePopover),n=P.useRef(null),i=qt(t,n),a=P.useRef(!1);return P.useEffect(()=>{const o=n.current;if(o)return U3(o)},[]),d.jsx(O5,{as:SFe,allowPinchZoom:!0,children:d.jsx(lJ,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:qe(e.onCloseAutoFocus,o=>{var s;o.preventDefault(),a.current||(s=r.triggerRef.current)==null||s.focus()}),onPointerDownOutside:qe(e.onPointerDownOutside,o=>{const s=o.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0,c=s.button===2||l;a.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:qe(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),PFe=P.forwardRef((e,t)=>{const r=Qu(Cm,e.__scopePopover),n=P.useRef(!1),i=P.useRef(!1);return d.jsx(lJ,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,s;(o=e.onCloseAutoFocus)==null||o.call(e,a),a.defaultPrevented||(n.current||(s=r.triggerRef.current)==null||s.focus(),a.preventDefault()),n.current=!1,i.current=!1},onInteractOutside:a=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=a.target;((c=r.triggerRef.current)==null?void 0:c.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),lJ=P.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...f}=e,p=Qu(Cm,r),h=g1(r);return B3(),d.jsx(C5,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:a,children:d.jsx($m,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>p.onOpenChange(!1),children:d.jsx(j3,{"data-state":uJ(p.open),role:"dialog",id:p.contentId,...h,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),cJ="PopoverClose",kFe=P.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,i=Qu(cJ,r);return d.jsx(ft.button,{type:"button",...n,ref:t,onClick:qe(e.onClick,()=>i.onOpenChange(!1))})});kFe.displayName=cJ;var jFe="PopoverArrow",NFe=P.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,i=g1(r);return d.jsx(N3,{...i,...n,ref:t})});NFe.displayName=jFe;function uJ(e){return e?"open":"closed"}var EFe=rJ,CFe=aJ,TFe=oJ,dJ=sJ;const OFe=EFe,RFe=CFe,fJ=P.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},i)=>d.jsx(TFe,{children:d.jsx(dJ,{ref:i,align:t,sideOffset:r,className:lt("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));fJ.displayName=dJ.displayName;const LFe=({open:e,onOpenChange:t,usedCount:r,limit:n})=>{const i=gs();return d.jsx(kX,{open:e,onOpenChange:t,children:d.jsxs(HO,{className:"max-w-md",children:[d.jsxs(NX,{children:[d.jsx("div",{className:"mx-auto flex h-14 w-14 items-center justify-center rounded-full bg-primary/10 mb-3",children:d.jsx(v5,{className:"h-7 w-7 text-primary"})}),d.jsx(EX,{className:"text-center text-xl",children:"Monthly Limit Reached"}),d.jsxs(CX,{className:"text-center",children:["You've analyzed ",d.jsxs("span",{className:"font-semibold text-foreground",children:[r,"/",n]})," free cities this month. Credits reset on the 1st of each month."]})]}),d.jsxs("div",{className:"space-y-3 mt-2",children:[d.jsxs("div",{className:"rounded-lg border bg-muted/30 p-4",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[d.jsx(DU,{className:"h-4 w-4 text-primary"}),d.jsx("span",{className:"font-semibold",children:"Upgrade to Pro"}),d.jsx(Nt,{variant:"secondary",className:"text-xs ml-auto",children:"$99/mo"})]}),d.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1.5 ml-6",children:[d.jsx("li",{children:"✓ Unlimited city analyses"}),d.jsx("li",{children:"✓ Full pricing & occupancy data"}),d.jsx("li",{children:"✓ AI-powered insights & forecasts"}),d.jsx("li",{children:"✓ PDF & CSV exports"}),d.jsx("li",{children:"✓ 20 reports/month"})]})]}),d.jsxs(pt,{className:"w-full",size:"lg",onClick:()=>{t(!1),i("/pricing")},children:["View Plans ",d.jsx(zl,{className:"ml-2 h-4 w-4"})]}),d.jsx(pt,{variant:"ghost",className:"w-full",size:"sm",onClick:()=>t(!1),children:"Maybe later"})]})]})})},IFe=["All Regions","North America","Europe","Asia Pacific","Latin America","Middle East","Africa"],MFe=["All","Low","Medium","High","Very High"],$Fe=5;function yP(e){const t=Math.min(e.yoyGrowth*4,25),r=Math.min(e.occupancyPct*.25,20),i={Low:25,Medium:15,High:8,"Very High":3}[e.competitionLevel]||10,a=Math.min(e.revPAR/15,15),o=e.tourismArrivalsYoy?Math.min(e.tourismArrivalsYoy*3,15):5;return Math.min(Math.round(t+r+i+a+o),100)}function t7(e){return e>=70?"default":e>=45?"secondary":"destructive"}const DFe=()=>{const{data:e,isLoading:t}=Sc(),{refresh:r}=TX(),{enrich:n}=OX(),{subscriptionTier:i,user:a}=vs(),o=P5(),[s,l]=P.useState(""),[c,u]=P.useState("All Regions"),[f,p]=P.useState("All"),[h,g]=P.useState(!1),[m,v]=P.useState(!1),[y,b]=P.useState(null);P.useState(null);const[x,S]=P.useState(!1),[_,k]=P.useState(!1),E=P.useRef(null),{usedCount:O,remaining:R,limit:$,isExhausted:N,isPaid:C,recordCity:D}=eJ(),I=P.useCallback(async V=>{if(y===V){b(null);return}a&&await D(V),b(V)},[y,D,a]),G=P.useMemo(()=>{if(!e||!s.trim())return{cities:[],countries:[]};const V=s.toLowerCase(),se=e.filter(de=>de.city.toLowerCase().includes(V)).slice(0,8).map(de=>({label:de.city,sub:de.country,type:"city"})),ae=[...new Set(e.filter(de=>de.country.toLowerCase().includes(V)).map(de=>de.country))].slice(0,5).map(de=>({label:de,sub:`${e.filter(ve=>ve.country===de).length} cities`,type:"country"}));return{cities:se,countries:ae}},[e,s]);P.useEffect(()=>{y&&E.current&&E.current.scrollIntoView({behavior:"smooth",block:"start"})},[y]);const Y=P.useMemo(()=>e?e.filter(V=>{const se=V.city.toLowerCase().includes(s.toLowerCase())||V.country.toLowerCase().includes(s.toLowerCase()),ae=c==="All Regions"||V.region===c,de=f==="All"||V.competitionLevel===f;return se&&ae&&de}):[],[e,s,c,f]),Z=e&&e.length>0&&e[0].isLive,U=["pro","business","enterprise"].includes(i),X=U?Y:Y.slice(0,$Fe),oe=Y.length-X.length,ue=P.useMemo(()=>!y||!e?null:e.find(V=>V.city===y)||null,[y,e]),M=async()=>{g(!0);try{const V=await r(5,0);xr.success(`Refreshed ${V.processed} cities`),o.invalidateQueries({queryKey:["city-market-data"]})}catch(V){xr.error(V.message||"Refresh failed")}finally{g(!1)}},W=async()=>{var V,se;v(!0);try{const ae=await n(3,0);xr.success(`Enriched ${ae.processed} cities from ${Object.keys(((se=(V=ae.results)==null?void 0:V[0])==null?void 0:se.sources)||{}).length} sources`),o.invalidateQueries({queryKey:["city-market-data"]})}catch(ae){xr.error(ae.message||"Enrichment failed")}finally{v(!1)}},z=V=>V.tourismArrivals||V.marketNews||V.perplexityInsights&&Object.keys(V.perplexityInsights).length>0,ie=({city:V})=>{const se=yP(V);return d.jsxs("div",{className:"rounded-lg border bg-card p-4 cursor-pointer hover:bg-muted/30 transition-colors active:scale-[0.98]",onClick:()=>I(V.city),children:[d.jsxs("div",{className:"flex items-start justify-between mb-3",children:[d.jsxs("div",{children:[d.jsx("h3",{className:"font-semibold text-sm",children:V.city}),d.jsxs("p",{className:"text-xs text-muted-foreground",children:[V.country," · ",V.region]})]}),d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsxs(Nt,{variant:t7(se),className:"text-[10px] font-bold px-1.5 py-0",children:[d.jsx(Yp,{className:"h-2.5 w-2.5 mr-0.5"}),se]}),z(V)&&d.jsxs(Nt,{variant:"outline",className:"text-[10px] px-1 py-0",children:[d.jsx(lc,{className:"h-2.5 w-2.5 mr-0.5"}),"enriched"]})]})]}),d.jsxs("div",{className:"grid grid-cols-4 gap-2 text-center",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-[10px] text-muted-foreground",children:"3★"}),d.jsxs("p",{className:"text-xs font-medium",children:["$",V.avgRate3Star]})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-[10px] text-muted-foreground",children:"4★"}),d.jsxs("p",{className:"text-xs font-bold",children:["$",V.avgRate4Star]})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-[10px] text-muted-foreground",children:"5★"}),d.jsxs("p",{className:"text-xs font-medium",children:["$",V.avgRate5Star]})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Occ."}),d.jsxs("p",{className:"text-xs font-medium",children:[V.occupancyPct,"%"]})]})]}),d.jsxs("div",{className:"grid grid-cols-4 gap-2 text-center mt-2 pt-2 border-t",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-[10px] text-muted-foreground",children:"RevPAR"}),d.jsxs("p",{className:"text-xs font-medium",children:["$",V.revPAR]})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-[10px] text-muted-foreground",children:"YoY"}),d.jsxs("p",{className:`text-xs font-medium ${V.yoyGrowth>5?"text-primary":""}`,children:[V.yoyGrowth>0?"+":"",V.yoyGrowth,"%"]})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Hotels"}),d.jsx("p",{className:"text-xs font-medium",children:V.hotelCount})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Comp."}),d.jsx("p",{className:"text-xs font-medium truncate",children:V.competitionLevel})]})]})]})},le=({city:V})=>d.jsx(d.Fragment,{children:d.jsxs(Ba,{className:"cursor-pointer hover:bg-muted/30",onClick:()=>I(V.city),children:[d.jsxs(Vt,{className:"font-medium whitespace-nowrap",children:[V.city,", ",V.country,z(V)&&d.jsxs(Nt,{variant:"outline",className:"ml-2 text-[10px] px-1 py-0",children:[d.jsx(lc,{className:"h-2.5 w-2.5 mr-0.5"}),"enriched"]})]}),d.jsx(Vt,{className:"text-sm text-muted-foreground",children:V.region}),d.jsxs(Vt,{className:"text-right",children:["$",V.avgRate3Star]}),d.jsxs(Vt,{className:"text-right font-medium",children:["$",V.avgRate4Star]}),d.jsxs(Vt,{className:"text-right",children:["$",V.avgRate5Star]}),d.jsxs(Vt,{className:"text-right",children:[V.occupancyPct,"%"]}),d.jsxs(Vt,{className:"text-right",children:["$",V.revPAR]}),d.jsx(Vt,{className:"text-right",children:d.jsxs("span",{className:V.yoyGrowth>5?"text-primary font-medium":"",children:[V.yoyGrowth>0?"+":"",V.yoyGrowth,"%"]})}),d.jsx(Vt,{children:d.jsx(Nt,{variant:"secondary",className:"text-xs",children:V.competitionLevel})}),d.jsx(Vt,{className:"text-sm text-muted-foreground",children:V.peakSeason}),d.jsx(Vt,{className:"text-center",children:d.jsx(Nt,{variant:t7(yP(V)),className:"text-xs font-bold",children:yP(V)})}),Z&&d.jsx(Vt,{className:"text-right text-sm text-muted-foreground",children:V.hotelCount}),Z&&d.jsx(Vt,{children:V.tourismArrivals?d.jsxs("span",{className:"text-xs text-muted-foreground",children:[V.tourismArrivals,"M"]}):V.aiInsights?d.jsx(Az,{children:d.jsxs(zoe,{children:[d.jsx(Hoe,{children:d.jsx(Ine,{className:"h-3.5 w-3.5 text-muted-foreground"})}),d.jsx(Pz,{className:"max-w-xs",children:d.jsx("p",{className:"text-xs",children:V.aiInsights})})]})}):null})]})});return d.jsx(ei,{children:d.jsxs("div",{className:"container mx-auto px-4 py-8",children:[d.jsxs("div",{className:"mb-6 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx("h1",{className:"text-2xl font-bold sm:text-3xl",children:"Market Explorer"}),d.jsxs("p",{className:"text-muted-foreground text-sm",children:["Aggregated hotel pricing data across ",(e==null?void 0:e.length)||0," cities",Z&&d.jsx(Nt,{variant:"default",className:"ml-2 text-xs",children:"Live Data"})]})]}),d.jsxs("div",{className:"flex flex-wrap gap-2",children:[d.jsxs(pt,{variant:"outline",size:"sm",onClick:W,disabled:m,children:[m?d.jsx(Va,{className:"mr-1 h-3 w-3 animate-spin"}):d.jsx(sc,{className:"mr-1 h-3 w-3"}),"Enrich Data"]}),d.jsxs(pt,{variant:"outline",size:"sm",onClick:M,disabled:h,children:[h?d.jsx(Va,{className:"mr-1 h-3 w-3 animate-spin"}):d.jsx(h3,{className:"mr-1 h-3 w-3"}),"Refresh"]})]})]}),d.jsx($e,{className:"mb-6",children:d.jsxs(De,{className:"flex gap-3 overflow-x-auto p-4 snap-x snap-mandatory md:flex-wrap md:overflow-visible scrollbar-hide",children:[d.jsx("div",{className:"relative flex-1 min-w-[200px] snap-start flex-shrink-0",children:d.jsxs(OFe,{open:x&&s.length>0&&(G.cities.length>0||G.countries.length>0),onOpenChange:S,children:[d.jsx(RFe,{asChild:!0,children:d.jsxs("div",{className:"relative",children:[d.jsx(Ay,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),d.jsx(qs,{placeholder:"Search city or country...",value:s,onChange:V=>{l(V.target.value),S(!0)},onFocus:()=>S(!0),className:"pl-9 pr-8"}),s&&d.jsx("button",{onClick:()=>{l(""),S(!1)},className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:d.jsx(Xp,{className:"h-3.5 w-3.5"})})]})}),d.jsx(fJ,{className:"z-50 w-[--radix-popover-trigger-width] p-0 bg-popover",align:"start",onOpenAutoFocus:V=>V.preventDefault(),children:d.jsxs("div",{className:"max-h-[300px] overflow-auto",children:[G.cities.length>0&&d.jsxs("div",{className:"p-1",children:[d.jsx("p",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Cities"}),G.cities.map(V=>d.jsxs("button",{className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-accent cursor-pointer",onClick:()=>{l(V.label),S(!1)},children:[d.jsx(Yl,{className:"h-3.5 w-3.5 text-primary"}),d.jsx("span",{className:"font-medium",children:V.label}),d.jsx("span",{className:"text-xs text-muted-foreground",children:V.sub})]},V.label))]}),G.countries.length>0&&d.jsxs("div",{className:"p-1 border-t",children:[d.jsx("p",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Countries"}),G.countries.map(V=>d.jsxs("button",{className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-accent cursor-pointer",onClick:()=>{l(V.label),S(!1)},children:[d.jsx(sc,{className:"h-3.5 w-3.5 text-muted-foreground"}),d.jsx("span",{className:"font-medium",children:V.label}),d.jsx("span",{className:"text-xs text-muted-foreground",children:V.sub})]},V.label))]})]})})]})}),d.jsxs(Ya,{value:c,onValueChange:u,children:[d.jsx(ga,{className:"w-44",children:d.jsx(Xa,{})}),d.jsx(va,{children:IFe.map(V=>d.jsx(Mi,{value:V,children:V},V))})]}),d.jsxs(Ya,{value:f,onValueChange:p,children:[d.jsx(ga,{className:"w-36",children:d.jsx(Xa,{placeholder:"Competition"})}),d.jsx(va,{children:MFe.map(V=>d.jsx(Mi,{value:V,children:V},V))})]})]})}),d.jsxs("p",{className:"mb-3 text-sm text-muted-foreground",children:[Y.length," cities found",!C&&oe>0&&d.jsxs("span",{className:"text-primary",children:[" · ",oe," more with Pro"]}),!C&&d.jsxs(Nt,{variant:R<=3?"destructive":"secondary",className:"ml-2 text-xs",children:[R,"/",$," credits left this month"]})]}),d.jsx(LFe,{open:_,onOpenChange:k,usedCount:O,limit:$}),ue&&d.jsx("div",{className:"mb-6",ref:E,children:d.jsx(QX,{city:ue,onClose:()=>b(null),onEnriched:()=>o.invalidateQueries({queryKey:["city-market-data"]})})}),t?d.jsx($e,{children:d.jsx(De,{className:"flex items-center justify-center py-12",children:d.jsx(Va,{className:"h-6 w-6 animate-spin text-muted-foreground"})})}):d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"space-y-3 md:hidden",children:X.map(V=>d.jsx(ie,{city:V},V.city))}),d.jsx($e,{className:"hidden md:block",children:d.jsx(De,{className:"p-0",children:d.jsx("div",{className:"overflow-auto",children:d.jsxs(qm,{children:[d.jsx(Wm,{children:d.jsxs(Ba,{className:"bg-muted/50",children:[d.jsx(ir,{children:"City"}),d.jsx(ir,{children:"Region"}),d.jsx(ir,{className:"text-right",children:"3★ Avg."}),d.jsx(ir,{className:"text-right",children:"4★ Avg."}),d.jsx(ir,{className:"text-right",children:"5★ Avg."}),d.jsx(ir,{className:"text-right",children:"Occ. %"}),d.jsx(ir,{className:"text-right",children:"RevPAR"}),d.jsx(ir,{className:"text-right",children:"YoY"}),d.jsx(ir,{children:"Competition"}),d.jsx(ir,{children:"Peak Season"}),d.jsx(ir,{className:"text-center",children:d.jsxs("span",{className:"flex items-center gap-1 justify-center",children:[d.jsx(Yp,{className:"h-3.5 w-3.5"})," Score"]})}),Z&&d.jsx(ir,{className:"text-right",children:"Hotels"}),Z&&d.jsx(ir,{className:"text-right",children:"Arrivals"})]})}),d.jsx(Gm,{children:X.map(V=>d.jsx(le,{city:V},V.city))})]})})})}),!U&&oe>0&&d.jsx("div",{className:"mt-6",children:d.jsx(Da,{requiredTier:"pro",featureName:`Unlock ${oe} more cities`,children:d.jsx("div",{})})})]})]})})},FFe=[{season:"Peak",change:"+4.2%",direction:"up",detail:"Strong leisure demand recovery"},{season:"Shoulder",change:"+7.8%",direction:"up",detail:"Business travel rebound driving shoulder growth"},{season:"Low",change:"+2.1%",direction:"up",detail:"Remote work extending low-season stays"}],BFe=[{keyword:"Boutique Hotels",volume:"+34%",trend:"up"},{keyword:"Extended Stay",volume:"+28%",trend:"up"},{keyword:"Wellness Resorts",volume:"+22%",trend:"up"},{keyword:"Airport Hotels",volume:"-8%",trend:"down"},{keyword:"Budget Hostels",volume:"-12%",trend:"down"},{keyword:"Eco-Friendly Hotels",volume:"+41%",trend:"up"}],xh=8,gv=400,UFe=()=>{const{data:e}=Sc(),t=P5(),r=gs(),[n,i]=P.useState(!1),a=async()=>{i(!0);try{const{data:b,error:x}=await wr.functions.invoke("ai-predictions",{body:{batch_size:10}});if(x)throw x;xr.success(`Generated predictions for ${b.processed} cities`),t.invalidateQueries({queryKey:["city-market-data"]})}catch(b){xr.error(b.message||"Predictions failed")}finally{i(!1)}},o=P.useMemo(()=>(e||[]).filter(b=>(b.tourismArrivals??0)>=xh||b.hotelCount>=gv),[e]),s=[...o].sort((b,x)=>x.yoyGrowth-b.yoyGrowth),l=s.filter(b=>b.yoyGrowth>0).slice(0,5).map(b=>({city:b.city,country:b.country,metric:"YoY Growth",change:b.yoyGrowth,direction:"up"})),c=s.filter(b=>b.yoyGrowth<=3).slice(-4).reverse().map(b=>({city:b.city,country:b.country,metric:"Lowest Growth",change:b.yoyGrowth,direction:"down"})),u={};o.forEach(b=>{u[b.region]||(u[b.region]=[]),u[b.region].push(b.yoyGrowth)});const f=Object.entries(u).map(([b,x])=>({region:b==="North America"?"N. America":b,growth:+(x.reduce((S,_)=>S+_,0)/x.length).toFixed(1)})).sort((b,x)=>x.growth-b.growth),p=P.useMemo(()=>{if(!(e!=null&&e.length))return{tourismGrowth:[],gdpGrowth:[],tourismIntensity:[],spendingPower:[],avgSpend:[],revenuePerCapita:[],valueIndex:[]};const b=new Map;for(const N of e){const C=b.get(N.country);C?(C.totalHotelCount+=N.hotelCount,N.tourismArrivals&&(!C.tourismArrivals||N.tourismArrivals>C.tourismArrivals)&&(C.tourismArrivals=N.tourismArrivals),N.tourismArrivalsYoy&&!C.tourismArrivalsYoy&&(C.tourismArrivalsYoy=N.tourismArrivalsYoy)):b.set(N.country,{country:N.country,tourismArrivalsYoy:N.tourismArrivalsYoy??N.yoyGrowth,gdpGrowth:N.gdpGrowth,gdpPerCapita:N.gdpPerCapita,countryPopulation:N.countryPopulation,tourismArrivals:N.tourismArrivals,avgSpendPerTourist:N.avgSpendPerTourist,tourismRevenuePerCapita:N.tourismRevenuePerCapita,tourismValueIndex:N.tourismValueIndex,totalHotelCount:N.hotelCount})}const x=Array.from(b.values()).filter(N=>(N.tourismArrivals??0)>=xh||N.totalHotelCount>=gv),S=x.filter(N=>N.tourismArrivalsYoy!=null).sort((N,C)=>(C.tourismArrivalsYoy??0)-(N.tourismArrivalsYoy??0)).slice(0,10).map((N,C)=>({rank:C+1,country:N.country,value:N.tourismArrivalsYoy,label:`${N.tourismArrivalsYoy>0?"+":""}${N.tourismArrivalsYoy.toFixed(1)}%`})),_=x.filter(N=>N.gdpGrowth!=null).sort((N,C)=>(C.gdpGrowth??0)-(N.gdpGrowth??0)).slice(0,10).map((N,C)=>({rank:C+1,country:N.country,value:N.gdpGrowth,label:`${N.gdpGrowth>0?"+":""}${N.gdpGrowth.toFixed(1)}%`})),k=x.filter(N=>N.tourismArrivals!=null&&N.countryPopulation!=null&&N.countryPopulation>0).map(N=>({country:N.country,intensity:N.tourismArrivals*1e6/N.countryPopulation*1e3})).sort((N,C)=>C.intensity-N.intensity).slice(0,10).map((N,C)=>({rank:C+1,country:N.country,value:N.intensity,label:`${N.intensity.toFixed(0)} per 1K`})),E=x.filter(N=>N.gdpPerCapita!=null).sort((N,C)=>(C.gdpPerCapita??0)-(N.gdpPerCapita??0)).slice(0,10).map((N,C)=>({rank:C+1,country:N.country,value:N.gdpPerCapita,label:`$${(N.gdpPerCapita/1e3).toFixed(1)}K`})),O=x.filter(N=>N.avgSpendPerTourist!=null).sort((N,C)=>(C.avgSpendPerTourist??0)-(N.avgSpendPerTourist??0)).slice(0,10).map((N,C)=>({rank:C+1,country:N.country,value:N.avgSpendPerTourist,label:`$${Math.round(N.avgSpendPerTourist).toLocaleString()}`})),R=x.filter(N=>N.tourismRevenuePerCapita!=null).sort((N,C)=>(C.tourismRevenuePerCapita??0)-(N.tourismRevenuePerCapita??0)).slice(0,10).map((N,C)=>({rank:C+1,country:N.country,value:N.tourismRevenuePerCapita,label:`$${Math.round(N.tourismRevenuePerCapita).toLocaleString()}`})),$=x.filter(N=>N.tourismValueIndex!=null).sort((N,C)=>(C.tourismValueIndex??0)-(N.tourismValueIndex??0)).slice(0,10).map((N,C)=>({rank:C+1,country:N.country,value:N.tourismValueIndex,label:`${N.tourismValueIndex}/100`}));return{tourismGrowth:S,gdpGrowth:_,tourismIntensity:k,spendingPower:E,avgSpend:O,revenuePerCapita:R,valueIndex:$}},[e]),h=P.useMemo(()=>{if(p.tourismGrowth.length>0)return p.tourismGrowth;const b=new Map;for(const x of e||[]){if((x.tourismArrivals??0)({country:x,avg:S.total/S.count})).sort((x,S)=>S.avg-x.avg).slice(0,10).map((x,S)=>({rank:S+1,country:x.country,value:x.avg,label:`${x.avg>0?"+":""}${x.avg.toFixed(1)}%`}))},[e,p.tourismGrowth]),g=P.useMemo(()=>{if(p.spendingPower.length>0)return p.spendingPower;const b=new Map;for(const x of e||[]){if((x.tourismArrivals??0)({country:x,avg:S.total/S.count})).sort((x,S)=>S.avg-x.avg).slice(0,10).map((x,S)=>({rank:S+1,country:x.country,value:x.avg,label:`$${Math.round(x.avg)} avg/night`}))},[e,p.spendingPower]),m=P.useMemo(()=>{if(p.tourismIntensity.length>0)return p.tourismIntensity;const b=new Map;for(const x of e||[]){if((x.tourismArrivals??0)S.arrivals&&(S.arrivals=x.tourismArrivals??0)):b.set(x.country,{arrivals:x.tourismArrivals??0,hotels:x.hotelCount})}return Array.from(b.entries()).map(([x,S])=>({country:x,ratio:S.arrivals})).sort((x,S)=>S.ratio-x.ratio).slice(0,10).map((x,S)=>({rank:S+1,country:x.country,value:x.ratio,label:`${x.ratio.toFixed(1)}M arrivals`}))},[e,p.tourismIntensity]),v=P.useMemo(()=>{if(p.gdpGrowth.length>0)return p.gdpGrowth;const b=new Map;for(const x of e||[]){if((x.tourismArrivals??0)({country:x,avg:S.total/S.count})).sort((x,S)=>S.avg-x.avg).slice(0,10).map((x,S)=>({rank:S+1,country:x.country,value:x.avg,label:`$${Math.round(x.avg)} RevPAR`}))},[e,p.gdpGrowth]),y=b=>{r(`/explorer?city=${encodeURIComponent(b)}`)};return d.jsx(ei,{children:d.jsxs("div",{className:"container mx-auto px-4 py-8",children:[d.jsxs("div",{className:"mb-6",children:[d.jsx("h1",{className:"text-3xl font-bold",children:"Trends Radar"}),d.jsx("p",{className:"text-muted-foreground",children:"Market movements, demand shifts, and growth opportunities in global hospitality"})]}),d.jsxs("div",{className:"mb-8",children:[d.jsxs("h2",{className:"text-lg font-semibold mb-1 flex items-center gap-2",children:[d.jsx(sc,{className:"h-5 w-5 text-primary"})," Macro Economic Trends"]}),d.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Country-level rankings across major tourism markets"}),d.jsxs("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-2",children:[d.jsx(Sd,{title:"Tourism Growth",icon:d.jsx(ri,{className:"h-4 w-4"}),items:h,positive:!0}),d.jsx(Sd,{title:"Economic Strength",icon:d.jsx(K0,{className:"h-4 w-4"}),items:v,positive:!0,subtitle:p.gdpGrowth.length===0?"Avg RevPAR by country":void 0}),d.jsx(Sd,{title:"Tourism Volume",icon:d.jsx(Dl,{className:"h-4 w-4"}),items:m,subtitle:p.tourismIntensity.length===0?"International arrivals":"Arrivals per 1,000 population"}),d.jsx(Sd,{title:"Market Pricing",icon:d.jsx(Ia,{className:"h-4 w-4"}),items:g,subtitle:p.spendingPower.length===0?"Avg 4-star nightly rate":"GDP per capita"})]})]}),p.avgSpend.length>0&&d.jsxs("div",{className:"mb-8",children:[d.jsxs("h2",{className:"text-lg font-semibold mb-1 flex items-center gap-2",children:[d.jsx(Ia,{className:"h-5 w-5 text-primary"})," Tourism Spend Intelligence"]}),d.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Proprietary metrics derived from global tourism data"}),d.jsxs("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-3",children:[d.jsx(Sd,{title:"Avg Spend / Tourist",icon:d.jsx(Ia,{className:"h-4 w-4"}),items:p.avgSpend,subtitle:"Tourism receipts ÷ arrivals",positive:!0}),d.jsx(Sd,{title:"Tourism Revenue / Capita",icon:d.jsx(Dl,{className:"h-4 w-4"}),items:p.revenuePerCapita,subtitle:"Tourism receipts ÷ population",positive:!0}),d.jsx(Sd,{title:"Tourism Value Index™",icon:d.jsx(uL,{className:"h-4 w-4"}),items:p.valueIndex,subtitle:"Composite 0-100 score",positive:!0})]})]}),d.jsxs("div",{className:"mb-8 grid gap-6 md:grid-cols-2",children:[d.jsxs($e,{children:[d.jsx(er,{children:d.jsxs(tr,{className:"flex items-center gap-2 text-base text-primary",children:[d.jsx(ri,{className:"h-5 w-5"})," Rising Markets"]})}),d.jsx(De,{className:"space-y-3",children:l.map(b=>d.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-3 cursor-pointer hover:bg-muted/50 transition-colors active:scale-[0.98]",onClick:()=>y(b.city),children:[d.jsxs("div",{children:[d.jsxs("p",{className:"font-medium",children:[b.city,", ",b.country]}),d.jsx("p",{className:"text-xs text-muted-foreground",children:b.metric})]}),d.jsxs(Nt,{className:"gap-1",children:[d.jsx(Kl,{className:"h-3 w-3"})," +",b.change,"%"]})]},b.city))})]}),d.jsxs($e,{children:[d.jsx(er,{children:d.jsxs(tr,{className:"flex items-center gap-2 text-base text-destructive",children:[d.jsx(p3,{className:"h-5 w-5"})," Declining / Softening Markets"]})}),d.jsx(De,{className:"space-y-3",children:c.map(b=>d.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-3 cursor-pointer hover:bg-muted/50 transition-colors active:scale-[0.98]",onClick:()=>y(b.city),children:[d.jsxs("div",{children:[d.jsxs("p",{className:"font-medium",children:[b.city,", ",b.country]}),d.jsx("p",{className:"text-xs text-muted-foreground",children:b.metric})]}),d.jsxs(Nt,{variant:"destructive",className:"gap-1",children:[d.jsx(lp,{className:"h-3 w-3"})," ",b.change,"%"]})]},b.city))})]})]}),d.jsx(Da,{requiredTier:"pro",featureName:"Regional Growth Analysis",preview:!0,children:d.jsxs($e,{className:"mb-8",children:[d.jsx(er,{children:d.jsx(tr,{className:"text-base",children:"Regional YoY Growth (%)"})}),d.jsx(De,{children:d.jsx("div",{className:"h-[280px]",children:d.jsx(Ka,{width:"100%",height:"100%",children:d.jsxs(sg,{data:f,children:[d.jsx(al,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),d.jsx(Qi,{dataKey:"region",tick:{fontSize:12},stroke:"hsl(var(--muted-foreground))"}),d.jsx(ma,{tick:{fontSize:12},stroke:"hsl(var(--muted-foreground))"}),d.jsx(En,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"8px",fontSize:12}}),d.jsx(Ji,{dataKey:"growth",fill:"hsl(var(--primary))",radius:[4,4,0,0],name:"YoY Growth %"})]})})})})]})}),d.jsx(Da,{requiredTier:"business",featureName:"Demand Intelligence & Search Trends",preview:!0,children:d.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[d.jsxs($e,{children:[d.jsx(er,{children:d.jsx(tr,{className:"text-base",children:"Seasonal Demand Shifts"})}),d.jsx(De,{className:"space-y-3",children:FFe.map(b=>d.jsxs("div",{className:"rounded-lg border p-4",children:[d.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[d.jsxs("span",{className:"font-medium",children:[b.season," Season"]}),d.jsxs(Nt,{variant:b.direction==="up"?"default":"destructive",className:"gap-1",children:[b.direction==="up"?d.jsx(Kl,{className:"h-3 w-3"}):d.jsx(lp,{className:"h-3 w-3"}),b.change]})]}),d.jsx("p",{className:"text-xs text-muted-foreground",children:b.detail})]},b.season))})]}),d.jsxs($e,{children:[d.jsx(er,{children:d.jsx(tr,{className:"text-base",children:"Trending Search Patterns"})}),d.jsx(De,{className:"space-y-2.5",children:BFe.map(b=>d.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[d.jsx("span",{className:"text-sm font-medium",children:b.keyword}),d.jsxs(Nt,{variant:b.trend==="up"?"default":"destructive",className:"gap-1 text-xs",children:[b.trend==="up"?d.jsx(Kl,{className:"h-3 w-3"}):d.jsx(lp,{className:"h-3 w-3"}),b.volume]})]},b.keyword))})]})]})}),d.jsx("div",{className:"mt-8",children:d.jsx(Da,{requiredTier:"business",featureName:"AI Market Predictions",preview:!0,children:d.jsxs($e,{children:[d.jsxs(er,{className:"flex-row items-center justify-between",children:[d.jsxs(tr,{className:"text-base flex items-center gap-2",children:[d.jsx(Uv,{className:"h-5 w-5 text-primary"})," AI Market Predictions"]}),d.jsxs(pt,{variant:"outline",size:"sm",onClick:a,disabled:n,children:[n?d.jsx(Va,{className:"mr-1 h-3 w-3 animate-spin"}):d.jsx(Uv,{className:"mr-1 h-3 w-3"}),"Generate Predictions"]})]}),d.jsx(De,{children:(()=>{const b=(e||[]).map(x=>({city:x.city,country:x.country,...typeof x.aiPredictions=="object"&&x.aiPredictions?x.aiPredictions:{}})).filter(x=>x.momentum_score);return b.length===0?d.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[d.jsx(Uv,{className:"h-10 w-10 mx-auto mb-3 opacity-50"}),d.jsx("p",{className:"text-sm",children:'No predictions generated yet. Click "Generate Predictions" to get AI-powered 6-month forecasts for all tracked cities.'})]}):d.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:b.map(x=>d.jsxs("div",{className:"rounded-lg border p-4 cursor-pointer hover:bg-muted/50 transition-colors",onClick:()=>y(x.city),children:[d.jsxs("div",{className:"flex items-center justify-between mb-2",children:[d.jsxs("h4",{className:"font-medium text-sm",children:[x.city,", ",x.country]}),d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx(uL,{className:"h-3.5 w-3.5 text-primary"}),d.jsxs("span",{className:"text-sm font-bold",children:[x.momentum_score,"/10"]})]})]}),d.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:x.summary}),d.jsxs("div",{className:"flex gap-2",children:[d.jsxs(Nt,{variant:x.rate_forecast==="up"?"default":x.rate_forecast==="down"?"destructive":"secondary",className:"text-[10px]",children:["Rates: ",x.rate_forecast]}),d.jsxs(Nt,{variant:x.occupancy_forecast==="up"?"default":x.occupancy_forecast==="down"?"destructive":"secondary",className:"text-[10px]",children:["Occ: ",x.occupancy_forecast]})]})]},x.city))})})()})]})})})]})})},zFe={France:"🇫🇷","United Kingdom":"🇬🇧",UK:"🇬🇧","United States":"🇺🇸",USA:"🇺🇸",Spain:"🇪🇸",Italy:"🇮🇹",Germany:"🇩🇪",Japan:"🇯🇵",China:"🇨🇳",Thailand:"🇹🇭",UAE:"🇦🇪",Singapore:"🇸🇬",Australia:"🇦🇺",Canada:"🇨🇦",Mexico:"🇲🇽",Brazil:"🇧🇷",India:"🇮🇳",Turkey:"🇹🇷",Greece:"🇬🇷",Portugal:"🇵🇹",Netherlands:"🇳🇱",Switzerland:"🇨🇭",Austria:"🇦🇹","South Korea":"🇰🇷",Indonesia:"🇮🇩",Malaysia:"🇲🇾",Vietnam:"🇻🇳",Philippines:"🇵🇭",Egypt:"🇪🇬",Morocco:"🇲🇦","South Africa":"🇿🇦",Kenya:"🇰🇪",Nigeria:"🇳🇬",Colombia:"🇨🇴",Argentina:"🇦🇷",Chile:"🇨🇱",Peru:"🇵🇪","Czech Republic":"🇨🇿",Poland:"🇵🇱",Hungary:"🇭🇺",Croatia:"🇭🇷",Ireland:"🇮🇪",Sweden:"🇸🇪",Norway:"🇳🇴",Denmark:"🇩🇰",Finland:"🇫🇮",Belgium:"🇧🇪","New Zealand":"🇳🇿",Israel:"🇮🇱","Saudi Arabia":"🇸🇦",Qatar:"🇶🇦",Russia:"🇷🇺","Hong Kong":"🇭🇰",Taiwan:"🇹🇼"},Sd=({title:e,icon:t,items:r,subtitle:n,positive:i})=>d.jsxs($e,{children:[d.jsxs(er,{className:"pb-2",children:[d.jsxs(tr,{className:"text-sm flex items-center gap-2",children:[t," ",e]}),n&&d.jsx("p",{className:"text-xs text-muted-foreground",children:n})]}),d.jsx(De,{className:"pt-0",children:r.length===0?d.jsx("p",{className:"text-xs text-muted-foreground text-center py-4",children:"No data available yet"}):d.jsx("div",{className:"space-y-1.5",children:r.map(a=>d.jsxs("div",{className:"flex items-center justify-between py-1 px-2 rounded-md hover:bg-muted/50 transition-colors",children:[d.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d.jsxs("span",{className:"text-xs font-mono text-muted-foreground w-5",children:[a.rank,"."]}),d.jsx("span",{className:"text-sm",children:zFe[a.country]||"🏳️"}),d.jsx("span",{className:"text-sm font-medium truncate",children:a.country})]}),d.jsx(Nt,{variant:i&&a.value>0?"default":"secondary",className:"text-xs shrink-0 ml-2",children:a.label})]},a.country))})})]}),HFe=()=>{const{data:e,isLoading:t}=Sc(),[r,n]=P.useState("Paris"),[i,a]=P.useState("Dubai"),o=(e||[]).map(h=>h.city),s=e==null?void 0:e.find(h=>h.city===r),l=e==null?void 0:e.find(h=>h.city===i);if(t)return d.jsx(ei,{children:d.jsx("div",{className:"flex items-center justify-center py-20",children:d.jsx(Va,{className:"h-6 w-6 animate-spin text-muted-foreground"})})});if(!s||!l)return d.jsx(ei,{children:d.jsx("div",{className:"container mx-auto px-4 py-8",children:d.jsx("p",{className:"text-muted-foreground",children:"Select two cities to compare."})})});const c=[{label:"3★ Rate",[r]:s.avgRate3Star,[i]:l.avgRate3Star},{label:"4★ Rate",[r]:s.avgRate4Star,[i]:l.avgRate4Star},{label:"5★ Rate",[r]:s.avgRate5Star,[i]:l.avgRate5Star},{label:"Peak Rate",[r]:s.peakRate,[i]:l.peakRate},{label:"Low Rate",[r]:s.lowRate,[i]:l.lowRate}],u=[{metric:"Occupancy",[r]:s.occupancyPct,[i]:l.occupancyPct},{metric:"RevPAR",[r]:Math.min(s.revPAR/3,100),[i]:Math.min(l.revPAR/3,100)},{metric:"Growth",[r]:s.yoyGrowth*5,[i]:l.yoyGrowth*5},{metric:"4★ Rate",[r]:Math.min(s.avgRate4Star/4,100),[i]:Math.min(l.avgRate4Star/4,100)},{metric:"Peak Rate",[r]:Math.min(s.peakRate/5,100),[i]:Math.min(l.peakRate/5,100)}],f=s.isLive,p=({label:h,v1:g,v2:m,format:v=""})=>d.jsxs("div",{className:"grid grid-cols-3 items-center gap-4 rounded-lg border p-3",children:[d.jsx("span",{className:"text-sm font-medium",children:h}),d.jsxs("span",{className:"text-center text-sm",children:[v,g]}),d.jsxs("span",{className:"text-center text-sm",children:[v,m]})]});return d.jsx(ei,{children:d.jsxs("div",{className:"container mx-auto px-4 py-8",children:[d.jsxs("div",{className:"mb-6",children:[d.jsx("h1",{className:"text-3xl font-bold",children:"City Comparison"}),d.jsxs("p",{className:"text-muted-foreground",children:["Compare hotel market metrics side by side",f&&d.jsx(Nt,{variant:"default",className:"ml-2 text-xs",children:"Live Data"})]})]}),d.jsx($e,{className:"mb-8",children:d.jsxs(De,{className:"flex flex-wrap items-center gap-4 p-4",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("div",{className:"h-3 w-3 rounded-full bg-primary"}),d.jsxs(Ya,{value:r,onValueChange:n,children:[d.jsx(ga,{className:"w-44",children:d.jsx(Xa,{})}),d.jsx(va,{children:o.map(h=>d.jsx(Mi,{value:h,children:h},h))})]})]}),d.jsx("span",{className:"text-muted-foreground font-medium",children:"vs"}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("div",{className:"h-3 w-3 rounded-full bg-accent"}),d.jsxs(Ya,{value:i,onValueChange:a,children:[d.jsx(ga,{className:"w-44",children:d.jsx(Xa,{})}),d.jsx(va,{children:o.map(h=>d.jsx(Mi,{value:h,children:h},h))})]})]})]})}),d.jsxs(Da,{requiredTier:"business",featureName:"City Comparison Tool",preview:!0,children:[d.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[d.jsxs($e,{children:[d.jsx(er,{children:d.jsx(tr,{className:"text-base",children:"Rate Comparison ($)"})}),d.jsx(De,{children:d.jsx("div",{className:"h-[300px]",children:d.jsx(Ka,{width:"100%",height:"100%",children:d.jsxs(sg,{data:c,children:[d.jsx(al,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),d.jsx(Qi,{dataKey:"label",tick:{fontSize:11},stroke:"hsl(var(--muted-foreground))"}),d.jsx(ma,{tick:{fontSize:12},stroke:"hsl(var(--muted-foreground))"}),d.jsx(En,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"8px",fontSize:12}}),d.jsx(Ji,{dataKey:r,fill:"hsl(var(--primary))",radius:[4,4,0,0]}),d.jsx(Ji,{dataKey:i,fill:"hsl(var(--accent))",radius:[4,4,0,0]}),d.jsx(Zl,{})]})})})})]}),d.jsxs($e,{children:[d.jsx(er,{children:d.jsx(tr,{className:"text-base",children:"Market Profile"})}),d.jsx(De,{children:d.jsx("div",{className:"h-[300px]",children:d.jsx(Ka,{width:"100%",height:"100%",children:d.jsxs(cIe,{data:u,children:[d.jsx(rG,{stroke:"hsl(var(--border))"}),d.jsx(u1,{dataKey:"metric",tick:{fontSize:11,fill:"hsl(var(--muted-foreground))"}}),d.jsx(mm,{name:r,dataKey:r,stroke:"hsl(var(--primary))",fill:"hsl(var(--primary) / 0.2)",strokeWidth:2}),d.jsx(mm,{name:i,dataKey:i,stroke:"hsl(var(--accent))",fill:"hsl(var(--accent) / 0.2)",strokeWidth:2}),d.jsx(Zl,{})]})})})})]})]}),d.jsxs($e,{className:"mt-6",children:[d.jsxs(er,{children:[d.jsx(tr,{className:"text-base",children:"Detailed Metrics"}),d.jsxs("div",{className:"grid grid-cols-3 gap-4 text-xs text-muted-foreground",children:[d.jsx("span",{children:"Metric"}),d.jsx("span",{className:"text-center",children:r}),d.jsx("span",{className:"text-center",children:i})]})]}),d.jsxs(De,{className:"space-y-2",children:[d.jsx(p,{label:"Occupancy",v1:`${s.occupancyPct}%`,v2:`${l.occupancyPct}%`}),d.jsx(p,{label:"RevPAR",v1:s.revPAR,v2:l.revPAR,format:"$"}),d.jsx(p,{label:"YoY Growth",v1:`${s.yoyGrowth}%`,v2:`${l.yoyGrowth}%`}),d.jsx(p,{label:"Competition",v1:s.competitionLevel,v2:l.competitionLevel}),d.jsx(p,{label:"Peak Season",v1:s.peakSeason,v2:l.peakSeason}),d.jsx(p,{label:"Peak Rate",v1:s.peakRate,v2:l.peakRate,format:"$"}),d.jsx(p,{label:"Low Season Rate",v1:s.lowRate,v2:l.lowRate,format:"$"}),f&&d.jsx(p,{label:"Hotels Tracked",v1:s.hotelCount,v2:l.hotelCount})]})]}),f&&(s.aiInsights||l.aiInsights)&&d.jsx("div",{className:"mt-6 grid gap-6 md:grid-cols-2",children:[s,l].map(h=>d.jsxs($e,{children:[d.jsx(er,{className:"pb-2",children:d.jsxs(tr,{className:"text-sm flex items-center gap-2",children:[d.jsx(Nt,{variant:"outline",className:"text-xs",children:"AI Insight"}),h.city]})}),d.jsx(De,{children:d.jsx("p",{className:"text-sm text-muted-foreground",children:h.aiInsights||"No insights generated yet."})})]},h.city))})]})]})})};var U_="Checkbox",[VFe,hqe]=Qa(U_),[qFe,GO]=VFe(U_);function WFe(e){const{__scopeCheckbox:t,checked:r,children:n,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:l,required:c,value:u="on",internal_do_not_use_render:f}=e,[p,h]=Ga({prop:r,defaultProp:i??!1,onChange:l,caller:U_}),[g,m]=P.useState(null),[v,y]=P.useState(null),b=P.useRef(!1),x=g?!!o||!!g.closest("form"):!0,S={checked:p,disabled:a,setChecked:h,control:g,setControl:m,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:b,required:c,defaultChecked:Ou(i)?!1:i,isFormControl:x,bubbleInput:v,setBubbleInput:y};return d.jsx(qFe,{scope:t,...S,children:GFe(f)?f(S):n})}var hJ="CheckboxTrigger",pJ=P.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...n},i)=>{const{control:a,value:o,disabled:s,checked:l,required:c,setControl:u,setChecked:f,hasConsumerStoppedPropagationRef:p,isFormControl:h,bubbleInput:g}=GO(hJ,e),m=qt(i,u),v=P.useRef(l);return P.useEffect(()=>{const y=a==null?void 0:a.form;if(y){const b=()=>f(v.current);return y.addEventListener("reset",b),()=>y.removeEventListener("reset",b)}},[a,f]),d.jsx(ft.button,{type:"button",role:"checkbox","aria-checked":Ou(l)?"mixed":l,"aria-required":c,"data-state":bJ(l),"data-disabled":s?"":void 0,disabled:s,value:o,...n,ref:m,onKeyDown:qe(t,y=>{y.key==="Enter"&&y.preventDefault()}),onClick:qe(r,y=>{f(b=>Ou(b)?!0:!b),g&&h&&(p.current=y.isPropagationStopped(),p.current||y.stopPropagation())})})});pJ.displayName=hJ;var KO=P.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:n,checked:i,defaultChecked:a,required:o,disabled:s,value:l,onCheckedChange:c,form:u,...f}=e;return d.jsx(WFe,{__scopeCheckbox:r,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:c,name:n,form:u,value:l,internal_do_not_use_render:({isFormControl:p})=>d.jsxs(d.Fragment,{children:[d.jsx(pJ,{...f,ref:t,__scopeCheckbox:r}),p&&d.jsx(yJ,{__scopeCheckbox:r})]})})});KO.displayName=U_;var mJ="CheckboxIndicator",gJ=P.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:n,...i}=e,a=GO(mJ,r);return d.jsx(ms,{present:n||Ou(a.checked)||a.checked===!0,children:d.jsx(ft.span,{"data-state":bJ(a.checked),"data-disabled":a.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});gJ.displayName=mJ;var vJ="CheckboxBubbleInput",yJ=P.forwardRef(({__scopeCheckbox:e,...t},r)=>{const{control:n,hasConsumerStoppedPropagationRef:i,checked:a,defaultChecked:o,required:s,disabled:l,name:c,value:u,form:f,bubbleInput:p,setBubbleInput:h}=GO(vJ,e),g=qt(r,h),m=UO(a),v=S3(n);P.useEffect(()=>{const b=p;if(!b)return;const x=window.HTMLInputElement.prototype,_=Object.getOwnPropertyDescriptor(x,"checked").set,k=!i.current;if(m!==a&&_){const E=new Event("click",{bubbles:k});b.indeterminate=Ou(a),_.call(b,Ou(a)?!1:a),b.dispatchEvent(E)}},[p,m,a,i]);const y=P.useRef(Ou(a)?!1:a);return d.jsx(ft.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??y.current,required:s,disabled:l,name:c,value:u,form:f,...t,tabIndex:-1,ref:g,style:{...t.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});yJ.displayName=vJ;function GFe(e){return typeof e=="function"}function Ou(e){return e==="indeterminate"}function bJ(e){return Ou(e)?"indeterminate":e?"checked":"unchecked"}const xJ=P.forwardRef(({className:e,...t},r)=>d.jsx(KO,{ref:r,className:lt("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:d.jsx(gJ,{className:lt("flex items-center justify-center text-current"),children:d.jsx(Sy,{className:"h-4 w-4"})})}));xJ.displayName=KO.displayName;const KFe="modulepreload",YFe=function(e){return"/"+e},r7={},bP=function(t,r,n){let i=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),s=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.allSettled(r.map(l=>{if(l=YFe(l),l in r7)return;r7[l]=!0;const c=l.endsWith(".css"),u=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const f=document.createElement("link");if(f.rel=c?"stylesheet":KFe,c||(f.as="script"),f.crossOrigin="",f.href=l,s&&f.setAttribute("nonce",s),document.head.appendChild(f),c)return new Promise((p,h)=>{f.addEventListener("load",p),f.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${l}`)))})}))}function a(o){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=o,window.dispatchEvent(s),!s.defaultPrevented)throw o}return i.then(o=>{for(const s of o||[])s.status==="rejected"&&a(s.reason);return t().catch(a)})};function _r(e){"@babel/helpers - typeof";return _r=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},_r(e)}var ps=Uint8Array,Ua=Uint16Array,YO=Int32Array,XO=new ps([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),JO=new ps([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),n7=new ps([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),wJ=function(e,t){for(var r=new Ua(31),n=0;n<31;++n)r[n]=t+=1<>1|(qr&21845)<<1;Hc=(Hc&52428)>>2|(Hc&13107)<<2,Hc=(Hc&61680)>>4|(Hc&3855)<<4,HE[qr]=((Hc&65280)>>8|(Hc&255)<<8)>>1}var ty=function(e,t,r){for(var n=e.length,i=0,a=new Ua(t);i>l]=c}else for(s=new Ua(n),i=0;i>15-e[i]);return s},Tf=new ps(288);for(var qr=0;qr<144;++qr)Tf[qr]=8;for(var qr=144;qr<256;++qr)Tf[qr]=9;for(var qr=256;qr<280;++qr)Tf[qr]=7;for(var qr=280;qr<288;++qr)Tf[qr]=8;var z2=new ps(32);for(var qr=0;qr<32;++qr)z2[qr]=5;var ZFe=ty(Tf,9,0),QFe=ty(z2,5,0),SJ=function(e){return(e+7)/8|0},eBe=function(e,t,r){return(r==null||r>e.length)&&(r=e.length),new ps(e.subarray(t,r))},Nl=function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8},vv=function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8,e[n+2]|=r>>16},xP=function(e,t){for(var r=[],n=0;np&&(p=a[n].s);var h=new Ua(p+1),g=VE(r[u-1],h,0);if(g>t){var n=0,m=0,v=g-t,y=1<t)m+=y-(1<>=v;m>0;){var x=a[n].s;h[x]=0&&m;--n){var S=a[n].s;h[S]==t&&(--h[S],++m)}g=t}return{t:new ps(h),l:g}},VE=function(e,t,r){return e.s==-1?Math.max(VE(e.l,t,r+1),VE(e.r,t,r+1)):t[e.s]=r},a7=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new Ua(++t),n=0,i=e[0],a=1,o=function(l){r[n++]=l},s=1;s<=t;++s)if(e[s]==i&&s!=t)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(i),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(i);a=1,i=e[s]}return{c:r.subarray(0,n),n:t}},yv=function(e,t){for(var r=0,n=0;n>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var a=0;a4&&!$[n7[C-1]];--C);var D=c+5<<3,I=yv(i,Tf)+yv(a,z2)+o,G=yv(i,p)+yv(a,m)+o+14+3*C+yv(E,$)+2*E[16]+3*E[17]+7*E[18];if(l>=0&&D<=I&&D<=G)return AJ(t,u,e.subarray(l,l+c));var Y,Z,U,X;if(Nl(t,u,1+(G15&&(Nl(t,u,W[O]>>5&127),u+=W[O]>>12)}}else Y=ZFe,Z=Tf,U=QFe,X=z2;for(var O=0;O255){var z=ie>>18&31;vv(t,u,Y[z+257]),u+=Z[z+257],z>7&&(Nl(t,u,ie>>23&31),u+=XO[z]);var le=ie&31;vv(t,u,U[le]),u+=X[le],le>3&&(vv(t,u,ie>>5&8191),u+=JO[le])}else vv(t,u,Y[ie]),u+=Z[ie]}return vv(t,u,Y[256]),u+Z[256]},tBe=new YO([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),PJ=new ps(0),rBe=function(e,t,r,n,i,a){var o=a.z||e.length,s=new ps(n+o+5*(1+Math.ceil(o/7e3))+i),l=s.subarray(n,s.length-i),c=a.l,u=(a.r||0)&7;if(t){u&&(l[0]=a.r>>3);for(var f=tBe[t-1],p=f>>13,h=f&8191,g=(1<7e3||$>24576)&&(Y>423||!c)){u=o7(e,l,0,S,_,k,O,$,C,R-C,u),$=E=O=0,C=R;for(var Z=0;Z<286;++Z)_[Z]=0;for(var Z=0;Z<30;++Z)k[Z]=0}var U=2,X=0,oe=h,ue=I-G&32767;if(Y>2&&D==x(R-ue))for(var M=Math.min(p,Y)-1,W=Math.min(32767,R),z=Math.min(258,Y);ue<=W&&--oe&&I!=G;){if(e[R+U]==e[R+U-ue]){for(var ie=0;ieU){if(U=ie,X=ue,ie>M)break;for(var le=Math.min(ue,ie-2),V=0,Z=0;ZV&&(V=de,G=se)}}}I=G,G=m[I],ue+=I-G&32767}if(X){S[$++]=268435456|zE[U]<<18|i7[X];var ve=zE[U]&31,fe=i7[X]&31;O+=XO[ve]+JO[fe],++_[257+ve],++k[fe],N=R+U,++E}else S[$++]=e[R],++_[e[R]]}}for(R=Math.max(R,N);R=o&&(l[u/8|0]=c,je=o),u=AJ(l,u+1,e.subarray(R,je))}a.i=o}return eBe(s,0,n+SJ(u)+i)},kJ=function(){var e=1,t=0;return{p:function(r){for(var n=e,i=t,a=r.length|0,o=0;o!=a;){for(var s=Math.min(o+2655,a);o>16),i=(i&65535)+15*(i>>16)}e=n,t=i},d:function(){return e%=65521,t%=65521,(e&255)<<24|(e&65280)<<8|(t&255)<<8|t>>8}}},nBe=function(e,t,r,n,i){if(!i&&(i={l:1},t.dictionary)){var a=t.dictionary.subarray(-32768),o=new ps(a.length+e.length);o.set(a),o.set(e,a.length),e=o,i.w=a.length}return rBe(e,t.level==null?6:t.level,t.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,r,n,i)},jJ=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},iBe=function(e,t){var r=t.level,n=r==0?0:r<6?1:r==9?3:2;if(e[0]=120,e[1]=n<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){var i=kJ();i.p(t.dictionary),jJ(e,2,i.d())}};function qE(e,t){t||(t={});var r=kJ();r.p(e);var n=nBe(e,t,t.dictionary?6:2,4);return iBe(n,t),jJ(n,n.length-4,r.d()),n}var aBe=typeof TextDecoder<"u"&&new TextDecoder,oBe=0;try{aBe.decode(PJ,{stream:!0}),oBe=1}catch{}function sBe(e){if(Array.isArray(e))return e}function lBe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function s7(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{const e=new Uint8Array(4),t=new Uint32Array(e.buffer);return!((t[0]=1)&e[0])})(),wP={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array};class ZO{constructor(t=hBe,r={}){Gt(this,"buffer");Gt(this,"byteLength");Gt(this,"byteOffset");Gt(this,"length");Gt(this,"offset");Gt(this,"lastWrittenByte");Gt(this,"littleEndian");Gt(this,"_data");Gt(this,"_mark");Gt(this,"_marks");let n=!1;typeof t=="number"?t=new ArrayBuffer(t):(n=!0,this.lastWrittenByte=t.byteLength);const i=r.offset?r.offset>>>0:0,a=t.byteLength-i;let o=i;(ArrayBuffer.isView(t)||t instanceof ZO)&&(t.byteLength!==t.buffer.byteLength&&(o=t.byteOffset+i),t=t.buffer),n?this.lastWrittenByte=a:this.lastWrittenByte=0,this.buffer=t,this.length=a,this.byteLength=a,this.byteOffset=o,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,o,a),this._mark=0,this._marks=[]}available(t=1){return this.offset+t<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(t=1){return this.offset+=t,this}back(t=1){return this.offset-=t,this}seek(t){return this.offset=t,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){const t=this._marks.pop();if(t===void 0)throw new Error("Mark stack empty");return this.seek(t),this}rewind(){return this.offset=0,this}ensureAvailable(t=1){if(!this.available(t)){const n=(this.offset+t)*2,i=new Uint8Array(n);i.set(new Uint8Array(this.buffer)),this.buffer=i.buffer,this.length=n,this.byteLength=n,this._data=new DataView(this.buffer)}return this}readBoolean(){return this.readUint8()!==0}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(t=1){return this.readArray(t,"uint8")}readArray(t,r){const n=wP[r].BYTES_PER_ELEMENT*t,i=this.byteOffset+this.offset,a=this.buffer.slice(i,i+n);if(this.littleEndian===pBe&&r!=="uint8"&&r!=="int8"){const s=new Uint8Array(this.buffer.slice(i,i+n));s.reverse();const l=new wP[r](s.buffer);return this.offset+=n,l.reverse(),l}const o=new wP[r](a);return this.offset+=n,o}readInt16(){const t=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,t}readUint16(){const t=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,t}readInt32(){const t=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,t}readUint32(){const t=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,t}readFloat32(){const t=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,t}readFloat64(){const t=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,t}readBigInt64(){const t=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,t}readBigUint64(){const t=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,t}readChar(){return String.fromCharCode(this.readInt8())}readChars(t=1){let r="";for(let n=0;nthis.lastWrittenByte&&(this.lastWrittenByte=this.offset)}}/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const mBe=4,u7=0,d7=1,gBe=2;function pg(e){let t=e.length;for(;--t>=0;)e[t]=0}const vBe=0,NJ=1,yBe=2,bBe=3,xBe=258,QO=29,v1=256,j0=v1+1+QO,_p=30,e4=19,EJ=2*j0+1,Yd=15,_P=16,wBe=7,t4=256,CJ=16,TJ=17,OJ=18,WE=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Ux=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),_Be=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),RJ=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),SBe=512,Il=new Array((j0+2)*2);pg(Il);const ry=new Array(_p*2);pg(ry);const N0=new Array(SBe);pg(N0);const E0=new Array(xBe-bBe+1);pg(E0);const r4=new Array(QO);pg(r4);const H2=new Array(_p);pg(H2);function SP(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}let LJ,IJ,MJ;function AP(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}const $J=e=>e<256?N0[e]:N0[256+(e>>>7)],C0=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},da=(e,t,r)=>{e.bi_valid>_P-r?(e.bi_buf|=t<>_P-e.bi_valid,e.bi_valid+=r-_P):(e.bi_buf|=t<{da(e,r[t*2],r[t*2+1])},DJ=(e,t)=>{let r=0;do r|=e&1,e>>>=1,r<<=1;while(--t>0);return r>>>1},ABe=e=>{e.bi_valid===16?(C0(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},PBe=(e,t)=>{const r=t.dyn_tree,n=t.max_code,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,l=t.stat_desc.max_length;let c,u,f,p,h,g,m=0;for(p=0;p<=Yd;p++)e.bl_count[p]=0;for(r[e.heap[e.heap_max]*2+1]=0,c=e.heap_max+1;cl&&(p=l,m++),r[u*2+1]=p,!(u>n)&&(e.bl_count[p]++,h=0,u>=s&&(h=o[u-s]),g=r[u*2],e.opt_len+=g*(p+h),a&&(e.static_len+=g*(i[u*2+1]+h)));if(m!==0){do{for(p=l-1;e.bl_count[p]===0;)p--;e.bl_count[p]--,e.bl_count[p+1]+=2,e.bl_count[l]--,m-=2}while(m>0);for(p=l;p!==0;p--)for(u=e.bl_count[p];u!==0;)f=e.heap[--c],!(f>n)&&(r[f*2+1]!==p&&(e.opt_len+=(p-r[f*2+1])*r[f*2],r[f*2+1]=p),u--)}},FJ=(e,t,r)=>{const n=new Array(Yd+1);let i=0,a,o;for(a=1;a<=Yd;a++)i=i+r[a-1]<<1,n[a]=i;for(o=0;o<=t;o++){let s=e[o*2+1];s!==0&&(e[o*2]=DJ(n[s]++,s))}},kBe=()=>{let e,t,r,n,i;const a=new Array(Yd+1);for(r=0,n=0;n>=7;n<_p;n++)for(H2[n]=i<<7,e=0;e<1<{let t;for(t=0;t{e.bi_valid>8?C0(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},f7=(e,t,r,n)=>{const i=t*2,a=r*2;return e[i]{const n=e.heap[r];let i=r<<1;for(;i<=e.heap_len&&(i{let n,i,a=0,o,s;if(e.sym_next!==0)do n=e.pending_buf[e.sym_buf+a++]&255,n+=(e.pending_buf[e.sym_buf+a++]&255)<<8,i=e.pending_buf[e.sym_buf+a++],n===0?Us(e,i,t):(o=E0[i],Us(e,o+v1+1,t),s=WE[o],s!==0&&(i-=r4[o],da(e,i,s)),n--,o=$J(n),Us(e,o,r),s=Ux[o],s!==0&&(n-=H2[o],da(e,n,s)));while(a{const r=t.dyn_tree,n=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.elems;let o,s,l=-1,c;for(e.heap_len=0,e.heap_max=EJ,o=0;o>1;o>=1;o--)PP(e,r,o);c=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],PP(e,r,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,r[c*2]=r[o*2]+r[s*2],e.depth[c]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,r[o*2+1]=r[s*2+1]=c,e.heap[1]=c++,PP(e,r,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],PBe(e,t),FJ(r,l,e.bl_count)},p7=(e,t,r)=>{let n,i=-1,a,o=t[0*2+1],s=0,l=7,c=4;for(o===0&&(l=138,c=3),t[(r+1)*2+1]=65535,n=0;n<=r;n++)a=o,o=t[(n+1)*2+1],!(++s{let n,i=-1,a,o=t[0*2+1],s=0,l=7,c=4;for(o===0&&(l=138,c=3),n=0;n<=r;n++)if(a=o,o=t[(n+1)*2+1],!(++s{let t;for(p7(e,e.dyn_ltree,e.l_desc.max_code),p7(e,e.dyn_dtree,e.d_desc.max_code),GE(e,e.bl_desc),t=e4-1;t>=3&&e.bl_tree[RJ[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},NBe=(e,t,r,n)=>{let i;for(da(e,t-257,5),da(e,r-1,5),da(e,n-4,4),i=0;i{let t=4093624447,r;for(r=0;r<=31;r++,t>>>=1)if(t&1&&e.dyn_ltree[r*2]!==0)return u7;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return d7;for(r=32;r{g7||(kBe(),g7=!0),e.l_desc=new AP(e.dyn_ltree,LJ),e.d_desc=new AP(e.dyn_dtree,IJ),e.bl_desc=new AP(e.bl_tree,MJ),e.bi_buf=0,e.bi_valid=0,BJ(e)},zJ=(e,t,r,n)=>{da(e,(vBe<<1)+(n?1:0),3),UJ(e),C0(e,r),C0(e,~r),r&&e.pending_buf.set(e.window.subarray(t,t+r),e.pending),e.pending+=r},TBe=e=>{da(e,NJ<<1,3),Us(e,t4,Il),ABe(e)},OBe=(e,t,r,n)=>{let i,a,o=0;e.level>0?(e.strm.data_type===gBe&&(e.strm.data_type=EBe(e)),GE(e,e.l_desc),GE(e,e.d_desc),o=jBe(e),i=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=i&&(i=a)):i=a=r+5,r+4<=i&&t!==-1?zJ(e,t,r,n):e.strategy===mBe||a===i?(da(e,(NJ<<1)+(n?1:0),3),h7(e,Il,ry)):(da(e,(yBe<<1)+(n?1:0),3),NBe(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),h7(e,e.dyn_ltree,e.dyn_dtree)),BJ(e),n&&UJ(e)},RBe=(e,t,r)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=r,t===0?e.dyn_ltree[r*2]++:(e.matches++,t--,e.dyn_ltree[(E0[r]+v1+1)*2]++,e.dyn_dtree[$J(t)*2]++),e.sym_next===e.sym_end);var LBe=CBe,IBe=zJ,MBe=OBe,$Be=RBe,DBe=TBe,FBe={_tr_init:LBe,_tr_stored_block:IBe,_tr_flush_block:MBe,_tr_tally:$Be,_tr_align:DBe};const BBe=(e,t,r,n)=>{let i=e&65535|0,a=e>>>16&65535|0,o=0;for(;r!==0;){o=r>2e3?2e3:r,r-=o;do i=i+t[n++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0};var T0=BBe;const UBe=()=>{let e,t=[];for(var r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;t[r]=e}return t},zBe=new Uint32Array(UBe()),HBe=(e,t,r,n)=>{const i=zBe,a=n+r;e^=-1;for(let o=n;o>>8^i[(e^t[o])&255];return e^-1};var Yn=HBe,Tm={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},y1={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:VBe,_tr_stored_block:KE,_tr_flush_block:qBe,_tr_tally:Ru,_tr_align:WBe}=FBe,{Z_NO_FLUSH:Lu,Z_PARTIAL_FLUSH:GBe,Z_FULL_FLUSH:KBe,Z_FINISH:vo,Z_BLOCK:v7,Z_OK:mi,Z_STREAM_END:y7,Z_STREAM_ERROR:el,Z_DATA_ERROR:YBe,Z_BUF_ERROR:kP,Z_DEFAULT_COMPRESSION:XBe,Z_FILTERED:JBe,Z_HUFFMAN_ONLY:ax,Z_RLE:ZBe,Z_FIXED:QBe,Z_DEFAULT_STRATEGY:e9e,Z_UNKNOWN:t9e,Z_DEFLATED:z_}=y1,r9e=9,n9e=15,i9e=8,a9e=29,o9e=256,YE=o9e+1+a9e,s9e=30,l9e=19,c9e=2*YE+1,u9e=15,Qt=3,bu=258,tl=bu+Qt+1,d9e=32,Om=42,n4=57,XE=69,JE=73,ZE=91,QE=103,Xd=113,Ev=666,Yi=1,mg=2,Of=3,gg=4,f9e=3,Jd=(e,t)=>(e.msg=Tm[t],t),b7=e=>e*2-(e>4?9:0),iu=e=>{let t=e.length;for(;--t>=0;)e[t]=0},h9e=e=>{let t,r,n,i=e.w_size;t=e.hash_size,n=t;do r=e.head[--n],e.head[n]=r>=i?r-i:0;while(--t);t=i,n=t;do r=e.prev[--n],e.prev[n]=r>=i?r-i:0;while(--t)};let p9e=(e,t,r)=>(t<{const t=e.state;let r=t.pending;r>e.avail_out&&(r=e.avail_out),r!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+r),e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,t.pending===0&&(t.pending_out=0))},za=(e,t)=>{qBe(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Ta(e.strm)},hr=(e,t)=>{e.pending_buf[e.pending++]=t},bv=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},eC=(e,t,r,n)=>{let i=e.avail_in;return i>n&&(i=n),i===0?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),r),e.state.wrap===1?e.adler=T0(e.adler,t,i,r):e.state.wrap===2&&(e.adler=Yn(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)},HJ=(e,t)=>{let r=e.max_chain_length,n=e.strstart,i,a,o=e.prev_length,s=e.nice_match;const l=e.strstart>e.w_size-tl?e.strstart-(e.w_size-tl):0,c=e.window,u=e.w_mask,f=e.prev,p=e.strstart+bu;let h=c[n+o-1],g=c[n+o];e.prev_length>=e.good_match&&(r>>=2),s>e.lookahead&&(s=e.lookahead);do if(i=t,!(c[i+o]!==g||c[i+o-1]!==h||c[i]!==c[n]||c[++i]!==c[n+1])){n+=2,i++;do;while(c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&no){if(e.match_start=t,o=a,a>=s)break;h=c[n+o-1],g=c[n+o]}}while((t=f[t&u])>l&&--r!==0);return o<=e.lookahead?o:e.lookahead},Rm=e=>{const t=e.w_size;let r,n,i;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-tl)&&(e.window.set(e.window.subarray(t,t+t-n),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),h9e(e),n+=t),e.strm.avail_in===0)break;if(r=eC(e.strm,e.window,e.strstart+e.lookahead,n),e.lookahead+=r,e.lookahead+e.insert>=Qt)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=Iu(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=Iu(e,e.ins_h,e.window[i+Qt-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert{let r=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,n,i,a,o=0,s=e.strm.avail_in;do{if(n=65535,a=e.bi_valid+42>>3,e.strm.avail_outi+e.strm.avail_in&&(n=i+e.strm.avail_in),n>a&&(n=a),n>8,e.pending_buf[e.pending-2]=~n,e.pending_buf[e.pending-1]=~n>>8,Ta(e.strm),i&&(i>n&&(i=n),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+i),e.strm.next_out),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i,e.block_start+=i,n-=i),n&&(eC(e.strm,e.strm.output,e.strm.next_out,n),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n)}while(o===0);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_watera&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,a+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),a>e.strm.avail_in&&(a=e.strm.avail_in),a&&(eC(e.strm,e.window,e.strstart,a),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.high_water>3,a=e.pending_buf_size-a>65535?65535:e.pending_buf_size-a,r=a>e.w_size?e.w_size:a,i=e.strstart-e.block_start,(i>=r||(i||t===vo)&&t!==Lu&&e.strm.avail_in===0&&i<=a)&&(n=i>a?a:i,o=t===vo&&e.strm.avail_in===0&&n===i?1:0,KE(e,e.block_start,n,o),e.block_start+=n,Ta(e.strm)),o?Of:Yi)},jP=(e,t)=>{let r,n;for(;;){if(e.lookahead=Qt&&(e.ins_h=Iu(e,e.ins_h,e.window[e.strstart+Qt-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),r!==0&&e.strstart-r<=e.w_size-tl&&(e.match_length=HJ(e,r)),e.match_length>=Qt)if(n=Ru(e,e.strstart-e.match_start,e.match_length-Qt),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=Qt){e.match_length--;do e.strstart++,e.ins_h=Iu(e,e.ins_h,e.window[e.strstart+Qt-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=Iu(e,e.ins_h,e.window[e.strstart+1]);else n=Ru(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(za(e,!1),e.strm.avail_out===0))return Yi}return e.insert=e.strstart{let r,n,i;for(;;){if(e.lookahead=Qt&&(e.ins_h=Iu(e,e.ins_h,e.window[e.strstart+Qt-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=Qt-1,r!==0&&e.prev_length4096)&&(e.match_length=Qt-1)),e.prev_length>=Qt&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-Qt,n=Ru(e,e.strstart-1-e.prev_match,e.prev_length-Qt),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=Iu(e,e.ins_h,e.window[e.strstart+Qt-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=Qt-1,e.strstart++,n&&(za(e,!1),e.strm.avail_out===0))return Yi}else if(e.match_available){if(n=Ru(e,0,e.window[e.strstart-1]),n&&za(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return Yi}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=Ru(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart{let r,n,i,a;const o=e.window;for(;;){if(e.lookahead<=bu){if(Rm(e),e.lookahead<=bu&&t===Lu)return Yi;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=Qt&&e.strstart>0&&(i=e.strstart-1,n=o[i],n===o[++i]&&n===o[++i]&&n===o[++i])){a=e.strstart+bu;do;while(n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&ie.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=Qt?(r=Ru(e,1,e.match_length-Qt),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=Ru(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(za(e,!1),e.strm.avail_out===0))return Yi}return e.insert=0,t===vo?(za(e,!0),e.strm.avail_out===0?Of:gg):e.sym_next&&(za(e,!1),e.strm.avail_out===0)?Yi:mg},g9e=(e,t)=>{let r;for(;;){if(e.lookahead===0&&(Rm(e),e.lookahead===0)){if(t===Lu)return Yi;break}if(e.match_length=0,r=Ru(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(za(e,!1),e.strm.avail_out===0))return Yi}return e.insert=0,t===vo?(za(e,!0),e.strm.avail_out===0?Of:gg):e.sym_next&&(za(e,!1),e.strm.avail_out===0)?Yi:mg};function Os(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}const Cv=[new Os(0,0,0,0,VJ),new Os(4,4,8,4,jP),new Os(4,5,16,8,jP),new Os(4,6,32,32,jP),new Os(4,4,16,16,wh),new Os(8,16,32,32,wh),new Os(8,16,128,128,wh),new Os(8,32,128,256,wh),new Os(32,128,258,1024,wh),new Os(32,258,258,4096,wh)],v9e=e=>{e.window_size=2*e.w_size,iu(e.head),e.max_lazy_match=Cv[e.level].max_lazy,e.good_match=Cv[e.level].good_length,e.nice_match=Cv[e.level].nice_length,e.max_chain_length=Cv[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=Qt-1,e.match_available=0,e.ins_h=0};function y9e(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=z_,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(c9e*2),this.dyn_dtree=new Uint16Array((2*s9e+1)*2),this.bl_tree=new Uint16Array((2*l9e+1)*2),iu(this.dyn_ltree),iu(this.dyn_dtree),iu(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(u9e+1),this.heap=new Uint16Array(2*YE+1),iu(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*YE+1),iu(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const b1=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==Om&&t.status!==n4&&t.status!==XE&&t.status!==JE&&t.status!==ZE&&t.status!==QE&&t.status!==Xd&&t.status!==Ev?1:0},qJ=e=>{if(b1(e))return Jd(e,el);e.total_in=e.total_out=0,e.data_type=t9e;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?n4:t.wrap?Om:Xd,e.adler=t.wrap===2?0:1,t.last_flush=-2,VBe(t),mi},WJ=e=>{const t=qJ(e);return t===mi&&v9e(e.state),t},b9e=(e,t)=>b1(e)||e.state.wrap!==2?el:(e.state.gzhead=t,mi),GJ=(e,t,r,n,i,a)=>{if(!e)return el;let o=1;if(t===XBe&&(t=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),i<1||i>r9e||r!==z_||n<8||n>15||t<0||t>9||a<0||a>QBe||n===8&&o!==1)return Jd(e,el);n===8&&(n=9);const s=new y9e;return e.state=s,s.strm=e,s.status=Om,s.wrap=o,s.gzhead=null,s.w_bits=n,s.w_size=1<GJ(e,t,z_,n9e,i9e,e9e),w9e=(e,t)=>{if(b1(e)||t>v7||t<0)return e?Jd(e,el):el;const r=e.state;if(!e.output||e.avail_in!==0&&!e.input||r.status===Ev&&t!==vo)return Jd(e,e.avail_out===0?kP:el);const n=r.last_flush;if(r.last_flush=t,r.pending!==0){if(Ta(e),e.avail_out===0)return r.last_flush=-1,mi}else if(e.avail_in===0&&b7(t)<=b7(n)&&t!==vo)return Jd(e,kP);if(r.status===Ev&&e.avail_in!==0)return Jd(e,kP);if(r.status===Om&&r.wrap===0&&(r.status=Xd),r.status===Om){let i=z_+(r.w_bits-8<<4)<<8,a=-1;if(r.strategy>=ax||r.level<2?a=0:r.level<6?a=1:r.level===6?a=2:a=3,i|=a<<6,r.strstart!==0&&(i|=d9e),i+=31-i%31,bv(r,i),r.strstart!==0&&(bv(r,e.adler>>>16),bv(r,e.adler&65535)),e.adler=1,r.status=Xd,Ta(e),r.pending!==0)return r.last_flush=-1,mi}if(r.status===n4){if(e.adler=0,hr(r,31),hr(r,139),hr(r,8),r.gzhead)hr(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),hr(r,r.gzhead.time&255),hr(r,r.gzhead.time>>8&255),hr(r,r.gzhead.time>>16&255),hr(r,r.gzhead.time>>24&255),hr(r,r.level===9?2:r.strategy>=ax||r.level<2?4:0),hr(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(hr(r,r.gzhead.extra.length&255),hr(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=Yn(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=XE;else if(hr(r,0),hr(r,0),hr(r,0),hr(r,0),hr(r,0),hr(r,r.level===9?2:r.strategy>=ax||r.level<2?4:0),hr(r,f9e),r.status=Xd,Ta(e),r.pending!==0)return r.last_flush=-1,mi}if(r.status===XE){if(r.gzhead.extra){let i=r.pending,a=(r.gzhead.extra.length&65535)-r.gzindex;for(;r.pending+a>r.pending_buf_size;){let s=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+s),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>i&&(e.adler=Yn(e.adler,r.pending_buf,r.pending-i,i)),r.gzindex+=s,Ta(e),r.pending!==0)return r.last_flush=-1,mi;i=0,a-=s}let o=new Uint8Array(r.gzhead.extra);r.pending_buf.set(o.subarray(r.gzindex,r.gzindex+a),r.pending),r.pending+=a,r.gzhead.hcrc&&r.pending>i&&(e.adler=Yn(e.adler,r.pending_buf,r.pending-i,i)),r.gzindex=0}r.status=JE}if(r.status===JE){if(r.gzhead.name){let i=r.pending,a;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>i&&(e.adler=Yn(e.adler,r.pending_buf,r.pending-i,i)),Ta(e),r.pending!==0)return r.last_flush=-1,mi;i=0}r.gzindexi&&(e.adler=Yn(e.adler,r.pending_buf,r.pending-i,i)),r.gzindex=0}r.status=ZE}if(r.status===ZE){if(r.gzhead.comment){let i=r.pending,a;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>i&&(e.adler=Yn(e.adler,r.pending_buf,r.pending-i,i)),Ta(e),r.pending!==0)return r.last_flush=-1,mi;i=0}r.gzindexi&&(e.adler=Yn(e.adler,r.pending_buf,r.pending-i,i))}r.status=QE}if(r.status===QE){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(Ta(e),r.pending!==0))return r.last_flush=-1,mi;hr(r,e.adler&255),hr(r,e.adler>>8&255),e.adler=0}if(r.status=Xd,Ta(e),r.pending!==0)return r.last_flush=-1,mi}if(e.avail_in!==0||r.lookahead!==0||t!==Lu&&r.status!==Ev){let i=r.level===0?VJ(r,t):r.strategy===ax?g9e(r,t):r.strategy===ZBe?m9e(r,t):Cv[r.level].func(r,t);if((i===Of||i===gg)&&(r.status=Ev),i===Yi||i===Of)return e.avail_out===0&&(r.last_flush=-1),mi;if(i===mg&&(t===GBe?WBe(r):t!==v7&&(KE(r,0,0,!1),t===KBe&&(iu(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),Ta(e),e.avail_out===0))return r.last_flush=-1,mi}return t!==vo?mi:r.wrap<=0?y7:(r.wrap===2?(hr(r,e.adler&255),hr(r,e.adler>>8&255),hr(r,e.adler>>16&255),hr(r,e.adler>>24&255),hr(r,e.total_in&255),hr(r,e.total_in>>8&255),hr(r,e.total_in>>16&255),hr(r,e.total_in>>24&255)):(bv(r,e.adler>>>16),bv(r,e.adler&65535)),Ta(e),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?mi:y7)},_9e=e=>{if(b1(e))return el;const t=e.state.status;return e.state=null,t===Xd?Jd(e,YBe):mi},S9e=(e,t)=>{let r=t.length;if(b1(e))return el;const n=e.state,i=n.wrap;if(i===2||i===1&&n.status!==Om||n.lookahead)return el;if(i===1&&(e.adler=T0(e.adler,t,r,0)),n.wrap=0,r>=n.w_size){i===0&&(iu(n.head),n.strstart=0,n.block_start=0,n.insert=0);let l=new Uint8Array(n.w_size);l.set(t.subarray(r-n.w_size,r),0),t=l,r=n.w_size}const a=e.avail_in,o=e.next_in,s=e.input;for(e.avail_in=r,e.next_in=0,e.input=t,Rm(n);n.lookahead>=Qt;){let l=n.strstart,c=n.lookahead-(Qt-1);do n.ins_h=Iu(n,n.ins_h,n.window[l+Qt-1]),n.prev[l&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=l,l++;while(--c);n.strstart=l,n.lookahead=Qt-1,Rm(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=Qt-1,n.match_available=0,e.next_in=o,e.input=s,e.avail_in=a,n.wrap=i,mi};var A9e=x9e,P9e=GJ,k9e=WJ,j9e=qJ,N9e=b9e,E9e=w9e,C9e=_9e,T9e=S9e,O9e="pako deflate (from Nodeca project)",ny={deflateInit:A9e,deflateInit2:P9e,deflateReset:k9e,deflateResetKeep:j9e,deflateSetHeader:N9e,deflate:E9e,deflateEnd:C9e,deflateSetDictionary:T9e,deflateInfo:O9e};const R9e=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var L9e=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const r=t.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(const n in r)R9e(r,n)&&(e[n]=r[n])}}return e},I9e=e=>{let t=0;for(let n=0,i=e.length;n=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;O0[254]=O0[254]=1;var M9e=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,r,n,i,a,o=e.length,s=0;for(i=0;i>>6,t[a++]=128|r&63):r<65536?(t[a++]=224|r>>>12,t[a++]=128|r>>>6&63,t[a++]=128|r&63):(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63,t[a++]=128|r>>>6&63,t[a++]=128|r&63);return t};const $9e=(e,t)=>{if(t<65534&&e.subarray&&KJ)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let r="";for(let n=0;n{const r=t||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let n,i;const a=new Array(r*2);for(i=0,n=0;n4){a[i++]=65533,n+=s-1;continue}for(o&=s===2?31:s===3?15:7;s>1&&n1){a[i++]=65533;continue}o<65536?a[i++]=o:(o-=65536,a[i++]=55296|o>>10&1023,a[i++]=56320|o&1023)}return $9e(a,i)},F9e=(e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let r=t-1;for(;r>=0&&(e[r]&192)===128;)r--;return r<0||r===0?t:r+O0[e[r]]>t?r:t},R0={string2buf:M9e,buf2string:D9e,utf8border:F9e};function B9e(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var YJ=B9e;const XJ=Object.prototype.toString,{Z_NO_FLUSH:U9e,Z_SYNC_FLUSH:z9e,Z_FULL_FLUSH:H9e,Z_FINISH:V9e,Z_OK:V2,Z_STREAM_END:q9e,Z_DEFAULT_COMPRESSION:W9e,Z_DEFAULT_STRATEGY:G9e,Z_DEFLATED:K9e}=y1;function i4(e){this.options=H_.assign({level:W9e,method:K9e,chunkSize:16384,windowBits:15,memLevel:8,strategy:G9e},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new YJ,this.strm.avail_out=0;let r=ny.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==V2)throw new Error(Tm[r]);if(t.header&&ny.deflateSetHeader(this.strm,t.header),t.dictionary){let n;if(typeof t.dictionary=="string"?n=R0.string2buf(t.dictionary):XJ.call(t.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(t.dictionary):n=t.dictionary,r=ny.deflateSetDictionary(this.strm,n),r!==V2)throw new Error(Tm[r]);this._dict_set=!0}}i4.prototype.push=function(e,t){const r=this.strm,n=this.options.chunkSize;let i,a;if(this.ended)return!1;for(t===~~t?a=t:a=t===!0?V9e:U9e,typeof e=="string"?r.input=R0.string2buf(e):XJ.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;){if(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(a===z9e||a===H9e)&&r.avail_out<=6){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(i=ny.deflate(r,a),i===q9e)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=ny.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===V2;if(r.avail_out===0){this.onData(r.output);continue}if(a>0&&r.next_out>0){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(r.avail_in===0)break}return!0};i4.prototype.onData=function(e){this.chunks.push(e)};i4.prototype.onEnd=function(e){e===V2&&(this.result=H_.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const ox=16209,Y9e=16191;var X9e=function(t,r){let n,i,a,o,s,l,c,u,f,p,h,g,m,v,y,b,x,S,_,k,E,O,R,$;const N=t.state;n=t.next_in,R=t.input,i=n+(t.avail_in-5),a=t.next_out,$=t.output,o=a-(r-t.avail_out),s=a+(t.avail_out-257),l=N.dmax,c=N.wsize,u=N.whave,f=N.wnext,p=N.window,h=N.hold,g=N.bits,m=N.lencode,v=N.distcode,y=(1<>>24,h>>>=S,g-=S,S=x>>>16&255,S===0)$[a++]=x&65535;else if(S&16){_=x&65535,S&=15,S&&(g>>=S,g-=S),g<15&&(h+=R[n++]<>>24,h>>>=S,g-=S,S=x>>>16&255,S&16){if(k=x&65535,S&=15,gl){t.msg="invalid distance too far back",N.mode=ox;break e}if(h>>>=S,g-=S,S=a-o,k>S){if(S=k-S,S>u&&N.sane){t.msg="invalid distance too far back",N.mode=ox;break e}if(E=0,O=p,f===0){if(E+=c-S,S<_){_-=S;do $[a++]=p[E++];while(--S);E=a-k,O=$}}else if(f2;)$[a++]=O[E++],$[a++]=O[E++],$[a++]=O[E++],_-=3;_&&($[a++]=O[E++],_>1&&($[a++]=O[E++]))}else{E=a-k;do $[a++]=$[E++],$[a++]=$[E++],$[a++]=$[E++],_-=3;while(_>2);_&&($[a++]=$[E++],_>1&&($[a++]=$[E++]))}}else if(S&64){t.msg="invalid distance code",N.mode=ox;break e}else{x=v[(x&65535)+(h&(1<>3,n-=_,g-=_<<3,h&=(1<{const l=s.bits;let c=0,u=0,f=0,p=0,h=0,g=0,m=0,v=0,y=0,b=0,x,S,_,k,E,O=null,R;const $=new Uint16Array(_h+1),N=new Uint16Array(_h+1);let C=null,D,I,G;for(c=0;c<=_h;c++)$[c]=0;for(u=0;u=1&&$[p]===0;p--);if(h>p&&(h=p),p===0)return i[a++]=1<<24|64<<16|0,i[a++]=1<<24|64<<16|0,s.bits=1,0;for(f=1;f0&&(e===_7||p!==1))return-1;for(N[1]=0,c=1;c<_h;c++)N[c+1]=N[c]+$[c];for(u=0;ux7||e===S7&&y>w7)return 1;for(;;){D=c-m,o[u]+1=R?(I=C[o[u]-R],G=O[o[u]-R]):(I=96,G=0),x=1<>m)+S]=D<<24|I<<16|G|0;while(S!==0);for(x=1<>=1;if(x!==0?(b&=x-1,b+=x):b=0,u++,--$[c]===0){if(c===p)break;c=t[r+o[u]]}if(c>h&&(b&k)!==_){for(m===0&&(m=h),E+=f,g=c-m,v=1<x7||e===S7&&y>w7)return 1;_=b&k,i[_]=h<<24|g<<16|E-a|0}}return b!==0&&(i[E+b]=c-m<<24|64<<16|0),s.bits=h,0};var iy=tUe;const rUe=0,JJ=1,ZJ=2,{Z_FINISH:A7,Z_BLOCK:nUe,Z_TREES:sx,Z_OK:Rf,Z_STREAM_END:iUe,Z_NEED_DICT:aUe,Z_STREAM_ERROR:Co,Z_DATA_ERROR:QJ,Z_MEM_ERROR:eZ,Z_BUF_ERROR:oUe,Z_DEFLATED:P7}=y1,V_=16180,k7=16181,j7=16182,N7=16183,E7=16184,C7=16185,T7=16186,O7=16187,R7=16188,L7=16189,q2=16190,El=16191,EP=16192,I7=16193,CP=16194,M7=16195,$7=16196,D7=16197,F7=16198,lx=16199,cx=16200,B7=16201,U7=16202,z7=16203,H7=16204,V7=16205,TP=16206,q7=16207,W7=16208,Yr=16209,tZ=16210,rZ=16211,sUe=852,lUe=592,cUe=15,uUe=cUe,G7=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function dUe(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Hf=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.moderZ?1:0},nZ=e=>{if(Hf(e))return Co;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=V_,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(sUe),t.distcode=t.distdyn=new Int32Array(lUe),t.sane=1,t.back=-1,Rf},iZ=e=>{if(Hf(e))return Co;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,nZ(e)},aZ=(e,t)=>{let r;if(Hf(e))return Co;const n=e.state;return t<0?(r=0,t=-t):(r=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?Co:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,iZ(e))},oZ=(e,t)=>{if(!e)return Co;const r=new dUe;e.state=r,r.strm=e,r.window=null,r.mode=V_;const n=aZ(e,t);return n!==Rf&&(e.state=null),n},fUe=e=>oZ(e,uUe);let K7=!0,OP,RP;const hUe=e=>{if(K7){OP=new Int32Array(512),RP=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(iy(JJ,e.lens,0,288,OP,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;iy(ZJ,e.lens,0,32,RP,0,e.work,{bits:5}),K7=!1}e.lencode=OP,e.lenbits=9,e.distcode=RP,e.distbits=5},sZ=(e,t,r,n)=>{let i;const a=e.state;return a.window===null&&(a.wsize=1<=a.wsize?(a.window.set(t.subarray(r-a.wsize,r),0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>n&&(i=n),a.window.set(t.subarray(r-n,r-n+i),a.wnext),n-=i,n?(a.window.set(t.subarray(r-n,r),0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave{let r,n,i,a,o,s,l,c,u,f,p,h,g,m,v=0,y,b,x,S,_,k,E,O;const R=new Uint8Array(4);let $,N;const C=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Hf(e)||!e.output||!e.input&&e.avail_in!==0)return Co;r=e.state,r.mode===El&&(r.mode=EP),o=e.next_out,i=e.output,l=e.avail_out,a=e.next_in,n=e.input,s=e.avail_in,c=r.hold,u=r.bits,f=s,p=l,O=Rf;e:for(;;)switch(r.mode){case V_:if(r.wrap===0){r.mode=EP;break}for(;u<16;){if(s===0)break e;s--,c+=n[a++]<>>8&255,r.check=Yn(r.check,R,2,0),c=0,u=0,r.mode=k7;break}if(r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){e.msg="incorrect header check",r.mode=Yr;break}if((c&15)!==P7){e.msg="unknown compression method",r.mode=Yr;break}if(c>>>=4,u-=4,E=(c&15)+8,r.wbits===0&&(r.wbits=E),E>15||E>r.wbits){e.msg="invalid window size",r.mode=Yr;break}r.dmax=1<>8&1),r.flags&512&&r.wrap&4&&(R[0]=c&255,R[1]=c>>>8&255,r.check=Yn(r.check,R,2,0)),c=0,u=0,r.mode=j7;case j7:for(;u<32;){if(s===0)break e;s--,c+=n[a++]<>>8&255,R[2]=c>>>16&255,R[3]=c>>>24&255,r.check=Yn(r.check,R,4,0)),c=0,u=0,r.mode=N7;case N7:for(;u<16;){if(s===0)break e;s--,c+=n[a++]<>8),r.flags&512&&r.wrap&4&&(R[0]=c&255,R[1]=c>>>8&255,r.check=Yn(r.check,R,2,0)),c=0,u=0,r.mode=E7;case E7:if(r.flags&1024){for(;u<16;){if(s===0)break e;s--,c+=n[a++]<>>8&255,r.check=Yn(r.check,R,2,0)),c=0,u=0}else r.head&&(r.head.extra=null);r.mode=C7;case C7:if(r.flags&1024&&(h=r.length,h>s&&(h=s),h&&(r.head&&(E=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(a,a+h),E)),r.flags&512&&r.wrap&4&&(r.check=Yn(r.check,n,h,a)),s-=h,a+=h,r.length-=h),r.length))break e;r.length=0,r.mode=T7;case T7:if(r.flags&2048){if(s===0)break e;h=0;do E=n[a+h++],r.head&&E&&r.length<65536&&(r.head.name+=String.fromCharCode(E));while(E&&h>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=El;break;case L7:for(;u<32;){if(s===0)break e;s--,c+=n[a++]<>>=u&7,u-=u&7,r.mode=TP;break}for(;u<3;){if(s===0)break e;s--,c+=n[a++]<>>=1,u-=1,c&3){case 0:r.mode=I7;break;case 1:if(hUe(r),r.mode=lx,t===sx){c>>>=2,u-=2;break e}break;case 2:r.mode=$7;break;case 3:e.msg="invalid block type",r.mode=Yr}c>>>=2,u-=2;break;case I7:for(c>>>=u&7,u-=u&7;u<32;){if(s===0)break e;s--,c+=n[a++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=Yr;break}if(r.length=c&65535,c=0,u=0,r.mode=CP,t===sx)break e;case CP:r.mode=M7;case M7:if(h=r.length,h){if(h>s&&(h=s),h>l&&(h=l),h===0)break e;i.set(n.subarray(a,a+h),o),s-=h,a+=h,l-=h,o+=h,r.length-=h;break}r.mode=El;break;case $7:for(;u<14;){if(s===0)break e;s--,c+=n[a++]<>>=5,u-=5,r.ndist=(c&31)+1,c>>>=5,u-=5,r.ncode=(c&15)+4,c>>>=4,u-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=Yr;break}r.have=0,r.mode=D7;case D7:for(;r.have>>=3,u-=3}for(;r.have<19;)r.lens[C[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,$={bits:r.lenbits},O=iy(rUe,r.lens,0,19,r.lencode,0,r.work,$),r.lenbits=$.bits,O){e.msg="invalid code lengths set",r.mode=Yr;break}r.have=0,r.mode=F7;case F7:for(;r.have>>24,b=v>>>16&255,x=v&65535,!(y<=u);){if(s===0)break e;s--,c+=n[a++]<>>=y,u-=y,r.lens[r.have++]=x;else{if(x===16){for(N=y+2;u>>=y,u-=y,r.have===0){e.msg="invalid bit length repeat",r.mode=Yr;break}E=r.lens[r.have-1],h=3+(c&3),c>>>=2,u-=2}else if(x===17){for(N=y+3;u>>=y,u-=y,E=0,h=3+(c&7),c>>>=3,u-=3}else{for(N=y+7;u>>=y,u-=y,E=0,h=11+(c&127),c>>>=7,u-=7}if(r.have+h>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=Yr;break}for(;h--;)r.lens[r.have++]=E}}if(r.mode===Yr)break;if(r.lens[256]===0){e.msg="invalid code -- missing end-of-block",r.mode=Yr;break}if(r.lenbits=9,$={bits:r.lenbits},O=iy(JJ,r.lens,0,r.nlen,r.lencode,0,r.work,$),r.lenbits=$.bits,O){e.msg="invalid literal/lengths set",r.mode=Yr;break}if(r.distbits=6,r.distcode=r.distdyn,$={bits:r.distbits},O=iy(ZJ,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,$),r.distbits=$.bits,O){e.msg="invalid distances set",r.mode=Yr;break}if(r.mode=lx,t===sx)break e;case lx:r.mode=cx;case cx:if(s>=6&&l>=258){e.next_out=o,e.avail_out=l,e.next_in=a,e.avail_in=s,r.hold=c,r.bits=u,X9e(e,p),o=e.next_out,i=e.output,l=e.avail_out,a=e.next_in,n=e.input,s=e.avail_in,c=r.hold,u=r.bits,r.mode===El&&(r.back=-1);break}for(r.back=0;v=r.lencode[c&(1<>>24,b=v>>>16&255,x=v&65535,!(y<=u);){if(s===0)break e;s--,c+=n[a++]<>S)],y=v>>>24,b=v>>>16&255,x=v&65535,!(S+y<=u);){if(s===0)break e;s--,c+=n[a++]<>>=S,u-=S,r.back+=S}if(c>>>=y,u-=y,r.back+=y,r.length=x,b===0){r.mode=V7;break}if(b&32){r.back=-1,r.mode=El;break}if(b&64){e.msg="invalid literal/length code",r.mode=Yr;break}r.extra=b&15,r.mode=B7;case B7:if(r.extra){for(N=r.extra;u>>=r.extra,u-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=U7;case U7:for(;v=r.distcode[c&(1<>>24,b=v>>>16&255,x=v&65535,!(y<=u);){if(s===0)break e;s--,c+=n[a++]<>S)],y=v>>>24,b=v>>>16&255,x=v&65535,!(S+y<=u);){if(s===0)break e;s--,c+=n[a++]<>>=S,u-=S,r.back+=S}if(c>>>=y,u-=y,r.back+=y,b&64){e.msg="invalid distance code",r.mode=Yr;break}r.offset=x,r.extra=b&15,r.mode=z7;case z7:if(r.extra){for(N=r.extra;u>>=r.extra,u-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=Yr;break}r.mode=H7;case H7:if(l===0)break e;if(h=p-l,r.offset>h){if(h=r.offset-h,h>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=Yr;break}h>r.wnext?(h-=r.wnext,g=r.wsize-h):g=r.wnext-h,h>r.length&&(h=r.length),m=r.window}else m=i,g=o-r.offset,h=r.length;h>l&&(h=l),l-=h,r.length-=h;do i[o++]=m[g++];while(--h);r.length===0&&(r.mode=cx);break;case V7:if(l===0)break e;i[o++]=r.length,l--,r.mode=cx;break;case TP:if(r.wrap){for(;u<32;){if(s===0)break e;s--,c|=n[a++]<{if(Hf(e))return Co;let t=e.state;return t.window&&(t.window=null),e.state=null,Rf},gUe=(e,t)=>{if(Hf(e))return Co;const r=e.state;return r.wrap&2?(r.head=t,t.done=!1,Rf):Co},vUe=(e,t)=>{const r=t.length;let n,i,a;return Hf(e)||(n=e.state,n.wrap!==0&&n.mode!==q2)?Co:n.mode===q2&&(i=1,i=T0(i,t,r,0),i!==n.check)?QJ:(a=sZ(e,t,r,r),a?(n.mode=tZ,eZ):(n.havedict=1,Rf))};var yUe=iZ,bUe=aZ,xUe=nZ,wUe=fUe,_Ue=oZ,SUe=pUe,AUe=mUe,PUe=gUe,kUe=vUe,jUe="pako inflate (from Nodeca project)",Ml={inflateReset:yUe,inflateReset2:bUe,inflateResetKeep:xUe,inflateInit:wUe,inflateInit2:_Ue,inflate:SUe,inflateEnd:AUe,inflateGetHeader:PUe,inflateSetDictionary:kUe,inflateInfo:jUe};function NUe(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var EUe=NUe;const lZ=Object.prototype.toString,{Z_NO_FLUSH:CUe,Z_FINISH:TUe,Z_OK:L0,Z_STREAM_END:LP,Z_NEED_DICT:IP,Z_STREAM_ERROR:OUe,Z_DATA_ERROR:Y7,Z_MEM_ERROR:RUe}=y1;function x1(e){this.options=H_.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new YJ,this.strm.avail_out=0;let r=Ml.inflateInit2(this.strm,t.windowBits);if(r!==L0)throw new Error(Tm[r]);if(this.header=new EUe,Ml.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=R0.string2buf(t.dictionary):lZ.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=Ml.inflateSetDictionary(this.strm,t.dictionary),r!==L0)))throw new Error(Tm[r])}x1.prototype.push=function(e,t){const r=this.strm,n=this.options.chunkSize,i=this.options.dictionary;let a,o,s;if(this.ended)return!1;for(t===~~t?o=t:o=t===!0?TUe:CUe,lZ.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;){for(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),a=Ml.inflate(r,o),a===IP&&i&&(a=Ml.inflateSetDictionary(r,i),a===L0?a=Ml.inflate(r,o):a===Y7&&(a=IP));r.avail_in>0&&a===LP&&r.state.wrap>0&&e[r.next_in]!==0;)Ml.inflateReset(r),a=Ml.inflate(r,o);switch(a){case OUe:case Y7:case IP:case RUe:return this.onEnd(a),this.ended=!0,!1}if(s=r.avail_out,r.next_out&&(r.avail_out===0||a===LP))if(this.options.to==="string"){let l=R0.utf8border(r.output,r.next_out),c=r.next_out-l,u=R0.buf2string(r.output,l);r.next_out=c,r.avail_out=n-c,c&&r.output.set(r.output.subarray(l,l+c),0),this.onData(u)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(!(a===L0&&s===0)){if(a===LP)return a=Ml.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(r.avail_in===0)break}}return!0};x1.prototype.onData=function(e){this.chunks.push(e)};x1.prototype.onEnd=function(e){e===L0&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=H_.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function a4(e,t){const r=new x1(t);if(r.push(e),r.err)throw r.msg||Tm[r.err];return r.result}function LUe(e,t){return t=t||{},t.raw=!0,a4(e,t)}var IUe=x1,MUe=a4,$Ue=LUe,DUe=a4,FUe=y1,BUe={Inflate:IUe,inflate:MUe,inflateRaw:$Ue,ungzip:DUe,constants:FUe};const{Inflate:UUe,inflate:zUe,inflateRaw:pqe,ungzip:mqe}=BUe;var X7=UUe,HUe=zUe;const cZ=[];for(let e=0;e<256;e++){let t=e;for(let r=0;r<8;r++)t&1?t=3988292384^t>>>1:t=t>>>1;cZ[e]=t}const J7=4294967295;function VUe(e,t,r){let n=e;for(let i=0;i>>8;return n}function qUe(e,t){return(VUe(J7,e,t)^J7)>>>0}function Z7(e,t,r){const n=e.readUint32(),i=qUe(new Uint8Array(e.buffer,e.byteOffset+e.offset-t-4,t),t);if(i!==n)throw new Error(`CRC mismatch for chunk ${r}. Expected ${n}, found ${i}`)}function uZ(e,t,r){for(let n=0;n>1)&255}else{for(;a>1)&255;for(;a>1)&255}}function pZ(e,t,r,n,i){let a=0;if(r.length===0){for(;a=r||k>=n))for(let E=0;E>8&255}const QUe=new Uint16Array([255]),eze=new Uint8Array(QUe.buffer),tze=eze[0]===255,rze=new Uint8Array(0);function Q7(e){const{data:t,width:r,height:n,channels:i,depth:a}=e,o=Math.ceil(a/8)*i,s=Math.ceil(a/8*i*r),l=new Uint8Array(n*s);let c=rze,u=0,f,p;for(let h=0;h>8&255}const zx=Uint8Array.of(137,80,78,71,13,10,26,10);function eF(e){if(!ize(e.readBytes(zx.length)))throw new Error("wrong PNG signature")}function ize(e){if(e.length79)throw new Error("keyword length must be between 1 and 79")}const lze=/^[\u0000-\u00FF]*$/;function cze(e){if(!lze.test(e))throw new Error("invalid latin1 text")}function uze(e,t,r){const n=gZ(t);e[n]=dze(t,r-n.length-1)}function gZ(e){for(e.mark();e.readByte()!==oze;);const t=e.offset;e.reset();const r=mZ.decode(e.readBytes(t-e.offset-1));return e.skip(1),sze(r),r}function dze(e,t){return mZ.decode(e.readBytes(t))}const Na={UNKNOWN:-1,GREYSCALE:0,TRUECOLOUR:2,INDEXED_COLOUR:3,GREYSCALE_ALPHA:4,TRUECOLOUR_ALPHA:6},MP={UNKNOWN:-1,DEFLATE:0},tF={UNKNOWN:-1,ADAPTIVE:0},$P={UNKNOWN:-1,NO_INTERLACE:0,ADAM7:1},ux={NONE:0,BACKGROUND:1,PREVIOUS:2},DP={SOURCE:0,OVER:1};class fze extends ZO{constructor(r,n={}){super(r);Gt(this,"_checkCrc");Gt(this,"_inflator");Gt(this,"_png");Gt(this,"_apng");Gt(this,"_end");Gt(this,"_hasPalette");Gt(this,"_palette");Gt(this,"_hasTransparency");Gt(this,"_transparency");Gt(this,"_compressionMethod");Gt(this,"_filterMethod");Gt(this,"_interlaceMethod");Gt(this,"_colorType");Gt(this,"_isAnimated");Gt(this,"_numberOfFrames");Gt(this,"_numberOfPlays");Gt(this,"_frames");Gt(this,"_writingDataChunks");const{checkCrc:i=!1}=n;this._checkCrc=i,this._inflator=new X7,this._png={width:-1,height:-1,channels:-1,data:new Uint8Array(0),depth:1,text:{}},this._apng={width:-1,height:-1,channels:-1,depth:1,numberOfFrames:1,numberOfPlays:0,text:{},frames:[]},this._end=!1,this._hasPalette=!1,this._palette=[],this._hasTransparency=!1,this._transparency=new Uint16Array(0),this._compressionMethod=MP.UNKNOWN,this._filterMethod=tF.UNKNOWN,this._interlaceMethod=$P.UNKNOWN,this._colorType=Na.UNKNOWN,this._isAnimated=!1,this._numberOfFrames=1,this._numberOfPlays=0,this._frames=[],this._writingDataChunks=!1,this.setBigEndian()}decode(){for(eF(this);!this._end;){const r=this.readUint32(),n=this.readChars(4);this.decodeChunk(r,n)}return this.decodeImage(),this._png}decodeApng(){for(eF(this);!this._end;){const r=this.readUint32(),n=this.readChars(4);this.decodeApngChunk(r,n)}return this.decodeApngImage(),this._apng}decodeChunk(r,n){const i=this.offset;switch(n){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(r);break;case"IDAT":this.decodeIDAT(r);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(r);break;case"iCCP":this.decodeiCCP(r);break;case aze:uze(this._png.text,this,r);break;case"pHYs":this.decodepHYs();break;default:this.skip(r);break}if(this.offset-i!==r)throw new Error(`Length mismatch while decoding chunk ${n}`);this._checkCrc?Z7(this,r+4,n):this.skip(4)}decodeApngChunk(r,n){const i=this.offset;switch(n!=="fdAT"&&n!=="IDAT"&&this._writingDataChunks&&this.pushDataToFrame(),n){case"acTL":this.decodeACTL();break;case"fcTL":this.decodeFCTL();break;case"fdAT":this.decodeFDAT(r);break;default:this.decodeChunk(r,n),this.offset=i+r;break}if(this.offset-i!==r)throw new Error(`Length mismatch while decoding chunk ${n}`);this._checkCrc?Z7(this,r+4,n):this.skip(4)}decodeIHDR(){const r=this._png;r.width=this.readUint32(),r.height=this.readUint32(),r.depth=hze(this.readUint8());const n=this.readUint8();this._colorType=n;let i;switch(n){case Na.GREYSCALE:i=1;break;case Na.TRUECOLOUR:i=3;break;case Na.INDEXED_COLOUR:i=1;break;case Na.GREYSCALE_ALPHA:i=2;break;case Na.TRUECOLOUR_ALPHA:i=4;break;case Na.UNKNOWN:default:throw new Error(`Unknown color type: ${n}`)}if(this._png.channels=i,this._compressionMethod=this.readUint8(),this._compressionMethod!==MP.DEFLATE)throw new Error(`Unsupported compression method: ${this._compressionMethod}`);this._filterMethod=this.readUint8(),this._interlaceMethod=this.readUint8()}decodeACTL(){this._numberOfFrames=this.readUint32(),this._numberOfPlays=this.readUint32(),this._isAnimated=!0}decodeFCTL(){const r={sequenceNumber:this.readUint32(),width:this.readUint32(),height:this.readUint32(),xOffset:this.readUint32(),yOffset:this.readUint32(),delayNumber:this.readUint16(),delayDenominator:this.readUint16(),disposeOp:this.readUint8(),blendOp:this.readUint8(),data:new Uint8Array(0)};this._frames.push(r)}decodePLTE(r){if(r%3!==0)throw new RangeError(`PLTE field length must be a multiple of 3. Got ${r}`);const n=r/3;this._hasPalette=!0;const i=[];this._palette=i;for(let a=0;athis._png.width*this._png.height)throw new Error(`tRNS chunk contains more alpha values than there are pixels (${r/2} vs ${this._png.width*this._png.height})`);this._hasTransparency=!0,this._transparency=new Uint16Array(r/2);for(let n=0;nthis._palette.length)throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${r} vs ${this._palette.length})`);let n=0;for(;n{const l=((o+n.yOffset)*this._png.width+n.xOffset+s)*this._png.channels,c=(o*n.width+s)*this._png.channels;return{index:l,frameIndex:c}};switch(n.blendOp){case DP.SOURCE:for(let o=0;o=200&&t.status<=299}function dx(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var Td=St.saveAs||((typeof window>"u"?"undefined":_r(window))!=="object"||window!==St?function(){}:typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype?function(e,t,r){var n=St.URL||St.webkitURL,i=document.createElement("a");t=t||e.name||"download",i.download=t,i.rel="noopener",typeof e=="string"?(i.href=e,i.origin!==location.origin?nF(i.href)?BP(e,t,r):dx(i,i.target="_blank"):dx(i)):(i.href=n.createObjectURL(e),setTimeout(function(){n.revokeObjectURL(i.href)},4e4),setTimeout(function(){dx(i)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,r){if(t=t||e.name||"download",typeof e=="string")if(nF(e))BP(e,t,r);else{var n=document.createElement("a");n.href=e,n.target="_blank",setTimeout(function(){dx(n)})}else navigator.msSaveOrOpenBlob(function(i,a){return a===void 0?a={autoBom:!1}:_r(a)!=="object"&&(Cr.warn("Deprecated: Expected third argument to be a object"),a={autoBom:!a}),a.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(i.type)?new Blob(["\uFEFF",i],{type:i.type}):i}(e,r),t)}:function(e,t,r,n){if((n=n||open("","_blank"))&&(n.document.title=n.document.body.innerText="downloading..."),typeof e=="string")return BP(e,t,r);var i=e.type==="application/octet-stream",a=/constructor/i.test(St.HTMLElement)||St.safari,o=/CriOS\/[\d]+/.test(navigator.userAgent);if((o||i&&a)&&(typeof FileReader>"u"?"undefined":_r(FileReader))==="object"){var s=new FileReader;s.onloadend=function(){var u=s.result;u=o?u:u.replace(/^data:[^;]*;/,"data:attachment/file;"),n?n.location.href=u:location=u,n=null},s.readAsDataURL(e)}else{var l=St.URL||St.webkitURL,c=l.createObjectURL(e);n?n.location=c:location.href=c,n=null,setTimeout(function(){l.revokeObjectURL(c)},4e4)}});/** * A class to parse color values * @author Stoyan Stefanov * {@link http://www.phpied.com/rgb-color-parser-in-javascript/} * @license Use it if you like it */function vZ(e){var t;e=e||"",this.ok=!1,e.charAt(0)=="#"&&(e=e.substr(1,6)),e={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"}[e=(e=e.replace(/ /g,"")).toLowerCase()]||e;for(var r=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(s){return[parseInt(s[1]),parseInt(s[2]),parseInt(s[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(s){return[parseInt(s[1],16),parseInt(s[2],16),parseInt(s[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(s){return[parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16),parseInt(s[3]+s[3],16)]}}],n=0;n255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var s=this.r.toString(16),l=this.g.toString(16),c=this.b.toString(16);return s.length==1&&(s="0"+s),l.length==1&&(l="0"+l),c.length==1&&(c="0"+c),"#"+s+l+c}}var Hx=St.atob.bind(St),iF=St.btoa.bind(St);/** * @license * Joseph Myers does not specify a particular license for his work. * * Author: Joseph Myers * Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js * * Modified by: Owen Leong */function UP(e,t){var r=e[0],n=e[1],i=e[2],a=e[3];r=Pi(r,n,i,a,t[0],7,-680876936),a=Pi(a,r,n,i,t[1],12,-389564586),i=Pi(i,a,r,n,t[2],17,606105819),n=Pi(n,i,a,r,t[3],22,-1044525330),r=Pi(r,n,i,a,t[4],7,-176418897),a=Pi(a,r,n,i,t[5],12,1200080426),i=Pi(i,a,r,n,t[6],17,-1473231341),n=Pi(n,i,a,r,t[7],22,-45705983),r=Pi(r,n,i,a,t[8],7,1770035416),a=Pi(a,r,n,i,t[9],12,-1958414417),i=Pi(i,a,r,n,t[10],17,-42063),n=Pi(n,i,a,r,t[11],22,-1990404162),r=Pi(r,n,i,a,t[12],7,1804603682),a=Pi(a,r,n,i,t[13],12,-40341101),i=Pi(i,a,r,n,t[14],17,-1502002290),r=ki(r,n=Pi(n,i,a,r,t[15],22,1236535329),i,a,t[1],5,-165796510),a=ki(a,r,n,i,t[6],9,-1069501632),i=ki(i,a,r,n,t[11],14,643717713),n=ki(n,i,a,r,t[0],20,-373897302),r=ki(r,n,i,a,t[5],5,-701558691),a=ki(a,r,n,i,t[10],9,38016083),i=ki(i,a,r,n,t[15],14,-660478335),n=ki(n,i,a,r,t[4],20,-405537848),r=ki(r,n,i,a,t[9],5,568446438),a=ki(a,r,n,i,t[14],9,-1019803690),i=ki(i,a,r,n,t[3],14,-187363961),n=ki(n,i,a,r,t[8],20,1163531501),r=ki(r,n,i,a,t[13],5,-1444681467),a=ki(a,r,n,i,t[2],9,-51403784),i=ki(i,a,r,n,t[7],14,1735328473),r=ji(r,n=ki(n,i,a,r,t[12],20,-1926607734),i,a,t[5],4,-378558),a=ji(a,r,n,i,t[8],11,-2022574463),i=ji(i,a,r,n,t[11],16,1839030562),n=ji(n,i,a,r,t[14],23,-35309556),r=ji(r,n,i,a,t[1],4,-1530992060),a=ji(a,r,n,i,t[4],11,1272893353),i=ji(i,a,r,n,t[7],16,-155497632),n=ji(n,i,a,r,t[10],23,-1094730640),r=ji(r,n,i,a,t[13],4,681279174),a=ji(a,r,n,i,t[0],11,-358537222),i=ji(i,a,r,n,t[3],16,-722521979),n=ji(n,i,a,r,t[6],23,76029189),r=ji(r,n,i,a,t[9],4,-640364487),a=ji(a,r,n,i,t[12],11,-421815835),i=ji(i,a,r,n,t[15],16,530742520),r=Ni(r,n=ji(n,i,a,r,t[2],23,-995338651),i,a,t[0],6,-198630844),a=Ni(a,r,n,i,t[7],10,1126891415),i=Ni(i,a,r,n,t[14],15,-1416354905),n=Ni(n,i,a,r,t[5],21,-57434055),r=Ni(r,n,i,a,t[12],6,1700485571),a=Ni(a,r,n,i,t[3],10,-1894986606),i=Ni(i,a,r,n,t[10],15,-1051523),n=Ni(n,i,a,r,t[1],21,-2054922799),r=Ni(r,n,i,a,t[8],6,1873313359),a=Ni(a,r,n,i,t[15],10,-30611744),i=Ni(i,a,r,n,t[6],15,-1560198380),n=Ni(n,i,a,r,t[13],21,1309151649),r=Ni(r,n,i,a,t[4],6,-145523070),a=Ni(a,r,n,i,t[11],10,-1120210379),i=Ni(i,a,r,n,t[2],15,718787259),n=Ni(n,i,a,r,t[9],21,-343485551),e[0]=xu(r,e[0]),e[1]=xu(n,e[1]),e[2]=xu(i,e[2]),e[3]=xu(a,e[3])}function q_(e,t,r,n,i,a){return t=xu(xu(t,e),xu(n,a)),xu(t<>>32-i,r)}function Pi(e,t,r,n,i,a,o){return q_(t&r|~t&n,e,t,i,a,o)}function ki(e,t,r,n,i,a,o){return q_(t&n|r&~n,e,t,i,a,o)}function ji(e,t,r,n,i,a,o){return q_(t^r^n,e,t,i,a,o)}function Ni(e,t,r,n,i,a,o){return q_(r^(t|~n),e,t,i,a,o)}function yZ(e){var t,r=e.length,n=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=e.length;t+=64)UP(n,mze(e.substring(t-64,t)));e=e.substring(t-64);var i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t>2]|=e.charCodeAt(t)<<(t%4<<3);if(i[t>>2]|=128<<(t%4<<3),t>55)for(UP(n,i),t=0;t<16;t++)i[t]=0;return i[14]=8*r,UP(n,i),n}function mze(e){var t,r=[];for(t=0;t<64;t+=4)r[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return r}var aF="0123456789abcdef".split("");function gze(e){for(var t="",r=0;r<4;r++)t+=aF[e>>8*r+4&15]+aF[e>>8*r&15];return t}function vze(e){return String.fromCharCode(255&e,(65280&e)>>8,(16711680&e)>>16,(4278190080&e)>>24)}function tC(e){return yZ(e).map(vze).join("")}var yze=function(e){for(var t=0;t>16)+(t>>16)+(r>>16)<<16|65535&r}return e+t&4294967295}/** * @license * FPDF is released under a permissive license: there is no usage restriction. * You may embed it freely in your application (commercial or not), with or * without modifications. * * Reference: http://www.fpdf.org/en/script/script37.php */function rC(e,t){var r,n,i,a;if(e!==r){for(var o=(i=e,a=1+(256/e.length|0),new Array(a+1).join(i)),s=[],l=0;l<256;l++)s[l]=l;var c=0;for(l=0;l<256;l++){var u=s[l];c=(c+u+o.charCodeAt(l))%256,s[l]=s[c],s[c]=u}r=e,n=s}else s=n;var f=t.length,p=0,h=0,g="";for(l=0;l€/\f©þdSiz";var a=(t+this.padding).substr(0,32),o=(r+this.padding).substr(0,32);this.O=this.processOwnerPassword(a,o),this.P=-(1+(255^i)),this.encryptionKey=tC(a+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(n)).substr(0,5),this.U=rC(this.encryptionKey,this.padding)}function Oh(e){if(/[^\u0000-\u00ff]/.test(e))throw new Error("Invalid PDF Name Object: "+e+", Only accept ASCII characters.");for(var t="",r=e.length,n=0;n126?"#"+("0"+i.toString(16)).slice(-2):e[n]}return t}function sF(e){if(_r(e)!=="object")throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var t={};this.subscribe=function(r,n,i){if(i=i||!1,typeof r!="string"||typeof n!="function"||typeof i!="boolean")throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");t.hasOwnProperty(r)||(t[r]={});var a=Math.random().toString(35);return t[r][a]=[n,!!i],a},this.unsubscribe=function(r){for(var n in t)if(t[n][r])return delete t[n][r],Object.keys(t[n]).length===0&&delete t[n],!0;return!1},this.publish=function(r){if(t.hasOwnProperty(r)){var n=Array.prototype.slice.call(arguments,1),i=[];for(var a in t[r]){var o=t[r][a];try{o[0].apply(e,n)}catch(s){St.console&&Cr.error("jsPDF PubSub Error",s.message,s)}o[1]&&i.push(a)}i.length&&i.forEach(this.unsubscribe)}},this.getTopics=function(){return t}}function W2(e){if(!(this instanceof W2))return new W2(e);var t="opacity,stroke-opacity".split(",");for(var r in e)e.hasOwnProperty(r)&&t.indexOf(r)>=0&&(this[r]=e[r]);this.id="",this.objectNumber=-1}function bZ(e,t){this.gState=e,this.matrix=t,this.id="",this.objectNumber=-1}function Id(e,t,r,n,i){if(!(this instanceof Id))return new Id(e,t,r,n,i);this.type=e==="axial"?2:3,this.coords=t,this.colors=r,bZ.call(this,n,i)}function tp(e,t,r,n,i){if(!(this instanceof tp))return new tp(e,t,r,n,i);this.boundingBox=e,this.xStep=t,this.yStep=r,this.stream="",this.cloneIndex=0,bZ.call(this,n,i)}function ct(e){var t,r=typeof arguments[0]=="string"?arguments[0]:"p",n=arguments[1],i=arguments[2],a=arguments[3],o=[],s=1,l=16,c="S",u=null;_r(e=e||{})==="object"&&(r=e.orientation,n=e.unit||n,i=e.format||i,a=e.compress||e.compressPdf||a,(u=e.encryption||null)!==null&&(u.userPassword=u.userPassword||"",u.ownerPassword=u.ownerPassword||"",u.userPermissions=u.userPermissions||[]),s=typeof e.userUnit=="number"?Math.abs(e.userUnit):1,e.precision!==void 0&&(t=e.precision),e.floatPrecision!==void 0&&(l=e.floatPrecision),c=e.defaultPathOperation||"S"),o=e.filters||(a===!0?["FlateEncode"]:o),n=n||"mm",r=(""+(r||"P")).toLowerCase();var f=e.putOnlyUsedFonts||!1,p={},h={internal:{},__private__:{}};h.__private__.PubSub=sF;var g="1.3",m=h.__private__.getPdfVersion=function(){return g};h.__private__.setPdfVersion=function(j){g=j};var v={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};h.__private__.getPageFormats=function(){return v};var y=h.__private__.getPageFormat=function(j){return v[j]};i=i||"a4";var b="compat",x="advanced",S=b;function _(){this.saveGraphicsState(),Q(new Je(_t,0,0,-_t,0,sd()*_t).toString()+" cm"),this.setFontSize(this.getFontSize()/_t),c="n",S=x}function k(){this.restoreGraphicsState(),c="S",S=b}var E=h.__private__.combineFontStyleAndFontWeight=function(j,F){if(j=="bold"&&F=="normal"||j=="bold"&&F==400||j=="normal"&&F=="italic"||j=="bold"&&F=="italic")throw new Error("Invalid Combination of fontweight and fontstyle");return F&&(j=F==400||F==="normal"?j==="italic"?"italic":"normal":F!=700&&F!=="bold"||j!=="normal"?(F==700?"bold":F)+""+j:"bold"),j};h.advancedAPI=function(j){var F=S===b;return F&&_.call(this),typeof j!="function"||(j(this),F&&k.call(this)),this},h.compatAPI=function(j){var F=S===x;return F&&k.call(this),typeof j!="function"||(j(this),F&&_.call(this)),this},h.isAdvancedAPI=function(){return S===x};var O,R=function(j){if(S!==x)throw new Error(j+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},$=h.roundToPrecision=h.__private__.roundToPrecision=function(j,F){var ne=t||F;if(isNaN(j)||isNaN(ne))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return j.toFixed(ne).replace(/0+$/,"")};O=h.hpf=h.__private__.hpf=typeof l=="number"?function(j){if(isNaN(j))throw new Error("Invalid argument passed to jsPDF.hpf");return $(j,l)}:l==="smart"?function(j){if(isNaN(j))throw new Error("Invalid argument passed to jsPDF.hpf");return $(j,j>-1&&j<1?16:5)}:function(j){if(isNaN(j))throw new Error("Invalid argument passed to jsPDF.hpf");return $(j,16)};var N=h.f2=h.__private__.f2=function(j){if(isNaN(j))throw new Error("Invalid argument passed to jsPDF.f2");return $(j,2)},C=h.__private__.f3=function(j){if(isNaN(j))throw new Error("Invalid argument passed to jsPDF.f3");return $(j,3)},D=h.scale=h.__private__.scale=function(j){if(isNaN(j))throw new Error("Invalid argument passed to jsPDF.scale");return S===b?j*_t:S===x?j:void 0},I=function(j){return D(function(F){return S===b?sd()-F:S===x?F:void 0}(j))};h.__private__.setPrecision=h.setPrecision=function(j){typeof parseInt(j,10)=="number"&&(t=parseInt(j,10))};var G,Y="00000000000000000000000000000000",Z=h.__private__.getFileId=function(){return Y},U=h.__private__.setFileId=function(j){return Y=j!==void 0&&/^[a-fA-F0-9]{32}$/.test(j)?j.toUpperCase():Y.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),u!==null&&(Rn=new Th(u.userPermissions,u.userPassword,u.ownerPassword,Y)),Y};h.setFileId=function(j){return U(j),this},h.getFileId=function(){return Z()};var X=h.__private__.convertDateToPDFDate=function(j){var F=j.getTimezoneOffset(),ne=F<0?"+":"-",ce=Math.floor(Math.abs(F/60)),ge=Math.abs(F%60),Ae=[ne,z(ce),"'",z(ge),"'"].join("");return["D:",j.getFullYear(),z(j.getMonth()+1),z(j.getDate()),z(j.getHours()),z(j.getMinutes()),z(j.getSeconds()),Ae].join("")},oe=h.__private__.convertPDFDateToDate=function(j){var F=parseInt(j.substr(2,4),10),ne=parseInt(j.substr(6,2),10)-1,ce=parseInt(j.substr(8,2),10),ge=parseInt(j.substr(10,2),10),Ae=parseInt(j.substr(12,2),10),Ne=parseInt(j.substr(14,2),10);return new Date(F,ne,ce,ge,Ae,Ne,0)},ue=h.__private__.setCreationDate=function(j){var F;if(j===void 0&&(j=new Date),j instanceof Date)F=X(j);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(j))throw new Error("Invalid argument passed to jsPDF.setCreationDate");F=j}return G=F},M=h.__private__.getCreationDate=function(j){var F=G;return j==="jsDate"&&(F=oe(G)),F};h.setCreationDate=function(j){return ue(j),this},h.getCreationDate=function(j){return M(j)};var W,z=h.__private__.padd2=function(j){return("0"+parseInt(j)).slice(-2)},ie=h.__private__.padd2Hex=function(j){return("00"+(j=j.toString())).substr(j.length)},le=0,V=[],se=[],ae=0,de=[],ve=[],fe=!1,je=se;h.__private__.setCustomOutputDestination=function(j){fe=!0,je=j};var Te=function(j){fe||(je=j)};h.__private__.resetCustomOutputDestination=function(){fe=!1,je=se};var Q=h.__private__.out=function(j){return j=j.toString(),ae+=j.length+1,je.push(j),je},Ce=h.__private__.write=function(j){return Q(arguments.length===1?j.toString():Array.prototype.join.call(arguments," "))},Ke=h.__private__.getArrayBuffer=function(j){for(var F=j.length,ne=new ArrayBuffer(F),ce=new Uint8Array(ne);F--;)ce[F]=j.charCodeAt(F);return ne},Fe=[["Helvetica","helvetica","normal","WinAnsiEncoding"],["Helvetica-Bold","helvetica","bold","WinAnsiEncoding"],["Helvetica-Oblique","helvetica","italic","WinAnsiEncoding"],["Helvetica-BoldOblique","helvetica","bolditalic","WinAnsiEncoding"],["Courier","courier","normal","WinAnsiEncoding"],["Courier-Bold","courier","bold","WinAnsiEncoding"],["Courier-Oblique","courier","italic","WinAnsiEncoding"],["Courier-BoldOblique","courier","bolditalic","WinAnsiEncoding"],["Times-Roman","times","normal","WinAnsiEncoding"],["Times-Bold","times","bold","WinAnsiEncoding"],["Times-Italic","times","italic","WinAnsiEncoding"],["Times-BoldItalic","times","bolditalic","WinAnsiEncoding"],["ZapfDingbats","zapfdingbats","normal",null],["Symbol","symbol","normal",null]];h.__private__.getStandardFonts=function(){return Fe};var ke=e.fontSize||16;h.__private__.setFontSize=h.setFontSize=function(j){return ke=S===x?j/_t:j,this};var rt,Me=h.__private__.getFontSize=h.getFontSize=function(){return S===b?ke:ke*_t},Ye=e.R2L||!1;h.__private__.setR2L=h.setR2L=function(j){return Ye=j,this},h.__private__.getR2L=h.getR2L=function(){return Ye};var Be,Yt=h.__private__.setZoomMode=function(j){if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(j))rt=j;else if(isNaN(j)){if([void 0,null,"fullwidth","fullheight","fullpage","original"].indexOf(j)===-1)throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+j+'" is not recognized.');rt=j}else rt=parseInt(j,10)};h.__private__.getZoomMode=function(){return rt};var Dt,ut=h.__private__.setPageMode=function(j){if([void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(j)==-1)throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+j+'" is not recognized.');Be=j};h.__private__.getPageMode=function(){return Be};var Lt=h.__private__.setLayoutMode=function(j){if([void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(j)==-1)throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+j+'" is not recognized.');Dt=j};h.__private__.getLayoutMode=function(){return Dt},h.__private__.setDisplayMode=h.setDisplayMode=function(j,F,ne){return Yt(j),Lt(F),ut(ne),this};var Ht={title:"",subject:"",author:"",keywords:"",creator:""};h.__private__.getDocumentProperty=function(j){if(Object.keys(Ht).indexOf(j)===-1)throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return Ht[j]},h.__private__.getDocumentProperties=function(){return Ht},h.__private__.setDocumentProperties=h.setProperties=h.setDocumentProperties=function(j){for(var F in Ht)Ht.hasOwnProperty(F)&&j[F]&&(Ht[F]=j[F]);return this},h.__private__.setDocumentProperty=function(j,F){if(Object.keys(Ht).indexOf(j)===-1)throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return Ht[j]=F};var Ze,_t,nt,Gr,Wt,Pt={},It={},fr=[],ht={},Pr={},mt={},kt={},Or=null,Mt=0,it=[],cr=new sF(h),gt=e.hotfixes||[],Et={},rr={},an=[],Je=function j(F,ne,ce,ge,Ae,Ne){if(!(this instanceof j))return new j(F,ne,ce,ge,Ae,Ne);isNaN(F)&&(F=1),isNaN(ne)&&(ne=0),isNaN(ce)&&(ce=0),isNaN(ge)&&(ge=1),isNaN(Ae)&&(Ae=0),isNaN(Ne)&&(Ne=0),this._matrix=[F,ne,ce,ge,Ae,Ne]};Object.defineProperty(Je.prototype,"sx",{get:function(){return this._matrix[0]},set:function(j){this._matrix[0]=j}}),Object.defineProperty(Je.prototype,"shy",{get:function(){return this._matrix[1]},set:function(j){this._matrix[1]=j}}),Object.defineProperty(Je.prototype,"shx",{get:function(){return this._matrix[2]},set:function(j){this._matrix[2]=j}}),Object.defineProperty(Je.prototype,"sy",{get:function(){return this._matrix[3]},set:function(j){this._matrix[3]=j}}),Object.defineProperty(Je.prototype,"tx",{get:function(){return this._matrix[4]},set:function(j){this._matrix[4]=j}}),Object.defineProperty(Je.prototype,"ty",{get:function(){return this._matrix[5]},set:function(j){this._matrix[5]=j}}),Object.defineProperty(Je.prototype,"a",{get:function(){return this._matrix[0]},set:function(j){this._matrix[0]=j}}),Object.defineProperty(Je.prototype,"b",{get:function(){return this._matrix[1]},set:function(j){this._matrix[1]=j}}),Object.defineProperty(Je.prototype,"c",{get:function(){return this._matrix[2]},set:function(j){this._matrix[2]=j}}),Object.defineProperty(Je.prototype,"d",{get:function(){return this._matrix[3]},set:function(j){this._matrix[3]=j}}),Object.defineProperty(Je.prototype,"e",{get:function(){return this._matrix[4]},set:function(j){this._matrix[4]=j}}),Object.defineProperty(Je.prototype,"f",{get:function(){return this._matrix[5]},set:function(j){this._matrix[5]=j}}),Object.defineProperty(Je.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(Je.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(Je.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(Je.prototype,"isIdentity",{get:function(){return this.sx===1&&this.shy===0&&this.shx===0&&this.sy===1&&this.tx===0&&this.ty===0}}),Je.prototype.join=function(j){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(O).join(j)},Je.prototype.multiply=function(j){var F=j.sx*this.sx+j.shy*this.shx,ne=j.sx*this.shy+j.shy*this.sy,ce=j.shx*this.sx+j.sy*this.shx,ge=j.shx*this.shy+j.sy*this.sy,Ae=j.tx*this.sx+j.ty*this.shx+this.tx,Ne=j.tx*this.shy+j.ty*this.sy+this.ty;return new Je(F,ne,ce,ge,Ae,Ne)},Je.prototype.decompose=function(){var j=this.sx,F=this.shy,ne=this.shx,ce=this.sy,ge=this.tx,Ae=this.ty,Ne=Math.sqrt(j*j+F*F),Xe=(j/=Ne)*ne+(F/=Ne)*ce;ne-=j*Xe,ce-=F*Xe;var at=Math.sqrt(ne*ne+ce*ce);return Xe/=at,j*(ce/=at)>16&255,ce=at>>8&255,ge=255&at}if(ce===void 0||Ae===void 0&&ne===ce&&ce===ge)F=typeof ne=="string"?ne+" "+Ne[0]:j.precision===2?N(ne/255)+" "+Ne[0]:C(ne/255)+" "+Ne[0];else if(Ae===void 0||_r(Ae)==="object"){if(Ae&&!isNaN(Ae.a)&&Ae.a===0)return["1.","1.","1.",Ne[1]].join(" ");F=typeof ne=="string"?[ne,ce,ge,Ne[1]].join(" "):j.precision===2?[N(ne/255),N(ce/255),N(ge/255),Ne[1]].join(" "):[C(ne/255),C(ce/255),C(ge/255),Ne[1]].join(" ")}else F=typeof ne=="string"?[ne,ce,ge,Ae,Ne[2]].join(" "):j.precision===2?[N(ne),N(ce),N(ge),N(Ae),Ne[2]].join(" "):[C(ne),C(ce),C(ge),C(Ae),Ne[2]].join(" ");return F},Io=h.__private__.getFilters=function(){return o},eo=h.__private__.putStream=function(j){var F=(j=j||{}).data||"",ne=j.filters||Io(),ce=j.alreadyAppliedFilters||[],ge=j.addLength1||!1,Ae=F.length,Ne=j.objectId,Xe=function(Ln){return Ln};if(u!==null&&Ne===void 0)throw new Error("ObjectId must be passed to putStream for file encryption");u!==null&&(Xe=Rn.encryptor(Ne,0));var at={};ne===!0&&(ne=["FlateEncode"]);var jt=j.additionalKeyValues||[],$t=(at=ct.API.processDataByFilters!==void 0?ct.API.processDataByFilters(F,ne):{data:F,reverseChain:[]}).reverseChain+(Array.isArray(ce)?ce.join(" "):ce.toString());if(at.data.length!==0&&(jt.push({key:"Length",value:at.data.length}),ge===!0&&jt.push({key:"Length1",value:Ae})),$t.length!=0)if($t.split("/").length-1==1)jt.push({key:"Filter",value:$t});else{jt.push({key:"Filter",value:"["+$t+"]"});for(var or=0;or>"),at.data.length!==0&&(Q("stream"),Q(Xe(at.data)),Q("endstream"))},td=h.__private__.putPage=function(j){var F=j.number,ne=j.data,ce=j.objId,ge=j.contentsObjId;ai(ce,!0),Q("<>"),Q("endobj");var Ae=ne.join(` `);return S===x&&(Ae+=` Q`),ai(ge,!0),eo({data:Ae,filters:Io(),objectId:ge}),Q("endobj"),ce},As=h.__private__.putPages=function(){var j,F,ne=[];for(j=1;j<=Mt;j++)it[j].objId=Kn(),it[j].contentsObjId=Kn();for(j=1;j<=Mt;j++)ne.push(td({number:j,data:ve[j],objId:it[j].objId,contentsObjId:it[j].contentsObjId,mediaBox:it[j].mediaBox,cropBox:it[j].cropBox,bleedBox:it[j].bleedBox,trimBox:it[j].trimBox,artBox:it[j].artBox,userUnit:it[j].userUnit,rootDictionaryObjId:Ac,resourceDictionaryObjId:Ro}));ai(Ac,!0),Q("<>"),Q("endobj"),cr.publish("postPutPages")},rd=function(j){cr.publish("putFont",{font:j,out:Q,newObject:on,putStream:eo}),j.isAlreadyPutted!==!0&&(j.objectNumber=on(),Q("<<"),Q("/Type /Font"),Q("/BaseFont /"+Oh(j.postScriptName)),Q("/Subtype /Type1"),typeof j.encoding=="string"&&Q("/Encoding /"+j.encoding),Q("/FirstChar 32"),Q("/LastChar 255"),Q(">>"),Q("endobj"))},qf=function(j){j.objectNumber=on();var F=[];F.push({key:"Type",value:"/XObject"}),F.push({key:"Subtype",value:"/Form"}),F.push({key:"BBox",value:"["+[O(j.x),O(j.y),O(j.x+j.width),O(j.y+j.height)].join(" ")+"]"}),F.push({key:"Matrix",value:"["+j.matrix.toString()+"]"});var ne=j.pages[1].join(` `);eo({data:ne,additionalKeyValues:F,objectId:j.objectNumber}),Q("endobj")},Wf=function(j,F){F||(F=21);var ne=on(),ce=function(Ne,Xe){var at,jt=[],$t=1/(Xe-1);for(at=0;at<1;at+=$t)jt.push(at);if(jt.push(1),Ne[0].offset!=0){var or={offset:0,color:Ne[0].color};Ne.unshift(or)}if(Ne[Ne.length-1].offset!=1){var Zr={offset:1,color:Ne[Ne.length-1].color};Ne.push(Zr)}for(var An="",Rr=0,Ln=0;LnNe[Rr+1].offset;)Rr++;var Pn=Ne[Rr].offset,oi=(at-Pn)/(Ne[Rr+1].offset-Pn),yl=Ne[Rr].color,$o=Ne[Rr+1].color;An+=ie(Math.round((1-oi)*yl[0]+oi*$o[0]).toString(16))+ie(Math.round((1-oi)*yl[1]+oi*$o[1]).toString(16))+ie(Math.round((1-oi)*yl[2]+oi*$o[2]).toString(16))}return An.trim()}(j.colors,F),ge=[];ge.push({key:"FunctionType",value:"0"}),ge.push({key:"Domain",value:"[0.0 1.0]"}),ge.push({key:"Size",value:"["+F+"]"}),ge.push({key:"BitsPerSample",value:"8"}),ge.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),ge.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),eo({data:ce,additionalKeyValues:ge,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:ne}),Q("endobj"),j.objectNumber=on(),Q("<< /ShadingType "+j.type),Q("/ColorSpace /DeviceRGB");var Ae="/Coords ["+O(parseFloat(j.coords[0]))+" "+O(parseFloat(j.coords[1]))+" ";j.type===2?Ae+=O(parseFloat(j.coords[2]))+" "+O(parseFloat(j.coords[3])):Ae+=O(parseFloat(j.coords[2]))+" "+O(parseFloat(j.coords[3]))+" "+O(parseFloat(j.coords[4]))+" "+O(parseFloat(j.coords[5])),Q(Ae+="]"),j.matrix&&Q("/Matrix ["+j.matrix.toString()+"]"),Q("/Function "+ne+" 0 R"),Q("/Extend [true true]"),Q(">>"),Q("endobj")},Gf=function(j,F){var ne=Kn(),ce=on();F.push({resourcesOid:ne,objectOid:ce}),j.objectNumber=ce;var ge=[];ge.push({key:"Type",value:"/Pattern"}),ge.push({key:"PatternType",value:"1"}),ge.push({key:"PaintType",value:"1"}),ge.push({key:"TilingType",value:"1"}),ge.push({key:"BBox",value:"["+j.boundingBox.map(O).join(" ")+"]"}),ge.push({key:"XStep",value:O(j.xStep)}),ge.push({key:"YStep",value:O(j.yStep)}),ge.push({key:"Resources",value:ne+" 0 R"}),j.matrix&&ge.push({key:"Matrix",value:"["+j.matrix.toString()+"]"}),eo({data:j.stream,additionalKeyValues:ge,objectId:j.objectNumber}),Q("endobj")},K_=function(j){for(var F in j.objectNumber=on(),Q("<<"),j)switch(F){case"opacity":Q("/ca "+N(j[F]));break;case"stroke-opacity":Q("/CA "+N(j[F]))}Q(">>"),Q("endobj")},yg=function(j){ai(j.resourcesOid,!0),Q("<<"),Q("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),function(){for(var F in Q("/Font <<"),Pt)Pt.hasOwnProperty(F)&&(f===!1||f===!0&&p.hasOwnProperty(F))&&Q("/"+F+" "+Pt[F].objectNumber+" 0 R");Q(">>")}(),function(){if(Object.keys(ht).length>0){for(var F in Q("/Shading <<"),ht)ht.hasOwnProperty(F)&&ht[F]instanceof Id&&ht[F].objectNumber>=0&&Q("/"+F+" "+ht[F].objectNumber+" 0 R");cr.publish("putShadingPatternDict"),Q(">>")}}(),function(F){if(Object.keys(ht).length>0){for(var ne in Q("/Pattern <<"),ht)ht.hasOwnProperty(ne)&&ht[ne]instanceof h.TilingPattern&&ht[ne].objectNumber>=0&&ht[ne].objectNumber>")}}(j.objectOid),function(){if(Object.keys(mt).length>0){var F;for(F in Q("/ExtGState <<"),mt)mt.hasOwnProperty(F)&&mt[F].objectNumber>=0&&Q("/"+F+" "+mt[F].objectNumber+" 0 R");cr.publish("putGStateDict"),Q(">>")}}(),function(){for(var F in Q("/XObject <<"),Et)Et.hasOwnProperty(F)&&Et[F].objectNumber>=0&&Q("/"+F+" "+Et[F].objectNumber+" 0 R");cr.publish("putXobjectDict"),Q(">>")}(),Q(">>"),Q("endobj")},w1=function(j){It[j.fontName]=It[j.fontName]||{},It[j.fontName][j.fontStyle]=j.id},_1=function(j,F,ne,ce,ge){var Ae={id:"F"+(Object.keys(Pt).length+1).toString(10),postScriptName:j,fontName:F,fontStyle:ne,encoding:ce,isStandardFont:ge||!1,metadata:{}};return cr.publish("addFont",{font:Ae,instance:this}),Pt[Ae.id]=Ae,w1(Ae),Ae.id},to=h.__private__.pdfEscape=h.pdfEscape=function(j,F){return function(ne,ce){var ge,Ae,Ne,Xe,at,jt,$t,or,Zr;if(Ne=(ce=ce||{}).sourceEncoding||"Unicode",at=ce.outputEncoding,(ce.autoencode||at)&&Pt[Ze].metadata&&Pt[Ze].metadata[Ne]&&Pt[Ze].metadata[Ne].encoding&&(Xe=Pt[Ze].metadata[Ne].encoding,!at&&Pt[Ze].encoding&&(at=Pt[Ze].encoding),!at&&Xe.codePages&&(at=Xe.codePages[0]),typeof at=="string"&&(at=Xe[at]),at)){for($t=!1,jt=[],ge=0,Ae=ne.length;ge>8&&($t=!0);ne=jt.join("")}for(ge=ne.length;$t===void 0&&ge!==0;)ne.charCodeAt(ge-1)>>8&&($t=!0),ge--;if(!$t)return ne;for(jt=ce.noBOM?[]:[254,255],ge=0,Ae=ne.length;ge>8)>>8)throw new Error("Character at position "+ge+" of string '"+ne+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");jt.push(Zr),jt.push(or-(Zr<<8))}return String.fromCharCode.apply(void 0,jt)}(j,F).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},bg=h.__private__.beginPage=function(j){ve[++Mt]=[],it[Mt]={objId:0,contentsObjId:0,userUnit:Number(s),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(j[0]),topRightY:Number(j[1])}},A1(Mt),Te(ve[W])},S1=function(j,F){var ne,ce,ge;switch(r=F||r,typeof j=="string"&&(ne=y(j.toLowerCase()),Array.isArray(ne)&&(ce=ne[0],ge=ne[1])),Array.isArray(j)&&(ce=j[0]*_t,ge=j[1]*_t),isNaN(ce)&&(ce=i[0],ge=i[1]),(ce>14400||ge>14400)&&(Cr.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),ce=Math.min(14400,ce),ge=Math.min(14400,ge)),i=[ce,ge],r.substr(0,1)){case"l":ge>ce&&(i=[ge,ce]);break;case"p":ce>ge&&(i=[ge,ce])}bg(i),Ct(_g),Q(Jf),Ag!==0&&Q(Ag+" J"),Pg!==0&&Q(Pg+" j"),cr.publish("addPage",{pageNumber:Mt})},xg=function(j){j>0&&j<=Mt&&(ve.splice(j,1),it.splice(j,1),Mt--,W>Mt&&(W=Mt),this.setPage(W))},A1=function(j){j>0&&j<=Mt&&(W=j)},P1=h.__private__.getNumberOfPages=h.getNumberOfPages=function(){return ve.length-1},k1=function(j,F,ne){var ce,ge=void 0;return ne=ne||{},j=j!==void 0?j:Pt[Ze].fontName,F=F!==void 0?F:Pt[Ze].fontStyle,ce=j.toLowerCase(),It[ce]!==void 0&&It[ce][F]!==void 0?ge=It[ce][F]:It[j]!==void 0&&It[j][F]!==void 0?ge=It[j][F]:ne.disableWarning===!1&&Cr.warn("Unable to look up font label for font '"+j+"', '"+F+"'. Refer to getFontList() for available fonts."),ge||ne.noFallback||(ge=It.times[F])==null&&(ge=It.times.normal),ge},Ps=h.__private__.putInfo=function(){var j=on(),F=function(ce){return ce};for(var ne in u!==null&&(F=Rn.encryptor(j,0)),Q("<<"),Q("/Producer ("+to(F("jsPDF "+ct.version))+")"),Ht)Ht.hasOwnProperty(ne)&&Ht[ne]&&Q("/"+ne.substr(0,1).toUpperCase()+ne.substr(1)+" ("+to(F(Ht[ne]))+")");Q("/CreationDate ("+to(F(G))+")"),Q(">>"),Q("endobj")},Kf=h.__private__.putCatalog=function(j){var F=(j=j||{}).rootDictionaryObjId||Ac;switch(on(),Q("<<"),Q("/Type /Catalog"),Q("/Pages "+F+" 0 R"),rt||(rt="fullwidth"),rt){case"fullwidth":Q("/OpenAction [3 0 R /FitH null]");break;case"fullheight":Q("/OpenAction [3 0 R /FitV null]");break;case"fullpage":Q("/OpenAction [3 0 R /Fit]");break;case"original":Q("/OpenAction [3 0 R /XYZ null null 1]");break;default:var ne=""+rt;ne.substr(ne.length-1)==="%"&&(rt=parseInt(rt)/100),typeof rt=="number"&&Q("/OpenAction [3 0 R /XYZ null null "+N(rt)+"]")}switch(Dt||(Dt="continuous"),Dt){case"continuous":Q("/PageLayout /OneColumn");break;case"single":Q("/PageLayout /SinglePage");break;case"two":case"twoleft":Q("/PageLayout /TwoColumnLeft");break;case"tworight":Q("/PageLayout /TwoColumnRight")}Be&&Q("/PageMode /"+Be),cr.publish("putCatalog"),Q(">>"),Q("endobj")},Y_=h.__private__.putTrailer=function(){Q("trailer"),Q("<<"),Q("/Size "+(le+1)),Q("/Root "+le+" 0 R"),Q("/Info "+(le-1)+" 0 R"),u!==null&&Q("/Encrypt "+Rn.oid+" 0 R"),Q("/ID [ <"+Y+"> <"+Y+"> ]"),Q(">>")},Sn=h.__private__.putHeader=function(){Q("%PDF-"+g),Q("%ºß¬à")},j1=h.__private__.putXRef=function(){var j="0000000000";Q("xref"),Q("0 "+(le+1)),Q("0000000000 65535 f ");for(var F=1;F<=le;F++)typeof V[F]=="function"?Q((j+V[F]()).slice(-10)+" 00000 n "):V[F]!==void 0?Q((j+V[F]).slice(-10)+" 00000 n "):Q("0000000000 00000 n ")},ks=h.__private__.buildDocument=function(){var j;le=0,ae=0,se=[],V=[],de=[],Ac=Kn(),Ro=Kn(),Te(se),cr.publish("buildDocument"),Sn(),As(),function(){cr.publish("putAdditionalObjects");for(var ne=0;ne"),Q("/O <"+Rn.toHexString(Rn.O)+">"),Q("/P "+Rn.P),Q(">>"),Q("endobj")),Ps(),Kf();var F=ae;return j1(),Y_(),Q("startxref"),Q(""+F),Q("%%EOF"),Te(ve[W]),se.join(` `)},Yf=h.__private__.getBlob=function(j){return new Blob([Ke(j)],{type:"application/pdf"})},N1=h.output=h.__private__.output=(pn=function(j,F){switch(typeof(F=F||{})=="string"?F={filename:F}:F.filename=F.filename||"generated.pdf",j){case void 0:return ks();case"save":h.save(F.filename);break;case"arraybuffer":return Ke(ks());case"blob":return Yf(ks());case"bloburi":case"bloburl":if(St.URL!==void 0&&typeof St.URL.createObjectURL=="function")return St.URL&&St.URL.createObjectURL(Yf(ks()))||void 0;Cr.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var ne="",ce=ks();try{ne=iF(ce)}catch{ne=iF(unescape(encodeURIComponent(ce)))}return"data:application/pdf;filename="+F.filename+";base64,"+ne;case"pdfobjectnewwindow":if(Object.prototype.toString.call(St)==="[object Window]"){var ge="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",Ae=' integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==" crossorigin="anonymous"';F.pdfObjectUrl&&(ge=F.pdfObjectUrl,Ae="");var Ne='