function NN(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 s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();var kn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function M6(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var _N={exports:{}},S0={},UN={exports:{}},Bt={};/** * @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 hh=Symbol.for("react.element"),H6=Symbol.for("react.portal"),K6=Symbol.for("react.fragment"),V6=Symbol.for("react.strict_mode"),$6=Symbol.for("react.profiler"),G6=Symbol.for("react.provider"),z6=Symbol.for("react.context"),W6=Symbol.for("react.forward_ref"),J6=Symbol.for("react.suspense"),q6=Symbol.for("react.memo"),Y6=Symbol.for("react.lazy"),A5=Symbol.iterator;function X6(e){return e===null||typeof e!="object"?null:(e=A5&&e[A5]||e["@@iterator"],typeof e=="function"?e:null)}var jN={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},TN=Object.assign,IN={};function Fu(e,t,r){this.props=e,this.context=t,this.refs=IN,this.updater=r||jN}Fu.prototype.isReactComponent={};Fu.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")};Fu.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function kN(){}kN.prototype=Fu.prototype;function qx(e,t,r){this.props=e,this.context=t,this.refs=IN,this.updater=r||jN}var Yx=qx.prototype=new kN;Yx.constructor=qx;TN(Yx,Fu.prototype);Yx.isPureReactComponent=!0;var l5=Array.isArray,LN=Object.prototype.hasOwnProperty,Xx={current:null},PN={key:!0,ref:!0,__self:!0,__source:!0};function QN(e,t,r){var n,i={},s=null,a=null;if(t!=null)for(n in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(s=""+t.key),t)LN.call(t,n)&&!PN.hasOwnProperty(n)&&(i[n]=t[n]);var o=arguments.length-2;if(o===1)i.children=r;else if(1>>1,O=M[le];if(0>>1;lei(q,X))nei(ie,q)?(M[le]=ie,M[ne]=X,le=ne):(M[le]=q,M[z]=X,le=z);else if(nei(ie,X))M[le]=ie,M[ne]=X,le=ne;else break e}}return $}function i(M,$){var X=M.sortIndex-$.sortIndex;return X!==0?X:M.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var A=[],c=[],u=1,d=null,f=3,h=!1,v=!1,p=!1,y=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(M){for(var $=r(c);$!==null;){if($.callback===null)n(c);else if($.startTime<=M)n(c),$.sortIndex=$.expirationTime,t(A,$);else break;$=r(c)}}function E(M){if(p=!1,b(M),!v)if(r(A)!==null)v=!0,U(L);else{var $=r(c);$!==null&&P(E,$.startTime-M)}}function L(M,$){v=!1,p&&(p=!1,g(S),S=-1),h=!0;var X=f;try{for(b($),d=r(A);d!==null&&(!(d.expirationTime>$)||M&&!N());){var le=d.callback;if(typeof le=="function"){d.callback=null,f=d.priorityLevel;var O=le(d.expirationTime<=$);$=e.unstable_now(),typeof O=="function"?d.callback=O:d===r(A)&&n(A),b($)}else n(A);d=r(A)}if(d!==null)var J=!0;else{var z=r(c);z!==null&&P(E,z.startTime-$),J=!1}return J}finally{d=null,f=X,h=!1}}var _=!1,k=null,S=-1,I=5,H=-1;function N(){return!(e.unstable_now()-HM||125le?(M.sortIndex=X,t(c,M),r(A)===null&&M===r(c)&&(p?(g(S),S=-1):p=!0,P(E,X-le))):(M.sortIndex=O,t(A,M),v||h||(v=!0,U(L))),M},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(M){var $=f;return function(){var X=f;f=$;try{return M.apply(this,arguments)}finally{f=X}}}})(HN);MN.exports=HN;var l8=MN.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 c8=C,_i=l8;function je(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"),yw=Object.prototype.hasOwnProperty,u8=/^[: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]*$/,u5={},d5={};function d8(e){return yw.call(d5,e)?!0:yw.call(u5,e)?!1:u8.test(e)?d5[e]=!0:(u5[e]=!0,!1)}function f8(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 h8(e,t,r,n){if(t===null||typeof t>"u"||f8(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 zn(e,t,r,n,i,s,a){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=s,this.removeEmptyString=a}var wn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){wn[e]=new zn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];wn[t]=new zn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){wn[e]=new zn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){wn[e]=new zn(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){wn[e]=new zn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){wn[e]=new zn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){wn[e]=new zn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){wn[e]=new zn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){wn[e]=new zn(e,5,!1,e.toLowerCase(),null,!1,!1)});var eb=/[\-:]([a-z])/g;function tb(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(eb,tb);wn[t]=new zn(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(eb,tb);wn[t]=new zn(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(eb,tb);wn[t]=new zn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){wn[e]=new zn(e,1,!1,e.toLowerCase(),null,!1,!1)});wn.xlinkHref=new zn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){wn[e]=new zn(e,1,!1,e.toLowerCase(),null,!0,!0)});function rb(e,t,r,n){var i=wn.hasOwnProperty(t)?wn[t]:null;(i!==null?i.type!==0:n||!(2o||i[a]!==s[o]){var A=` `+i[a].replace(" at new "," at ");return e.displayName&&A.includes("")&&(A=A.replace("",e.displayName)),A}while(1<=a&&0<=o);break}}}finally{_1=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Kd(e):""}function p8(e){switch(e.tag){case 5:return Kd(e.type);case 16:return Kd("Lazy");case 13:return Kd("Suspense");case 19:return Kd("SuspenseList");case 0:case 2:case 15:return e=U1(e.type,!1),e;case 11:return e=U1(e.type.render,!1),e;case 1:return e=U1(e.type,!0),e;default:return""}}function Bw(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 Fc:return"Fragment";case Sc:return"Portal";case xw:return"Profiler";case nb:return"StrictMode";case bw:return"Suspense";case Cw:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case $N:return(e.displayName||"Context")+".Consumer";case VN:return(e._context.displayName||"Context")+".Provider";case ib:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case sb:return t=e.displayName||null,t!==null?t:Bw(e.type)||"Memo";case Fo:t=e._payload,e=e._init;try{return Bw(e(t))}catch{}}return null}function m8(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 Bw(t);case 8:return t===nb?"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 eA(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function zN(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function g8(e){var t=zN(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,s=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){n=""+a,s.call(this,a)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(a){n=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function jp(e){e._valueTracker||(e._valueTracker=g8(e))}function WN(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=zN(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function yg(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 Sw(e,t){var r=t.checked;return br({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function h5(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=eA(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 JN(e,t){t=t.checked,t!=null&&rb(e,"checked",t,!1)}function Fw(e,t){JN(e,t);var r=eA(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")?Ew(e,t.type,r):t.hasOwnProperty("defaultValue")&&Ew(e,t.type,eA(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function p5(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 Ew(e,t,r){(t!=="number"||yg(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Vd=Array.isArray;function Gc(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Tp.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Uf(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var of={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},v8=["Webkit","ms","Moz","O"];Object.keys(of).forEach(function(e){v8.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),of[t]=of[e]})});function ZN(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||of.hasOwnProperty(e)&&of[e]?(""+t).trim():t+"px"}function e_(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=ZN(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var w8=br({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 Uw(e,t){if(t){if(w8[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(je(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(je(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(je(61))}if(t.style!=null&&typeof t.style!="object")throw Error(je(62))}}function jw(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 Tw=null;function ab(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Iw=null,zc=null,Wc=null;function v5(e){if(e=gh(e)){if(typeof Iw!="function")throw Error(je(280));var t=e.stateNode;t&&(t=U0(t),Iw(e.stateNode,e.type,t))}}function t_(e){zc?Wc?Wc.push(e):Wc=[e]:zc=e}function r_(){if(zc){var e=zc,t=Wc;if(Wc=zc=null,v5(e),t)for(e=0;e>>=0,e===0?32:31-(U8(e)/j8|0)|0}var Ip=64,kp=4194304;function $d(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 Bg(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,s=e.pingedLanes,a=r&268435455;if(a!==0){var o=a&~i;o!==0?n=$d(o):(s&=a,s!==0&&(n=$d(s)))}else a=r&~i,a!==0?n=$d(a):s!==0&&(n=$d(s));if(n===0)return 0;if(t!==0&&t!==n&&!(t&i)&&(i=n&-n,s=t&-t,i>=s||i===16&&(s&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 ph(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Fs(t),e[t]=r}function L8(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=lf),E5=String.fromCharCode(32),N5=!1;function b_(e,t){switch(e){case"keyup":return lD.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function C_(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ec=!1;function uD(e,t){switch(e){case"compositionend":return C_(t);case"keypress":return t.which!==32?null:(N5=!0,E5);case"textInput":return e=t.data,e===E5&&N5?null:e;default:return null}}function dD(e,t){if(Ec)return e==="compositionend"||!hb&&b_(e,t)?(e=y_(),zm=ub=To=null,Ec=!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=T5(r)}}function E_(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?E_(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function N_(){for(var e=window,t=yg();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=yg(e.document)}return t}function pb(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 xD(e){var t=N_(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&E_(r.ownerDocument.documentElement,r)){if(n!==null&&pb(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,s=Math.min(n.start,i);n=n.end===void 0?s:Math.min(n.end,i),!e.extend&&s>n&&(i=n,n=s,s=i),i=I5(r,s);var a=I5(r,n);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>n?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.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,Nc=null,Ow=null,uf=null,Rw=!1;function k5(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Rw||Nc==null||Nc!==yg(n)||(n=Nc,"selectionStart"in n&&pb(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}),uf&&Pf(uf,n)||(uf=n,n=Eg(Ow,"onSelect"),0jc||(e.current=Gw[jc],Gw[jc]=null,jc--)}function sr(e,t){jc++,Gw[jc]=e.current,e.current=t}var tA={},Pn=uA(tA),oi=uA(!1),il=tA;function lu(e,t){var r=e.type.contextTypes;if(!r)return tA;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in r)i[s]=t[s];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Ai(e){return e=e.childContextTypes,e!=null}function _g(){cr(oi),cr(Pn)}function M5(e,t,r){if(Pn.current!==tA)throw Error(je(168));sr(Pn,t),sr(oi,r)}function Q_(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(je(108,m8(e)||"Unknown",i));return br({},r,n)}function Ug(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||tA,il=Pn.current,sr(Pn,e),sr(oi,oi.current),!0}function H5(e,t,r){var n=e.stateNode;if(!n)throw Error(je(169));r?(e=Q_(e,t,il),n.__reactInternalMemoizedMergedChildContext=e,cr(oi),cr(Pn),sr(Pn,e)):cr(oi),sr(oi,r)}var Ua=null,j0=!1,V1=!1;function D_(e){Ua===null?Ua=[e]:Ua.push(e)}function ID(e){j0=!0,D_(e)}function dA(){if(!V1&&Ua!==null){V1=!0;var e=0,t=Gt;try{var r=Ua;for(Gt=1;e>=a,i-=a,Ta=1<<32-Fs(t)+i|r<S?(I=k,k=null):I=k.sibling;var H=f(g,k,b[S],E);if(H===null){k===null&&(k=I);break}e&&k&&H.alternate===null&&t(g,k),w=s(H,w,S),_===null?L=H:_.sibling=H,_=H,k=I}if(S===b.length)return r(g,k),mr&&PA(g,S),L;if(k===null){for(;SS?(I=k,k=null):I=k.sibling;var N=f(g,k,H.value,E);if(N===null){k===null&&(k=I);break}e&&k&&N.alternate===null&&t(g,k),w=s(N,w,S),_===null?L=N:_.sibling=N,_=N,k=I}if(H.done)return r(g,k),mr&&PA(g,S),L;if(k===null){for(;!H.done;S++,H=b.next())H=d(g,H.value,E),H!==null&&(w=s(H,w,S),_===null?L=H:_.sibling=H,_=H);return mr&&PA(g,S),L}for(k=n(g,k);!H.done;S++,H=b.next())H=h(k,g,S,H.value,E),H!==null&&(e&&H.alternate!==null&&k.delete(H.key===null?S:H.key),w=s(H,w,S),_===null?L=H:_.sibling=H,_=H);return e&&k.forEach(function(j){return t(g,j)}),mr&&PA(g,S),L}function y(g,w,b,E){if(typeof b=="object"&&b!==null&&b.type===Fc&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case Up:e:{for(var L=b.key,_=w;_!==null;){if(_.key===L){if(L=b.type,L===Fc){if(_.tag===7){r(g,_.sibling),w=i(_,b.props.children),w.return=g,g=w;break e}}else if(_.elementType===L||typeof L=="object"&&L!==null&&L.$$typeof===Fo&&$5(L)===_.type){r(g,_.sibling),w=i(_,b.props),w.ref=Fd(g,_,b),w.return=g,g=w;break e}r(g,_);break}else t(g,_);_=_.sibling}b.type===Fc?(w=XA(b.props.children,g.mode,E,b.key),w.return=g,g=w):(E=tg(b.type,b.key,b.props,null,g.mode,E),E.ref=Fd(g,w,b),E.return=g,g=E)}return a(g);case Sc:e:{for(_=b.key;w!==null;){if(w.key===_)if(w.tag===4&&w.stateNode.containerInfo===b.containerInfo&&w.stateNode.implementation===b.implementation){r(g,w.sibling),w=i(w,b.children||[]),w.return=g,g=w;break e}else{r(g,w);break}else t(g,w);w=w.sibling}w=X1(b,g.mode,E),w.return=g,g=w}return a(g);case Fo:return _=b._init,y(g,w,_(b._payload),E)}if(Vd(b))return v(g,w,b,E);if(xd(b))return p(g,w,b,E);Mp(g,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,w!==null&&w.tag===6?(r(g,w.sibling),w=i(w,b),w.return=g,g=w):(r(g,w),w=Y1(b,g.mode,E),w.return=g,g=w),a(g)):r(g,w)}return y}var uu=H_(!0),K_=H_(!1),Ig=uA(null),kg=null,kc=null,wb=null;function yb(){wb=kc=kg=null}function xb(e){var t=Ig.current;cr(Ig),e._currentValue=t}function Jw(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 qc(e,t){kg=e,wb=kc=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ai=!0),e.firstContext=null)}function Zi(e){var t=e._currentValue;if(wb!==e)if(e={context:e,memoizedValue:t,next:null},kc===null){if(kg===null)throw Error(je(308));kc=e,kg.dependencies={lanes:0,firstContext:e}}else kc=kc.next=e;return t}var GA=null;function bb(e){GA===null?GA=[e]:GA.push(e)}function V_(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,bb(t)):(r.next=i.next,i.next=r),t.interleaved=r,Ha(e,n)}function Ha(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 Eo=!1;function Cb(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function $_(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 ka(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ko(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,It&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,Ha(e,r)}return i=n.interleaved,i===null?(t.next=t,bb(n)):(t.next=i.next,i.next=t),n.interleaved=t,Ha(e,r)}function Jm(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,Ab(e,r)}}function G5(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,s=null;if(r=r.firstBaseUpdate,r!==null){do{var a={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};s===null?i=s=a:s=s.next=a,r=r.next}while(r!==null);s===null?i=s=t:s=s.next=t}else i=s=t;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:s,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 Lg(e,t,r,n){var i=e.updateQueue;Eo=!1;var s=i.firstBaseUpdate,a=i.lastBaseUpdate,o=i.shared.pending;if(o!==null){i.shared.pending=null;var A=o,c=A.next;A.next=null,a===null?s=c:a.next=c,a=A;var u=e.alternate;u!==null&&(u=u.updateQueue,o=u.lastBaseUpdate,o!==a&&(o===null?u.firstBaseUpdate=c:o.next=c,u.lastBaseUpdate=A))}if(s!==null){var d=i.baseState;a=0,u=c=A=null,o=s;do{var f=o.lane,h=o.eventTime;if((n&f)===f){u!==null&&(u=u.next={eventTime:h,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var v=e,p=o;switch(f=t,h=r,p.tag){case 1:if(v=p.payload,typeof v=="function"){d=v.call(h,d,f);break e}d=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=p.payload,f=typeof v=="function"?v.call(h,d,f):v,f==null)break e;d=br({},d,f);break e;case 2:Eo=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[o]:f.push(o))}else h={eventTime:h,lane:f,tag:o.tag,payload:o.payload,callback:o.callback,next:null},u===null?(c=u=h,A=d):u=u.next=h,a|=f;if(o=o.next,o===null){if(o=i.shared.pending,o===null)break;f=o,o=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(1);if(u===null&&(A=d),i.baseState=A,i.firstBaseUpdate=c,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do a|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);ol|=a,e.lanes=a,e.memoizedState=d}}function z5(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=G1.transition;G1.transition={};try{e(!1),t()}finally{Gt=r,G1.transition=n}}function A3(){return es().memoizedState}function QD(e,t,r){var n=$o(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},l3(e))c3(t,r);else if(r=V_(e,t,r,n),r!==null){var i=Vn();Es(r,e,n,i),u3(r,t,n)}}function DD(e,t,r){var n=$o(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(l3(e))c3(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var a=t.lastRenderedState,o=s(a,r);if(i.hasEagerState=!0,i.eagerState=o,Ns(o,a)){var A=t.interleaved;A===null?(i.next=i,bb(t)):(i.next=A.next,A.next=i),t.interleaved=i;return}}catch{}finally{}r=V_(e,t,i,n),r!==null&&(i=Vn(),Es(r,e,n,i),u3(r,t,n))}}function l3(e){var t=e.alternate;return e===xr||t!==null&&t===xr}function c3(e,t){df=Qg=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function u3(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Ab(e,r)}}var Dg={readContext:Zi,useCallback:Cn,useContext:Cn,useEffect:Cn,useImperativeHandle:Cn,useInsertionEffect:Cn,useLayoutEffect:Cn,useMemo:Cn,useReducer:Cn,useRef:Cn,useState:Cn,useDebugValue:Cn,useDeferredValue:Cn,useTransition:Cn,useMutableSource:Cn,useSyncExternalStore:Cn,useId:Cn,unstable_isNewReconciler:!1},OD={readContext:Zi,useCallback:function(e,t){return Ws().memoizedState=[e,t===void 0?null:t],e},useContext:Zi,useEffect:J5,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Ym(4194308,4,n3.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Ym(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ym(4,2,e,t)},useMemo:function(e,t){var r=Ws();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Ws();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=QD.bind(null,xr,e),[n.memoizedState,e]},useRef:function(e){var t=Ws();return e={current:e},t.memoizedState=e},useState:W5,useDebugValue:jb,useDeferredValue:function(e){return Ws().memoizedState=e},useTransition:function(){var e=W5(!1),t=e[0];return e=PD.bind(null,e[1]),Ws().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=xr,i=Ws();if(mr){if(r===void 0)throw Error(je(407));r=r()}else{if(r=t(),cn===null)throw Error(je(349));al&30||J_(n,t,r)}i.memoizedState=r;var s={value:r,getSnapshot:t};return i.queue=s,J5(Y_.bind(null,n,s,e),[e]),n.flags|=2048,Vf(9,q_.bind(null,n,s,r,t),void 0,null),r},useId:function(){var e=Ws(),t=cn.identifierPrefix;if(mr){var r=Ia,n=Ta;r=(n&~(1<<32-Fs(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Hf++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=a.createElement(r,{is:n.is}):(e=a.createElement(r),r==="select"&&(a=e,n.multiple?a.multiple=!0:n.size&&(a.size=n.size))):e=a.createElementNS(e,r),e[qs]=t,e[Of]=n,x3(e,t,!1,!1),t.stateNode=e;e:{switch(a=jw(r,n),r){case"dialog":Ar("cancel",e),Ar("close",e),i=n;break;case"iframe":case"object":case"embed":Ar("load",e),i=n;break;case"video":case"audio":for(i=0;ihu&&(t.flags|=128,n=!0,Ed(s,!1),t.lanes=4194304)}else{if(!n)if(e=Pg(a),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Ed(s,!0),s.tail===null&&s.tailMode==="hidden"&&!a.alternate&&!mr)return Bn(t),null}else 2*Lr()-s.renderingStartTime>hu&&r!==1073741824&&(t.flags|=128,n=!0,Ed(s,!1),t.lanes=4194304);s.isBackwards?(a.sibling=t.child,t.child=a):(r=s.last,r!==null?r.sibling=a:t.child=a,s.last=a)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Lr(),t.sibling=null,r=wr.current,sr(wr,n?r&1|2:r&1),t):(Bn(t),null);case 22:case 23:return Qb(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?wi&1073741824&&(Bn(t),t.subtreeFlags&6&&(t.flags|=8192)):Bn(t),null;case 24:return null;case 25:return null}throw Error(je(156,t.tag))}function zD(e,t){switch(gb(t),t.tag){case 1:return Ai(t.type)&&_g(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return du(),cr(oi),cr(Pn),Fb(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Sb(t),null;case 13:if(cr(wr),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(je(340));cu()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return cr(wr),null;case 4:return du(),null;case 10:return xb(t.type._context),null;case 22:case 23:return Qb(),null;case 24:return null;default:return null}}var Kp=!1,Tn=!1,WD=typeof WeakSet=="function"?WeakSet:Set,We=null;function Lc(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Nr(e,t,n)}else r.current=null}function iy(e,t,r){try{r()}catch(n){Nr(e,t,n)}}var a4=!1;function JD(e,t){if(Mw=Sg,e=N_(),pb(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,s=n.focusNode;n=n.focusOffset;try{r.nodeType,s.nodeType}catch{r=null;break e}var a=0,o=-1,A=-1,c=0,u=0,d=e,f=null;t:for(;;){for(var h;d!==r||i!==0&&d.nodeType!==3||(o=a+i),d!==s||n!==0&&d.nodeType!==3||(A=a+n),d.nodeType===3&&(a+=d.nodeValue.length),(h=d.firstChild)!==null;)f=d,d=h;for(;;){if(d===e)break t;if(f===r&&++c===i&&(o=a),f===s&&++u===n&&(A=a),(h=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=h}r=o===-1||A===-1?null:{start:o,end:A}}else r=null}r=r||{start:0,end:0}}else r=null;for(Hw={focusedElem:e,selectionRange:r},Sg=!1,We=t;We!==null;)if(t=We,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,We=e;else for(;We!==null;){t=We;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var p=v.memoizedProps,y=v.memoizedState,g=t.stateNode,w=g.getSnapshotBeforeUpdate(t.elementType===t.type?p:ws(t.type,p),y);g.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(je(163))}}catch(E){Nr(t,t.return,E)}if(e=t.sibling,e!==null){e.return=t.return,We=e;break}We=t.return}return v=a4,a4=!1,v}function ff(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 s=i.destroy;i.destroy=void 0,s!==void 0&&iy(t,r,s)}i=i.next}while(i!==n)}}function k0(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 sy(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 B3(e){var t=e.alternate;t!==null&&(e.alternate=null,B3(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[qs],delete t[Of],delete t[$w],delete t[jD],delete t[TD])),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 S3(e){return e.tag===5||e.tag===3||e.tag===4}function o4(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||S3(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 ay(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=Ng));else if(n!==4&&(e=e.child,e!==null))for(ay(e,t,r),e=e.sibling;e!==null;)ay(e,t,r),e=e.sibling}function oy(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(oy(e,t,r),e=e.sibling;e!==null;)oy(e,t,r),e=e.sibling}var hn=null,bs=!1;function po(e,t,r){for(r=r.child;r!==null;)F3(e,t,r),r=r.sibling}function F3(e,t,r){if(Zs&&typeof Zs.onCommitFiberUnmount=="function")try{Zs.onCommitFiberUnmount(F0,r)}catch{}switch(r.tag){case 5:Tn||Lc(r,t);case 6:var n=hn,i=bs;hn=null,po(e,t,r),hn=n,bs=i,hn!==null&&(bs?(e=hn,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):hn.removeChild(r.stateNode));break;case 18:hn!==null&&(bs?(e=hn,r=r.stateNode,e.nodeType===8?K1(e.parentNode,r):e.nodeType===1&&K1(e,r),kf(e)):K1(hn,r.stateNode));break;case 4:n=hn,i=bs,hn=r.stateNode.containerInfo,bs=!0,po(e,t,r),hn=n,bs=i;break;case 0:case 11:case 14:case 15:if(!Tn&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var s=i,a=s.destroy;s=s.tag,a!==void 0&&(s&2||s&4)&&iy(r,t,a),i=i.next}while(i!==n)}po(e,t,r);break;case 1:if(!Tn&&(Lc(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(o){Nr(r,t,o)}po(e,t,r);break;case 21:po(e,t,r);break;case 22:r.mode&1?(Tn=(n=Tn)||r.memoizedState!==null,po(e,t,r),Tn=n):po(e,t,r);break;default:po(e,t,r)}}function A4(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new WD),t.forEach(function(n){var i=iO.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function ds(e,t){var r=t.deletions;if(r!==null)for(var n=0;ni&&(i=a),n&=~s}if(n=i,n=Lr()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*YD(n/1960))-n,10e?16:e,Io===null)var n=!1;else{if(e=Io,Io=null,Mg=0,It&6)throw Error(je(331));var i=It;for(It|=4,We=e.current;We!==null;){var s=We,a=s.child;if(We.flags&16){var o=s.deletions;if(o!==null){for(var A=0;ALr()-Lb?YA(e,0):kb|=r),li(e,t)}function k3(e,t){t===0&&(e.mode&1?(t=kp,kp<<=1,!(kp&130023424)&&(kp=4194304)):t=1);var r=Vn();e=Ha(e,t),e!==null&&(ph(e,t,r),li(e,r))}function nO(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),k3(e,r)}function iO(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(je(314))}n!==null&&n.delete(t),k3(e,r)}var L3;L3=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||oi.current)ai=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return ai=!1,$D(e,t,r);ai=!!(e.flags&131072)}else ai=!1,mr&&t.flags&1048576&&O_(t,Tg,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Xm(e,t),e=t.pendingProps;var i=lu(t,Pn.current);qc(t,r),i=Nb(null,t,n,e,i,r);var s=_b();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,Ai(n)?(s=!0,Ug(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Cb(t),i.updater=I0,t.stateNode=i,i._reactInternals=t,Yw(t,n,e,r),t=ey(null,t,n,!0,s,r)):(t.tag=0,mr&&s&&mb(t),Hn(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Xm(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=aO(n),e=ws(n,e),i){case 0:t=Zw(null,t,n,e,r);break e;case 1:t=n4(null,t,n,e,r);break e;case 11:t=t4(null,t,n,e,r);break e;case 14:t=r4(null,t,n,ws(n.type,e),r);break e}throw Error(je(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:ws(n,i),Zw(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:ws(n,i),n4(e,t,n,i,r);case 3:e:{if(v3(t),e===null)throw Error(je(387));n=t.pendingProps,s=t.memoizedState,i=s.element,$_(e,t),Lg(t,n,null,r);var a=t.memoizedState;if(n=a.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=fu(Error(je(423)),t),t=i4(e,t,n,r,i);break e}else if(n!==i){i=fu(Error(je(424)),t),t=i4(e,t,n,r,i);break e}else for(Ci=Ho(t.stateNode.containerInfo.firstChild),Si=t,mr=!0,Bs=null,r=K_(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(cu(),n===i){t=Ka(e,t,r);break e}Hn(e,t,n,r)}t=t.child}return t;case 5:return G_(t),e===null&&Ww(t),n=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,a=i.children,Kw(n,i)?a=null:s!==null&&Kw(n,s)&&(t.flags|=32),g3(e,t),Hn(e,t,a,r),t.child;case 6:return e===null&&Ww(t),null;case 13:return w3(e,t,r);case 4:return Bb(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=uu(t,null,n,r):Hn(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:ws(n,i),t4(e,t,n,i,r);case 7:return Hn(e,t,t.pendingProps,r),t.child;case 8:return Hn(e,t,t.pendingProps.children,r),t.child;case 12:return Hn(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,s=t.memoizedProps,a=i.value,sr(Ig,n._currentValue),n._currentValue=a,s!==null)if(Ns(s.value,a)){if(s.children===i.children&&!oi.current){t=Ka(e,t,r);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var o=s.dependencies;if(o!==null){a=s.child;for(var A=o.firstContext;A!==null;){if(A.context===n){if(s.tag===1){A=ka(-1,r&-r),A.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?A.next=A:(A.next=u.next,u.next=A),c.pending=A}}s.lanes|=r,A=s.alternate,A!==null&&(A.lanes|=r),Jw(s.return,r,t),o.lanes|=r;break}A=A.next}}else if(s.tag===10)a=s.type===t.type?null:s.child;else if(s.tag===18){if(a=s.return,a===null)throw Error(je(341));a.lanes|=r,o=a.alternate,o!==null&&(o.lanes|=r),Jw(a,r,t),a=s.sibling}else a=s.child;if(a!==null)a.return=s;else for(a=s;a!==null;){if(a===t){a=null;break}if(s=a.sibling,s!==null){s.return=a.return,a=s;break}a=a.return}s=a}Hn(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,qc(t,r),i=Zi(i),n=n(i),t.flags|=1,Hn(e,t,n,r),t.child;case 14:return n=t.type,i=ws(n,t.pendingProps),i=ws(n.type,i),r4(e,t,n,i,r);case 15:return p3(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:ws(n,i),Xm(e,t),t.tag=1,Ai(n)?(e=!0,Ug(t)):e=!1,qc(t,r),d3(t,n,i),Yw(t,n,i,r),ey(null,t,n,!0,e,r);case 19:return y3(e,t,r);case 22:return m3(e,t,r)}throw Error(je(156,t.tag))};function P3(e,t){return l_(e,t)}function sO(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 Ji(e,t,r,n){return new sO(e,t,r,n)}function Ob(e){return e=e.prototype,!(!e||!e.isReactComponent)}function aO(e){if(typeof e=="function")return Ob(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ib)return 11;if(e===sb)return 14}return 2}function Go(e,t){var r=e.alternate;return r===null?(r=Ji(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 tg(e,t,r,n,i,s){var a=2;if(n=e,typeof e=="function")Ob(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Fc:return XA(r.children,i,s,t);case nb:a=8,i|=8;break;case xw:return e=Ji(12,r,t,i|2),e.elementType=xw,e.lanes=s,e;case bw:return e=Ji(13,r,t,i),e.elementType=bw,e.lanes=s,e;case Cw:return e=Ji(19,r,t,i),e.elementType=Cw,e.lanes=s,e;case GN:return P0(r,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case VN:a=10;break e;case $N:a=9;break e;case ib:a=11;break e;case sb:a=14;break e;case Fo:a=16,n=null;break e}throw Error(je(130,e==null?e:typeof e,""))}return t=Ji(a,r,t,i),t.elementType=e,t.type=n,t.lanes=s,t}function XA(e,t,r,n){return e=Ji(7,e,n,t),e.lanes=r,e}function P0(e,t,r,n){return e=Ji(22,e,n,t),e.elementType=GN,e.lanes=r,e.stateNode={isHidden:!1},e}function Y1(e,t,r){return e=Ji(6,e,null,t),e.lanes=r,e}function X1(e,t,r){return t=Ji(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function oO(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=T1(0),this.expirationTimes=T1(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=T1(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Rb(e,t,r,n,i,s,a,o,A){return e=new oO(e,t,r,o,A),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Ji(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Cb(s),e}function AO(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(R3)}catch(e){console.error(e)}}R3(),RN.exports=ji;var qa=RN.exports;const M3=wl(qa);var H3,m4=qa;H3=ww.createRoot=m4.createRoot,ww.hydrateRoot=m4.hydrateRoot;/** * @remix-run/router v1.23.2 * * 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 Gf(){return Gf=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Vb(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function hO(){return Math.random().toString(36).substr(2,8)}function v4(e,t){return{usr:e.state,key:e.key,idx:t}}function dy(e,t,r,n){return r===void 0&&(r=null),Gf({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Uu(t):t,{state:r,key:t&&t.key||n||hO()})}function Vg(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 Uu(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 pO(e,t,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:s=!1}=n,a=i.history,o=ko.Pop,A=null,c=u();c==null&&(c=0,a.replaceState(Gf({},a.state,{idx:c}),""));function u(){return(a.state||{idx:null}).idx}function d(){o=ko.Pop;let y=u(),g=y==null?null:y-c;c=y,A&&A({action:o,location:p.location,delta:g})}function f(y,g){o=ko.Push;let w=dy(p.location,y,g);r&&r(w,y),c=u()+1;let b=v4(w,c),E=p.createHref(w);try{a.pushState(b,"",E)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;i.location.assign(E)}s&&A&&A({action:o,location:p.location,delta:1})}function h(y,g){o=ko.Replace;let w=dy(p.location,y,g);r&&r(w,y),c=u();let b=v4(w,c),E=p.createHref(w);a.replaceState(b,"",E),s&&A&&A({action:o,location:p.location,delta:0})}function v(y){let g=i.location.origin!=="null"?i.location.origin:i.location.href,w=typeof y=="string"?y:Vg(y);return w=w.replace(/ $/,"%20"),Rr(g,"No window.location.(origin|href) available to create URL for href: "+w),new URL(w,g)}let p={get action(){return o},get location(){return e(i,a)},listen(y){if(A)throw new Error("A history only accepts one active listener");return i.addEventListener(g4,d),A=y,()=>{i.removeEventListener(g4,d),A=null}},createHref(y){return t(i,y)},createURL:v,encodeLocation(y){let g=v(y);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:f,replace:h,go(y){return a.go(y)}};return p}var w4;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(w4||(w4={}));function mO(e,t,r){return r===void 0&&(r="/"),gO(e,t,r,!1)}function gO(e,t,r,n){let i=typeof t=="string"?Uu(t):t,s=$b(i.pathname||"/",r);if(s==null)return null;let a=K3(e);vO(a);let o=null;for(let A=0;o==null&&A{let A={relativePath:o===void 0?s.path||"":o,caseSensitive:s.caseSensitive===!0,childrenIndex:a,route:s};A.relativePath.startsWith("/")&&(Rr(A.relativePath.startsWith(n),'Absolute route path "'+A.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),A.relativePath=A.relativePath.slice(n.length));let c=zo([n,A.relativePath]),u=r.concat(A);s.children&&s.children.length>0&&(Rr(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),K3(s.children,t,u,c)),!(s.path==null&&!s.index)&&t.push({path:c,score:SO(c,s.index),routesMeta:u})};return e.forEach((s,a)=>{var o;if(s.path===""||!((o=s.path)!=null&&o.includes("?")))i(s,a);else for(let A of V3(s.path))i(s,a,A)}),t}function V3(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,i=r.endsWith("?"),s=r.replace(/\?$/,"");if(n.length===0)return i?[s,""]:[s];let a=V3(n.join("/")),o=[];return o.push(...a.map(A=>A===""?s:[s,A].join("/"))),i&&o.push(...a),o.map(A=>e.startsWith("/")&&A===""?"/":A)}function vO(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:FO(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const wO=/^:[\w-]+$/,yO=3,xO=2,bO=1,CO=10,BO=-2,y4=e=>e==="*";function SO(e,t){let r=e.split("/"),n=r.length;return r.some(y4)&&(n+=BO),t&&(n+=xO),r.filter(i=>!y4(i)).reduce((i,s)=>i+(wO.test(s)?yO:s===""?bO:CO),n)}function FO(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 EO(e,t,r){r===void 0&&(r=!1);let{routesMeta:n}=e,i={},s="/",a=[];for(let o=0;o{let{paramName:f,isOptional:h}=u;if(f==="*"){let p=o[d]||"";a=s.slice(0,s.length-p.length).replace(/(.)\/+$/,"$1")}const v=o[d];return h&&!v?c[f]=void 0:c[f]=(v||"").replace(/%2F/g,"/"),c},{}),pathname:s,pathnameBase:a,pattern:e}}function NO(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),Vb(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,(a,o,A)=>(n.push({paramName:o,isOptional:A!=null}),A?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),n]}function _O(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Vb(!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 $b(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)||"/"}const UO=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,jO=e=>UO.test(e);function TO(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:i=""}=typeof e=="string"?Uu(e):e,s;if(r)if(jO(r))s=r;else{if(r.includes("//")){let a=r;r=r.replace(/\/\/+/g,"/"),Vb(!1,"Pathnames cannot have embedded double slashes - normalizing "+(a+" -> "+r))}r.startsWith("/")?s=b4(r.substring(1),"/"):s=b4(r,t)}else s=t;return{pathname:s,search:LO(n),hash:PO(i)}}function b4(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 Z1(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 IO(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Gb(e,t){let r=IO(e);return t?r.map((n,i)=>i===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function zb(e,t,r,n){n===void 0&&(n=!1);let i;typeof e=="string"?i=Uu(e):(i=Gf({},e),Rr(!i.pathname||!i.pathname.includes("?"),Z1("?","pathname","search",i)),Rr(!i.pathname||!i.pathname.includes("#"),Z1("#","pathname","hash",i)),Rr(!i.search||!i.search.includes("#"),Z1("#","search","hash",i)));let s=e===""||i.pathname==="",a=s?"/":i.pathname,o;if(a==null)o=r;else{let d=t.length-1;if(!n&&a.startsWith("..")){let f=a.split("/");for(;f[0]==="..";)f.shift(),d-=1;i.pathname=f.join("/")}o=d>=0?t[d]:"/"}let A=TO(i,o),c=a&&a!=="/"&&a.endsWith("/"),u=(s||a===".")&&r.endsWith("/");return!A.pathname.endsWith("/")&&(c||u)&&(A.pathname+="/"),A}const zo=e=>e.join("/").replace(/\/\/+/g,"/"),kO=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),LO=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,PO=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function QO(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const $3=["post","put","patch","delete"];new Set($3);const DO=["get",...$3];new Set(DO);/** * React Router v6.30.3 * * 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 zf(){return zf=Object.assign?Object.assign.bind():function(e){for(var t=1;t{o.current=!0}),C.useCallback(function(c,u){if(u===void 0&&(u={}),!o.current)return;if(typeof c=="number"){n.go(c);return}let d=zb(c,JSON.parse(a),s,u.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:zo([t,d.pathname])),(u.replace?n.replace:n.push)(d,u.state,u)},[t,n,a,s,e])}function HO(){let{matches:e}=C.useContext(Ya),t=e[e.length-1];return t?t.params:{}}function W3(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=C.useContext(fA),{matches:i}=C.useContext(Ya),{pathname:s}=bl(),a=JSON.stringify(Gb(i,n.v7_relativeSplatPath));return C.useMemo(()=>zb(e,JSON.parse(a),s,r==="path"),[e,a,s,r])}function KO(e,t){return VO(e,t)}function VO(e,t,r,n){ju()||Rr(!1);let{navigator:i}=C.useContext(fA),{matches:s}=C.useContext(Ya),a=s[s.length-1],o=a?a.params:{};a&&a.pathname;let A=a?a.pathnameBase:"/";a&&a.route;let c=bl(),u;if(t){var d;let y=typeof t=="string"?Uu(t):t;A==="/"||(d=y.pathname)!=null&&d.startsWith(A)||Rr(!1),u=y}else u=c;let f=u.pathname||"/",h=f;if(A!=="/"){let y=A.replace(/^\//,"").split("/");h="/"+f.replace(/^\//,"").split("/").slice(y.length).join("/")}let v=mO(e,{pathname:h}),p=JO(v&&v.map(y=>Object.assign({},y,{params:Object.assign({},o,y.params),pathname:zo([A,i.encodeLocation?i.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?A:zo([A,i.encodeLocation?i.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),s,r,n);return t&&p?C.createElement(M0.Provider,{value:{location:zf({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:ko.Pop}},p):p}function $O(){let e=ZO(),t=QO(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)"},s=null;return C.createElement(C.Fragment,null,C.createElement("h2",null,"Unexpected Application Error!"),C.createElement("h3",{style:{fontStyle:"italic"}},t),r?C.createElement("pre",{style:i},r):null,s)}const GO=C.createElement($O,null);class zO extends C.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?C.createElement(Ya.Provider,{value:this.props.routeContext},C.createElement(G3.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function WO(e){let{routeContext:t,match:r,children:n}=e,i=C.useContext(Wb);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),C.createElement(Ya.Provider,{value:t},n)}function JO(e,t,r,n){var i;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var s;if(!r)return null;if(r.errors)e=r.matches;else if((s=n)!=null&&s.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let a=e,o=(i=r)==null?void 0:i.errors;if(o!=null){let u=a.findIndex(d=>d.route.id&&(o==null?void 0:o[d.route.id])!==void 0);u>=0||Rr(!1),a=a.slice(0,Math.min(a.length,u+1))}let A=!1,c=-1;if(r&&n&&n.v7_partialHydration)for(let u=0;u=0?a=a.slice(0,c+1):a=[a[0]];break}}}return a.reduceRight((u,d,f)=>{let h,v=!1,p=null,y=null;r&&(h=o&&d.route.id?o[d.route.id]:void 0,p=d.route.errorElement||GO,A&&(c<0&&f===0?(tR("route-fallback",!1),v=!0,y=null):c===f&&(v=!0,y=d.route.hydrateFallbackElement||null)));let g=t.concat(a.slice(0,f+1)),w=()=>{let b;return h?b=p:v?b=y:d.route.Component?b=C.createElement(d.route.Component,null):d.route.element?b=d.route.element:b=u,C.createElement(WO,{match:d,routeContext:{outlet:u,matches:g,isDataRoute:r!=null},children:b})};return r&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?C.createElement(zO,{location:r.location,revalidation:r.revalidation,component:p,error:h,children:w(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):w()},null)}var J3=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(J3||{}),$g=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}($g||{});function qO(e){let t=C.useContext(Wb);return t||Rr(!1),t}function YO(e){let t=C.useContext(OO);return t||Rr(!1),t}function XO(e){let t=C.useContext(Ya);return t||Rr(!1),t}function q3(e){let t=XO(),r=t.matches[t.matches.length-1];return r.route.id||Rr(!1),r.route.id}function ZO(){var e;let t=C.useContext(G3),r=YO($g.UseRouteError),n=q3($g.UseRouteError);return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function eR(){let{router:e}=qO(J3.UseNavigateStable),t=q3($g.UseNavigateStable),r=C.useRef(!1);return z3(()=>{r.current=!0}),C.useCallback(function(i,s){s===void 0&&(s={}),r.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,zf({fromRouteId:t},s)))},[e,t])}const C4={};function tR(e,t,r){!t&&!C4[e]&&(C4[e]=!0)}function rR(e,t){e==null||e.v7_startTransition,(e==null?void 0:e.v7_relativeSplatPath)===void 0&&(!t||t.v7_relativeSplatPath),t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation)}function nR(e){let{to:t,replace:r,state:n,relative:i}=e;ju()||Rr(!1);let{future:s,static:a}=C.useContext(fA),{matches:o}=C.useContext(Ya),{pathname:A}=bl(),c=rs(),u=zb(t,Gb(o,s.v7_relativeSplatPath),A,i==="path"),d=JSON.stringify(u);return C.useEffect(()=>c(JSON.parse(d),{replace:r,state:n,relative:i}),[c,d,i,r,n]),null}function Ki(e){Rr(!1)}function iR(e){let{basename:t="/",children:r=null,location:n,navigationType:i=ko.Pop,navigator:s,static:a=!1,future:o}=e;ju()&&Rr(!1);let A=t.replace(/^\/*/,"/"),c=C.useMemo(()=>({basename:A,navigator:s,static:a,future:zf({v7_relativeSplatPath:!1},o)}),[A,o,s,a]);typeof n=="string"&&(n=Uu(n));let{pathname:u="/",search:d="",hash:f="",state:h=null,key:v="default"}=n,p=C.useMemo(()=>{let y=$b(u,A);return y==null?null:{location:{pathname:y,search:d,hash:f,state:h,key:v},navigationType:i}},[A,u,d,f,h,v,i]);return p==null?null:C.createElement(fA.Provider,{value:c},C.createElement(M0.Provider,{children:r,value:p}))}function sR(e){let{children:t,location:r}=e;return KO(fy(t),r)}new Promise(()=>{});function fy(e,t){t===void 0&&(t=[]);let r=[];return C.Children.forEach(e,(n,i)=>{if(!C.isValidElement(n))return;let s=[...t,i];if(n.type===C.Fragment){r.push.apply(r,fy(n.props.children,s));return}n.type!==Ki&&Rr(!1),!n.props.index||!n.props.children||Rr(!1);let a={id:n.props.id||s.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&&(a.children=fy(n.props.children,s)),r.push(a)}),r}/** * React Router DOM v6.30.3 * * 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 hy(){return hy=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[i]=e[i]);return r}function oR(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function AR(e,t){return e.button===0&&(!t||t==="_self")&&!oR(e)}const lR=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],cR="6";try{window.__reactRouterVersion=cR}catch{}const uR="startTransition",B4=Eu[uR];function dR(e){let{basename:t,children:r,future:n,window:i}=e,s=C.useRef();s.current==null&&(s.current=fO({window:i,v5Compat:!0}));let a=s.current,[o,A]=C.useState({action:a.action,location:a.location}),{v7_startTransition:c}=n||{},u=C.useCallback(d=>{c&&B4?B4(()=>A(d)):A(d)},[A,c]);return C.useLayoutEffect(()=>a.listen(u),[a,u]),C.useEffect(()=>rR(n),[n]),C.createElement(iR,{basename:t,children:r,location:o.location,navigationType:o.action,navigator:a,future:n})}const fR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",hR=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ll=C.forwardRef(function(t,r){let{onClick:n,relative:i,reloadDocument:s,replace:a,state:o,target:A,to:c,preventScrollReset:u,viewTransition:d}=t,f=aR(t,lR),{basename:h}=C.useContext(fA),v,p=!1;if(typeof c=="string"&&hR.test(c)&&(v=c,fR))try{let b=new URL(window.location.href),E=c.startsWith("//")?new URL(b.protocol+c):new URL(c),L=$b(E.pathname,h);E.origin===b.origin&&L!=null?c=L+E.search+E.hash:p=!0}catch{}let y=RO(c,{relative:i}),g=pR(c,{replace:a,state:o,target:A,preventScrollReset:u,relative:i,viewTransition:d});function w(b){n&&n(b),b.defaultPrevented||g(b)}return C.createElement("a",hy({},f,{href:v||y,onClick:p||s?n:w,ref:r,target:A}))});var S4;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(S4||(S4={}));var F4;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(F4||(F4={}));function pR(e,t){let{target:r,replace:n,state:i,preventScrollReset:s,relative:a,viewTransition:o}=t===void 0?{}:t,A=rs(),c=bl(),u=W3(e,{relative:a});return C.useCallback(d=>{if(AR(d,r)){d.preventDefault();let f=n!==void 0?n:Vg(c)===Vg(u);A(e,{replace:f,state:i,preventScrollReset:s,relative:a,viewTransition:o})}},[c,A,u,n,i,r,e,s,a,o])}var Y3={exports:{}},mR="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",gR=mR,vR=gR;function X3(){}function Z3(){}Z3.resetWarningCache=X3;var wR=function(){function e(n,i,s,a,o,A){if(A!==vR){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Z3,resetWarningCache:X3};return r.PropTypes=r,r};Y3.exports=wR();var yR=Y3.exports;const fr=wl(yR);function xR(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var eU=C,bR=xR(eU);function E4(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function CR(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var BR=!!(typeof window<"u"&&window.document&&window.document.createElement);function SR(e,t,r){if(typeof e!="function")throw new Error("Expected reducePropsToState to be a function.");if(typeof t!="function")throw new Error("Expected handleStateChangeOnClient to be a function.");if(typeof r<"u"&&typeof r!="function")throw new Error("Expected mapStateOnServer to either be undefined or a function.");function n(i){return i.displayName||i.name||"Component"}return function(s){if(typeof s!="function")throw new Error("Expected WrappedComponent to be a React component.");var a=[],o;function A(){o=e(a.map(function(u){return u.props})),c.canUseDOM?t(o):r&&(o=r(o))}var c=function(u){CR(d,u);function d(){return u.apply(this,arguments)||this}d.peek=function(){return o},d.rewind=function(){if(d.canUseDOM)throw new Error("You may only call rewind() on the server. Call peek() to read the current state.");var v=o;return o=void 0,a=[],v};var f=d.prototype;return f.UNSAFE_componentWillMount=function(){a.push(this),A()},f.componentDidUpdate=function(){A()},f.componentWillUnmount=function(){var v=a.indexOf(this);a.splice(v,1),A()},f.render=function(){return bR.createElement(s,this.props)},d}(eU.PureComponent);return E4(c,"displayName","SideEffect("+n(s)+")"),E4(c,"canUseDOM",BR),c}}var FR=SR;const ER=wl(FR);var NR=typeof Element<"u",_R=typeof Map=="function",UR=typeof Set=="function",jR=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function rg(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(!rg(e[n],t[n]))return!1;return!0}var s;if(_R&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(s=e.entries();!(n=s.next()).done;)if(!t.has(n.value[0]))return!1;for(s=e.entries();!(n=s.next()).done;)if(!rg(n.value[1],t.get(n.value[0])))return!1;return!0}if(UR&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(s=e.entries();!(n=s.next()).done;)if(!t.has(n.value[0]))return!1;return!0}if(jR&&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(NR&&e instanceof Element)return!1;for(n=r;n--!==0;)if(!((i[n]==="_owner"||i[n]==="__v"||i[n]==="__o")&&e.$$typeof)&&!rg(e[i[n]],t[i[n]]))return!1;return!0}return e!==e&&t!==t}var TR=function(t,r){try{return rg(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 IR=wl(TR);/* object-assign (c) Sindre Sorhus @license MIT */var N4=Object.getOwnPropertySymbols,kR=Object.prototype.hasOwnProperty,LR=Object.prototype.propertyIsEnumerable;function PR(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function QR(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;var n=Object.getOwnPropertyNames(t).map(function(s){return t[s]});if(n.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(s){i[s]=s}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var DR=QR()?Object.assign:function(e,t){for(var r,n=PR(e),i,s=1;s=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r},GR=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e},py=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return r===!1?String(t):String(t).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")},zR=function(t){var r=Xc(t,gt.TITLE),n=Xc(t,Wf.TITLE_TEMPLATE);if(n&&r)return n.replace(/%s/g,function(){return Array.isArray(r)?r.join(""):r});var i=Xc(t,Wf.DEFAULT_TITLE);return r||i||void 0},WR=function(t){return Xc(t,Wf.ON_CHANGE_CLIENT_STATE)||function(){}},e2=function(t,r){return r.filter(function(n){return typeof n[t]<"u"}).map(function(n){return n[t]}).reduce(function(n,i){return ti({},n,i)},{})},JR=function(t,r){return r.filter(function(n){return typeof n[gt.BASE]<"u"}).map(function(n){return n[gt.BASE]}).reverse().reduce(function(n,i){if(!n.length)for(var s=Object.keys(i),a=0;a=0;n--){var i=t[n];if(i.hasOwnProperty(r))return i[r]}return null},qR=function(t){return{baseTag:JR([pr.HREF,pr.TARGET],t),bodyAttributes:e2(ZA.BODY,t),defer:Xc(t,Wf.DEFER),encode:Xc(t,Wf.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:e2(ZA.HTML,t),linkTags:_d(gt.LINK,[pr.REL,pr.HREF],t),metaTags:_d(gt.META,[pr.NAME,pr.CHARSET,pr.HTTPEQUIV,pr.PROPERTY,pr.ITEM_PROP],t),noscriptTags:_d(gt.NOSCRIPT,[pr.INNER_HTML],t),onChangeClientState:WR(t),scriptTags:_d(gt.SCRIPT,[pr.SRC,pr.INNER_HTML],t),styleTags:_d(gt.STYLE,[pr.CSS_TEXT],t),title:zR(t),titleAttributes:e2(ZA.TITLE,t)}},my=function(){var e=Date.now();return function(t){var r=Date.now();r-e>16?(e=r,t(r)):setTimeout(function(){my(t)},0)}}(),U4=function(t){return clearTimeout(t)},YR=typeof window<"u"?window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||my:global.requestAnimationFrame||my,XR=typeof window<"u"?window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||U4:global.cancelAnimationFrame||U4,ZR=function(t){return console&&typeof console.warn=="function"&&console.warn(t)},Ud=null,eM=function(t){Ud&&XR(Ud),t.defer?Ud=YR(function(){j4(t,function(){Ud=null})}):(j4(t),Ud=null)},j4=function(t,r){var n=t.baseTag,i=t.bodyAttributes,s=t.htmlAttributes,a=t.linkTags,o=t.metaTags,A=t.noscriptTags,c=t.onChangeClientState,u=t.scriptTags,d=t.styleTags,f=t.title,h=t.titleAttributes;gy(gt.BODY,i),gy(gt.HTML,s),tM(f,h);var v={baseTag:oc(gt.BASE,n),linkTags:oc(gt.LINK,a),metaTags:oc(gt.META,o),noscriptTags:oc(gt.NOSCRIPT,A),scriptTags:oc(gt.SCRIPT,u),styleTags:oc(gt.STYLE,d)},p={},y={};Object.keys(v).forEach(function(g){var w=v[g],b=w.newTags,E=w.oldTags;b.length&&(p[g]=b),E.length&&(y[g]=v[g].oldTags)}),r&&r(),c(t,p,y)},tU=function(t){return Array.isArray(t)?t.join(""):t},tM=function(t,r){typeof t<"u"&&document.title!==t&&(document.title=tU(t)),gy(gt.TITLE,r)},gy=function(t,r){var n=document.getElementsByTagName(t)[0];if(n){for(var i=n.getAttribute(Ss),s=i?i.split(","):[],a=[].concat(s),o=Object.keys(r),A=0;A=0;f--)n.removeAttribute(a[f]);s.length===a.length?n.removeAttribute(Ss):n.getAttribute(Ss)!==o.join(",")&&n.setAttribute(Ss,o.join(","))}},oc=function(t,r){var n=document.head||document.querySelector(gt.HEAD),i=n.querySelectorAll(t+"["+Ss+"]"),s=Array.prototype.slice.call(i),a=[],o=void 0;return r&&r.length&&r.forEach(function(A){var c=document.createElement(t);for(var u in A)if(A.hasOwnProperty(u))if(u===pr.INNER_HTML)c.innerHTML=A.innerHTML;else if(u===pr.CSS_TEXT)c.styleSheet?c.styleSheet.cssText=A.cssText:c.appendChild(document.createTextNode(A.cssText));else{var d=typeof A[u]>"u"?"":A[u];c.setAttribute(u,d)}c.setAttribute(Ss,"true"),s.some(function(f,h){return o=h,c.isEqualNode(f)})?s.splice(o,1):a.push(c)}),s.forEach(function(A){return A.parentNode.removeChild(A)}),a.forEach(function(A){return n.appendChild(A)}),{oldTags:s,newTags:a}},rU=function(t){return Object.keys(t).reduce(function(r,n){var i=typeof t[n]<"u"?n+'="'+t[n]+'"':""+n;return r?r+" "+i:i},"")},rM=function(t,r,n,i){var s=rU(n),a=tU(r);return s?"<"+t+" "+Ss+'="true" '+s+">"+py(a,i)+"":"<"+t+" "+Ss+'="true">'+py(a,i)+""},nM=function(t,r,n){return r.reduce(function(i,s){var a=Object.keys(s).filter(function(c){return!(c===pr.INNER_HTML||c===pr.CSS_TEXT)}).reduce(function(c,u){var d=typeof s[u]>"u"?u:u+'="'+py(s[u],n)+'"';return c?c+" "+d:d},""),o=s.innerHTML||s.cssText||"",A=MR.indexOf(t)===-1;return i+"<"+t+" "+Ss+'="true" '+a+(A?"/>":">"+o+"")},"")},nU=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.keys(t).reduce(function(n,i){return n[Gg[i]||i]=t[i],n},r)},iM=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.keys(t).reduce(function(n,i){return n[RR[i]||i]=t[i],n},r)},sM=function(t,r,n){var i,s=(i={key:r},i[Ss]=!0,i),a=nU(n,s);return[Ct.createElement(gt.TITLE,a,r)]},aM=function(t,r){return r.map(function(n,i){var s,a=(s={key:i},s[Ss]=!0,s);return Object.keys(n).forEach(function(o){var A=Gg[o]||o;if(A===pr.INNER_HTML||A===pr.CSS_TEXT){var c=n.innerHTML||n.cssText;a.dangerouslySetInnerHTML={__html:c}}else a[A]=n[o]}),Ct.createElement(t,a)})},xa=function(t,r,n){switch(t){case gt.TITLE:return{toComponent:function(){return sM(t,r.title,r.titleAttributes)},toString:function(){return rM(t,r.title,r.titleAttributes,n)}};case ZA.BODY:case ZA.HTML:return{toComponent:function(){return nU(r)},toString:function(){return rU(r)}};default:return{toComponent:function(){return aM(t,r)},toString:function(){return nM(t,r,n)}}}},iU=function(t){var r=t.baseTag,n=t.bodyAttributes,i=t.encode,s=t.htmlAttributes,a=t.linkTags,o=t.metaTags,A=t.noscriptTags,c=t.scriptTags,u=t.styleTags,d=t.title,f=d===void 0?"":d,h=t.titleAttributes;return{base:xa(gt.BASE,r,i),bodyAttributes:xa(ZA.BODY,n,i),htmlAttributes:xa(ZA.HTML,s,i),link:xa(gt.LINK,a,i),meta:xa(gt.META,o,i),noscript:xa(gt.NOSCRIPT,A,i),script:xa(gt.SCRIPT,c,i),style:xa(gt.STYLE,u,i),title:xa(gt.TITLE,{title:f,titleAttributes:h},i)}},oM=function(t){var r,n;return n=r=function(i){$R(s,i);function s(){return KR(this,s),GR(this,i.apply(this,arguments))}return s.prototype.shouldComponentUpdate=function(o){return!IR(this.props,o)},s.prototype.mapNestedChildrenToProps=function(o,A){if(!A)return null;switch(o.type){case gt.SCRIPT:case gt.NOSCRIPT:return{innerHTML:A};case gt.STYLE:return{cssText:A}}throw new Error("<"+o.type+" /> elements are self-closing and can not contain children. Refer to our API for more information.")},s.prototype.flattenArrayTypeChildren=function(o){var A,c=o.child,u=o.arrayTypeChildren,d=o.newChildProps,f=o.nestedChildren;return ti({},u,(A={},A[c.type]=[].concat(u[c.type]||[],[ti({},d,this.mapNestedChildrenToProps(c,f))]),A))},s.prototype.mapObjectTypeChildren=function(o){var A,c,u=o.child,d=o.newProps,f=o.newChildProps,h=o.nestedChildren;switch(u.type){case gt.TITLE:return ti({},d,(A={},A[u.type]=h,A.titleAttributes=ti({},f),A));case gt.BODY:return ti({},d,{bodyAttributes:ti({},f)});case gt.HTML:return ti({},d,{htmlAttributes:ti({},f)})}return ti({},d,(c={},c[u.type]=ti({},f),c))},s.prototype.mapArrayTypeChildrenToProps=function(o,A){var c=ti({},A);return Object.keys(o).forEach(function(u){var d;c=ti({},c,(d={},d[u]=o[u],d))}),c},s.prototype.warnOnInvalidChildren=function(o,A){return!0},s.prototype.mapChildrenToProps=function(o,A){var c=this,u={};return Ct.Children.forEach(o,function(d){if(!(!d||!d.props)){var f=d.props,h=f.children,v=_4(f,["children"]),p=iM(v);switch(c.warnOnInvalidChildren(d,h),d.type){case gt.LINK:case gt.META:case gt.NOSCRIPT:case gt.SCRIPT:case gt.STYLE:u=c.flattenArrayTypeChildren({child:d,arrayTypeChildren:u,newChildProps:p,nestedChildren:h});break;default:A=c.mapObjectTypeChildren({child:d,newProps:A,newChildProps:p,nestedChildren:h});break}}}),A=this.mapArrayTypeChildrenToProps(u,A),A},s.prototype.render=function(){var o=this.props,A=o.children,c=_4(o,["children"]),u=ti({},c);return A&&(u=this.mapChildrenToProps(A,u)),Ct.createElement(t,u)},VR(s,null,[{key:"canUseDOM",set:function(o){t.canUseDOM=o}}]),s}(Ct.Component),r.propTypes={base:fr.object,bodyAttributes:fr.object,children:fr.oneOfType([fr.arrayOf(fr.node),fr.node]),defaultTitle:fr.string,defer:fr.bool,encodeSpecialCharacters:fr.bool,htmlAttributes:fr.object,link:fr.arrayOf(fr.object),meta:fr.arrayOf(fr.object),noscript:fr.arrayOf(fr.object),onChangeClientState:fr.func,script:fr.arrayOf(fr.object),style:fr.arrayOf(fr.object),title:fr.string,titleAttributes:fr.object,titleTemplate:fr.string},r.defaultProps={defer:!0,encodeSpecialCharacters:!0},r.peek=t.peek,r.rewind=function(){var i=t.rewind();return i||(i=iU({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}})),i},n},AM=function(){return null},lM=ER(qR,eM,iU)(AM),Jf=oM(lM);Jf.renderStatic=Jf.rewind;function cM(e){if(typeof Proxy>"u")return e;const t=new Map,r=(...n)=>e(...n);return new Proxy(r,{get:(n,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}function H0(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const vy=e=>Array.isArray(e);function sU(e,t){if(!Array.isArray(t))return!1;const r=t.length;if(r!==e.length)return!1;for(let n=0;n{t[0][n]=r.get(),t[1][n]=r.getVelocity()}),t}function Jb(e,t,r,n){if(typeof t=="function"){const[i,s]=T4(n);t=t(r!==void 0?r:e.custom,i,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,s]=T4(n);t=t(r!==void 0?r:e.custom,i,s)}return t}function K0(e,t,r){const n=e.getProps();return Jb(n,t,r!==void 0?r:n.custom,e)}const qb=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Yb=["initial",...qb],wh=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Cl=new Set(wh),La=e=>e*1e3,Pa=e=>e/1e3,uM={type:"spring",stiffness:500,damping:25,restSpeed:10},dM=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),fM={type:"keyframes",duration:.8},hM={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},pM=(e,{keyframes:t})=>t.length>2?fM:Cl.has(e)?e.startsWith("scale")?dM(t[1]):uM:hM;function Xb(e,t){return e?e[t]||e.default||e:void 0}const mM={skipAnimations:!1,useManualTiming:!1},gM=e=>e!==null;function V0(e,{repeat:t,repeatType:r="loop"},n){const i=e.filter(gM),s=t&&r!=="loop"&&t%2===1?0:i.length-1;return!s||n===void 0?i[s]:n}const Fi=e=>e;let aU=Fi;function vM(e){let t=new Set,r=new Set,n=!1,i=!1;const s=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function o(c){s.has(c)&&(A.schedule(c),e()),c(a)}const A={schedule:(c,u=!1,d=!1)=>{const h=d&&n?t:r;return u&&s.add(c),h.has(c)||h.add(c),c},cancel:c=>{r.delete(c),s.delete(c)},process:c=>{if(a=c,n){i=!0;return}n=!0,[t,r]=[r,t],t.forEach(o),t.clear(),n=!1,i&&(i=!1,A.process(c))}};return A}const Gp=["read","resolveKeyframes","update","preRender","render","postRender"],wM=40;function oU(e,t){let r=!1,n=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>r=!0,a=Gp.reduce((g,w)=>(g[w]=vM(s),g),{}),{read:o,resolveKeyframes:A,update:c,preRender:u,render:d,postRender:f}=a,h=()=>{const g=performance.now();r=!1,i.delta=n?1e3/60:Math.max(Math.min(g-i.timestamp,wM),1),i.timestamp=g,i.isProcessing=!0,o.process(i),A.process(i),c.process(i),u.process(i),d.process(i),f.process(i),i.isProcessing=!1,r&&t&&(n=!1,e(h))},v=()=>{r=!0,n=!0,i.isProcessing||e(h)};return{schedule:Gp.reduce((g,w)=>{const b=a[w];return g[w]=(E,L=!1,_=!1)=>(r||v(),b.schedule(E,L,_)),g},{}),cancel:g=>{for(let w=0;w(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,yM=1e-7,xM=12;function bM(e,t,r,n,i){let s,a,o=0;do a=t+(r-t)/2,s=AU(a,n,i)-e,s>0?r=a:t=a;while(Math.abs(s)>yM&&++obM(s,0,1,e,r);return s=>s===0||s===1?s:AU(i(s),t,n)}const lU=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,cU=e=>t=>1-e(1-t),uU=yh(.33,1.53,.69,.99),Zb=cU(uU),dU=lU(Zb),fU=e=>(e*=2)<1?.5*Zb(e):.5*(2-Math.pow(2,-10*(e-1))),eC=e=>1-Math.sin(Math.acos(e)),hU=cU(eC),pU=lU(eC),mU=e=>/^0[^.\s]+$/u.test(e);function CM(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||mU(e):!0}const gU=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),vU=e=>t=>typeof t=="string"&&t.startsWith(e),wU=vU("--"),BM=vU("var(--"),tC=e=>BM(e)?SM.test(e.split("/*")[0].trim()):!1,SM=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,FM=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function EM(e){const t=FM.exec(e);if(!t)return[,];const[,r,n,i]=t;return[`--${r??n}`,i]}function yU(e,t,r=1){const[n,i]=EM(e);if(!n)return;const s=window.getComputedStyle(t).getPropertyValue(n);if(s){const a=s.trim();return gU(a)?parseFloat(a):a}return tC(i)?yU(i,t,r+1):i}const Va=(e,t,r)=>r>t?t:rtypeof e=="number",parse:parseFloat,transform:e=>e},Yf={...Tu,transform:e=>Va(0,1,e)},zp={...Tu,default:1},xh=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),xo=xh("deg"),ta=xh("%"),at=xh("px"),NM=xh("vh"),_M=xh("vw"),I4={...ta,parse:e=>ta.parse(e)/100,transform:e=>ta.transform(e*100)},UM=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),k4=e=>e===Tu||e===at,L4=(e,t)=>parseFloat(e.split(", ")[t]),P4=(e,t)=>(r,{transform:n})=>{if(n==="none"||!n)return 0;const i=n.match(/^matrix3d\((.+)\)$/u);if(i)return L4(i[1],t);{const s=n.match(/^matrix\((.+)\)$/u);return s?L4(s[1],e):0}},jM=new Set(["x","y","z"]),TM=wh.filter(e=>!jM.has(e));function IM(e){const t=[];return TM.forEach(r=>{const n=e.getValue(r);n!==void 0&&(t.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),t}const pu={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:P4(4,13),y:P4(5,14)};pu.translateX=pu.x;pu.translateY=pu.y;const xU=e=>t=>t.test(e),kM={test:e=>e==="auto",parse:e=>e},bU=[Tu,at,ta,xo,_M,NM,kM],Q4=e=>bU.find(xU(e)),el=new Set;let wy=!1,yy=!1;function CU(){if(yy){const e=Array.from(el).filter(n=>n.needsMeasurement),t=new Set(e.map(n=>n.element)),r=new Map;t.forEach(n=>{const i=IM(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(([s,a])=>{var o;(o=n.getValue(s))===null||o===void 0||o.set(a)})}),e.forEach(n=>n.measureEndState()),e.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}yy=!1,wy=!1,el.forEach(e=>e.complete()),el.clear()}function BU(){el.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(yy=!0)})}function LM(){BU(),CU()}class rC{constructor(t,r,n,i,s,a=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=r,this.name=n,this.motionValue=i,this.element=s,this.isAsync=a}scheduleResolve(){this.isScheduled=!0,this.isAsync?(el.add(this),wy||(wy=!0,ur.read(BU),ur.resolveKeyframes(CU))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:r,element:n,motionValue:i}=this;for(let s=0;sMath.round(e*1e5)/1e5,nC=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function PM(e){return e==null}const QM=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,iC=(e,t)=>r=>!!(typeof r=="string"&&QM.test(r)&&r.startsWith(e)||t&&!PM(r)&&Object.prototype.hasOwnProperty.call(r,t)),SU=(e,t,r)=>n=>{if(typeof n!="string")return n;const[i,s,a,o]=n.match(nC);return{[e]:parseFloat(i),[t]:parseFloat(s),[r]:parseFloat(a),alpha:o!==void 0?parseFloat(o):1}},DM=e=>Va(0,255,e),r2={...Tu,transform:e=>Math.round(DM(e))},WA={test:iC("rgb","red"),parse:SU("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+r2.transform(e)+", "+r2.transform(t)+", "+r2.transform(r)+", "+mf(Yf.transform(n))+")"};function OM(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 xy={test:iC("#"),parse:OM,transform:WA.transform},Qc={test:iC("hsl","hue"),parse:SU("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+ta.transform(mf(t))+", "+ta.transform(mf(r))+", "+mf(Yf.transform(n))+")"},Un={test:e=>WA.test(e)||xy.test(e)||Qc.test(e),parse:e=>WA.test(e)?WA.parse(e):Qc.test(e)?Qc.parse(e):xy.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?WA.transform(e):Qc.transform(e)},RM=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function MM(e){var t,r;return isNaN(e)&&typeof e=="string"&&(((t=e.match(nC))===null||t===void 0?void 0:t.length)||0)+(((r=e.match(RM))===null||r===void 0?void 0:r.length)||0)>0}const FU="number",EU="color",HM="var",KM="var(",D4="${}",VM=/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 Xf(e){const t=e.toString(),r=[],n={color:[],number:[],var:[]},i=[];let s=0;const o=t.replace(VM,A=>(Un.test(A)?(n.color.push(s),i.push(EU),r.push(Un.parse(A))):A.startsWith(KM)?(n.var.push(s),i.push(HM),r.push(A)):(n.number.push(s),i.push(FU),r.push(parseFloat(A))),++s,D4)).split(D4);return{values:r,split:o,indexes:n,types:i}}function NU(e){return Xf(e).values}function _U(e){const{split:t,types:r}=Xf(e),n=t.length;return i=>{let s="";for(let a=0;atypeof e=="number"?0:e;function GM(e){const t=NU(e);return _U(e)(t.map($M))}const nA={test:MM,parse:NU,createTransformer:_U,getAnimatableNone:GM},zM=new Set(["brightness","contrast","saturate","opacity"]);function WM(e){const[t,r]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[n]=r.match(nC)||[];if(!n)return e;const i=r.replace(n,"");let s=zM.has(t)?1:0;return n!==r&&(s*=100),t+"("+s+i+")"}const JM=/\b([a-z-]*)\(.*?\)/gu,by={...nA,getAnimatableNone:e=>{const t=e.match(JM);return t?t.map(WM).join(" "):e}},qM={borderWidth:at,borderTopWidth:at,borderRightWidth:at,borderBottomWidth:at,borderLeftWidth:at,borderRadius:at,radius:at,borderTopLeftRadius:at,borderTopRightRadius:at,borderBottomRightRadius:at,borderBottomLeftRadius:at,width:at,maxWidth:at,height:at,maxHeight:at,top:at,right:at,bottom:at,left:at,padding:at,paddingTop:at,paddingRight:at,paddingBottom:at,paddingLeft:at,margin:at,marginTop:at,marginRight:at,marginBottom:at,marginLeft:at,backgroundPositionX:at,backgroundPositionY:at},YM={rotate:xo,rotateX:xo,rotateY:xo,rotateZ:xo,scale:zp,scaleX:zp,scaleY:zp,scaleZ:zp,skew:xo,skewX:xo,skewY:xo,distance:at,translateX:at,translateY:at,translateZ:at,x:at,y:at,z:at,perspective:at,transformPerspective:at,opacity:Yf,originX:I4,originY:I4,originZ:at},O4={...Tu,transform:Math.round},sC={...qM,...YM,zIndex:O4,size:at,fillOpacity:Yf,strokeOpacity:Yf,numOctaves:O4},XM={...sC,color:Un,backgroundColor:Un,outlineColor:Un,fill:Un,stroke:Un,borderColor:Un,borderTopColor:Un,borderRightColor:Un,borderBottomColor:Un,borderLeftColor:Un,filter:by,WebkitFilter:by},aC=e=>XM[e];function UU(e,t){let r=aC(e);return r!==by&&(r=nA),r.getAnimatableNone?r.getAnimatableNone(t):void 0}const ZM=new Set(["auto","none","0"]);function e7(e,t,r){let n=0,i;for(;n{r.getValue(A).set(c)}),this.resolveNoneKeyframes()}}function oC(e){return typeof e=="function"}let ng;function t7(){ng=void 0}const ra={now:()=>(ng===void 0&&ra.set(pn.isProcessing||mM.useManualTiming?pn.timestamp:performance.now()),ng),set:e=>{ng=e,queueMicrotask(t7)}},R4=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(nA.test(e)||e==="0")&&!e.startsWith("url("));function r7(e){const t=e[0];if(e.length===1)return!0;for(let r=0;ri7?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&LM(),this._resolved}onKeyframesResolved(t,r){this.resolvedAt=ra.now(),this.hasAttemptedResolve=!0;const{name:n,type:i,velocity:s,delay:a,onComplete:o,onUpdate:A,isGenerator:c}=this.options;if(!c&&!n7(t,n,i,s))if(a)this.options.duration=0;else{A==null||A(V0(t,this.options,r)),o==null||o(),this.resolveFinishedPromise();return}const u=this.initPlayback(t,r);u!==!1&&(this._resolved={keyframes:t,finalKeyframe:r,...u},this.onPostResolved())}onPostResolved(){}then(t,r){return this.currentFinishedPromise.then(t,r)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const mu=(e,t,r)=>{const n=t-e;return n===0?1:(r-e)/n},IU=(e,t,r=10)=>{let n="";const i=Math.max(Math.round(t/r),2);for(let s=0;s{const u=c*a,d=u*e,f=u-r,h=Cy(c,a),v=Math.exp(-d);return n2-f/h*v},s=c=>{const d=c*a*e,f=d*r+r,h=Math.pow(a,2)*Math.pow(c,2)*e,v=Math.exp(-d),p=Cy(Math.pow(c,2),a);return(-i(c)+n2>0?-1:1)*((f-h)*v)/p}):(i=c=>{const u=Math.exp(-c*e),d=(c-r)*e+1;return-n2+u*d},s=c=>{const u=Math.exp(-c*e),d=(r-c)*(e*e);return u*d});const o=5/e,A=A7(i,s,o);if(e=La(e),isNaN(A))return{stiffness:Er.stiffness,damping:Er.damping,duration:e};{const c=Math.pow(A,2)*n;return{stiffness:c,damping:a*2*Math.sqrt(n*c),duration:e}}}const o7=12;function A7(e,t,r){let n=r;for(let i=1;i=By?1/0:t}const l7=["duration","bounce"],c7=["stiffness","damping","mass"];function M4(e,t){return t.some(r=>e[r]!==void 0)}function u7(e){let t={velocity:Er.velocity,stiffness:Er.stiffness,damping:Er.damping,mass:Er.mass,isResolvedFromDuration:!1,...e};if(!M4(e,c7)&&M4(e,l7))if(e.visualDuration){const r=e.visualDuration,n=2*Math.PI/(r*1.2),i=n*n,s=2*Va(.05,1,1-e.bounce)*Math.sqrt(i);t={...t,mass:Er.mass,stiffness:i,damping:s}}else{const r=a7(e);t={...t,...r,mass:Er.mass},t.isResolvedFromDuration=!0}return t}function QU(e=Er.visualDuration,t=Er.bounce){const r=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:n,restDelta:i}=r;const s=r.keyframes[0],a=r.keyframes[r.keyframes.length-1],o={done:!1,value:s},{stiffness:A,damping:c,mass:u,duration:d,velocity:f,isResolvedFromDuration:h}=u7({...r,velocity:-Pa(r.velocity||0)}),v=f||0,p=c/(2*Math.sqrt(A*u)),y=a-s,g=Pa(Math.sqrt(A/u)),w=Math.abs(y)<5;n||(n=w?Er.restSpeed.granular:Er.restSpeed.default),i||(i=w?Er.restDelta.granular:Er.restDelta.default);let b;if(p<1){const L=Cy(g,p);b=_=>{const k=Math.exp(-p*g*_);return a-k*((v+p*g*y)/L*Math.sin(L*_)+y*Math.cos(L*_))}}else if(p===1)b=L=>a-Math.exp(-g*L)*(y+(v+g*y)*L);else{const L=g*Math.sqrt(p*p-1);b=_=>{const k=Math.exp(-p*g*_),S=Math.min(L*_,300);return a-k*((v+p*g*y)*Math.sinh(S)+L*y*Math.cosh(S))/L}}const E={calculatedDuration:h&&d||null,next:L=>{const _=b(L);if(h)o.done=L>=d;else{let k=0;p<1&&(k=L===0?La(v):LU(b,L,_));const S=Math.abs(k)<=n,I=Math.abs(a-_)<=i;o.done=S&&I}return o.value=o.done?a:_,o},toString:()=>{const L=Math.min(PU(E),By),_=IU(k=>E.next(L*k).value,L,30);return L+"ms "+_}};return E}function H4({keyframes:e,velocity:t=0,power:r=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:a,min:o,max:A,restDelta:c=.5,restSpeed:u}){const d=e[0],f={done:!1,value:d},h=S=>o!==void 0&&SA,v=S=>o===void 0?A:A===void 0||Math.abs(o-S)-p*Math.exp(-S/n),b=S=>g+w(S),E=S=>{const I=w(S),H=b(S);f.done=Math.abs(I)<=c,f.value=f.done?g:H};let L,_;const k=S=>{h(f.value)&&(L=S,_=QU({keyframes:[f.value,v(f.value)],velocity:LU(b,S,f.value),damping:i,stiffness:s,restDelta:c,restSpeed:u}))};return k(0),{calculatedDuration:null,next:S=>{let I=!1;return!_&&L===void 0&&(I=!0,E(S),k(S)),L!==void 0&&S>=L?_.next(S-L):(!I&&E(S),f)}}}const d7=yh(.42,0,1,1),f7=yh(0,0,.58,1),DU=yh(.42,0,.58,1),h7=e=>Array.isArray(e)&&typeof e[0]!="number",AC=e=>Array.isArray(e)&&typeof e[0]=="number",p7={linear:Fi,easeIn:d7,easeInOut:DU,easeOut:f7,circIn:eC,circInOut:pU,circOut:hU,backIn:Zb,backInOut:dU,backOut:uU,anticipate:fU},K4=e=>{if(AC(e)){aU(e.length===4);const[t,r,n,i]=e;return yh(t,r,n,i)}else if(typeof e=="string")return p7[e];return e},m7=(e,t)=>r=>t(e(r)),bh=(...e)=>e.reduce(m7),yr=(e,t,r)=>e+(t-e)*r;function i2(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 g7({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,t/=100,r/=100;let i=0,s=0,a=0;if(!t)i=s=a=r;else{const o=r<.5?r*(1+t):r+t-r*t,A=2*r-o;i=i2(A,o,e+1/3),s=i2(A,o,e),a=i2(A,o,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(a*255),alpha:n}}function zg(e,t){return r=>r>0?t:e}const s2=(e,t,r)=>{const n=e*e,i=r*(t*t-n)+n;return i<0?0:Math.sqrt(i)},v7=[xy,WA,Qc],w7=e=>v7.find(t=>t.test(e));function V4(e){const t=w7(e);if(!t)return!1;let r=t.parse(e);return t===Qc&&(r=g7(r)),r}const $4=(e,t)=>{const r=V4(e),n=V4(t);if(!r||!n)return zg(e,t);const i={...r};return s=>(i.red=s2(r.red,n.red,s),i.green=s2(r.green,n.green,s),i.blue=s2(r.blue,n.blue,s),i.alpha=yr(r.alpha,n.alpha,s),WA.transform(i))},Sy=new Set(["none","hidden"]);function y7(e,t){return Sy.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}function x7(e,t){return r=>yr(e,t,r)}function lC(e){return typeof e=="number"?x7:typeof e=="string"?tC(e)?zg:Un.test(e)?$4:B7:Array.isArray(e)?OU:typeof e=="object"?Un.test(e)?$4:b7:zg}function OU(e,t){const r=[...e],n=r.length,i=e.map((s,a)=>lC(s)(s,t[a]));return s=>{for(let a=0;a{for(const s in n)r[s]=n[s](i);return r}}function C7(e,t){var r;const n=[],i={color:0,var:0,number:0};for(let s=0;s{const r=nA.createTransformer(t),n=Xf(e),i=Xf(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?Sy.has(e)&&!i.values.length||Sy.has(t)&&!n.values.length?y7(e,t):bh(OU(C7(n,i),i.values),r):zg(e,t)};function RU(e,t,r){return typeof e=="number"&&typeof t=="number"&&typeof r=="number"?yr(e,t,r):lC(e)(e,t)}function S7(e,t,r){const n=[],i=r||RU,s=e.length-1;for(let a=0;at[0];if(s===2&&e[0]===e[1])return()=>t[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=S7(t,n,i),o=a.length,A=c=>{let u=0;if(o>1)for(;uA(Va(e[0],e[s-1],c)):A}function E7(e,t){const r=e[e.length-1];for(let n=1;n<=t;n++){const i=mu(0,t,n);e.push(yr(r,1,i))}}function N7(e){const t=[0];return E7(t,e.length-1),t}function _7(e,t){return e.map(r=>r*t)}function U7(e,t){return e.map(()=>t||DU).splice(0,e.length-1)}function Wg({duration:e=300,keyframes:t,times:r,ease:n="easeInOut"}){const i=h7(n)?n.map(K4):K4(n),s={done:!1,value:t[0]},a=_7(r&&r.length===t.length?r:N7(t),e),o=F7(a,t,{ease:Array.isArray(i)?i:U7(t,i)});return{calculatedDuration:e,next:A=>(s.value=o(A),s.done=A>=e,s)}}const j7=e=>{const t=({timestamp:r})=>e(r);return{start:()=>ur.update(t,!0),stop:()=>rA(t),now:()=>pn.isProcessing?pn.timestamp:ra.now()}},T7={decay:H4,inertia:H4,tween:Wg,keyframes:Wg,spring:QU},I7=e=>e/100;class cC extends TU{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:A}=this.options;A&&A()};const{name:r,motionValue:n,element:i,keyframes:s}=this.options,a=(i==null?void 0:i.KeyframeResolver)||rC,o=(A,c)=>this.onKeyframesResolved(A,c);this.resolver=new a(s,o,r,n,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:r="keyframes",repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:a=0}=this.options,o=oC(r)?r:T7[r]||Wg;let A,c;o!==Wg&&typeof t[0]!="number"&&(A=bh(I7,RU(t[0],t[1])),t=[0,100]);const u=o({...this.options,keyframes:t});s==="mirror"&&(c=o({...this.options,keyframes:[...t].reverse(),velocity:-a})),u.calculatedDuration===null&&(u.calculatedDuration=PU(u));const{calculatedDuration:d}=u,f=d+i,h=f*(n+1)-i;return{generator:u,mirroredGenerator:c,mapPercentToKeyframes:A,calculatedDuration:d,resolvedDuration:f,totalDuration:h}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,r=!1){const{resolved:n}=this;if(!n){const{keyframes:S}=this.options;return{done:!0,value:S[S.length-1]}}const{finalKeyframe:i,generator:s,mirroredGenerator:a,mapPercentToKeyframes:o,keyframes:A,calculatedDuration:c,totalDuration:u,resolvedDuration:d}=n;if(this.startTime===null)return s.next(0);const{delay:f,repeat:h,repeatType:v,repeatDelay:p,onUpdate:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),r?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const g=this.currentTime-f*(this.speed>=0?1:-1),w=this.speed>=0?g<0:g>u;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let b=this.currentTime,E=s;if(h){const S=Math.min(this.currentTime,u)/d;let I=Math.floor(S),H=S%1;!H&&S>=1&&(H=1),H===1&&I--,I=Math.min(I,h+1),!!(I%2)&&(v==="reverse"?(H=1-H,p&&(H-=p/d)):v==="mirror"&&(E=a)),b=Va(0,1,H)*d}const L=w?{done:!1,value:A[0]}:E.next(b);o&&(L.value=o(L.value));let{done:_}=L;!w&&c!==null&&(_=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const k=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&_);return k&&i!==void 0&&(L.value=V0(A,this.options,i)),y&&y(L.value),k&&this.finish(),L}get duration(){const{resolved:t}=this;return t?Pa(t.calculatedDuration):0}get time(){return Pa(this.currentTime)}set time(t){t=La(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const r=this.playbackSpeed!==t;this.playbackSpeed=t,r&&(this.time=Pa(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=j7,onPlay:r,startTime:n}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),r&&r();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=n??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const k7=new Set(["opacity","clipPath","filter","transform"]);function uC(e){let t;return()=>(t===void 0&&(t=e()),t)}const L7={linearEasing:void 0};function P7(e,t){const r=uC(e);return()=>{var n;return(n=L7[t])!==null&&n!==void 0?n:r()}}const Jg=P7(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");function MU(e){return!!(typeof e=="function"&&Jg()||!e||typeof e=="string"&&(e in Fy||Jg())||AC(e)||Array.isArray(e)&&e.every(MU))}const zd=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`,Fy={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:zd([0,.65,.55,1]),circOut:zd([.55,0,1,.45]),backIn:zd([.31,.01,.66,-.59]),backOut:zd([.33,1.53,.69,.99])};function HU(e,t){if(e)return typeof e=="function"&&Jg()?IU(e,t):AC(e)?zd(e):Array.isArray(e)?e.map(r=>HU(r,t)||Fy.easeOut):Fy[e]}function Q7(e,t,r,{delay:n=0,duration:i=300,repeat:s=0,repeatType:a="loop",ease:o="easeInOut",times:A}={}){const c={[t]:r};A&&(c.offset=A);const u=HU(o,i);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:n,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:s+1,direction:a==="reverse"?"alternate":"normal"})}function G4(e,t){e.timeline=t,e.onfinish=null}const D7=uC(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),qg=10,O7=2e4;function R7(e){return oC(e.type)||e.type==="spring"||!MU(e.ease)}function M7(e,t){const r=new cC({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let n={done:!1,value:e[0]};const i=[];let s=0;for(;!n.done&&sthis.onKeyframesResolved(a,o),r,n,i),this.resolver.scheduleResolve()}initPlayback(t,r){var n;let{duration:i=300,times:s,ease:a,type:o,motionValue:A,name:c,startTime:u}=this.options;if(!(!((n=A.owner)===null||n===void 0)&&n.current))return!1;if(typeof a=="string"&&Jg()&&H7(a)&&(a=KU[a]),R7(this.options)){const{onComplete:f,onUpdate:h,motionValue:v,element:p,...y}=this.options,g=M7(t,y);t=g.keyframes,t.length===1&&(t[1]=t[0]),i=g.duration,s=g.times,a=g.ease,o="keyframes"}const d=Q7(A.owner.current,c,t,{...this.options,duration:i,times:s,ease:a});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(G4(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;A.set(V0(t,this.options,r)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:i,times:s,type:o,ease:a,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:r}=t;return Pa(r)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:r}=t;return Pa(r.currentTime||0)}set time(t){const{resolved:r}=this;if(!r)return;const{animation:n}=r;n.currentTime=La(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:r}=t;return r.playbackRate}set speed(t){const{resolved:r}=this;if(!r)return;const{animation:n}=r;n.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:r}=t;return r.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:r}=t;return r.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:r}=this;if(!r)return Fi;const{animation:n}=r;G4(n,t)}return Fi}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:r}=t;r.playState==="finished"&&this.updateFinishedPromise(),r.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:r}=t;r.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:r,keyframes:n,duration:i,type:s,ease:a,times:o}=t;if(r.playState==="idle"||r.playState==="finished")return;if(this.time){const{motionValue:c,onUpdate:u,onComplete:d,element:f,...h}=this.options,v=new cC({...h,keyframes:n,duration:i,type:s,ease:a,times:o,isGenerator:!0}),p=La(this.time);c.setWithVelocity(v.sample(p-qg).value,v.sample(p).value,qg)}const{onStop:A}=this.options;A&&A(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:r,name:n,repeatDelay:i,repeatType:s,damping:a,type:o}=t;return D7()&&n&&k7.has(n)&&r&&r.owner&&r.owner.current instanceof HTMLElement&&!r.owner.getProps().onUpdate&&!i&&s!=="mirror"&&a!==0&&o!=="inertia"}}const K7=uC(()=>window.ScrollTimeline!==void 0);class V7{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}then(t,r){return Promise.all(this.animations).then(t).catch(r)}getAll(t){return this.animations[0][t]}setAll(t,r){for(let n=0;nK7()&&i.attachTimeline?i.attachTimeline(t):r(i));return()=>{n.forEach((i,s)=>{i&&i(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let r=0;rr[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function $7({when:e,delay:t,delayChildren:r,staggerChildren:n,staggerDirection:i,repeat:s,repeatType:a,repeatDelay:o,from:A,elapsed:c,...u}){return!!Object.keys(u).length}const dC=(e,t,r,n={},i,s)=>a=>{const o=Xb(n,e)||{},A=o.delay||n.delay||0;let{elapsed:c=0}=n;c=c-La(A);let u={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:t.getVelocity(),...o,delay:-c,onUpdate:f=>{t.set(f),o.onUpdate&&o.onUpdate(f)},onComplete:()=>{a(),o.onComplete&&o.onComplete()},name:e,motionValue:t,element:s?void 0:i};$7(o)||(u={...u,...pM(e,u)}),u.duration&&(u.duration=La(u.duration)),u.repeatDelay&&(u.repeatDelay=La(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(d=!0)),d&&!s&&t.get()!==void 0){const f=V0(u.keyframes,o);if(f!==void 0)return ur.update(()=>{u.onUpdate(f),u.onComplete()}),new V7([])}return!s&&z4.supports(u)?new z4(u):new cC(u)},G7=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),z7=e=>vy(e)?e[e.length-1]||0:e;function fC(e,t){e.indexOf(t)===-1&&e.push(t)}function hC(e,t){const r=e.indexOf(t);r>-1&&e.splice(r,1)}class pC{constructor(){this.subscriptions=[]}add(t){return fC(this.subscriptions,t),()=>hC(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 s=0;s!isNaN(parseFloat(e));class J7{constructor(t,r={}){this.version="11.15.0",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(n,i=!0)=>{const s=ra.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=r.owner}setCurrent(t){this.current=t,this.updatedAt=ra.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=W7(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 pC);const n=this.events[t].add(r);return t==="change"?()=>{n(),ur.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,r=!0){!r||!this.passiveEffect?this.updateAndNotify(t,r):this.passiveEffect(t,this.updateAndNotify)}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()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=ra.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>W4)return 0;const r=Math.min(this.updatedAt-this.prevUpdatedAt,W4);return kU(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(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Zf(e,t){return new J7(e,t)}function q7(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,Zf(r))}function Y7(e,t){const r=K0(e,t);let{transitionEnd:n={},transition:i={},...s}=r||{};s={...s,...n};for(const a in s){const o=z7(s[a]);q7(e,a,o)}}const mC=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),X7="framerAppearId",VU="data-"+mC(X7);function $U(e){return e.props[VU]}const Ln=e=>!!(e&&e.getVelocity);function Z7(e){return!!(Ln(e)&&e.add)}function Ey(e,t){const r=e.getValue("willChange");if(Z7(r))return r.add(t)}function eH({protectedKeys:e,needsAnimating:t},r){const n=e.hasOwnProperty(r)&&t[r]!==!0;return t[r]=!1,n}function GU(e,t,{delay:r=0,transitionOverride:n,type:i}={}){var s;let{transition:a=e.getDefaultTransition(),transitionEnd:o,...A}=t;n&&(a=n);const c=[],u=i&&e.animationState&&e.animationState.getState()[i];for(const d in A){const f=e.getValue(d,(s=e.latestValues[d])!==null&&s!==void 0?s:null),h=A[d];if(h===void 0||u&&eH(u,d))continue;const v={delay:r,...Xb(a||{},d)};let p=!1;if(window.MotionHandoffAnimation){const g=$U(e);if(g){const w=window.MotionHandoffAnimation(g,d,ur);w!==null&&(v.startTime=w,p=!0)}}Ey(e,d),f.start(dC(d,f,h,e.shouldReduceMotion&&Cl.has(d)?{type:!1}:v,e,p));const y=f.animation;y&&c.push(y)}return o&&Promise.all(c).then(()=>{ur.update(()=>{o&&Y7(e,o)})}),c}function Ny(e,t,r={}){var n;const i=K0(e,t,r.type==="exit"?(n=e.presenceContext)===null||n===void 0?void 0:n.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=i||{};r.transitionOverride&&(s=r.transitionOverride);const a=i?()=>Promise.all(GU(e,i,r)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:f}=s;return tH(e,t,u+c,d,f,r)}:()=>Promise.resolve(),{when:A}=s;if(A){const[c,u]=A==="beforeChildren"?[a,o]:[o,a];return c().then(()=>u())}else return Promise.all([a(),o(r.delay)])}function tH(e,t,r=0,n=0,i=1,s){const a=[],o=(e.variantChildren.size-1)*n,A=i===1?(c=0)=>c*n:(c=0)=>o-c*n;return Array.from(e.variantChildren).sort(rH).forEach((c,u)=>{c.notify("AnimationStart",t),a.push(Ny(c,t,{...s,delay:r+A(u)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(a)}function rH(e,t){return e.sortNodePosition(t)}function nH(e,t,r={}){e.notify("AnimationStart",t);let n;if(Array.isArray(t)){const i=t.map(s=>Ny(e,s,r));n=Promise.all(i)}else if(typeof t=="string")n=Ny(e,t,r);else{const i=typeof t=="function"?K0(e,t,r.custom):t;n=Promise.all(GU(e,i,r))}return n.then(()=>{e.notify("AnimationComplete",t)})}const iH=Yb.length;function zU(e){if(!e)return;if(!e.isControllingVariants){const r=e.parent?zU(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})=>nH(e,r,n)))}function AH(e){let t=oH(e),r=J4(),n=!0;const i=A=>(c,u)=>{var d;const f=K0(e,u,A==="exit"?(d=e.presenceContext)===null||d===void 0?void 0:d.custom:void 0);if(f){const{transition:h,transitionEnd:v,...p}=f;c={...c,...p,...v}}return c};function s(A){t=A(e)}function a(A){const{props:c}=e,u=zU(e.parent)||{},d=[],f=new Set;let h={},v=1/0;for(let y=0;yv&&E,I=!1;const H=Array.isArray(b)?b:[b];let N=H.reduce(i(g),{});L===!1&&(N={});const{prevResolvedValues:j={}}=w,R={...j,...N},T=P=>{S=!0,f.has(P)&&(I=!0,f.delete(P)),w.needsAnimating[P]=!0;const M=e.getValue(P);M&&(M.liveStyle=!1)};for(const P in R){const M=N[P],$=j[P];if(h.hasOwnProperty(P))continue;let X=!1;vy(M)&&vy($)?X=!sU(M,$):X=M!==$,X?M!=null?T(P):f.add(P):M!==void 0&&f.has(P)?T(P):w.protectedKeys[P]=!0}w.prevProp=b,w.prevResolvedValues=N,w.isActive&&(h={...h,...N}),n&&e.blockInitialAnimation&&(S=!1),S&&(!(_&&k)||I)&&d.push(...H.map(P=>({animation:P,options:{type:g}})))}if(f.size){const y={};f.forEach(g=>{const w=e.getBaseTarget(g),b=e.getValue(g);b&&(b.liveStyle=!0),y[g]=w??null}),d.push({animation:y})}let p=!!d.length;return n&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(p=!1),n=!1,p?t(d):Promise.resolve()}function o(A,c){var u;if(r[A].isActive===c)return Promise.resolve();(u=e.variantChildren)===null||u===void 0||u.forEach(f=>{var h;return(h=f.animationState)===null||h===void 0?void 0:h.setActive(A,c)}),r[A].isActive=c;const d=a(A);for(const f in r)r[f].protectedKeys={};return d}return{animateChanges:a,setActive:o,setAnimateFunction:s,getState:()=>r,reset:()=>{r=J4(),n=!0}}}function lH(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!sU(t,e):!1}function TA(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function J4(){return{animate:TA(!0),whileInView:TA(),whileHover:TA(),whileTap:TA(),whileDrag:TA(),whileFocus:TA(),exit:TA()}}class hA{constructor(t){this.isMounted=!1,this.node=t}update(){}}class cH extends hA{constructor(t){super(t),t.animationState||(t.animationState=AH(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();H0(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===void 0||t.call(this)}}let uH=0;class dH extends hA{constructor(){super(...arguments),this.id=uH++}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}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const fH={animation:{Feature:cH},exit:{Feature:dH}},gs={x:!1,y:!1};function WU(){return gs.x||gs.y}function hH(e,t,r){var n;if(e instanceof Element)return[e];if(typeof e=="string"){let i=document;t&&(i=t.current);const s=(n=r==null?void 0:r[e])!==null&&n!==void 0?n:i.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}function JU(e,t){const r=hH(e),n=new AbortController,i={passive:!0,...t,signal:n.signal};return[r,i,()=>n.abort()]}function q4(e){return t=>{t.pointerType==="touch"||WU()||e(t)}}function pH(e,t,r={}){const[n,i,s]=JU(e,r),a=q4(o=>{const{target:A}=o,c=t(o);if(!c||!A)return;const u=q4(d=>{c(d),A.removeEventListener("pointerleave",u)});A.addEventListener("pointerleave",u,i)});return n.forEach(o=>{o.addEventListener("pointerenter",a,i)}),s}const gC=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Wd=new WeakSet;function Y4(e){return t=>{t.key==="Enter"&&e(t)}}function a2(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const mH=(e,t)=>{const r=e.currentTarget;if(!r)return;const n=Y4(()=>{if(Wd.has(r))return;a2(r,"down");const i=Y4(()=>{a2(r,"up")}),s=()=>a2(r,"cancel");r.addEventListener("keyup",i,t),r.addEventListener("blur",s,t)});r.addEventListener("keydown",n,t),r.addEventListener("blur",()=>r.removeEventListener("keydown",n),t)},gH=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function vH(e){return gH.has(e.tagName)||e.tabIndex!==-1}const qU=(e,t)=>t?e===t?!0:qU(e,t.parentElement):!1;function X4(e){return gC(e)&&!WU()}function wH(e,t,r={}){const[n,i,s]=JU(e,r),a=o=>{const A=o.currentTarget;if(!X4(o)||Wd.has(A))return;Wd.add(A);const c=t(o),u=(h,v)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),!(!X4(h)||!Wd.has(A))&&(Wd.delete(A),c&&c(h,{success:v}))},d=h=>{u(h,r.useGlobalTarget||qU(A,h.target))},f=h=>{u(h,!1)};window.addEventListener("pointerup",d,i),window.addEventListener("pointercancel",f,i)};return n.forEach(o=>{vH(o)||(o.tabIndex=0),(r.useGlobalTarget?window:o).addEventListener("pointerdown",a,i),o.addEventListener("focus",c=>mH(c,i),i)}),s}function yH(e){return e==="x"||e==="y"?gs[e]?null:(gs[e]=!0,()=>{gs[e]=!1}):gs.x||gs.y?null:(gs.x=gs.y=!0,()=>{gs.x=gs.y=!1})}function Ch(e){return{point:{x:e.pageX,y:e.pageY}}}const xH=e=>t=>gC(t)&&e(t,Ch(t));function eh(e,t,r,n={passive:!0}){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r)}function gf(e,t,r,n){return eh(e,t,xH(r),n)}const Z4=(e,t)=>Math.abs(e-t);function bH(e,t){const r=Z4(e.x,t.x),n=Z4(e.y,t.y);return Math.sqrt(r**2+n**2)}class YU{constructor(t,r,{transformPagePoint:n,contextWindow:i,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=A2(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,h=bH(d.offset,{x:0,y:0})>=3;if(!f&&!h)return;const{point:v}=d,{timestamp:p}=pn;this.history.push({...v,timestamp:p});const{onStart:y,onMove:g}=this.handlers;f||(y&&y(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,d)},this.handlePointerMove=(d,f)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=o2(f,this.transformPagePoint),ur.update(this.updatePoint,!0)},this.handlePointerUp=(d,f)=>{this.end();const{onEnd:h,onSessionEnd:v,resumeAnimation:p}=this.handlers;if(this.dragSnapToOrigin&&p&&p(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=A2(d.type==="pointercancel"?this.lastMoveEventInfo:o2(f,this.transformPagePoint),this.history);this.startEvent&&h&&h(d,y),v&&v(d,y)},!gC(t))return;this.dragSnapToOrigin=s,this.handlers=r,this.transformPagePoint=n,this.contextWindow=i||window;const a=Ch(t),o=o2(a,this.transformPagePoint),{point:A}=o,{timestamp:c}=pn;this.history=[{...A,timestamp:c}];const{onSessionStart:u}=r;u&&u(t,A2(o,this.history)),this.removeListeners=bh(gf(this.contextWindow,"pointermove",this.handlePointerMove),gf(this.contextWindow,"pointerup",this.handlePointerUp),gf(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),rA(this.updatePoint)}}function o2(e,t){return t?{point:t(e.point)}:e}function eS(e,t){return{x:e.x-t.x,y:e.y-t.y}}function A2({point:e},t){return{point:e,delta:eS(e,XU(t)),offset:eS(e,CH(t)),velocity:BH(t,.1)}}function CH(e){return e[0]}function XU(e){return e[e.length-1]}function BH(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,n=null;const i=XU(e);for(;r>=0&&(n=e[r],!(i.timestamp-n.timestamp>La(t)));)r--;if(!n)return{x:0,y:0};const s=Pa(i.timestamp-n.timestamp);if(s===0)return{x:0,y:0};const a={x:(i.x-n.x)/s,y:(i.y-n.y)/s};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function Dc(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}const ZU=1e-4,SH=1-ZU,FH=1+ZU,ej=.01,EH=0-ej,NH=0+ej;function Ui(e){return e.max-e.min}function _H(e,t,r){return Math.abs(e-t)<=r}function tS(e,t,r,n=.5){e.origin=n,e.originPoint=yr(t.min,t.max,e.origin),e.scale=Ui(r)/Ui(t),e.translate=yr(r.min,r.max,e.origin)-e.originPoint,(e.scale>=SH&&e.scale<=FH||isNaN(e.scale))&&(e.scale=1),(e.translate>=EH&&e.translate<=NH||isNaN(e.translate))&&(e.translate=0)}function vf(e,t,r,n){tS(e.x,t.x,r.x,n?n.originX:void 0),tS(e.y,t.y,r.y,n?n.originY:void 0)}function rS(e,t,r){e.min=r.min+t.min,e.max=e.min+Ui(t)}function UH(e,t,r){rS(e.x,t.x,r.x),rS(e.y,t.y,r.y)}function nS(e,t,r){e.min=t.min-r.min,e.max=e.min+Ui(t)}function wf(e,t,r){nS(e.x,t.x,r.x),nS(e.y,t.y,r.y)}function jH(e,{min:t,max:r},n){return t!==void 0&&er&&(e=n?yr(r,e,n.max):Math.min(e,r)),e}function iS(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 TH(e,{top:t,left:r,bottom:n,right:i}){return{x:iS(e.x,r,i),y:iS(e.y,t,n)}}function sS(e,t){let r=t.min-e.min,n=t.max-e.max;return t.max-t.minn?r=mu(t.min,t.max-n,e.min):n>i&&(r=mu(e.min,e.max-i,t.min)),Va(0,1,r)}function LH(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 _y=.35;function PH(e=_y){return e===!1?e=0:e===!0&&(e=_y),{x:aS(e,"left","right"),y:aS(e,"top","bottom")}}function aS(e,t,r){return{min:oS(e,t),max:oS(e,r)}}function oS(e,t){return typeof e=="number"?e:e[t]||0}const AS=()=>({translate:0,scale:1,origin:0,originPoint:0}),Oc=()=>({x:AS(),y:AS()}),lS=()=>({min:0,max:0}),Ir=()=>({x:lS(),y:lS()});function Vi(e){return[e("x"),e("y")]}function tj({top:e,left:t,right:r,bottom:n}){return{x:{min:t,max:r},y:{min:e,max:n}}}function QH({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function DH(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 l2(e){return e===void 0||e===1}function Uy({scale:e,scaleX:t,scaleY:r}){return!l2(e)||!l2(t)||!l2(r)}function DA(e){return Uy(e)||rj(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function rj(e){return cS(e.x)||cS(e.y)}function cS(e){return e&&e!=="0%"}function Yg(e,t,r){const n=e-r,i=t*n;return r+i}function uS(e,t,r,n,i){return i!==void 0&&(e=Yg(e,i,n)),Yg(e,r,n)+t}function jy(e,t=0,r=1,n,i){e.min=uS(e.min,t,r,n,i),e.max=uS(e.max,t,r,n,i)}function nj(e,{x:t,y:r}){jy(e.x,t.translate,t.scale,t.originPoint),jy(e.y,r.translate,r.scale,r.originPoint)}const dS=.999999999999,fS=1.0000000000001;function OH(e,t,r,n=!1){const i=r.length;if(!i)return;t.x=t.y=1;let s,a;for(let o=0;odS&&(t.x=1),t.ydS&&(t.y=1)}function Rc(e,t){e.min=e.min+t,e.max=e.max+t}function hS(e,t,r,n,i=.5){const s=yr(e.min,e.max,i);jy(e,t,r,s,n)}function Mc(e,t){hS(e.x,t.x,t.scaleX,t.scale,t.originX),hS(e.y,t.y,t.scaleY,t.scale,t.originY)}function ij(e,t){return tj(DH(e.getBoundingClientRect(),t))}function RH(e,t,r){const n=ij(e,r),{scroll:i}=t;return i&&(Rc(n.x,i.offset.x),Rc(n.y,i.offset.y)),n}const sj=({current:e})=>e?e.ownerDocument.defaultView:null,MH=new WeakMap;class HH{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=Ir(),this.visualElement=t}start(t,{snapToCursor:r=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&n.isPresent===!1)return;const i=u=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),r&&this.snapToCursor(Ch(u).point)},s=(u,d)=>{const{drag:f,dragPropagation:h,onDragStart:v}=this.getProps();if(f&&!h&&(this.openDragLock&&this.openDragLock(),this.openDragLock=yH(f),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Vi(y=>{let g=this.getAxisMotionValue(y).get()||0;if(ta.test(g)){const{projection:w}=this.visualElement;if(w&&w.layout){const b=w.layout.layoutBox[y];b&&(g=Ui(b)*(parseFloat(g)/100))}}this.originPoint[y]=g}),v&&ur.postRender(()=>v(u,d)),Ey(this.visualElement,"transform");const{animationState:p}=this.visualElement;p&&p.setActive("whileDrag",!0)},a=(u,d)=>{const{dragPropagation:f,dragDirectionLock:h,onDirectionLock:v,onDrag:p}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:y}=d;if(h&&this.currentDirection===null){this.currentDirection=KH(y),this.currentDirection!==null&&v&&v(this.currentDirection);return}this.updateAxis("x",d.point,y),this.updateAxis("y",d.point,y),this.visualElement.render(),p&&p(u,d)},o=(u,d)=>this.stop(u,d),A=()=>Vi(u=>{var d;return this.getAnimationState(u)==="paused"&&((d=this.getAxisMotionValue(u).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new YU(t,{onSessionStart:i,onStart:s,onMove:a,onSessionEnd:o,resumeAnimation:A},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:sj(this.visualElement)})}stop(t,r){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:i}=r;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&ur.postRender(()=>s(t,r))}cancel(){this.isDragging=!1;const{projection:t,animationState:r}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),r&&r.setActive("whileDrag",!1)}updateAxis(t,r,n){const{drag:i}=this.getProps();if(!n||!Wp(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let a=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(a=jH(a,this.constraints[t],this.elastic[t])),s.set(a)}resolveConstraints(){var t;const{dragConstraints:r,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,s=this.constraints;r&&Dc(r)?this.constraints||(this.constraints=this.resolveRefConstraints()):r&&i?this.constraints=TH(i.layoutBox,r):this.constraints=!1,this.elastic=PH(n),s!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Vi(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=LH(i.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:r}=this.getProps();if(!t||!Dc(t))return!1;const n=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=RH(n,i.root,this.visualElement.getTransformPagePoint());let a=IH(i.layout.layoutBox,s);if(r){const o=r(QH(a));this.hasMutatedConstraints=!!o,o&&(a=tj(o))}return a}startAnimation(t){const{drag:r,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),A=this.constraints||{},c=Vi(u=>{if(!Wp(u,r,this.currentDirection))return;let d=A&&A[u]||{};a&&(d={min:0,max:0});const f=i?200:1e6,h=i?40:1e7,v={type:"inertia",velocity:n?t[u]:0,bounceStiffness:f,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...s,...d};return this.startAxisValueAnimation(u,v)});return Promise.all(c).then(o)}startAxisValueAnimation(t,r){const n=this.getAxisMotionValue(t);return Ey(this.visualElement,t),n.start(dC(t,n,0,r,this.visualElement,!1))}stopAnimation(){Vi(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Vi(t=>{var r;return(r=this.getAxisMotionValue(t).animation)===null||r===void 0?void 0:r.pause()})}getAnimationState(t){var r;return(r=this.getAxisMotionValue(t).animation)===null||r===void 0?void 0:r.state}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){Vi(r=>{const{drag:n}=this.getProps();if(!Wp(r,n,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(r);if(i&&i.layout){const{min:a,max:o}=i.layout.layoutBox[r];s.set(t[r]-yr(a,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:r}=this.getProps(),{projection:n}=this.visualElement;if(!Dc(r)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Vi(a=>{const o=this.getAxisMotionValue(a);if(o&&this.constraints!==!1){const A=o.get();i[a]=kH({min:A,max:A},this.constraints[a])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Vi(a=>{if(!Wp(a,t,null))return;const o=this.getAxisMotionValue(a),{min:A,max:c}=this.constraints[a];o.set(yr(A,c,i[a]))})}addListeners(){if(!this.visualElement.current)return;MH.set(this.visualElement,this);const t=this.visualElement.current,r=gf(t,"pointerdown",A=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(A)}),n=()=>{const{dragConstraints:A}=this.getProps();Dc(A)&&A.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",n);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),ur.read(n);const a=eh(window,"resize",()=>this.scalePositionWithinConstraints()),o=i.addEventListener("didUpdate",({delta:A,hasLayoutChanged:c})=>{this.isDragging&&c&&(Vi(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=A[u].translate,d.set(d.get()+A[u].translate))}),this.visualElement.render())});return()=>{a(),r(),s(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:a=_y,dragMomentum:o=!0}=t;return{...t,drag:r,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:a,dragMomentum:o}}}function Wp(e,t,r){return(t===!0||t===e)&&(r===null||r===e)}function KH(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}class VH extends hA{constructor(t){super(t),this.removeGroupControls=Fi,this.removeListeners=Fi,this.controls=new HH(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Fi}unmount(){this.removeGroupControls(),this.removeListeners()}}const pS=e=>(t,r)=>{e&&ur.postRender(()=>e(t,r))};class $H extends hA{constructor(){super(...arguments),this.removePointerDownListener=Fi}onPointerDown(t){this.session=new YU(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:sj(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:r,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:pS(t),onStart:pS(r),onMove:n,onEnd:(s,a)=>{delete this.session,i&&ur.postRender(()=>i(s,a))}}}mount(){this.removePointerDownListener=gf(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const $0=C.createContext(null);function GH(){const e=C.useContext($0);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:r,register:n}=e,i=C.useId();C.useEffect(()=>n(i),[]);const s=C.useCallback(()=>r&&r(i),[i,r]);return!t&&r?[!1,s]:[!0]}const vC=C.createContext({}),aj=C.createContext({}),ig={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function mS(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const jd={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(at.test(e))e=parseFloat(e);else return e;const r=mS(e,t.target.x),n=mS(e,t.target.y);return`${r}% ${n}%`}},zH={correct:(e,{treeScale:t,projectionDelta:r})=>{const n=e,i=nA.parse(e);if(i.length>5)return n;const s=nA.createTransformer(e),a=typeof i[0]!="number"?1:0,o=r.x.scale*t.x,A=r.y.scale*t.y;i[0+a]/=o,i[1+a]/=A;const c=yr(o,A,.5);return typeof i[2+a]=="number"&&(i[2+a]/=c),typeof i[3+a]=="number"&&(i[3+a]/=c),s(i)}},Xg={};function WH(e){Object.assign(Xg,e)}const{schedule:wC,cancel:uoe}=oU(queueMicrotask,!1);class JH extends C.Component{componentDidMount(){const{visualElement:t,layoutGroup:r,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=t;WH(qH),s&&(r.group&&r.group.add(s),n&&n.register&&i&&n.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),ig.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:r,visualElement:n,drag:i,isPresent:s}=this.props,a=n.projection;return a&&(a.isPresent=s,i||t.layoutDependency!==r||r===void 0?a.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?a.promote():a.relegate()||ur.postRender(()=>{const o=a.getStack();(!o||!o.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),wC.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:r,switchLayoutGroup:n}=this.props,{projection:i}=t;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 oj(e){const[t,r]=GH(),n=C.useContext(vC);return l.jsx(JH,{...e,layoutGroup:n,switchLayoutGroup:C.useContext(aj),isPresent:t,safeToRemove:r})}const qH={borderRadius:{...jd,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:jd,borderTopRightRadius:jd,borderBottomLeftRadius:jd,borderBottomRightRadius:jd,boxShadow:zH},Aj=["TopLeft","TopRight","BottomLeft","BottomRight"],YH=Aj.length,gS=e=>typeof e=="string"?parseFloat(e):e,vS=e=>typeof e=="number"||at.test(e);function XH(e,t,r,n,i,s){i?(e.opacity=yr(0,r.opacity!==void 0?r.opacity:1,ZH(n)),e.opacityExit=yr(t.opacity!==void 0?t.opacity:1,0,e9(n))):s&&(e.opacity=yr(t.opacity!==void 0?t.opacity:1,r.opacity!==void 0?r.opacity:1,n));for(let a=0;ant?1:r(mu(e,t,n))}function yS(e,t){e.min=t.min,e.max=t.max}function Hi(e,t){yS(e.x,t.x),yS(e.y,t.y)}function xS(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function bS(e,t,r,n,i){return e-=t,e=Yg(e,1/r,n),i!==void 0&&(e=Yg(e,1/i,n)),e}function t9(e,t=0,r=1,n=.5,i,s=e,a=e){if(ta.test(t)&&(t=parseFloat(t),t=yr(a.min,a.max,t/100)-a.min),typeof t!="number")return;let o=yr(s.min,s.max,n);e===s&&(o-=t),e.min=bS(e.min,t,r,o,i),e.max=bS(e.max,t,r,o,i)}function CS(e,t,[r,n,i],s,a){t9(e,t[r],t[n],t[i],t.scale,s,a)}const r9=["x","scaleX","originX"],n9=["y","scaleY","originY"];function BS(e,t,r,n){CS(e.x,t,r9,r?r.x:void 0,n?n.x:void 0),CS(e.y,t,n9,r?r.y:void 0,n?n.y:void 0)}function SS(e){return e.translate===0&&e.scale===1}function cj(e){return SS(e.x)&&SS(e.y)}function FS(e,t){return e.min===t.min&&e.max===t.max}function i9(e,t){return FS(e.x,t.x)&&FS(e.y,t.y)}function ES(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function uj(e,t){return ES(e.x,t.x)&&ES(e.y,t.y)}function NS(e){return Ui(e.x)/Ui(e.y)}function _S(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class s9{constructor(){this.members=[]}add(t){fC(this.members,t),t.scheduleRender()}remove(t){if(hC(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 s=this.members[i];if(s.isPresent!==!1){n=s;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(),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:i}=t.options;i===!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)}}function a9(e,t,r){let n="";const i=e.x.translate/t.x,s=e.y.translate/t.y,a=(r==null?void 0:r.z)||0;if((i||s||a)&&(n=`translate3d(${i}px, ${s}px, ${a}px) `),(t.x!==1||t.y!==1)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),r){const{transformPerspective:c,rotate:u,rotateX:d,rotateY:f,skewX:h,skewY:v}=r;c&&(n=`perspective(${c}px) ${n}`),u&&(n+=`rotate(${u}deg) `),d&&(n+=`rotateX(${d}deg) `),f&&(n+=`rotateY(${f}deg) `),h&&(n+=`skewX(${h}deg) `),v&&(n+=`skewY(${v}deg) `)}const o=e.x.scale*t.x,A=e.y.scale*t.y;return(o!==1||A!==1)&&(n+=`scale(${o}, ${A})`),n||"none"}const o9=(e,t)=>e.depth-t.depth;class A9{constructor(){this.children=[],this.isDirty=!1}add(t){fC(this.children,t),this.isDirty=!0}remove(t){hC(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(o9),this.isDirty=!1,this.children.forEach(t)}}function sg(e){const t=Ln(e)?e.get():e;return G7(t)?t.toValue():t}function l9(e,t){const r=ra.now(),n=({timestamp:i})=>{const s=i-r;s>=t&&(rA(n),e(s-t))};return ur.read(n,!0),()=>rA(n)}function c9(e){return e instanceof SVGElement&&e.tagName!=="svg"}function u9(e,t,r){const n=Ln(e)?e:Zf(e);return n.start(dC("",n,t,r)),n.animation}const OA={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Jd=typeof window<"u"&&window.MotionDebug!==void 0,c2=["","X","Y","Z"],d9={visibility:"hidden"},US=1e3;let f9=0;function u2(e,t,r,n){const{latestValues:i}=t;i[e]&&(r[e]=i[e],t.setStaticValue(e,0),n&&(n[e]=0))}function dj(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const r=$U(t);if(window.MotionHasOptimisedAnimation(r,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(r,"transform",ur,!(i||s))}const{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&dj(n)}function fj({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(a={},o=t==null?void 0:t()){this.id=f9++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Jd&&(OA.totalNodes=OA.resolvedTargetDeltas=OA.recalculatedProjection=0),this.nodes.forEach(m9),this.nodes.forEach(x9),this.nodes.forEach(b9),this.nodes.forEach(g9),Jd&&window.MotionDebug.record(OA)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.depth+1:0;for(let A=0;Athis.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=l9(f,250),ig.hasAnimatedSinceResize&&(ig.hasAnimatedSinceResize=!1,this.nodes.forEach(TS))})}A&&this.root.registerSharedNode(A,this),this.options.animate!==!1&&u&&(A||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeTargetChanged:h,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||u.getDefaultTransition()||E9,{onLayoutAnimationStart:y,onLayoutAnimationComplete:g}=u.getProps(),w=!this.targetLayout||!uj(this.targetLayout,v)||h,b=!f&&h;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||b||f&&(w||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,b);const E={...Xb(p,"layout"),onPlay:y,onComplete:g};(u.shouldReduceMotion||this.options.layoutRoot)&&(E.delay=0,E.type=!1),this.startAnimation(E)}else f||TS(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,rA(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(C9),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&dj(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())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let A=0;A{const L=E/1e3;IS(d.x,a.x,L),IS(d.y,a.y,L),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(wf(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),S9(this.relativeTarget,this.relativeTargetOrigin,f,L),b&&i9(this.relativeTarget,b)&&(this.isProjectionDirty=!1),b||(b=Ir()),Hi(b,this.relativeTarget)),p&&(this.animationValues=u,XH(u,c,this.latestValues,L,w,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=L},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(rA(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ur.update(()=>{ig.hasAnimatedSinceResize=!0,this.currentAnimation=u9(0,US,{...a,onUpdate:o=>{this.mixTargetDelta(o),a.onUpdate&&a.onUpdate(o)},onComplete:()=>{a.onComplete&&a.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 a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(US),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:o,target:A,layout:c,latestValues:u}=a;if(!(!o||!A||!c)){if(this!==a&&this.layout&&c&&hj(this.options.animationType,this.layout.layoutBox,c.layoutBox)){A=this.target||Ir();const d=Ui(this.layout.layoutBox.x);A.x.min=a.target.x.min,A.x.max=A.x.min+d;const f=Ui(this.layout.layoutBox.y);A.y.min=a.target.y.min,A.y.max=A.y.min+f}Hi(o,A),Mc(o,u),vf(this.projectionDeltaWithTransform,this.layoutCorrected,o,u)}}registerSharedNode(a,o){this.sharedNodes.has(a)||this.sharedNodes.set(a,new s9),this.sharedNodes.get(a).add(o);const c=o.options.initialPromotionConfig;o.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(o):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())===null||a===void 0?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(a=this.getStack())===null||a===void 0?void 0:a.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:o,preserveFollowOpacity:A}={}){const c=this.getStack();c&&c.promote(this,A),a&&(this.projectionDelta=void 0,this.needsReset=!0),o&&this.setOptions({transition:o})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let o=!1;const{latestValues:A}=a;if((A.z||A.rotate||A.rotateX||A.rotateY||A.rotateZ||A.skewX||A.skewY)&&(o=!0),!o)return;const c={};A.z&&u2("z",a,c,this.animationValues);for(let u=0;u{var o;return(o=a.currentAnimation)===null||o===void 0?void 0:o.stop()}),this.root.nodes.forEach(jS),this.root.sharedNodes.clear()}}}function h9(e){e.updateLayout()}function p9(e){var t;const r=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&r&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=e.layout,{animationType:s}=e.options,a=r.source!==e.layout.source;s==="size"?Vi(d=>{const f=a?r.measuredBox[d]:r.layoutBox[d],h=Ui(f);f.min=n[d].min,f.max=f.min+h}):hj(s,r.layoutBox,n)&&Vi(d=>{const f=a?r.measuredBox[d]:r.layoutBox[d],h=Ui(n[d]);f.max=f.min+h,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+h)});const o=Oc();vf(o,n,r.layoutBox);const A=Oc();a?vf(A,e.applyTransform(i,!0),r.measuredBox):vf(A,n,r.layoutBox);const c=!cj(o);let u=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:h}=d;if(f&&h){const v=Ir();wf(v,r.layoutBox,f.layoutBox);const p=Ir();wf(p,n,h.layoutBox),uj(v,p)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=p,e.relativeTargetOrigin=v,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:r,delta:A,layoutDelta:o,hasLayoutChanged:c,hasRelativeTargetChanged:u})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function m9(e){Jd&&OA.totalNodes++,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 g9(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function v9(e){e.clearSnapshot()}function jS(e){e.clearMeasurements()}function w9(e){e.isLayoutDirty=!1}function y9(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function TS(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function x9(e){e.resolveTargetDelta()}function b9(e){e.calcProjection()}function C9(e){e.resetSkewAndRotation()}function B9(e){e.removeLeadSnapshot()}function IS(e,t,r){e.translate=yr(t.translate,0,r),e.scale=yr(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function kS(e,t,r,n){e.min=yr(t.min,r.min,n),e.max=yr(t.max,r.max,n)}function S9(e,t,r,n){kS(e.x,t.x,r.x,n),kS(e.y,t.y,r.y,n)}function F9(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const E9={duration:.45,ease:[.4,0,.1,1]},LS=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),PS=LS("applewebkit/")&&!LS("chrome/")?Math.round:Fi;function QS(e){e.min=PS(e.min),e.max=PS(e.max)}function N9(e){QS(e.x),QS(e.y)}function hj(e,t,r){return e==="position"||e==="preserve-aspect"&&!_H(NS(t),NS(r),.2)}function _9(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const U9=fj({attachResizeListener:(e,t)=>eh(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),d2={current:void 0},pj=fj({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!d2.current){const e=new U9({});e.mount(window),e.setOptions({layoutScroll:!0}),d2.current=e}return d2.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),j9={pan:{Feature:$H},drag:{Feature:VH,ProjectionNode:pj,MeasureLayout:oj}};function DS(e,t,r){const{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover",r==="Start");const i="onHover"+r,s=n[i];s&&ur.postRender(()=>s(t,Ch(t)))}class T9 extends hA{mount(){const{current:t}=this.node;t&&(this.unmount=pH(t,r=>(DS(this.node,r,"Start"),n=>DS(this.node,n,"End"))))}unmount(){}}class I9 extends hA{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=bh(eh(this.node.current,"focus",()=>this.onFocus()),eh(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function OS(e,t,r){const{props:n}=e;e.animationState&&n.whileTap&&e.animationState.setActive("whileTap",r==="Start");const i="onTap"+(r==="End"?"":r),s=n[i];s&&ur.postRender(()=>s(t,Ch(t)))}class k9 extends hA{mount(){const{current:t}=this.node;t&&(this.unmount=wH(t,r=>(OS(this.node,r,"Start"),(n,{success:i})=>OS(this.node,n,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Ty=new WeakMap,f2=new WeakMap,L9=e=>{const t=Ty.get(e.target);t&&t(e)},P9=e=>{e.forEach(L9)};function Q9({root:e,...t}){const r=e||document;f2.has(r)||f2.set(r,{});const n=f2.get(r),i=JSON.stringify(t);return n[i]||(n[i]=new IntersectionObserver(P9,{root:e,...t})),n[i]}function D9(e,t,r){const n=Q9(t);return Ty.set(e,r),n.observe(e),()=>{Ty.delete(e),n.unobserve(e)}}const O9={some:0,all:1};class R9 extends hA{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:s}=t,a={root:r?r.current:void 0,rootMargin:n,threshold:typeof i=="number"?i:O9[i]},o=A=>{const{isIntersecting:c}=A;if(this.isInView===c||(this.isInView=c,s&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),f=c?u:d;f&&f(A)};return D9(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:r}=this.node;["amount","margin","root"].some(M9(t,r))&&this.startObserver()}unmount(){}}function M9({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}const H9={inView:{Feature:R9},tap:{Feature:k9},focus:{Feature:I9},hover:{Feature:T9}},K9={layout:{ProjectionNode:pj,MeasureLayout:oj}},yC=C.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),G0=C.createContext({}),xC=typeof window<"u",mj=xC?C.useLayoutEffect:C.useEffect,gj=C.createContext({strict:!1});function V9(e,t,r,n,i){var s,a;const{visualElement:o}=C.useContext(G0),A=C.useContext(gj),c=C.useContext($0),u=C.useContext(yC).reducedMotion,d=C.useRef(null);n=n||A.renderer,!d.current&&n&&(d.current=n(e,{visualState:t,parent:o,props:r,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u}));const f=d.current,h=C.useContext(aj);f&&!f.projection&&i&&(f.type==="html"||f.type==="svg")&&$9(d.current,r,i,h);const v=C.useRef(!1);C.useInsertionEffect(()=>{f&&v.current&&f.update(r,c)});const p=r[VU],y=C.useRef(!!p&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,p))&&((a=window.MotionHasOptimisedAnimation)===null||a===void 0?void 0:a.call(window,p)));return mj(()=>{f&&(v.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),wC.render(f.render),y.current&&f.animationState&&f.animationState.animateChanges())}),C.useEffect(()=>{f&&(!y.current&&f.animationState&&f.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var g;(g=window.MotionHandoffMarkAsComplete)===null||g===void 0||g.call(window,p)}),y.current=!1))}),f}function $9(e,t,r,n){const{layoutId:i,layout:s,drag:a,dragConstraints:o,layoutScroll:A,layoutRoot:c}=t;e.projection=new r(e.latestValues,t["data-framer-portal-id"]?void 0:vj(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!a||o&&Dc(o),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:n,layoutScroll:A,layoutRoot:c})}function vj(e){if(e)return e.options.allowProjection!==!1?e.projection:vj(e.parent)}function G9(e,t,r){return C.useCallback(n=>{n&&e.mount&&e.mount(n),t&&(n?t.mount(n):t.unmount()),r&&(typeof r=="function"?r(n):Dc(r)&&(r.current=n))},[t])}function z0(e){return H0(e.animate)||Yb.some(t=>qf(e[t]))}function wj(e){return!!(z0(e)||e.variants)}function z9(e,t){if(z0(e)){const{initial:r,animate:n}=e;return{initial:r===!1||qf(r)?r:void 0,animate:qf(n)?n:void 0}}return e.inherit!==!1?t:{}}function W9(e){const{initial:t,animate:r}=z9(e,C.useContext(G0));return C.useMemo(()=>({initial:t,animate:r}),[RS(t),RS(r)])}function RS(e){return Array.isArray(e)?e.join(" "):e}const MS={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"]},gu={};for(const e in MS)gu[e]={isEnabled:t=>MS[e].some(r=>!!t[r])};function J9(e){for(const t in e)gu[t]={...gu[t],...e[t]}}const q9=Symbol.for("motionComponentSymbol");function Y9({preloadedFeatures:e,createVisualElement:t,useRender:r,useVisualState:n,Component:i}){e&&J9(e);function s(o,A){let c;const u={...C.useContext(yC),...o,layoutId:X9(o)},{isStatic:d}=u,f=W9(o),h=n(o,d);if(!d&&xC){Z9();const v=eK(u);c=v.MeasureLayout,f.visualElement=V9(i,h,u,t,v.ProjectionNode)}return l.jsxs(G0.Provider,{value:f,children:[c&&f.visualElement?l.jsx(c,{visualElement:f.visualElement,...u}):null,r(i,o,G9(h,f.visualElement,A),h,d,f.visualElement)]})}const a=C.forwardRef(s);return a[q9]=i,a}function X9({layoutId:e}){const t=C.useContext(vC).id;return t&&e!==void 0?t+"-"+e:e}function Z9(e,t){C.useContext(gj).strict}function eK(e){const{drag:t,layout:r}=gu;if(!t&&!r)return{};const n={...t,...r};return{MeasureLayout:t!=null&&t.isEnabled(e)||r!=null&&r.isEnabled(e)?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}const tK=["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 bC(e){return typeof e!="string"||e.includes("-")?!1:!!(tK.indexOf(e)>-1||/[A-Z]/u.test(e))}function yj(e,{style:t,vars:r},n,i){Object.assign(e.style,t,i&&i.getProjectionStyles(n));for(const s in r)e.style.setProperty(s,r[s])}const xj=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function bj(e,t,r,n){yj(e,t,void 0,n);for(const i in t.attrs)e.setAttribute(xj.has(i)?i:mC(i),t.attrs[i])}function Cj(e,{layout:t,layoutId:r}){return Cl.has(e)||e.startsWith("origin")||(t||r!==void 0)&&(!!Xg[e]||e==="opacity")}function CC(e,t,r){var n;const{style:i}=e,s={};for(const a in i)(Ln(i[a])||t.style&&Ln(t.style[a])||Cj(a,e)||((n=r==null?void 0:r.getValue(a))===null||n===void 0?void 0:n.liveStyle)!==void 0)&&(s[a]=i[a]);return s}function Bj(e,t,r){const n=CC(e,t,r);for(const i in e)if(Ln(e[i])||Ln(t[i])){const s=wh.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;n[s]=e[i]}return n}function BC(e){const t=C.useRef(null);return t.current===null&&(t.current=e()),t.current}function rK({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:r},n,i,s){const a={latestValues:nK(n,i,s,e),renderState:t()};return r&&(a.mount=o=>r(n,o,a)),a}const Sj=e=>(t,r)=>{const n=C.useContext(G0),i=C.useContext($0),s=()=>rK(e,t,n,i);return r?s():BC(s)};function nK(e,t,r,n){const i={},s=n(e,{});for(const f in s)i[f]=sg(s[f]);let{initial:a,animate:o}=e;const A=z0(e),c=wj(e);t&&c&&!A&&e.inherit!==!1&&(a===void 0&&(a=t.initial),o===void 0&&(o=t.animate));let u=r?r.initial===!1:!1;u=u||a===!1;const d=u?o:a;if(d&&typeof d!="boolean"&&!H0(d)){const f=Array.isArray(d)?d:[d];for(let h=0;h({style:{},transform:{},transformOrigin:{},vars:{}}),Fj=()=>({...SC(),attrs:{}}),Ej=(e,t)=>t&&typeof e=="number"?t.transform(e):e,iK={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},sK=wh.length;function aK(e,t,r){let n="",i=!0;for(let s=0;stypeof e=="string"&&e.toLowerCase()==="svg",uK={useVisualState:Sj({scrapeMotionValuesFromProps:Bj,createRenderState:Fj,onMount:(e,t,{renderState:r,latestValues:n})=>{ur.read(()=>{try{r.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{r.dimensions={x:0,y:0,width:0,height:0}}}),ur.render(()=>{EC(r,n,NC(t.tagName),e.transformTemplate),bj(t,r)})}})},dK={useVisualState:Sj({scrapeMotionValuesFromProps:CC,createRenderState:SC})};function Nj(e,t,r){for(const n in t)!Ln(t[n])&&!Cj(n,r)&&(e[n]=t[n])}function fK({transformTemplate:e},t){return C.useMemo(()=>{const r=SC();return FC(r,t,e),Object.assign({},r.vars,r.style)},[t])}function hK(e,t){const r=e.style||{},n={};return Nj(n,r,e),Object.assign(n,fK(e,t)),n}function pK(e,t){const r={},n=hK(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 mK=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Zg(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||mK.has(e)}let _j=e=>!Zg(e);function gK(e){e&&(_j=t=>t.startsWith("on")?!Zg(t):e(t))}try{gK(require("@emotion/is-prop-valid").default)}catch{}function vK(e,t,r){const n={};for(const i in e)i==="values"&&typeof e.values=="object"||(_j(i)||r===!0&&Zg(i)||!t&&!Zg(i)||e.draggable&&i.startsWith("onDrag"))&&(n[i]=e[i]);return n}function wK(e,t,r,n){const i=C.useMemo(()=>{const s=Fj();return EC(s,t,NC(n),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};Nj(s,e.style,e),i.style={...s,...i.style}}return i}function yK(e=!1){return(r,n,i,{latestValues:s},a)=>{const A=(bC(r)?wK:pK)(n,s,a,r),c=vK(n,typeof r=="string",e),u=r!==C.Fragment?{...c,...A,ref:i}:{},{children:d}=n,f=C.useMemo(()=>Ln(d)?d.get():d,[d]);return C.createElement(r,{...u,children:f})}}function xK(e,t){return function(n,{forwardMotionProps:i}={forwardMotionProps:!1}){const a={...bC(n)?uK:dK,preloadedFeatures:e,useRender:yK(i),createVisualElement:t,Component:n};return Y9(a)}}const Iy={current:null},Uj={current:!1};function bK(){if(Uj.current=!0,!!xC)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Iy.current=e.matches;e.addListener(t),t()}else Iy.current=!1}function CK(e,t,r){for(const n in t){const i=t[n],s=r[n];if(Ln(i))e.addValue(n,i);else if(Ln(s))e.addValue(n,Zf(i,{owner:e}));else if(s!==i)if(e.hasValue(n)){const a=e.getValue(n);a.liveStyle===!0?a.jump(i):a.hasAnimated||a.set(i)}else{const a=e.getStaticValue(n);e.addValue(n,Zf(a!==void 0?a:i,{owner:e}))}}for(const n in r)t[n]===void 0&&e.removeValue(n);return t}const KS=new WeakMap,BK=[...bU,Un,nA],SK=e=>BK.find(xU(e)),VS=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class FK{scrapeMotionValuesFromProps(t,r,n){return{}}constructor({parent:t,props:r,presenceContext:n,reducedMotionConfig:i,blockInitialAnimation:s,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=rC,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=ra.now();this.renderScheduledAtthis.bindToMotionValue(n,r)),Uj.current||bK(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Iy.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){KS.delete(this.current),this.projection&&this.projection.unmount(),rA(this.notifyUpdate),rA(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const r=this.features[t];r&&(r.unmount(),r.isMounted=!1)}this.current=null}bindToMotionValue(t,r){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=Cl.has(t),i=r.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&ur.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),s=r.on("renderRequest",this.scheduleRender);let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,r)),this.valueSubscriptions.set(t,()=>{i(),s(),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 gu){const r=gu[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 s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ir()}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=Zf(r===null?void 0:r,{owner:this}),this.addValue(t,n)),n}readValue(t,r){var n;let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(n=this.getBaseTargetFromProps(this.props,t))!==null&&n!==void 0?n:this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(gU(i)||mU(i))?i=parseFloat(i):!SK(i)&&nA.test(r)&&(i=UU(t,r)),this.setBaseTarget(t,Ln(i)?i.get():i)),Ln(i)?i.get():i}setBaseTarget(t,r){this.baseTarget[t]=r}getBaseTarget(t){var r;const{initial:n}=this.props;let i;if(typeof n=="string"||typeof n=="object"){const a=Jb(this.props,n,(r=this.presenceContext)===null||r===void 0?void 0:r.custom);a&&(i=a[t])}if(n&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Ln(s)?s:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,r){return this.events[t]||(this.events[t]=new pC),this.events[t].add(r)}notify(t,...r){this.events[t]&&this.events[t].notify(...r)}}class jj extends FK{constructor(){super(...arguments),this.KeyframeResolver=jU}sortInstanceNodePosition(t,r){return t.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(t,r){return t.style?t.style[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;Ln(t)&&(this.childSubscription=t.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}}function EK(e){return window.getComputedStyle(e)}class NK extends jj{constructor(){super(...arguments),this.type="html",this.renderInstance=yj}readValueFromInstance(t,r){if(Cl.has(r)){const n=aC(r);return n&&n.default||0}else{const n=EK(t),i=(wU(r)?n.getPropertyValue(r):n[r])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:r}){return ij(t,r)}build(t,r,n){FC(t,r,n.transformTemplate)}scrapeMotionValuesFromProps(t,r,n){return CC(t,r,n)}}class _K extends jj{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ir}getBaseTargetFromProps(t,r){return t[r]}readValueFromInstance(t,r){if(Cl.has(r)){const n=aC(r);return n&&n.default||0}return r=xj.has(r)?r:mC(r),t.getAttribute(r)}scrapeMotionValuesFromProps(t,r,n){return Bj(t,r,n)}build(t,r,n){EC(t,r,this.isSVGTag,n.transformTemplate)}renderInstance(t,r,n,i){bj(t,r,n,i)}mount(t){this.isSVGTag=NC(t.tagName),super.mount(t)}}const UK=(e,t)=>bC(e)?new _K(t):new NK(t,{allowProjection:e!==C.Fragment}),jK=xK({...fH,...H9,...j9,...K9},UK),gr=cM(jK);class TK extends C.Component{getSnapshotBeforeUpdate(t){const r=this.props.childRef.current;if(r&&t.isPresent&&!this.props.isPresent){const n=this.props.sizeRef.current;n.height=r.offsetHeight||0,n.width=r.offsetWidth||0,n.top=r.offsetTop,n.left=r.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function IK({children:e,isPresent:t}){const r=C.useId(),n=C.useRef(null),i=C.useRef({width:0,height:0,top:0,left:0}),{nonce:s}=C.useContext(yC);return C.useInsertionEffect(()=>{const{width:a,height:o,top:A,left:c}=i.current;if(t||!n.current||!a||!o)return;n.current.dataset.motionPopId=r;const u=document.createElement("style");return s&&(u.nonce=s),document.head.appendChild(u),u.sheet&&u.sheet.insertRule(` [data-motion-pop-id="${r}"] { position: absolute !important; width: ${a}px !important; height: ${o}px !important; top: ${A}px !important; left: ${c}px !important; } `),()=>{document.head.removeChild(u)}},[t]),l.jsx(TK,{isPresent:t,childRef:n,sizeRef:i,children:C.cloneElement(e,{ref:n})})}const kK=({children:e,initial:t,isPresent:r,onExitComplete:n,custom:i,presenceAffectsLayout:s,mode:a})=>{const o=BC(LK),A=C.useId(),c=C.useCallback(d=>{o.set(d,!0);for(const f of o.values())if(!f)return;n&&n()},[o,n]),u=C.useMemo(()=>({id:A,initial:t,isPresent:r,custom:i,onExitComplete:c,register:d=>(o.set(d,!1),()=>o.delete(d))}),s?[Math.random(),c]:[r,c]);return C.useMemo(()=>{o.forEach((d,f)=>o.set(f,!1))},[r]),C.useEffect(()=>{!r&&!o.size&&n&&n()},[r]),a==="popLayout"&&(e=l.jsx(IK,{isPresent:r,children:e})),l.jsx($0.Provider,{value:u,children:e})};function LK(){return new Map}const Jp=e=>e.key||"";function $S(e){const t=[];return C.Children.forEach(e,r=>{C.isValidElement(r)&&t.push(r)}),t}const W0=({children:e,exitBeforeEnter:t,custom:r,initial:n=!0,onExitComplete:i,presenceAffectsLayout:s=!0,mode:a="sync"})=>{const o=C.useMemo(()=>$S(e),[e]),A=o.map(Jp),c=C.useRef(!0),u=C.useRef(o),d=BC(()=>new Map),[f,h]=C.useState(o),[v,p]=C.useState(o);mj(()=>{c.current=!1,u.current=o;for(let w=0;w{const b=Jp(w),E=o===v||A.includes(b),L=()=>{if(d.has(b))d.set(b,!0);else return;let _=!0;d.forEach(k=>{k||(_=!1)}),_&&(g==null||g(),p(u.current),i&&i())};return l.jsx(kK,{isPresent:E,initial:!c.current||n?void 0:!1,custom:E?void 0:r,presenceAffectsLayout:s,mode:a,onExitComplete:E?void 0:L,children:w},b)})})};/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const PK=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Tj=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var QK={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.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const DK=C.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:i="",children:s,iconNode:a,...o},A)=>C.createElement("svg",{ref:A,...QK,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:Tj("lucide",i),...o},[...a.map(([c,u])=>C.createElement(c,u)),...Array.isArray(s)?s:[s]]));/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ze=(e,t)=>{const r=C.forwardRef(({className:n,...i},s)=>C.createElement(DK,{ref:s,iconNode:t,className:Tj(`lucide-${PK(e)}`,n),...i}));return r.displayName=`${e}`,r};/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const OK=ze("Armchair",[["path",{d:"M19 9V6a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v3",key:"irtipd"}],["path",{d:"M3 16a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-5a2 2 0 0 0-4 0v1.5a.5.5 0 0 1-.5.5h-9a.5.5 0 0 1-.5-.5V11a2 2 0 0 0-4 0z",key:"1qyhux"}],["path",{d:"M5 18v2",key:"ppbyun"}],["path",{d:"M19 18v2",key:"gy7782"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const RK=ze("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const MK=ze("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** * @license lucide-react v0.469.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=ze("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const HK=ze("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ij=ze("ArrowUpFromLine",[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const kj=ze("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Lj=ze("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const KK=ze("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.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ky=ze("Briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const VK=ze("Building",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["path",{d:"M9 22v-4h6v4",key:"r93iot"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ly=ze("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.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Pj=ze("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.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const vu=ze("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const $K=ze("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Py=ze("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const th=ze("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ku=ze("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const GK=ze("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** * @license lucide-react v0.469.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=ze("ClipboardList",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const WK=ze("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** * @license lucide-react v0.469.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=ze("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.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Qj=ze("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Bh=ze("FileDown",[["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:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Dj=ze("FileImage",[["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"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const _C=ze("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.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const qK=ze("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const YK=ze("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const XK=ze("Hammer",[["path",{d:"m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9",key:"eefl8a"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172V7l-2.26-2.26a6 6 0 0 0-4.202-1.756L9 2.96l.92.82A6.18 6.18 0 0 1 12 8.4V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"b7pghm"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const UC=ze("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.469.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=ze("ImagePlus",[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const wu=ze("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const eV=ze("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.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const tV=ze("Instagram",[["rect",{width:"20",height:"20",x:"2",y:"2",rx:"5",ry:"5",key:"2e1cvw"}],["path",{d:"M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z",key:"9exkf1"}],["line",{x1:"17.5",x2:"17.51",y1:"6.5",y2:"6.5",key:"r4j83e"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const rV=ze("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const nV=ze("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const kt=ze("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const GS=ze("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.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const iV=ze("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const sV=ze("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Lu=ze("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.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Oj=ze("Map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Rj=ze("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.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const zS=ze("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const aV=ze("MonitorPlay",[["path",{d:"M10 7.75a.75.75 0 0 1 1.142-.638l3.664 2.249a.75.75 0 0 1 0 1.278l-3.664 2.25a.75.75 0 0 1-1.142-.64z",key:"1pctta"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",key:"x3v2xh"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Mj=ze("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const oV=ze("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Bl=ze("Pen",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const AV=ze("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const lV=ze("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.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const WS=ze("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const $a=ze("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const e0=ze("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.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const cV=ze("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const jC=ze("Ruler",[["path",{d:"M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z",key:"icamh8"}],["path",{d:"m14.5 12.5 2-2",key:"inckbg"}],["path",{d:"m11.5 9.5 2-2",key:"fmmyf7"}],["path",{d:"m8.5 6.5 2-2",key:"vc6u1g"}],["path",{d:"m17.5 15.5 2-2",key:"wo5hmg"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const pA=ze("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const J0=ze("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** * @license lucide-react v0.469.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=ze("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const JS=ze("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.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const dV=ze("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.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const rh=ze("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.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const aa=ze("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const fV=ze("Trees",[["path",{d:"M10 10v.2A3 3 0 0 1 8.9 16H5a3 3 0 0 1-1-5.8V10a3 3 0 0 1 6 0Z",key:"1l6gj6"}],["path",{d:"M7 16v6",key:"1a82de"}],["path",{d:"M13 19v3",key:"13sx9i"}],["path",{d:"M12 19h8.3a1 1 0 0 0 .7-1.7L18 14h.3a1 1 0 0 0 .7-1.7L16 9h.2a1 1 0 0 0 .8-1.7L13 3l-1.4 1.5",key:"1sj9kv"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const qS=ze("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Hj=ze("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const q0=ze("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const TC=ze("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const hV=ze("Wallet",[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]]);/** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ei=ze("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),qp="site_logo_url",IA="https://horizons-cdn.hostinger.com/be71d8fd-e4d4-44bb-a5d1-b08712088a77/Logo.jpg",Kj=()=>{const[e,t]=C.useState(IA),[r,n]=C.useState(!0);return C.useEffect(()=>{(()=>{try{const c=localStorage.getItem(qp);t(c||IA)}catch(c){console.error("Failed to load logo:",c)}finally{n(!1)}})();const o=c=>{c.key===qp&&t(c.newValue||IA)},A=c=>{t(c.detail||IA)};return window.addEventListener("storage",o),window.addEventListener("logo-updated",A),()=>{window.removeEventListener("storage",o),window.removeEventListener("logo-updated",A)}},[]),{logoUrl:e,uploadLogo:a=>new Promise((o,A)=>{if(!a){A(new Error("No file provided"));return}if(!a.type.startsWith("image/")){A(new Error("File must be an image"));return}if(a.size>2*1024*1024){A(new Error("File size too large. Max 2MB."));return}const c=new FileReader;c.onload=u=>{const d=u.target.result;try{localStorage.setItem(qp,d),t(d),window.dispatchEvent(new CustomEvent("logo-updated",{detail:d})),o(d)}catch{A(new Error("Failed to save to browser storage."))}},c.onerror=()=>A(new Error("Failed to read file")),c.readAsDataURL(a)}),resetLogo:()=>{try{localStorage.removeItem(qp),t(IA),window.dispatchEvent(new CustomEvent("logo-updated",{detail:IA}))}catch(a){console.error("Error resetting logo:",a)}},isLoading:r,DEFAULT_LOGO:IA}};var Ys=function(){return Ys=Object.assign||function(t){for(var r,n=1,i=arguments.length;ne?(...t)=>e(...t):(...t)=>fetch(...t);class IC extends Error{constructor(t,r="FunctionsError",n){super(t),this.name=r,this.context=n}}class vV extends IC{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class YS extends IC{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class XS extends IC{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var Qy;(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"})(Qy||(Qy={}));class wV{constructor(t,{headers:r={},customFetch:n,region:i=Qy.Any}={}){this.url=t,this.headers=r,this.region=i,this.fetch=gV(n)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return pV(this,arguments,void 0,function*(r,n={}){var i;let s,a;try{const{headers:o,method:A,body:c,signal:u,timeout:d}=n;let f={},{region:h}=n;h||(h=this.region);const v=new URL(`${this.url}/${r}`);h&&h!=="any"&&(f["x-region"]=h,v.searchParams.set("forceFunctionRegion",h));let p;c&&(o&&!Object.prototype.hasOwnProperty.call(o,"Content-Type")||!o)?typeof Blob<"u"&&c instanceof Blob||c instanceof ArrayBuffer?(f["Content-Type"]="application/octet-stream",p=c):typeof c=="string"?(f["Content-Type"]="text/plain",p=c):typeof FormData<"u"&&c instanceof FormData?p=c:(f["Content-Type"]="application/json",p=JSON.stringify(c)):c&&typeof c!="string"&&!(typeof Blob<"u"&&c instanceof Blob)&&!(c instanceof ArrayBuffer)&&!(typeof FormData<"u"&&c instanceof FormData)?p=JSON.stringify(c):p=c;let y=u;d&&(a=new AbortController,s=setTimeout(()=>a.abort(),d),u?(y=a.signal,u.addEventListener("abort",()=>a.abort())):y=a.signal);const g=yield this.fetch(v.toString(),{method:A||"POST",headers:Object.assign(Object.assign(Object.assign({},f),this.headers),o),body:p,signal:y}).catch(L=>{throw new vV(L)}),w=g.headers.get("x-relay-error");if(w&&w==="true")throw new YS(g);if(!g.ok)throw new XS(g);let b=((i=g.headers.get("Content-Type"))!==null&&i!==void 0?i:"text/plain").split(";")[0].trim(),E;return b==="application/json"?E=yield g.json():b==="application/octet-stream"||b==="application/pdf"?E=yield g.blob():b==="text/event-stream"?E=g:b==="multipart/form-data"?E=yield g.formData():E=yield g.text(),{data:E,error:null,response:g}}catch(o){return{data:null,error:o,response:o instanceof XS||o instanceof YS?o.context:void 0}}finally{s&&clearTimeout(s)}})}}var ii={},kC={},Y0={},Sh={},X0={},Z0={},yV=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")},yu=yV();const xV=yu.fetch,bV=yu.fetch.bind(yu),CV=yu.Headers,BV=yu.Request,SV=yu.Response,FV=Object.freeze(Object.defineProperty({__proto__:null,Headers:CV,Request:BV,Response:SV,default:bV,fetch:xV},Symbol.toStringTag,{value:"Module"})),EV=M6(FV);var ev={};Object.defineProperty(ev,"__esModule",{value:!0});let NV=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.code=t.code}};ev.default=NV;var $j=kn&&kn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Z0,"__esModule",{value:!0});const _V=$j(EV),UV=$j(ev);let jV=class{constructor(t){var r,n;this.shouldThrowOnError=!1,this.method=t.method,this.url=t.url,this.headers=new Headers(t.headers),this.schema=t.schema,this.body=t.body,this.shouldThrowOnError=(r=t.shouldThrowOnError)!==null&&r!==void 0?r:!1,this.signal=t.signal,this.isMaybeSingle=(n=t.isMaybeSingle)!==null&&n!==void 0?n:!1,t.fetch?this.fetch=t.fetch:typeof fetch>"u"?this.fetch=_V.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,r){return this.headers=new Headers(this.headers),this.headers.set(t,r),this}then(t,r){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 s=>{var a,o,A,c;let u=null,d=null,f=null,h=s.status,v=s.statusText;if(s.ok){if(this.method!=="HEAD"){const w=await s.text();w===""||(this.headers.get("Accept")==="text/csv"||this.headers.get("Accept")&&(!((a=this.headers.get("Accept"))===null||a===void 0)&&a.includes("application/vnd.pgrst.plan+text"))?d=w:d=JSON.parse(w))}const y=(o=this.headers.get("Prefer"))===null||o===void 0?void 0:o.match(/count=(exact|planned|estimated)/),g=(A=s.headers.get("content-range"))===null||A===void 0?void 0:A.split("/");y&&g&&g.length>1&&(f=parseInt(g[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(d)&&(d.length>1?(u={code:"PGRST116",details:`Results contain ${d.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},d=null,f=null,h=406,v="Not Acceptable"):d.length===1?d=d[0]:d=null)}else{const y=await s.text();try{u=JSON.parse(y),Array.isArray(u)&&s.status===404&&(d=[],u=null,h=200,v="OK")}catch{s.status===404&&y===""?(h=204,v="No Content"):u={message:y}}if(u&&this.isMaybeSingle&&(!((c=u==null?void 0:u.details)===null||c===void 0)&&c.includes("0 rows"))&&(u=null,h=200,v="OK"),u&&this.shouldThrowOnError)throw new UV.default(u)}return{error:u,data:d,count:f,status:h,statusText:v}});return this.shouldThrowOnError||(i=i.catch(s=>{var a,o,A;return{error:{message:`${(a=s==null?void 0:s.name)!==null&&a!==void 0?a:"FetchError"}: ${s==null?void 0:s.message}`,details:`${(o=s==null?void 0:s.stack)!==null&&o!==void 0?o:""}`,hint:"",code:`${(A=s==null?void 0:s.code)!==null&&A!==void 0?A:""}`},data:null,count:null,status:0,statusText:""}})),i.then(t,r)}returns(){return this}overrideTypes(){return this}};Z0.default=jV;var TV=kn&&kn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(X0,"__esModule",{value:!0});const IV=TV(Z0);let kV=class extends IV.default{select(t){let r=!1;const n=(t??"*").split("").map(i=>/\s/.test(i)&&!r?"":(i==='"'&&(r=!r),i)).join("");return this.url.searchParams.set("select",n),this.headers.append("Prefer","return=representation"),this}order(t,{ascending:r=!0,nullsFirst:n,foreignTable:i,referencedTable:s=i}={}){const a=s?`${s}.order`:"order",o=this.url.searchParams.get(a);return this.url.searchParams.set(a,`${o?`${o},`:""}${t}.${r?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(t,{foreignTable:r,referencedTable:n=r}={}){const i=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(i,`${t}`),this}range(t,r,{foreignTable:n,referencedTable:i=n}={}){const s=typeof i>"u"?"offset":`${i}.offset`,a=typeof i>"u"?"limit":`${i}.limit`;return this.url.searchParams.set(s,`${t}`),this.url.searchParams.set(a,`${r-t+1}`),this}abortSignal(t){return this.signal=t,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:t=!1,verbose:r=!1,settings:n=!1,buffers:i=!1,wal:s=!1,format:a="text"}={}){var o;const A=[t?"analyze":null,r?"verbose":null,n?"settings":null,i?"buffers":null,s?"wal":null].filter(Boolean).join("|"),c=(o=this.headers.get("Accept"))!==null&&o!==void 0?o:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${a}; for="${c}"; options=${A};`),a==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(t){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${t}`),this}};X0.default=kV;var LV=kn&&kn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Sh,"__esModule",{value:!0});const PV=LV(X0);let QV=class extends PV.default{eq(t,r){return this.url.searchParams.append(t,`eq.${r}`),this}neq(t,r){return this.url.searchParams.append(t,`neq.${r}`),this}gt(t,r){return this.url.searchParams.append(t,`gt.${r}`),this}gte(t,r){return this.url.searchParams.append(t,`gte.${r}`),this}lt(t,r){return this.url.searchParams.append(t,`lt.${r}`),this}lte(t,r){return this.url.searchParams.append(t,`lte.${r}`),this}like(t,r){return this.url.searchParams.append(t,`like.${r}`),this}likeAllOf(t,r){return this.url.searchParams.append(t,`like(all).{${r.join(",")}}`),this}likeAnyOf(t,r){return this.url.searchParams.append(t,`like(any).{${r.join(",")}}`),this}ilike(t,r){return this.url.searchParams.append(t,`ilike.${r}`),this}ilikeAllOf(t,r){return this.url.searchParams.append(t,`ilike(all).{${r.join(",")}}`),this}ilikeAnyOf(t,r){return this.url.searchParams.append(t,`ilike(any).{${r.join(",")}}`),this}is(t,r){return this.url.searchParams.append(t,`is.${r}`),this}in(t,r){const n=Array.from(new Set(r)).map(i=>typeof i=="string"&&new RegExp("[,()]").test(i)?`"${i}"`:`${i}`).join(",");return this.url.searchParams.append(t,`in.(${n})`),this}contains(t,r){return typeof r=="string"?this.url.searchParams.append(t,`cs.${r}`):Array.isArray(r)?this.url.searchParams.append(t,`cs.{${r.join(",")}}`):this.url.searchParams.append(t,`cs.${JSON.stringify(r)}`),this}containedBy(t,r){return typeof r=="string"?this.url.searchParams.append(t,`cd.${r}`):Array.isArray(r)?this.url.searchParams.append(t,`cd.{${r.join(",")}}`):this.url.searchParams.append(t,`cd.${JSON.stringify(r)}`),this}rangeGt(t,r){return this.url.searchParams.append(t,`sr.${r}`),this}rangeGte(t,r){return this.url.searchParams.append(t,`nxl.${r}`),this}rangeLt(t,r){return this.url.searchParams.append(t,`sl.${r}`),this}rangeLte(t,r){return this.url.searchParams.append(t,`nxr.${r}`),this}rangeAdjacent(t,r){return this.url.searchParams.append(t,`adj.${r}`),this}overlaps(t,r){return typeof r=="string"?this.url.searchParams.append(t,`ov.${r}`):this.url.searchParams.append(t,`ov.{${r.join(",")}}`),this}textSearch(t,r,{config:n,type:i}={}){let s="";i==="plain"?s="pl":i==="phrase"?s="ph":i==="websearch"&&(s="w");const a=n===void 0?"":`(${n})`;return this.url.searchParams.append(t,`${s}fts${a}.${r}`),this}match(t){return Object.entries(t).forEach(([r,n])=>{this.url.searchParams.append(r,`eq.${n}`)}),this}not(t,r,n){return this.url.searchParams.append(t,`not.${r}.${n}`),this}or(t,{foreignTable:r,referencedTable:n=r}={}){const i=n?`${n}.or`:"or";return this.url.searchParams.append(i,`(${t})`),this}filter(t,r,n){return this.url.searchParams.append(t,`${r}.${n}`),this}};Sh.default=QV;var DV=kn&&kn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Y0,"__esModule",{value:!0});const Td=DV(Sh);let OV=class{constructor(t,{headers:r={},schema:n,fetch:i}){this.url=t,this.headers=new Headers(r),this.schema=n,this.fetch=i}select(t,{head:r=!1,count:n}={}){const i=r?"HEAD":"GET";let s=!1;const a=(t??"*").split("").map(o=>/\s/.test(o)&&!s?"":(o==='"'&&(s=!s),o)).join("");return this.url.searchParams.set("select",a),n&&this.headers.append("Prefer",`count=${n}`),new Td.default({method:i,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch})}insert(t,{count:r,defaultToNull:n=!0}={}){var i;const s="POST";if(r&&this.headers.append("Prefer",`count=${r}`),n||this.headers.append("Prefer","missing=default"),Array.isArray(t)){const a=t.reduce((o,A)=>o.concat(Object.keys(A)),[]);if(a.length>0){const o=[...new Set(a)].map(A=>`"${A}"`);this.url.searchParams.set("columns",o.join(","))}}return new Td.default({method:s,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch})}upsert(t,{onConflict:r,ignoreDuplicates:n=!1,count:i,defaultToNull:s=!0}={}){var a;const o="POST";if(this.headers.append("Prefer",`resolution=${n?"ignore":"merge"}-duplicates`),r!==void 0&&this.url.searchParams.set("on_conflict",r),i&&this.headers.append("Prefer",`count=${i}`),s||this.headers.append("Prefer","missing=default"),Array.isArray(t)){const A=t.reduce((c,u)=>c.concat(Object.keys(u)),[]);if(A.length>0){const c=[...new Set(A)].map(u=>`"${u}"`);this.url.searchParams.set("columns",c.join(","))}}return new Td.default({method:o,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch})}update(t,{count:r}={}){var n;const i="PATCH";return r&&this.headers.append("Prefer",`count=${r}`),new Td.default({method:i,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch})}delete({count:t}={}){var r;const n="DELETE";return t&&this.headers.append("Prefer",`count=${t}`),new Td.default({method:n,url:this.url,headers:this.headers,schema:this.schema,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch})}};Y0.default=OV;var Gj=kn&&kn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(kC,"__esModule",{value:!0});const RV=Gj(Y0),MV=Gj(Sh);let HV=class zj{constructor(t,{headers:r={},schema:n,fetch:i}={}){this.url=t,this.headers=new Headers(r),this.schemaName=n,this.fetch=i}from(t){const r=new URL(`${this.url}/${t}`);return new RV.default(r,{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(t){return new zj(this.url,{headers:this.headers,schema:t,fetch:this.fetch})}rpc(t,r={},{head:n=!1,get:i=!1,count:s}={}){var a;let o;const A=new URL(`${this.url}/rpc/${t}`);let c;n||i?(o=n?"HEAD":"GET",Object.entries(r).filter(([d,f])=>f!==void 0).map(([d,f])=>[d,Array.isArray(f)?`{${f.join(",")}}`:`${f}`]).forEach(([d,f])=>{A.searchParams.append(d,f)})):(o="POST",c=r);const u=new Headers(this.headers);return s&&u.set("Prefer",`count=${s}`),new MV.default({method:o,url:A,headers:u,schema:this.schemaName,body:c,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch})}};kC.default=HV;var Pu=kn&&kn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ii,"__esModule",{value:!0});ii.PostgrestError=ii.PostgrestBuilder=ii.PostgrestTransformBuilder=ii.PostgrestFilterBuilder=ii.PostgrestQueryBuilder=ii.PostgrestClient=void 0;const Wj=Pu(kC);ii.PostgrestClient=Wj.default;const Jj=Pu(Y0);ii.PostgrestQueryBuilder=Jj.default;const qj=Pu(Sh);ii.PostgrestFilterBuilder=qj.default;const Yj=Pu(X0);ii.PostgrestTransformBuilder=Yj.default;const Xj=Pu(Z0);ii.PostgrestBuilder=Xj.default;const Zj=Pu(ev);ii.PostgrestError=Zj.default;var KV=ii.default={PostgrestClient:Wj.default,PostgrestQueryBuilder:Jj.default,PostgrestFilterBuilder:qj.default,PostgrestTransformBuilder:Yj.default,PostgrestBuilder:Xj.default,PostgrestError:Zj.default};const{PostgrestClient:VV,PostgrestQueryBuilder:voe,PostgrestFilterBuilder:woe,PostgrestTransformBuilder:yoe,PostgrestBuilder:xoe,PostgrestError:boe}=KV;class $V{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,s=parseInt(i.replace(/^v/,"").split(".")[0]);return s>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${s} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${s} 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 GV="2.93.3",zV=`realtime-js/${GV}`,WV="1.0.0",eT="2.0.0",ZS=eT,Dy=1e4,JV=1e3,qV=100;var No;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(No||(No={}));var Yr;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(Yr||(Yr={}));var Cs;(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"})(Cs||(Cs={}));var Oy;(function(e){e.websocket="websocket"})(Oy||(Oy={}));var MA;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(MA||(MA={}));class YV{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:{},a=new TextEncoder().encode(JSON.stringify(i)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,a)}_encodeUserBroadcastPush(t,r,n){var i,s;const a=t.topic,o=(i=t.ref)!==null&&i!==void 0?i:"",A=(s=t.join_ref)!==null&&s!==void 0?s:"",c=t.payload.event,u=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},d=Object.keys(u).length===0?"":JSON.stringify(u);if(A.length>255)throw new Error(`joinRef length ${A.length} exceeds maximum of 255`);if(o.length>255)throw new Error(`ref length ${o.length} exceeds maximum of 255`);if(a.length>255)throw new Error(`topic length ${a.length} exceeds maximum of 255`);if(c.length>255)throw new Error(`userEvent length ${c.length} exceeds maximum of 255`);if(d.length>255)throw new Error(`metadata length ${d.length} exceeds maximum of 255`);const f=this.USER_BROADCAST_PUSH_META_LENGTH+A.length+o.length+a.length+c.length+d.length,h=new ArrayBuffer(this.HEADER_LENGTH+f);let v=new DataView(h),p=0;v.setUint8(p++,this.KINDS.userBroadcastPush),v.setUint8(p++,A.length),v.setUint8(p++,o.length),v.setUint8(p++,a.length),v.setUint8(p++,c.length),v.setUint8(p++,d.length),v.setUint8(p++,r),Array.from(A,g=>v.setUint8(p++,g.charCodeAt(0))),Array.from(o,g=>v.setUint8(p++,g.charCodeAt(0))),Array.from(a,g=>v.setUint8(p++,g.charCodeAt(0))),Array.from(c,g=>v.setUint8(p++,g.charCodeAt(0))),Array.from(d,g=>v.setUint8(p++,g.charCodeAt(0)));var y=new Uint8Array(h.byteLength+n.byteLength);return y.set(new Uint8Array(h),0),y.set(new Uint8Array(n),h.byteLength),y.buffer}decode(t,r){if(this._isArrayBuffer(t)){let n=this._binaryDecode(t);return r(n)}if(typeof t=="string"){const n=JSON.parse(t),[i,s,a,o,A]=n;return r({join_ref:i,ref:s,topic:a,event:o,payload:A})}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),s=r.getUint8(2),a=r.getUint8(3),o=r.getUint8(4);let A=this.HEADER_LENGTH+4;const c=n.decode(t.slice(A,A+i));A=A+i;const u=n.decode(t.slice(A,A+s));A=A+s;const d=n.decode(t.slice(A,A+a));A=A+a;const f=t.slice(A,t.byteLength),h=o===this.JSON_ENCODING?JSON.parse(n.decode(f)):f,v={type:this.BROADCAST_EVENT,event:u,payload:h};return a>0&&(v.meta=JSON.parse(d)),{join_ref:null,ref:null,topic:c,event:this.BROADCAST_EVENT,payload:v}}_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 tT{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 nr;(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"})(nr||(nr={}));const eF=(e,t,r={})=>{var n;const i=(n=r.skipTypes)!==null&&n!==void 0?n:[];return t?Object.keys(t).reduce((s,a)=>(s[a]=XV(a,e,t,i),s),{}):{}},XV=(e,t,r,n)=>{const i=t.find(o=>o.name===e),s=i==null?void 0:i.type,a=r[e];return s&&!n.includes(s)?rT(s,a):Ry(a)},rT=(e,t)=>{if(e.charAt(0)==="_"){const r=e.slice(1,e.length);return r$(t,r)}switch(e){case nr.bool:return ZV(t);case nr.float4:case nr.float8:case nr.int2:case nr.int4:case nr.int8:case nr.numeric:case nr.oid:return e$(t);case nr.json:case nr.jsonb:return t$(t);case nr.timestamp:return n$(t);case nr.abstime:case nr.date:case nr.daterange:case nr.int4range:case nr.int8range:case nr.money:case nr.reltime:case nr.text:case nr.time:case nr.timestamptz:case nr.timetz:case nr.tsrange:case nr.tstzrange:return Ry(t);default:return Ry(t)}},Ry=e=>e,ZV=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},e$=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},t$=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},r$=(e,t)=>{if(typeof e!="string")return e;const r=e.length-1,n=e[r];if(e[0]==="{"&&n==="}"){let s;const a=e.slice(1,r);try{s=JSON.parse("["+a+"]")}catch{s=a?a.split(","):[]}return s.map(o=>rT(t,o))}return e},n$=e=>typeof e=="string"?e.replace(" ","T"):e,nT=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 h2{constructor(t,r,n={},i=Dy){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 tF;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(tF||(tF={}));class yf{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:s,onLeave:a,onSync:o}=this.caller;this.joinRef=this.channel._joinRef(),this.state=yf.syncState(this.state,i,s,a),this.pendingDiffs.forEach(A=>{this.state=yf.syncDiff(this.state,A,s,a)}),this.pendingDiffs=[],o()}),this.channel._on(n.diff,{},i=>{const{onJoin:s,onLeave:a,onSync:o}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(i):(this.state=yf.syncDiff(this.state,i,s,a),o())}),this.onJoin((i,s,a)=>{this.channel._trigger("presence",{event:"join",key:i,currentPresences:s,newPresences:a})}),this.onLeave((i,s,a)=>{this.channel._trigger("presence",{event:"leave",key:i,currentPresences:s,leftPresences:a})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(t,r,n,i){const s=this.cloneDeep(t),a=this.transformState(r),o={},A={};return this.map(s,(c,u)=>{a[c]||(A[c]=u)}),this.map(a,(c,u)=>{const d=s[c];if(d){const f=u.map(y=>y.presence_ref),h=d.map(y=>y.presence_ref),v=u.filter(y=>h.indexOf(y.presence_ref)<0),p=d.filter(y=>f.indexOf(y.presence_ref)<0);v.length>0&&(o[c]=v),p.length>0&&(A[c]=p)}else o[c]=u}),this.syncDiff(s,{joins:o,leaves:A},n,i)}static syncDiff(t,r,n,i){const{joins:s,leaves:a}={joins:this.transformState(r.joins),leaves:this.transformState(r.leaves)};return n||(n=()=>{}),i||(i=()=>{}),this.map(s,(o,A)=>{var c;const u=(c=t[o])!==null&&c!==void 0?c:[];if(t[o]=this.cloneDeep(A),u.length>0){const d=t[o].map(h=>h.presence_ref),f=u.filter(h=>d.indexOf(h.presence_ref)<0);t[o].unshift(...f)}n(o,u,A)}),this.map(a,(o,A)=>{let c=t[o];if(!c)return;const u=A.map(d=>d.presence_ref);c=c.filter(d=>u.indexOf(d.presence_ref)<0),t[o]=c,i(o,c,A),c.length===0&&delete t[o]}),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(s=>(s.presence_ref=s.phx_ref,delete s.phx_ref,delete s.phx_ref_prev,s)):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 rF;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(rF||(rF={}));var xf;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(xf||(xf={}));var _a;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(_a||(_a={}));class Hc{constructor(t,r={config:{}},n){var i,s;if(this.topic=t,this.params=r,this.socket=n,this.bindings={},this.state=Yr.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 h2(this,Cs.join,this.params,this.timeout),this.rejoinTimer=new tT(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=Yr.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(a=>a.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=Yr.closed,this.socket._remove(this)}),this._onError(a=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,a),this.state=Yr.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=Yr.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",a=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,a),this.state=Yr.errored,this.rejoinTimer.scheduleTimeout())}),this._on(Cs.reply,{},(a,o)=>{this._trigger(this._replyEventName(o),a)}),this.presence=new yf(this),this.broadcastEndpointURL=nT(this.socket.endPoint),this.private=this.params.config.private||!1,!this.private&&(!((s=(i=this.params.config)===null||i===void 0?void 0:i.broadcast)===null||s===void 0)&&s.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,s;if(this.socket.isConnected()||this.socket.connect(),this.state==Yr.closed){const{config:{broadcast:a,presence:o,private:A}}=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[xf.PRESENCE]&&this.bindings[xf.PRESENCE].length>0||((s=this.params.config.presence)===null||s===void 0?void 0:s.enabled)===!0,d={},f={broadcast:a,presence:Object.assign(Object.assign({},o),{enabled:u}),postgres_changes:c,private:A};this.socket.accessTokenValue&&(d.access_token=this.socket.accessTokenValue),this._onError(h=>t==null?void 0:t(_a.CHANNEL_ERROR,h)),this._onClose(()=>t==null?void 0:t(_a.CLOSED)),this.updateJoinPayload(Object.assign({config:f},d)),this.joinedOnce=!0,this._rejoin(r),this.joinPush.receive("ok",async({postgres_changes:h})=>{var v;if(this.socket._isManualToken()||this.socket.setAuth(),h===void 0){t==null||t(_a.SUBSCRIBED);return}else{const p=this.bindings.postgres_changes,y=(v=p==null?void 0:p.length)!==null&&v!==void 0?v:0,g=[];for(let w=0;w{this.state=Yr.errored,t==null||t(_a.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(h).join(", ")||"error")))}).receive("timeout",()=>{t==null||t(_a.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===Yr.joined&&t===xf.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 s={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(s.Authorization=`Bearer ${this.socket.accessTokenValue}`);const a={method:"POST",headers:s,body:JSON.stringify({messages:[{topic:this.subTopic,event:t,payload:r,private:this.private}]})},o=await this._fetchWithTimeout(this.broadcastEndpointURL,a,(i=n.timeout)!==null&&i!==void 0?i:this.timeout);if(o.status===202)return{success:!0};let A=o.statusText;try{const c=await o.json();A=c.error||c.message||A}catch{}return Promise.reject(new Error(A))}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:s,payload:a}=t,o={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(o.Authorization=`Bearer ${this.socket.accessTokenValue}`);const A={method:"POST",headers:o,body:JSON.stringify({messages:[{topic:this.subTopic,event:s,payload:a,private:this.private}]})};try{const c=await this._fetchWithTimeout(this.broadcastEndpointURL,A,(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(s=>{var a,o,A;const c=this._push(t.type,t,r.timeout||this.timeout);t.type==="broadcast"&&!(!((A=(o=(a=this.params)===null||a===void 0?void 0:a.config)===null||o===void 0?void 0:o.broadcast)===null||A===void 0)&&A.ack)&&s("ok"),c.receive("ok",()=>s("ok")),c.receive("error",()=>s("error")),c.receive("timeout",()=>s("timed out"))})}updateJoinPayload(t){this.joinPush.updatePayload(t)}unsubscribe(t=this.timeout){this.state=Yr.leaving;const r=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(Cs.close,"leave",this._joinRef())};this.joinPush.destroy();let n=null;return new Promise(i=>{n=new h2(this,Cs.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=Yr.closed,this.bindings={}}async _fetchWithTimeout(t,r,n){const i=new AbortController,s=setTimeout(()=>i.abort(),n),a=await this.socket.fetch(t,Object.assign(Object.assign({},r),{signal:i.signal}));return clearTimeout(s),a}_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 h2(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>qV){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,s;const a=t.toLocaleLowerCase(),{close:o,error:A,leave:c,join:u}=Cs;if(n&&[o,A,c,u].indexOf(a)>=0&&n!==this._joinRef())return;let f=this._onMessage(a,r,n);if(r&&!f)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(a)?(i=this.bindings.postgres_changes)===null||i===void 0||i.filter(h=>{var v,p,y;return((v=h.filter)===null||v===void 0?void 0:v.event)==="*"||((y=(p=h.filter)===null||p===void 0?void 0:p.event)===null||y===void 0?void 0:y.toLocaleLowerCase())===a}).map(h=>h.callback(f,n)):(s=this.bindings[a])===null||s===void 0||s.filter(h=>{var v,p,y,g,w,b;if(["broadcast","presence","postgres_changes"].includes(a))if("id"in h){const E=h.id,L=(v=h.filter)===null||v===void 0?void 0:v.event;return E&&((p=r.ids)===null||p===void 0?void 0:p.includes(E))&&(L==="*"||(L==null?void 0:L.toLocaleLowerCase())===((y=r.data)===null||y===void 0?void 0:y.type.toLocaleLowerCase()))}else{const E=(w=(g=h==null?void 0:h.filter)===null||g===void 0?void 0:g.event)===null||w===void 0?void 0:w.toLocaleLowerCase();return E==="*"||E===((b=r==null?void 0:r.event)===null||b===void 0?void 0:b.toLocaleLowerCase())}else return h.type.toLocaleLowerCase()===a}).map(h=>{if(typeof f=="object"&&"ids"in f){const v=f.data,{schema:p,table:y,commit_timestamp:g,type:w,errors:b}=v;f=Object.assign(Object.assign({},{schema:p,table:y,commit_timestamp:g,eventType:w,new:{},old:{},errors:b}),this._getPayloadRecords(v))}h.callback(f,n)})}_isClosed(){return this.state===Yr.closed}_isJoined(){return this.state===Yr.joined}_isJoining(){return this.state===Yr.joining}_isLeaving(){return this.state===Yr.leaving}_replyEventName(t){return`chan_reply_${t}`}_on(t,r,n){const i=t.toLocaleLowerCase(),s={type:i,filter:r,callback:n};return this.bindings[i]?this.bindings[i].push(s):this.bindings[i]=[s],this}_off(t,r){const n=t.toLocaleLowerCase();return this.bindings[n]&&(this.bindings[n]=this.bindings[n].filter(i=>{var s;return!(((s=i.type)===null||s===void 0?void 0:s.toLocaleLowerCase())===n&&Hc.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(Cs.close,{},t)}_onError(t){this._on(Cs.error,{},r=>t(r))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(t=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=Yr.joining,this.joinPush.resend(t))}_getPayloadRecords(t){const r={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(r.new=eF(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(r.old=eF(t.columns,t.old_record)),r}}const p2=()=>{},Yp={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},i$=[1e3,2e3,5e3,1e4],s$=1e4,a$=` addEventListener("message", (e) => { if (e.data.event === "start") { setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); } });`;class o${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=Dy,this.transport=null,this.heartbeatIntervalMs=Yp.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=p2,this.ref=0,this.reconnectTimer=null,this.vsn=ZS,this.logger=p2,this.conn=null,this.sendBuffer=[],this.serializer=new YV,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?(...s)=>i(...s):(...s)=>fetch(...s),!(!((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}/${Oy.websocket}`,this.httpEndpoint=nT(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=$V.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 No.connecting:return MA.Connecting;case No.open:return MA.Open;case No.closing:return MA.Closing;default:return MA.Closed}}isConnected(){return this.connectionState()===MA.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(t,r={config:{}}){const n=`realtime:${t}`,i=this.getChannels().find(s=>s.topic===n);if(i)return i;{const s=new Hc(`realtime:${t}`,r,this);return this.channels.push(s),s}}push(t){const{topic:r,event:n,payload:i,ref:s}=t,a=()=>{this.encode(t,o=>{var A;(A=this.conn)===null||A===void 0||A.send(o)})};this.log("push",`${r} ${n} (${s})`,i),this.isConnected()?a():this.sendBuffer.push(a)}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(JV,"heartbeat timeout"),setTimeout(()=>{var r;this.isConnected()||(r=this.reconnectTimer)===null||r===void 0||r.scheduleTimeout()},Yp.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:s,ref:a}=r,o=a?`(${a})`:"",A=s.status||"";this.log("receive",`${A} ${n} ${i} ${o}`.trim(),s),this.channels.filter(c=>c._isMember(n)).forEach(c=>c._trigger(i,s,a)),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===No.open&&this._onConnOpen())}_teardownConnection(){if(this.conn){if(this.conn.readyState===No.open||this.conn.readyState===No.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(Cs.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([a$],{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 s={access_token:r,version:zV};r&&i.updateJoinPayload(s),i.joinedOnce&&i._isJoined()&&i._push(Cs.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 tT(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},Yp.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(t){var r,n,i,s,a,o,A,c,u,d,f,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:Dy,this.heartbeatIntervalMs=(i=t==null?void 0:t.heartbeatIntervalMs)!==null&&i!==void 0?i:Yp.HEARTBEAT_INTERVAL,this.worker=(s=t==null?void 0:t.worker)!==null&&s!==void 0?s:!1,this.accessToken=(a=t==null?void 0:t.accessToken)!==null&&a!==void 0?a:null,this.heartbeatCallback=(o=t==null?void 0:t.heartbeatCallback)!==null&&o!==void 0?o:p2,this.vsn=(A=t==null?void 0:t.vsn)!==null&&A!==void 0?A:ZS,t!=null&&t.params&&(this.params=t.params),t!=null&&t.logger&&(this.logger=t.logger),(t!=null&&t.logLevel||t!=null&&t.log_level)&&(this.logLevel=t.logLevel||t.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(c=t==null?void 0:t.reconnectAfterMs)!==null&&c!==void 0?c:v=>i$[v-1]||s$,this.vsn){case WV:this.encode=(u=t==null?void 0:t.encode)!==null&&u!==void 0?u:(v,p)=>p(JSON.stringify(v)),this.decode=(d=t==null?void 0:t.decode)!==null&&d!==void 0?d:(v,p)=>p(JSON.parse(v));break;case eT:this.encode=(f=t==null?void 0:t.encode)!==null&&f!==void 0?f: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 nh=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 A$(e,t,r){const n=new URL(t,e);if(r)for(const[i,s]of Object.entries(r))s!==void 0&&n.searchParams.set(i,s);return n.toString()}async function l$(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 c$(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:r,path:n,query:i,body:s,headers:a}){const o=A$(e.baseUrl,n,i),A=await l$(e.auth),c=await t(o,{method:r,headers:{...s?{"Content-Type":"application/json"}:{},...A,...a},body:s?JSON.stringify(s):void 0}),u=await c.text(),d=(c.headers.get("content-type")||"").includes("application/json"),f=d&&u?JSON.parse(u):u;if(!c.ok){const h=d?f:void 0,v=h==null?void 0:h.error;throw new nh((v==null?void 0:v.message)??`Request failed with status ${c.status}`,{status:c.status,icebergType:v==null?void 0:v.type,icebergCode:v==null?void 0:v.code,details:h})}return{status:c.status,headers:c.headers,data:f}}}}function Xp(e){return e.join("")}var u$=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:Xp(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/${Xp(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Xp(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Xp(e.namespace)}`}),!0}catch(t){if(t instanceof nh&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(r){if(r instanceof nh&&r.status===409)return;throw r}}};function Ac(e){return e.join("")}var d$=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/${Ac(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/${Ac(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/${Ac(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/${Ac(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/${Ac(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/${Ac(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(r){if(r instanceof nh&&r.status===404)return!1;throw r}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(r){if(r instanceof nh&&r.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw r}}},f$=class{constructor(e){var n;let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const r=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=c$({baseUrl:r,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=(n=e.accessDelegation)==null?void 0:n.join(","),this.namespaceOps=new u$(this.client,t),this.tableOps=new d$(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)}},tv=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 rv(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var Zp=class extends tv{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}}},iT=class extends tv{constructor(e,t,r="storage"){super(e,r),this.name=r==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=t}};const h$=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),p$=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)},My=e=>{if(Array.isArray(e))return e.map(r=>My(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,s=>s.toUpperCase().replace(/[-_]/g,""));t[i]=My(n)}),t},m$=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e);function ih(e){"@babel/helpers - typeof";return ih=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},ih(e)}function g$(e,t){if(ih(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ih(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function v$(e){var t=g$(e,"string");return ih(t)=="symbol"?t:t+""}function w$(e,t,r){return(t=v$(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nF(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 At(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)},y$=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,s=i.status||500;if(typeof i.json=="function")i.json().then(a=>{const o=(a==null?void 0:a.statusCode)||(a==null?void 0:a.code)||s+"";t(new Zp(iF(a),s,o,n))}).catch(()=>{if(n==="vectors"){const a=s+"";t(new Zp(i.statusText||`HTTP ${s} error`,s,a,n))}else{const a=s+"";t(new Zp(i.statusText||`HTTP ${s} error`,s,a,n))}});else{const a=s+"";t(new Zp(i.statusText||`HTTP ${s} error`,s,a,n))}}else t(new iT(iF(e),e,n))},x$=(e,t,r,n)=>{const i={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"||e==="HEAD"||!n?At(At({},i),r):(p$(n)?(i.headers=At({"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),At(At({},i),r))};async function Id(e,t,r,n,i,s,a){return new Promise((o,A)=>{e(r,x$(t,n,i,s)).then(c=>{if(!c.ok)throw c;if(n!=null&&n.noResolveJson)return c;if(a==="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=>o(c)).catch(c=>y$(c,A,n,a))})}function sT(e="storage"){return{get:async(t,r,n,i)=>Id(t,"GET",r,n,i,void 0,e),post:async(t,r,n,i,s)=>Id(t,"POST",r,i,s,n,e),put:async(t,r,n,i,s)=>Id(t,"PUT",r,i,s,n,e),head:async(t,r,n,i)=>Id(t,"HEAD",r,At(At({},n),{},{noResolveJson:!0}),i,void 0,e),remove:async(t,r,n,i,s)=>Id(t,"DELETE",r,i,s,n,e)}}const b$=sT("storage"),{get:sh,post:ys,put:Hy,head:C$,remove:LC}=b$,bi=sT("vectors");var Qu=class{constructor(e,t={},r,n="storage"){this.shouldThrowOnError=!1,this.url=e,this.headers=t,this.fetch=h$(r),this.namespace=n}throwOnError(){return this.shouldThrowOnError=!0,this}async handleOperation(e){var t=this;try{return{data:await e(),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(rv(r))return{data:null,error:r};throw r}}},B$=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(rv(t))return{data:null,error:t};throw t}}};let aT;aT=Symbol.toStringTag;var S$=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[aT]="BlobDownloadBuilder",this.promise=null}asStream(){return new B$(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(rv(t))return{data:null,error:t};throw t}}};const F$={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},sF={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var E$=class extends Qu{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 s;const a=At(At({},sF),n);let o=At(At({},i.headers),e==="POST"&&{"x-upsert":String(a.upsert)});const A=a.metadata;typeof Blob<"u"&&r instanceof Blob?(s=new FormData,s.append("cacheControl",a.cacheControl),A&&s.append("metadata",i.encodeMetadata(A)),s.append("",r)):typeof FormData<"u"&&r instanceof FormData?(s=r,s.has("cacheControl")||s.append("cacheControl",a.cacheControl),A&&!s.has("metadata")&&s.append("metadata",i.encodeMetadata(A))):(s=r,o["cache-control"]=`max-age=${a.cacheControl}`,o["content-type"]=a.contentType,A&&(o["x-metadata"]=i.toBase64(i.encodeMetadata(A))),(typeof ReadableStream<"u"&&s instanceof ReadableStream||s&&typeof s=="object"&&"pipe"in s&&typeof s.pipe=="function")&&!a.duplex&&(a.duplex="half")),n!=null&&n.headers&&(o=At(At({},o),n.headers));const c=i._removeEmptyFolders(t),u=i._getFinalPath(c),d=await(e=="PUT"?Hy:ys)(i.fetch,`${i.url}/object/${u}`,s,At({headers:o},a!=null&&a.duplex?{duplex:a.duplex}:{}));return{path:c,id:d.Id,fullPath:d.Key}})}async upload(e,t,r){return this.uploadOrUpdate("POST",e,t,r)}async uploadToSignedUrl(e,t,r,n){var i=this;const s=i._removeEmptyFolders(e),a=i._getFinalPath(s),o=new URL(i.url+`/object/upload/sign/${a}`);return o.searchParams.set("token",t),i.handleOperation(async()=>{let A;const c=At({upsert:sF.upsert},n),u=At(At({},i.headers),{"x-upsert":String(c.upsert)});return typeof Blob<"u"&&r instanceof Blob?(A=new FormData,A.append("cacheControl",c.cacheControl),A.append("",r)):typeof FormData<"u"&&r instanceof FormData?(A=r,A.append("cacheControl",c.cacheControl)):(A=r,u["cache-control"]=`max-age=${c.cacheControl}`,u["content-type"]=c.contentType),{path:s,fullPath:(await Hy(i.fetch,o.toString(),A,{headers:u})).Key}})}async createSignedUploadUrl(e,t){var r=this;return r.handleOperation(async()=>{let n=r._getFinalPath(e);const i=At({},r.headers);t!=null&&t.upsert&&(i["x-upsert"]="true");const s=await ys(r.fetch,`${r.url}/object/upload/sign/${n}`,{},{headers:i}),a=new URL(r.url+s.url),o=a.searchParams.get("token");if(!o)throw new tv("No token returned by API");return{signedUrl:a.toString(),path:e,token:o}})}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 ys(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 ys(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),s=await ys(n.fetch,`${n.url}/object/sign/${i}`,At({expiresIn:t},r!=null&&r.transform?{transform:r.transform}:{}),{headers:n.headers});const a=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return{signedUrl:encodeURI(`${n.url}${s.signedURL}${a}`)}})}async createSignedUrls(e,t,r){var n=this;return n.handleOperation(async()=>{const i=await ys(n.fetch,`${n.url}/object/sign/${n.bucketId}`,{expiresIn:t,paths:e},{headers:n.headers}),s=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return i.map(a=>At(At({},a),{},{signedUrl:a.signedURL?encodeURI(`${n.url}${a.signedURL}${s}`):null}))})}download(e,t){const r=typeof(t==null?void 0:t.transform)<"u"?"render/image/authenticated":"object",n=this.transformOptsToQueryString((t==null?void 0:t.transform)||{}),i=n?`?${n}`:"",s=this._getFinalPath(e),a=()=>sh(this.fetch,`${this.url}/${r}/${s}${i}`,{headers:this.headers,noResolveJson:!0});return new S$(a,this.shouldThrowOnError)}async info(e){var t=this;const r=t._getFinalPath(e);return t.handleOperation(async()=>My(await sh(t.fetch,`${t.url}/object/info/${r}`,{headers:t.headers})))}async exists(e){var t=this;const r=t._getFinalPath(e);try{return await C$(t.fetch,`${t.url}/object/${r}`,{headers:t.headers}),{data:!0,error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(rv(n)&&n instanceof iT){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 s=typeof(t==null?void 0:t.transform)<"u"?"render/image":"object",a=this.transformOptsToQueryString((t==null?void 0:t.transform)||{});a!==""&&n.push(a);let o=n.join("&");return o!==""&&(o=`?${o}`),{data:{publicUrl:encodeURI(`${this.url}/${s}/public/${r}${o}`)}}}async remove(e){var t=this;return t.handleOperation(async()=>await LC(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=At(At(At({},F$),t),{},{prefix:e||""});return await ys(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=At({},e);return await ys(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 N$="2.93.3",Fh={"X-Client-Info":`storage-js/${N$}`};var _$=class extends Qu{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 s=i.href.replace(/\/$/,""),a=At(At({},Fh),t);super(s,a,r,"storage")}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const r=t.listBucketOptionsToQueryString(e);return await sh(t.fetch,`${t.url}/bucket${r}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await sh(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var r=this;return r.handleOperation(async()=>await ys(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 Hy(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 ys(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await LC(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():""}},U$=class extends Qu{constructor(e,t={},r){const n=e.replace(/\/$/,""),i=At(At({},Fh),t);super(n,i,r,"storage")}async createBucket(e){var t=this;return t.handleOperation(async()=>await ys(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 sh(t.fetch,i,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await LC(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!m$(e))throw new tv("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 f$({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}),n=this.shouldThrowOnError;return new Proxy(r,{get(i,s){const a=i[s];return typeof a!="function"?a:async(...o)=>{try{return{data:await a.apply(i,o),error:null}}catch(A){if(n)throw A;return{data:null,error:A}}}}})}},j$=class extends Qu{constructor(e,t={},r){const n=e.replace(/\/$/,""),i=At(At({},Fh),{},{"Content-Type":"application/json"},t);super(n,i,r,"vectors")}async createIndex(e){var t=this;return t.handleOperation(async()=>await bi.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var r=this;return r.handleOperation(async()=>await bi.post(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await bi.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var r=this;return r.handleOperation(async()=>await bi.post(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers})||{})}},T$=class extends Qu{constructor(e,t={},r){const n=e.replace(/\/$/,""),i=At(At({},Fh),{},{"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 bi.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await bi.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 bi.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await bi.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 bi.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},I$=class extends Qu{constructor(e,t={},r){const n=e.replace(/\/$/,""),i=At(At({},Fh),{},{"Content-Type":"application/json"},t);super(n,i,r,"vectors")}async createBucket(e){var t=this;return t.handleOperation(async()=>await bi.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await bi.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await bi.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await bi.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},k$=class extends I${constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new L$(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)}},L$=class extends j${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,At(At({},e),{},{vectorBucketName:r.vectorBucketName}))}async listIndexes(e={}){var t=()=>super.listIndexes,r=this;return t().call(r,At(At({},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 P$(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},P$=class extends T${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,At(At({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async getVectors(e){var t=()=>super.getVectors,r=this;return t().call(r,At(At({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,r=this;return t().call(r,At(At({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,r=this;return t().call(r,At(At({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,r=this;return t().call(r,At(At({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}},Q$=class extends _${constructor(e,t={},r,n){super(e,t,r,n)}from(e){return new E$(this.url,this.headers,e,this.fetch)}get vectors(){return new k$(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new U$(this.url+"/iceberg",this.headers,this.fetch)}};const D$="2.30.0",O$={"X-Client-Info":`supabase-js/${D$}`};var Ky={exports:{}};(function(e,t){var r=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof kn<"u"&&kn,n=function(){function s(){this.fetch=!1,this.DOMException=r.DOMException}return s.prototype=r,new s}();(function(s){(function(a){var o=typeof s<"u"&&s||typeof self<"u"&&self||typeof kn<"u"&&kn||{},A={searchParams:"URLSearchParams"in o,iterable:"Symbol"in o&&"iterator"in Symbol,blob:"FileReader"in o&&"Blob"in o&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in o,arrayBuffer:"ArrayBuffer"in o};function c(D){return D&&DataView.prototype.isPrototypeOf(D)}if(A.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],d=ArrayBuffer.isView||function(D){return D&&u.indexOf(Object.prototype.toString.call(D))>-1};function f(D){if(typeof D!="string"&&(D=String(D)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(D)||D==="")throw new TypeError('Invalid character in header field name: "'+D+'"');return D.toLowerCase()}function h(D){return typeof D!="string"&&(D=String(D)),D}function v(D){var U={next:function(){var P=D.shift();return{done:P===void 0,value:P}}};return A.iterable&&(U[Symbol.iterator]=function(){return U}),U}function p(D){this.map={},D instanceof p?D.forEach(function(U,P){this.append(P,U)},this):Array.isArray(D)?D.forEach(function(U){if(U.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+U.length);this.append(U[0],U[1])},this):D&&Object.getOwnPropertyNames(D).forEach(function(U){this.append(U,D[U])},this)}p.prototype.append=function(D,U){D=f(D),U=h(U);var P=this.map[D];this.map[D]=P?P+", "+U:U},p.prototype.delete=function(D){delete this.map[f(D)]},p.prototype.get=function(D){return D=f(D),this.has(D)?this.map[D]:null},p.prototype.has=function(D){return this.map.hasOwnProperty(f(D))},p.prototype.set=function(D,U){this.map[f(D)]=h(U)},p.prototype.forEach=function(D,U){for(var P in this.map)this.map.hasOwnProperty(P)&&D.call(U,this.map[P],P,this)},p.prototype.keys=function(){var D=[];return this.forEach(function(U,P){D.push(P)}),v(D)},p.prototype.values=function(){var D=[];return this.forEach(function(U){D.push(U)}),v(D)},p.prototype.entries=function(){var D=[];return this.forEach(function(U,P){D.push([P,U])}),v(D)},A.iterable&&(p.prototype[Symbol.iterator]=p.prototype.entries);function y(D){if(!D._noBody){if(D.bodyUsed)return Promise.reject(new TypeError("Already read"));D.bodyUsed=!0}}function g(D){return new Promise(function(U,P){D.onload=function(){U(D.result)},D.onerror=function(){P(D.error)}})}function w(D){var U=new FileReader,P=g(U);return U.readAsArrayBuffer(D),P}function b(D){var U=new FileReader,P=g(U),M=/charset=([A-Za-z0-9_-]+)/.exec(D.type),$=M?M[1]:"utf-8";return U.readAsText(D,$),P}function E(D){for(var U=new Uint8Array(D),P=new Array(U.length),M=0;M-1?U:D}function I(D,U){if(!(this instanceof I))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');U=U||{};var P=U.body;if(D instanceof I){if(D.bodyUsed)throw new TypeError("Already read");this.url=D.url,this.credentials=D.credentials,U.headers||(this.headers=new p(D.headers)),this.method=D.method,this.mode=D.mode,this.signal=D.signal,!P&&D._bodyInit!=null&&(P=D._bodyInit,D.bodyUsed=!0)}else this.url=String(D);if(this.credentials=U.credentials||this.credentials||"same-origin",(U.headers||!this.headers)&&(this.headers=new p(U.headers)),this.method=S(U.method||this.method||"GET"),this.mode=U.mode||this.mode||null,this.signal=U.signal||this.signal||function(){if("AbortController"in o){var X=new AbortController;return X.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&P)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(P),(this.method==="GET"||this.method==="HEAD")&&(U.cache==="no-store"||U.cache==="no-cache")){var M=/([?&])_=[^&]*/;if(M.test(this.url))this.url=this.url.replace(M,"$1_="+new Date().getTime());else{var $=/\?/;this.url+=($.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}I.prototype.clone=function(){return new I(this,{body:this._bodyInit})};function H(D){var U=new FormData;return D.trim().split("&").forEach(function(P){if(P){var M=P.split("="),$=M.shift().replace(/\+/g," "),X=M.join("=").replace(/\+/g," ");U.append(decodeURIComponent($),decodeURIComponent(X))}}),U}function N(D){var U=new p,P=D.replace(/\r?\n[\t ]+/g," ");return P.split("\r").map(function(M){return M.indexOf(` `)===0?M.substr(1,M.length):M}).forEach(function(M){var $=M.split(":"),X=$.shift().trim();if(X){var le=$.join(":").trim();try{U.append(X,le)}catch(O){console.warn("Response "+O.message)}}}),U}_.call(I.prototype);function j(D,U){if(!(this instanceof j))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(U||(U={}),this.type="default",this.status=U.status===void 0?200:U.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=U.statusText===void 0?"":""+U.statusText,this.headers=new p(U.headers),this.url=U.url||"",this._initBody(D)}_.call(j.prototype),j.prototype.clone=function(){return new j(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},j.error=function(){var D=new j(null,{status:200,statusText:""});return D.ok=!1,D.status=0,D.type="error",D};var R=[301,302,303,307,308];j.redirect=function(D,U){if(R.indexOf(U)===-1)throw new RangeError("Invalid status code");return new j(null,{status:U,headers:{location:D}})},a.DOMException=o.DOMException;try{new a.DOMException}catch{a.DOMException=function(U,P){this.message=U,this.name=P;var M=Error(U);this.stack=M.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function T(D,U){return new Promise(function(P,M){var $=new I(D,U);if($.signal&&$.signal.aborted)return M(new a.DOMException("Aborted","AbortError"));var X=new XMLHttpRequest;function le(){X.abort()}X.onload=function(){var z={statusText:X.statusText,headers:N(X.getAllResponseHeaders()||"")};$.url.indexOf("file://")===0&&(X.status<200||X.status>599)?z.status=200:z.status=X.status,z.url="responseURL"in X?X.responseURL:z.headers.get("X-Request-URL");var q="response"in X?X.response:X.responseText;setTimeout(function(){P(new j(q,z))},0)},X.onerror=function(){setTimeout(function(){M(new TypeError("Network request failed"))},0)},X.ontimeout=function(){setTimeout(function(){M(new TypeError("Network request timed out"))},0)},X.onabort=function(){setTimeout(function(){M(new a.DOMException("Aborted","AbortError"))},0)};function O(z){try{return z===""&&o.location.href?o.location.href:z}catch{return z}}if(X.open($.method,O($.url),!0),$.credentials==="include"?X.withCredentials=!0:$.credentials==="omit"&&(X.withCredentials=!1),"responseType"in X&&(A.blob?X.responseType="blob":A.arrayBuffer&&(X.responseType="arraybuffer")),U&&typeof U.headers=="object"&&!(U.headers instanceof p||o.Headers&&U.headers instanceof o.Headers)){var J=[];Object.getOwnPropertyNames(U.headers).forEach(function(z){J.push(f(z)),X.setRequestHeader(z,h(U.headers[z]))}),$.headers.forEach(function(z,q){J.indexOf(q)===-1&&X.setRequestHeader(q,z)})}else $.headers.forEach(function(z,q){X.setRequestHeader(q,z)});$.signal&&($.signal.addEventListener("abort",le),X.onreadystatechange=function(){X.readyState===4&&$.signal.removeEventListener("abort",le)}),X.send(typeof $._bodyInit>"u"?null:$._bodyInit)})}return T.polyfill=!0,o.fetch||(o.fetch=T,o.Headers=p,o.Request=I,o.Response=j),a.Headers=p,a.Request=I,a.Response=j,a.fetch=T,Object.defineProperty(a,"__esModule",{value:!0}),a})({})})(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=r.fetch?r:n;t=i.fetch,t.default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t})(Ky,Ky.exports);var PC=Ky.exports;const oT=wl(PC),R$=NN({__proto__:null,default:oT},[PC]);var M$=globalThis&&globalThis.__awaiter||function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(u){try{c(n.next(u))}catch(d){a(d)}}function A(u){try{c(n.throw(u))}catch(d){a(d)}}function c(u){u.done?s(u.value):i(u.value).then(o,A)}c((n=n.apply(e,t||[])).next())})};const H$=e=>{let t;return e?t=e:typeof fetch>"u"?t=oT:t=fetch,(...r)=>t(...r)},K$=()=>typeof Headers>"u"?PC.Headers:Headers,V$=(e,t,r)=>{const n=H$(r),i=K$();return(s,a)=>M$(void 0,void 0,void 0,function*(){var o;const A=(o=yield t())!==null&&o!==void 0?o:e;let c=new i(a==null?void 0:a.headers);return c.has("apikey")||c.set("apikey",e),c.has("Authorization")||c.set("Authorization",`Bearer ${A}`),n(s,Object.assign(Object.assign({},a),{headers:c}))})};function $$(e){return e.replace(/\/$/,"")}function G$(e,t){const{db:r,auth:n,realtime:i,global:s}=e,{db:a,auth:o,realtime:A,global:c}=t;return{db:Object.assign(Object.assign({},a),r),auth:Object.assign(Object.assign({},o),n),realtime:Object.assign(Object.assign({},A),i),global:Object.assign(Object.assign({},c),s)}}const z$="modulepreload",W$=function(e){return"/"+e},aF={},t0=function(t,r,n){if(!r||r.length===0)return t();const i=document.getElementsByTagName("link");return Promise.all(r.map(s=>{if(s=W$(s),s in aF)return;aF[s]=!0;const a=s.endsWith(".css"),o=a?'[rel="stylesheet"]':"";if(!!n)for(let u=i.length-1;u>=0;u--){const d=i[u];if(d.href===s&&(!a||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${s}"]${o}`))return;const c=document.createElement("link");if(c.rel=a?"stylesheet":z$,a||(c.as="script",c.crossOrigin=""),c.href=s,document.head.appendChild(c),a)return new Promise((u,d)=>{c.addEventListener("load",u),c.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${s}`)))})})).then(()=>t()).catch(s=>{const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s})};function J$(e){return Math.round(Date.now()/1e3)+e}function q$(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}const Ea=()=>typeof document<"u",kA={tested:!1,writable:!1},ag=()=>{if(!Ea())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(kA.tested)return kA.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),kA.tested=!0,kA.writable=!0}catch{kA.tested=!0,kA.writable=!1}return kA.writable};function ei(e,t){var r;t||(t=((r=window==null?void 0:window.location)===null||r===void 0?void 0:r.href)||""),e=e.replace(/[\[\]]/g,"\\$&");const n=new RegExp("[?&#]"+e+"(=([^&#]*)|&|#|$)"),i=n.exec(t);return i?i[2]?decodeURIComponent(i[2].replace(/\+/g," ")):"":null}const AT=e=>{let t;return e?t=e:typeof fetch>"u"?t=async(...r)=>await(await t0(()=>Promise.resolve().then(()=>R$),void 0)).fetch(...r):t=fetch,(...r)=>t(...r)},Y$=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",kd=async(e,t,r)=>{await e.setItem(t,JSON.stringify(r))},em=async(e,t)=>{const r=await e.getItem(t);if(!r)return null;try{return JSON.parse(r)}catch{return r}},m2=async(e,t)=>{await e.removeItem(t)};function X$(e){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let r="",n,i,s,a,o,A,c,u=0;for(e=e.replace("-","+").replace("_","/");u>4,i=(o&15)<<4|A>>2,s=(A&3)<<6|c,r=r+String.fromCharCode(n),A!=64&&i!=0&&(r=r+String.fromCharCode(i)),c!=64&&s!=0&&(r=r+String.fromCharCode(s));return r}class nv{constructor(){this.promise=new nv.promiseConstructor((t,r)=>{this.resolve=t,this.reject=r})}}nv.promiseConstructor=Promise;function oF(e){const t=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}=?$|[a-z0-9_-]{2}(==)?$)$/i,r=e.split(".");if(r.length!==3)throw new Error("JWT is not valid: not a JWT structure");if(!t.test(r[1]))throw new Error("JWT is not valid: payload is not in base64url format");const n=r[1];return JSON.parse(X$(n))}function Z$(e){return new Promise(t=>{setTimeout(()=>t(null),e)})}function eG(e,t){return new Promise((n,i)=>{(async()=>{for(let s=0;s<1/0;s++)try{const a=await e(s);if(!t(s,null,a)){n(a);return}}catch(a){if(!t(s,a)){i(a);return}}})()})}function tG(e){return("0"+e.toString(16)).substr(-2)}function tm(){const t=new Uint32Array(56);if(typeof crypto>"u"){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=r.length;let i="";for(let s=0;s<56;s++)i+=r.charAt(Math.floor(Math.random()*n));return i}return crypto.getRandomValues(t),Array.from(t,tG).join("")}async function rG(e){const r=new TextEncoder().encode(e),n=await crypto.subtle.digest("SHA-256",r),i=new Uint8Array(n);return Array.from(i).map(s=>String.fromCharCode(s)).join("")}function nG(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function rm(e){if(typeof crypto>"u")return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;const t=await rG(e);return nG(t)}const iG="__stack_guard__",sG="__",aG=/__stack_guard__([a-zA-Z0-9_-]+)__/;let AF=!1,QC;function Vy(e){var t,r;QC();let n;try{throw new Error}catch(s){n=s}const i=(r=(t=n.stack)===null||t===void 0?void 0:t.split(` `))!==null&&r!==void 0?r:[];for(let s=0;sawait t()}[r]()}QC=async()=>{AF||(AF=!0,await $y("ENV_CHECK",async()=>{const e=Vy("ENV_CHECK");return e||console.warn("@supabase/gotrue-js: Stack guards not supported in this environment. Generally not an issue but may point to a very conservative transpilation environment (use ES2017 or above) that implements async/await with generators, or this is a JavaScript engine that does not support async/await stack traces."),e}))};class DC extends Error{constructor(t,r){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=r}}function Tt(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class oG extends DC{constructor(t,r){super(t,r),this.name="AuthApiError",this.status=r}toJSON(){return{name:this.name,message:this.message,status:this.status}}}function AG(e){return Tt(e)&&e.name==="AuthApiError"}class lT extends DC{constructor(t,r){super(t),this.name="AuthUnknownError",this.originalError=r}}class Du extends DC{constructor(t,r,n){super(t),this.name=r,this.status=n}toJSON(){return{name:this.name,message:this.message,status:this.status}}}class lc extends Du{constructor(){super("Auth session missing!","AuthSessionMissingError",400)}}class g2 extends Du{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500)}}class nm extends Du{constructor(t){super(t,"AuthInvalidCredentialsError",400)}}class ba extends Du{constructor(t,r=null){super(t,"AuthImplicitGrantRedirectError",500),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class v2 extends Du{constructor(t,r=null){super(t,"AuthPKCEGrantCodeExchangeError",500),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class Gy extends Du{constructor(t,r){super(t,"AuthRetryableFetchError",r)}}function lF(e){return Tt(e)&&e.name==="AuthRetryableFetchError"}var lG=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);ie.msg||e.message||e.error_description||e.error||JSON.stringify(e),cG=[502,503,504];async function cF(e){if(!Y$(e))throw new Gy(qd(e),0);if(cG.includes(e.status))throw new Gy(qd(e),e.status);let t;try{t=await e.json()}catch(r){throw new lT(qd(r),r)}throw new oG(qd(t),e.status||500)}const uG=(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 Dt(e,t,r,n){var i;const s=Object.assign({},n==null?void 0:n.headers);n!=null&&n.jwt&&(s.Authorization=`Bearer ${n.jwt}`);const a=(i=n==null?void 0:n.query)!==null&&i!==void 0?i:{};n!=null&&n.redirectTo&&(a.redirect_to=n.redirectTo);const o=Object.keys(a).length?"?"+new URLSearchParams(a).toString():"",A=await dG(e,t,r+o,{headers:s,noResolveJson:n==null?void 0:n.noResolveJson},{},n==null?void 0:n.body);return n!=null&&n.xform?n==null?void 0:n.xform(A):{data:Object.assign({},A),error:null}}async function dG(e,t,r,n,i,s){const a=uG(t,n,i,s);let o;try{o=await e(r,a)}catch(A){throw console.error(A),new Gy(qd(A),0)}if(o.ok||await cF(o),n!=null&&n.noResolveJson)return o;try{return await o.json()}catch(A){await cF(A)}}function mo(e){var t;let r=null;mG(e)&&(r=Object.assign({},e),r.expires_at=J$(e.expires_in));const n=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:r,user:n},error:null}}function HA(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function fG(e){return{data:e,error:null}}function hG(e){const{action_link:t,email_otp:r,hashed_token:n,redirect_to:i,verification_type:s}=e,a=lG(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),o={action_link:t,email_otp:r,hashed_token:n,redirect_to:i,verification_type:s},A=Object.assign({},a);return{data:{properties:o,user:A},error:null}}function pG(e){return e}function mG(e){return e.access_token&&e.refresh_token&&e.expires_in}var gG=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i0&&(h.forEach(v=>{const p=parseInt(v.split(";")[0].split("=")[1].substring(0,1)),y=JSON.parse(v.split(";")[1].split("=")[1]);c[`${y}Page`]=p}),c.total=parseInt(f)),{data:Object.assign(Object.assign({},d),c),error:null}}catch(c){if(Tt(c))return{data:{users:[]},error:c};throw c}}async getUserById(t){try{return await Dt(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:HA})}catch(r){if(Tt(r))return{data:{user:null},error:r};throw r}}async updateUserById(t,r){try{return await Dt(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:r,headers:this.headers,xform:HA})}catch(n){if(Tt(n))return{data:{user:null},error:n};throw n}}async deleteUser(t,r=!1){try{return await Dt(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:r},xform:HA})}catch(n){if(Tt(n))return{data:{user:null},error:n};throw n}}async _listFactors(t){try{const{data:r,error:n}=await Dt(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(Tt(r))return{data:null,error:r};throw r}}async _deleteFactor(t){try{return{data:await Dt(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(r){if(Tt(r))return{data:null,error:r};throw r}}}const wG="2.43.1",yG="http://localhost:9999",xG="supabase.auth.token",bG={"X-Client-Info":`gotrue-js/${wG}`},uF=10,dF={getItem:e=>ag()?globalThis.localStorage.getItem(e):null,setItem:(e,t)=>{ag()&&globalThis.localStorage.setItem(e,t)},removeItem:e=>{ag()&&globalThis.localStorage.removeItem(e)}};function CG(){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)}}CG();const BG={url:yG,storageKey:xG,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:bG,flowType:"implicit",debug:!1},im=30*1e3,fF=3;class ah{constructor(t){var r;this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.broadcastChannel=null,this.instanceID=ah.nextInstanceID,ah.nextInstanceID+=1,this.instanceID>0&&Ea()&&console.warn("Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.");const n=Object.assign(Object.assign({},BG),t);if(this.logDebugMessages=n.debug,this.inMemorySession=null,this.storageKey=n.storageKey,this.autoRefreshToken=n.autoRefreshToken,this.persistSession=n.persistSession,this.storage=n.storage||dF,this.admin=new vG({url:n.url,headers:n.headers,fetch:n.fetch}),this.url=n.url,this.headers=n.headers,this.fetch=AT(n.fetch),this.detectSessionInUrl=n.detectSessionInUrl,this.flowType=n.flowType,this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this)},this.persistSession&&this.storage===dF&&!ag()&&console.warn(`No storage option exists to persist the session, which may result in unexpected behavior when using auth. If you want to set persistSession to true, please provide a storage option or you may set persistSession to false to disable this warning.`),Ea()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(i){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",i)}(r=this.broadcastChannel)===null||r===void 0||r.addEventListener("message",async i=>{this._debug("received broadcast notification from other tab or client",i),await this._notifyAllSubscribers(i.data.event,i.data.session,!1)})}this.initialize()}_debug(...t){return this.logDebugMessages&&console.log(`GoTrueClient@${this.instanceID} ${new Date().toISOString()}`,...t),this}initialize(){return this.initializePromise?this.initializePromise:this._initialize()}async _initialize(){if(this.initializePromise)throw new Error("Double call of #_initialize()");return this.initializePromise=$y("_initialize",async()=>{try{const t=Ea()?await this._isPKCEFlow():!1;if(this._debug("#_initialize()","begin","is PKCE flow",t),t||this.detectSessionInUrl&&this._isImplicitGrantFlow()){const{data:r,error:n}=await this._getSessionFromUrl(t);if(n)return this._debug("#_initialize()","error detecting session from URL",n),await this._removeSession(),{error:n};const{session:i,redirectType:s}=r;return this._debug("#_initialize()","detected session in URL",i,"redirect type",s),await this._saveSession(i),setTimeout(async()=>{s==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",i):await this._notifyAllSubscribers("SIGNED_IN",i)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(t){return Tt(t)?{error:t}:{error:new lT("Unexpected error during initialization",t)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}),await this.initializePromise}async signUp(t){var r,n,i;try{await this._removeSession();let s;if("email"in t){const{email:u,password:d,options:f}=t;let h=null,v=null;if(this.flowType==="pkce"){const p=tm();await kd(this.storage,`${this.storageKey}-code-verifier`,p),h=await rm(p),v=p===h?"plain":"s256"}s=await Dt(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:f==null?void 0:f.emailRedirectTo,body:{email:u,password:d,data:(r=f==null?void 0:f.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken},code_challenge:h,code_challenge_method:v},xform:mo})}else if("phone"in t){const{phone:u,password:d,options:f}=t;s=await Dt(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:u,password:d,data:(n=f==null?void 0:f.data)!==null&&n!==void 0?n:{},channel:(i=f==null?void 0:f.channel)!==null&&i!==void 0?i:"sms",gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken}},xform:mo})}else throw new nm("You must provide either an email or phone number and a password");const{data:a,error:o}=s;if(o||!a)return{data:{user:null,session:null},error:o};const A=a.session,c=a.user;return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",A)),{data:{user:c,session:A},error:null}}catch(s){if(Tt(s))return{data:{user:null,session:null},error:s};throw s}}async signInWithPassword(t){try{await this._removeSession();let r;if("email"in t){const{email:s,password:a,options:o}=t;r=await Dt(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:s,password:a,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:mo})}else if("phone"in t){const{phone:s,password:a,options:o}=t;r=await Dt(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:s,password:a,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:mo})}else throw new nm("You must provide either an email or phone number and a password");const{data:n,error:i}=r;return i?{data:{user:null,session:null},error:i}:!n||!n.session||!n.user?{data:{user:null,session:null},error:new g2}:(n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),{data:{user:n.user,session:n.session},error:i})}catch(r){if(Tt(r))return{data:{user:null,session:null},error:r};throw r}}async signInWithOAuth(t){var r,n,i,s;return await this._removeSession(),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:(s=t.options)===null||s===void 0?void 0:s.skipBrowserRedirect})}async exchangeCodeForSession(t){const r=await em(this.storage,`${this.storageKey}-code-verifier`),{data:n,error:i}=await Dt(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:r},xform:mo});return await m2(this.storage,`${this.storageKey}-code-verifier`),i?{data:{user:null,session:null},error:i}:!n||!n.session||!n.user?{data:{user:null,session:null},error:new g2}:(n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),{data:n,error:i})}async signInWithIdToken(t){await this._removeSession();try{const{options:r,provider:n,token:i,access_token:s,nonce:a}=t,o=await Dt(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:i,access_token:s,nonce:a,gotrue_meta_security:{captcha_token:r==null?void 0:r.captchaToken}},xform:mo}),{data:A,error:c}=o;return c?{data:{user:null,session:null},error:c}:!A||!A.session||!A.user?{data:{user:null,session:null},error:new g2}:(A.session&&(await this._saveSession(A.session),await this._notifyAllSubscribers("SIGNED_IN",A.session)),{data:A,error:c})}catch(r){if(Tt(r))return{data:{user:null,session:null},error:r};throw r}}async signInWithOtp(t){var r,n,i,s,a;try{if(await this._removeSession(),"email"in t){const{email:o,options:A}=t;let c=null,u=null;if(this.flowType==="pkce"){const f=tm();await kd(this.storage,`${this.storageKey}-code-verifier`,f),c=await rm(f),u=f===c?"plain":"s256"}const{error:d}=await Dt(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:o,data:(r=A==null?void 0:A.data)!==null&&r!==void 0?r:{},create_user:(n=A==null?void 0:A.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:A==null?void 0:A.captchaToken},code_challenge:c,code_challenge_method:u},redirectTo:A==null?void 0:A.emailRedirectTo});return{data:{user:null,session:null},error:d}}if("phone"in t){const{phone:o,options:A}=t,{data:c,error:u}=await Dt(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:o,data:(i=A==null?void 0:A.data)!==null&&i!==void 0?i:{},create_user:(s=A==null?void 0:A.shouldCreateUser)!==null&&s!==void 0?s:!0,gotrue_meta_security:{captcha_token:A==null?void 0:A.captchaToken},channel:(a=A==null?void 0:A.channel)!==null&&a!==void 0?a:"sms"}});return{data:{user:null,session:null,messageId:c==null?void 0:c.message_id},error:u}}throw new nm("You must provide either an email or phone number.")}catch(o){if(Tt(o))return{data:{user:null,session:null},error:o};throw o}}async verifyOtp(t){var r,n;try{t.type!=="email_change"&&t.type!=="phone_change"&&await this._removeSession();const{data:i,error:s}=await Dt(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:(r=t.options)===null||r===void 0?void 0:r.captchaToken}}),redirectTo:(n=t.options)===null||n===void 0?void 0:n.redirectTo,xform:mo});if(s)throw s;if(!i)throw new Error("An error occurred on token verification.");const a=i.session,o=i.user;return a!=null&&a.access_token&&(await this._saveSession(a),await this._notifyAllSubscribers("SIGNED_IN",a)),{data:{user:o,session:a},error:null}}catch(i){if(Tt(i))return{data:{user:null,session:null},error:i};throw i}}async signInWithSSO(t){var r,n,i;try{return await this._removeSession(),await Dt(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}),headers:this.headers,xform:fG})}catch(s){if(Tt(s))return{data:null,error:s};throw s}}async reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;if(n)throw n;if(!r)throw new lc;const{error:i}=await Dt(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return{data:{user:null,session:null},error:i}})}catch(t){if(Tt(t))return{data:{user:null,session:null},error:t};throw t}}async resend(t){try{t.type!="email_change"&&t.type!="phone_change"&&await this._removeSession();const r=`${this.url}/resend`;if("email"in t){const{email:n,type:i,options:s}=t,{error:a}=await Dt(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:i,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken}},redirectTo:s==null?void 0:s.emailRedirectTo});return{data:{user:null,session:null},error:a}}else if("phone"in t){const{phone:n,type:i,options:s}=t,{data:a,error:o}=await Dt(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:i,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken}}});return{data:{user:null,session:null,messageId:a==null?void 0:a.message_id},error:o}}throw new nm("You must provide either an email or phone number and a type")}catch(r){if(Tt(r))return{data:{user:null,session:null},error:r};throw r}}async getSession(){return this._useSession(async t=>t)}async _useSession(t){return await $y("_useSession",async()=>{const r=await this.__loadSession();return await t(r)})}async __loadSession(){if(this._debug("#__loadSession()","begin"),this.logDebugMessages&&!Vy("_useSession"))throw new Error("Please use #_useSession()");Vy("_initialize")||await this.initializePromise;try{let t=null;if(this.persistSession){const s=await em(this.storage,this.storageKey);this._debug("#getSession()","session from storage",s),s!==null&&(this._isValidSession(s)?t=s:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession()))}else t=this.inMemorySession,this._debug("#getSession()","session from memory",t);if(!t)return{data:{session:null},error:null};const r=t.expires_at?t.expires_at<=Date.now()/1e3:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",t.expires_at),!r)return{data:{session:t},error:null};const{session:n,error:i}=await this._callRefreshToken(t.refresh_token);return i?{data:{session:null},error:i}:{data:{session:n},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(t){try{return await this._useSession(async r=>{var n,i;if(!t){const{data:s,error:a}=r;if(a)throw a;t=(i=(n=s.session)===null||n===void 0?void 0:n.access_token)!==null&&i!==void 0?i:void 0}return await Dt(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:HA})})}catch(r){if(Tt(r))return{data:{user:null},error:r};throw r}}async updateUser(t,r={}){try{return await this._useSession(async n=>{const{data:i,error:s}=n;if(s)throw s;if(!i.session)throw new lc;const a=i.session,{data:o,error:A}=await Dt(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r==null?void 0:r.emailRedirectTo,body:t,jwt:a.access_token,xform:HA});if(A)throw A;return a.user=o.user,await this._saveSession(a),await this._notifyAllSubscribers("USER_UPDATED",a),{data:{user:a.user},error:null}})}catch(n){if(Tt(n))return{data:{user:null},error:n};throw n}}_decodeJWT(t){return oF(t)}async setSession(t){try{if(!t.access_token||!t.refresh_token)throw new lc;const r=Date.now()/1e3;let n=r,i=!0,s=null;const a=oF(t.access_token);if(a.exp&&(n=a.exp,i=n<=r),i){const{session:o,error:A}=await this._callRefreshToken(t.refresh_token);if(A)return{data:{user:null,session:null},error:A};if(!o)return{data:{user:null,session:null},error:null};s=o}else{const{data:o,error:A}=await this.getUser(t.access_token);if(A)throw A;s={access_token:t.access_token,refresh_token:t.refresh_token,user:o.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)}return{data:{user:s.user,session:s},error:null}}catch(r){if(Tt(r))return{data:{session:null,user:null},error:r};throw r}}async refreshSession(t){try{return await this._useSession(async r=>{var n;if(!t){const{data:a,error:o}=r;if(o)throw o;t=(n=a.session)!==null&&n!==void 0?n:void 0}if(!(t!=null&&t.refresh_token))throw new lc;const{session:i,error:s}=await this._callRefreshToken(t.refresh_token);return s?{data:{user:null,session:null},error:s}:i?{data:{user:i.user,session:i},error:null}:{data:{user:null,session:null},error:null}})}catch(r){if(Tt(r))return{data:{user:null,session:null},error:r};throw r}}async _getSessionFromUrl(t){try{if(!Ea())throw new ba("No browser detected.");if(this.flowType==="implicit"&&!this._isImplicitGrantFlow())throw new ba("Not a valid implicit grant flow url.");if(this.flowType=="pkce"&&!t)throw new v2("Not a valid PKCE flow url.");if(t){const y=ei("code");if(!y)throw new v2("No code detected.");const{data:g,error:w}=await this.exchangeCodeForSession(y);if(w)throw w;if(!g.session)throw new v2("No session detected.");let b=new URL(window.location.href);return b.searchParams.delete("code"),window.history.replaceState(window.history.state,"",b.toString()),{data:{session:g.session,redirectType:null},error:null}}const r=ei("error_description");if(r){const y=ei("error_code");if(!y)throw new ba("No error_code detected.");const g=ei("error");throw g?new ba(r,{error:g,code:y}):new ba("No error detected.")}const n=ei("provider_token"),i=ei("provider_refresh_token"),s=ei("access_token");if(!s)throw new ba("No access_token detected.");const a=ei("expires_in");if(!a)throw new ba("No expires_in detected.");const o=ei("refresh_token");if(!o)throw new ba("No refresh_token detected.");const A=ei("token_type");if(!A)throw new ba("No token_type detected.");const u=Math.round(Date.now()/1e3)+parseInt(a),{data:d,error:f}=await this.getUser(s);if(f)throw f;const h=d.user,v={provider_token:n,provider_refresh_token:i,access_token:s,expires_in:parseInt(a),expires_at:u,refresh_token:o,token_type:A,user:h},p=ei("type");return window.location.hash="",this._debug("#_getSessionFromUrl()","clearing window.location.hash"),{data:{session:v,redirectType:p},error:null}}catch(r){if(Tt(r))return{data:{session:null,redirectType:null},error:r};throw r}}_isImplicitGrantFlow(){return Ea()&&(!!ei("access_token")||!!ei("error_description"))}async _isPKCEFlow(){const t=await em(this.storage,`${this.storageKey}-code-verifier`);return!!ei("code")&&!!t}async signOut({scope:t}={scope:"global"}){return await this._useSession(async r=>{var n;const{data:i,error:s}=r;if(s)return{error:s};const a=(n=i.session)===null||n===void 0?void 0:n.access_token;if(a){const{error:o}=await this.admin.signOut(a,t);if(o&&!(AG(o)&&(o.status===404||o.status===401)))return{error:o}}return t!=="others"&&(await this._removeSession(),await m2(this.storage,`${this.storageKey}-code-verifier`),await this._notifyAllSubscribers("SIGNED_OUT",null)),{error:null}})}onAuthStateChange(t){const r=q$(),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),this._emitInitialSession(r),{data:{subscription:n}}}async _emitInitialSession(t){return await this._useSession(async r=>{var n,i;try{const{data:{session:s},error:a}=r;if(a)throw a;await((n=this.stateChangeEmitters.get(t))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",s)),this._debug("INITIAL_SESSION","callback id",t,"session",s)}catch(s){await((i=this.stateChangeEmitters.get(t))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",s),console.error(s)}})}async resetPasswordForEmail(t,r={}){let n=null,i=null;if(this.flowType==="pkce"){const s=tm();await kd(this.storage,`${this.storageKey}-code-verifier`,s),n=await rm(s),i=s===n?"plain":"s256"}try{return await Dt(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(s){if(Tt(s))return{data:null,error:s};throw s}}async _refreshAccessToken(t){const r=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(r,"begin");try{const n=Date.now();return await eG(async i=>(await Z$(i*200),this._debug(r,"refreshing attempt",i),await Dt(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:mo})),(i,s,a)=>a&&a.error&&lF(a.error)&&Date.now()+(i+1)*200-n{try{await o.callback(t,r)}catch(A){s.push(A)}});if(await Promise.all(a),s.length>0){for(let o=0;othis._autoRefreshTokenTick(),im);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t),await this._autoRefreshTokenTick()}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{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)/im);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${im}ms, refresh threshold is ${fF} ticks`),i<=fF&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Ea()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){this._debug(`#_onVisibilityChanged(${t})`,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(t||(await this.initializePromise,await this._recoverAndRefresh(),this._debug("#_onVisibilityChanged()","finished waiting for initialize, _recoverAndRefresh")),this.autoRefreshToken&&this._startAutoRefresh()):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(t,r){const n=[`provider=${encodeURIComponent(t)}`];if(r!=null&&r.redirectTo&&n.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r!=null&&r.scopes&&n.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const i=tm();await kd(this.storage,`${this.storageKey}-code-verifier`,i);const s=await rm(i),a=i===s?"plain":"s256";this._debug("PKCE","code verifier",`${i.substring(0,5)}...`,"code challenge",s,"method",a);const o=new URLSearchParams({code_challenge:`${encodeURIComponent(s)}`,code_challenge_method:`${encodeURIComponent(a)}`});n.push(o.toString())}if(r!=null&&r.queryParams){const i=new URLSearchParams(r.queryParams);n.push(i.toString())}return`${this.url}/authorize?${n.join("&")}`}async _unenroll(t){try{return await this._useSession(async r=>{var n;const{data:i,error:s}=r;return s?{data:null,error:s}:await Dt(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(Tt(r))return{data:null,error:r};throw r}}async _enroll(t){try{return await this._useSession(async r=>{var n,i;const{data:s,error:a}=r;if(a)return{data:null,error:a};const{data:o,error:A}=await Dt(this.fetch,"POST",`${this.url}/factors`,{body:{friendly_name:t.friendlyName,factor_type:t.factorType,issuer:t.issuer},headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token});return A?{data:null,error:A}:(!((i=o==null?void 0:o.totp)===null||i===void 0)&&i.qr_code&&(o.totp.qr_code=`data:image/svg+xml;utf-8,${o.totp.qr_code}`),{data:o,error:null})})}catch(r){if(Tt(r))return{data:null,error:r};throw r}}async _verify(t){try{return await this._useSession(async r=>{var n;const{data:i,error:s}=r;if(s)return{data:null,error:s};const{data:a,error:o}=await Dt(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:{code:t.code,challenge_id:t.challengeId},headers:this.headers,jwt:(n=i==null?void 0:i.session)===null||n===void 0?void 0:n.access_token});return o?{data:null,error:o}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+a.expires_in},a)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",a),{data:a,error:o})})}catch(r){if(Tt(r))return{data:null,error:r};throw r}}async _challenge(t){try{return await this._useSession(async r=>{var n;const{data:i,error:s}=r;return s?{data:null,error:s}:await Dt(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{headers:this.headers,jwt:(n=i==null?void 0:i.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if(Tt(r))return{data:null,error:r};throw r}}async _challengeAndVerify(t){const{data:r,error:n}=await this._challenge({factorId:t.factorId});return n?{data:null,error:n}:await this._verify({factorId:t.factorId,challengeId:r.id,code:t.code})}async _listFactors(){const{data:{user:t},error:r}=await this.getUser();if(r)return{data:null,error:r};const n=(t==null?void 0:t.factors)||[],i=n.filter(s=>s.factor_type==="totp"&&s.status==="verified");return{data:{all:n,totp:i},error:null}}async _getAuthenticatorAssuranceLevel(){return await this._useSession(async t=>{var r,n;const{data:{session:i},error:s}=t;if(s)return{data:null,error:s};if(!i)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const a=this._decodeJWT(i.access_token);let o=null;a.aal&&(o=a.aal);let A=o;((n=(r=i.user.factors)===null||r===void 0?void 0:r.filter(d=>d.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(A="aal2");const u=a.amr||[];return{data:{currentLevel:o,nextLevel:A,currentAuthenticationMethods:u},error:null}})}}ah.nextInstanceID=0;class SG extends ah{constructor(t){super(t)}}var FG=globalThis&&globalThis.__awaiter||function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(u){try{c(n.next(u))}catch(d){a(d)}}function A(u){try{c(n.throw(u))}catch(d){a(d)}}function c(u){u.done?s(u.value):i(u.value).then(o,A)}c((n=n.apply(e,t||[])).next())})};const EG={headers:O$},NG={schema:"public"},_G={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},UG={};class jG{constructor(t,r,n){var i,s,a,o,A,c,u,d;if(this.supabaseUrl=t,this.supabaseKey=r,!t)throw new Error("supabaseUrl is required.");if(!r)throw new Error("supabaseKey is required.");const f=$$(t);this.realtimeUrl=`${f}/realtime/v1`.replace(/^http/i,"ws"),this.authUrl=`${f}/auth/v1`,this.storageUrl=`${f}/storage/v1`,this.functionsUrl=`${f}/functions/v1`;const h=`sb-${new URL(this.authUrl).hostname.split(".")[0]}-auth-token`,v={db:NG,realtime:UG,auth:Object.assign(Object.assign({},_G),{storageKey:h}),global:EG},p=G$(n??{},v);this.storageKey=(s=(i=p.auth)===null||i===void 0?void 0:i.storageKey)!==null&&s!==void 0?s:"",this.headers=(o=(a=p.global)===null||a===void 0?void 0:a.headers)!==null&&o!==void 0?o:{},this.auth=this._initSupabaseAuthClient((A=p.auth)!==null&&A!==void 0?A:{},this.headers,(c=p.global)===null||c===void 0?void 0:c.fetch),this.fetch=V$(r,this._getAccessToken.bind(this),(u=p.global)===null||u===void 0?void 0:u.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers},p.realtime)),this.rest=new VV(`${f}/rest/v1`,{headers:this.headers,schema:(d=p.db)===null||d===void 0?void 0:d.schema,fetch:this.fetch}),this._listenForAuthEvents()}get functions(){return new wV(this.functionsUrl,{headers:this.headers,customFetch:this.fetch})}get storage(){return new Q$(this.storageUrl,this.headers,this.fetch)}from(t){return this.rest.from(t)}rpc(t,r={},n){return this.rest.rpc(t,r,n)}channel(t,r={config:{}}){return this.realtime.channel(t,r)}getChannels(){return this.realtime.getChannels()}removeChannel(t){return this.realtime.removeChannel(t)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){var t,r;return FG(this,void 0,void 0,function*(){const{data:n}=yield this.auth.getSession();return(r=(t=n.session)===null||t===void 0?void 0:t.access_token)!==null&&r!==void 0?r:null})}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:r,detectSessionInUrl:n,storage:i,storageKey:s,flowType:a,debug:o},A,c){const u={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new SG({url:this.authUrl,headers:Object.assign(Object.assign({},u),A),storageKey:s,autoRefreshToken:t,persistSession:r,detectSessionInUrl:n,storage:i,flowType:a,debug:o,fetch:c})}_initRealtimeClient(t){return new o$(this.realtimeUrl,Object.assign(Object.assign({},t),{params:Object.assign({apikey:this.supabaseKey},t==null?void 0:t.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((r,n)=>{this._handleTokenChanged(r,"CLIENT",n==null?void 0:n.access_token)})}_handleTokenChanged(t,r,n){(t==="TOKEN_REFRESHED"||t==="SIGNED_IN")&&this.changedAccessToken!==n?(this.realtime.setAuth(n??null),this.changedAccessToken=n):t==="SIGNED_OUT"&&(this.realtime.setAuth(this.supabaseKey),r=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}}const TG=(e,t,r)=>new jG(e,t,r),IG="https://lyjntbzrbznhnibourke.supabase.co",kG="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imx5am50YnpyYnpuaG5pYm91cmtlIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njg0Njg3NDgsImV4cCI6MjA4NDA0NDc0OH0.Atrtk1lLtZE0nAjRAUUkLyaWwA-HVF8WmxOEH-yAIfM",ct=TG(IG,kG),LG=1;let w2=0;function PG(){return w2=(w2+1)%Number.MAX_VALUE,w2.toString()}const Mn={state:{toasts:[]},listeners:[],getState:()=>Mn.state,setState:e=>{typeof e=="function"?Mn.state=e(Mn.state):Mn.state={...Mn.state,...e},Mn.listeners.forEach(t=>t(Mn.state))},subscribe:e=>(Mn.listeners.push(e),()=>{Mn.listeners=Mn.listeners.filter(t=>t!==e)})},QG=({...e})=>{const t=PG(),r=i=>Mn.setState(s=>({...s,toasts:s.toasts.map(a=>a.id===t?{...a,...i}:a)})),n=()=>Mn.setState(i=>({...i,toasts:i.toasts.filter(s=>s.id!==t)}));return Mn.setState(i=>({...i,toasts:[{...e,id:t,dismiss:n},...i.toasts].slice(0,LG)})),{id:t,dismiss:n,update:r}};function zt(){const[e,t]=C.useState(Mn.getState());return C.useEffect(()=>Mn.subscribe(n=>{t(n)}),[]),C.useEffect(()=>{const r=[];return e.toasts.forEach(n=>{if(n.duration===1/0)return;const i=setTimeout(()=>{n.dismiss()},n.duration||5e3);r.push(i)}),()=>{r.forEach(n=>clearTimeout(n))}},[e.toasts]),{toast:QG,toasts:e.toasts}}const cT=C.createContext(void 0),DG=({children:e})=>{const{toast:t}=zt(),[r,n]=C.useState(null),[i,s]=C.useState(null),[a,o]=C.useState(!0),A=C.useCallback(h=>{s(h),n((h==null?void 0:h.user)??null),o(!1)},[]);C.useEffect(()=>{(async()=>{try{const{data:{session:p}}=await ct.auth.getSession();A(p)}catch(p){console.error("Error getting session:",p),o(!1)}})();const{data:{subscription:v}}=ct.auth.onAuthStateChange((p,y)=>{A(y)});return()=>{v==null||v.unsubscribe()}},[A]);const c=C.useCallback(async(h,v,p)=>{try{const{data:y,error:g}=await ct.auth.signUp({email:h,password:v,options:p});if(g)throw g;return{data:y,error:null}}catch(y){return t({variant:"destructive",title:"Sign up Failed",description:y.message||"Something went wrong"}),{data:null,error:y}}},[t]),u=C.useCallback(async(h,v)=>{try{const{data:p,error:y}=await ct.auth.signInWithPassword({email:h,password:v});if(y)throw y;return{data:p,error:null}}catch(p){return t({variant:"destructive",title:"Sign in Failed",description:p.message||"Something went wrong"}),{data:null,error:p}}},[t]),d=C.useCallback(async()=>{try{const{error:h}=await ct.auth.signOut();if(h)throw h;return{error:null}}catch(h){return t({variant:"destructive",title:"Sign out Failed",description:h.message||"Something went wrong"}),{error:h}}},[t]),f=C.useMemo(()=>({user:r,session:i,loading:a,signUp:c,signIn:u,signOut:d}),[r,i,a,c,u,d]);return l.jsx(cT.Provider,{value:f,children:e})},iv=()=>{const e=C.useContext(cT);if(e===void 0)throw new Error("useAuth must be used within an AuthProvider");return e};function uT(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;t{const t=MG(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:a=>{const o=a.split(OC);return o[0]===""&&o.length!==1&&o.shift(),fT(o,t)||RG(a)},getConflictingClassGroupIds:(a,o)=>{const A=r[a]||[];return o&&n[a]?[...A,...n[a]]:A}}},fT=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),i=n?fT(e.slice(1),n):void 0;if(i)return i;if(t.validators.length===0)return;const s=e.join(OC);return(a=t.validators.find(({validator:o})=>o(s)))==null?void 0:a.classGroupId},hF=/^\[(.+)\]$/,RG=e=>{if(hF.test(e)){const t=hF.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},MG=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return KG(Object.entries(e.classGroups),r).forEach(([s,a])=>{zy(a,n,s,t)}),n},zy=(e,t,r,n)=>{e.forEach(i=>{if(typeof i=="string"){const s=i===""?t:pF(t,i);s.classGroupId=r;return}if(typeof i=="function"){if(HG(i)){zy(i(n),t,r,n);return}t.validators.push({validator:i,classGroupId:r});return}Object.entries(i).forEach(([s,a])=>{zy(a,pF(t,s),r,n)})})},pF=(e,t)=>{let r=e;return t.split(OC).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},HG=e=>e.isThemeGetter,KG=(e,t)=>t?e.map(([r,n])=>{const i=n.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([a,o])=>[t+a,o])):s);return[r,i]}):e,VG=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const i=(s,a)=>{r.set(s,a),t++,t>e&&(t=0,n=r,r=new Map)};return{get(s){let a=r.get(s);if(a!==void 0)return a;if((a=n.get(s))!==void 0)return i(s,a),a},set(s,a){r.has(s)?r.set(s,a):i(s,a)}}},hT="!",$G=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,i=t[0],s=t.length,a=o=>{const A=[];let c=0,u=0,d;for(let y=0;yu?d-u:void 0;return{modifiers:A,hasImportantModifier:h,baseClassName:v,maybePostfixModifierPosition:p}};return r?o=>r({className:o,parseClassName:a}):a},GG=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},zG=e=>({cache:VG(e.cacheSize),parseClassName:$G(e),...OG(e)}),WG=/\s+/,JG=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i}=t,s=[],a=e.trim().split(WG);let o="";for(let A=a.length-1;A>=0;A-=1){const c=a[A],{modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:h}=r(c);let v=!!h,p=n(v?f.substring(0,h):f);if(!p){if(!v){o=c+(o.length>0?" "+o:o);continue}if(p=n(f),!p){o=c+(o.length>0?" "+o:o);continue}v=!1}const y=GG(u).join(":"),g=d?y+hT:y,w=g+p;if(s.includes(w))continue;s.push(w);const b=i(p,v);for(let E=0;E0?" "+o:o)}return o};function qG(){let e=0,t,r,n="";for(;e{if(typeof e=="string")return e;let t,r="";for(let n=0;nd(u),e());return r=zG(c),n=r.cache.get,i=r.cache.set,s=o,o(A)}function o(A){const c=n(A);if(c)return c;const u=JG(A,r);return i(A,u),u}return function(){return s(qG.apply(null,arguments))}}const or=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},mT=/^\[(?:([a-z-]+):)?(.+)\]$/i,XG=/^\d+\/\d+$/,ZG=new Set(["px","full","screen"]),ez=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,tz=/\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$/,rz=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,nz=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,iz=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ca=e=>Zc(e)||ZG.has(e)||XG.test(e),go=e=>Ou(e,"length",dz),Zc=e=>!!e&&!Number.isNaN(Number(e)),y2=e=>Ou(e,"number",Zc),Ld=e=>!!e&&Number.isInteger(Number(e)),sz=e=>e.endsWith("%")&&Zc(e.slice(0,-1)),yt=e=>mT.test(e),vo=e=>ez.test(e),az=new Set(["length","size","percentage"]),oz=e=>Ou(e,az,gT),Az=e=>Ou(e,"position",gT),lz=new Set(["image","url"]),cz=e=>Ou(e,lz,hz),uz=e=>Ou(e,"",fz),Pd=()=>!0,Ou=(e,t,r)=>{const n=mT.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},dz=e=>tz.test(e)&&!rz.test(e),gT=()=>!1,fz=e=>nz.test(e),hz=e=>iz.test(e),pz=()=>{const e=or("colors"),t=or("spacing"),r=or("blur"),n=or("brightness"),i=or("borderColor"),s=or("borderRadius"),a=or("borderSpacing"),o=or("borderWidth"),A=or("contrast"),c=or("grayscale"),u=or("hueRotate"),d=or("invert"),f=or("gap"),h=or("gradientColorStops"),v=or("gradientColorStopPositions"),p=or("inset"),y=or("margin"),g=or("opacity"),w=or("padding"),b=or("saturate"),E=or("scale"),L=or("sepia"),_=or("skew"),k=or("space"),S=or("translate"),I=()=>["auto","contain","none"],H=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto",yt,t],j=()=>[yt,t],R=()=>["",Ca,go],T=()=>["auto",Zc,yt],D=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],U=()=>["solid","dashed","dotted","double","none"],P=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],M=()=>["start","end","center","between","around","evenly","stretch"],$=()=>["","0",yt],X=()=>["auto","avoid","all","avoid-page","page","left","right","column"],le=()=>[Zc,yt];return{cacheSize:500,separator:":",theme:{colors:[Pd],spacing:[Ca,go],blur:["none","",vo,yt],brightness:le(),borderColor:[e],borderRadius:["none","","full",vo,yt],borderSpacing:j(),borderWidth:R(),contrast:le(),grayscale:$(),hueRotate:le(),invert:$(),gap:j(),gradientColorStops:[e],gradientColorStopPositions:[sz,go],inset:N(),margin:N(),opacity:le(),padding:j(),saturate:le(),scale:le(),sepia:$(),skew:le(),space:j(),translate:j()},classGroups:{aspect:[{aspect:["auto","square","video",yt]}],container:["container"],columns:[{columns:[vo]}],"break-after":[{"break-after":X()}],"break-before":[{"break-before":X()}],"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:[...D(),yt]}],overflow:[{overflow:H()}],"overflow-x":[{"overflow-x":H()}],"overflow-y":[{"overflow-y":H()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ld,yt]}],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",yt]}],grow:[{grow:$()}],shrink:[{shrink:$()}],order:[{order:["first","last","none",Ld,yt]}],"grid-cols":[{"grid-cols":[Pd]}],"col-start-end":[{col:["auto",{span:["full",Ld,yt]},yt]}],"col-start":[{"col-start":T()}],"col-end":[{"col-end":T()}],"grid-rows":[{"grid-rows":[Pd]}],"row-start-end":[{row:["auto",{span:[Ld,yt]},yt]}],"row-start":[{"row-start":T()}],"row-end":[{"row-end":T()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",yt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",yt]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...M()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...M(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...M(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",yt,t]}],"min-w":[{"min-w":[yt,t,"min","max","fit"]}],"max-w":[{"max-w":[yt,t,"none","full","min","max","fit","prose",{screen:[vo]},vo]}],h:[{h:[yt,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[yt,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[yt,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[yt,t,"auto","min","max","fit"]}],"font-size":[{text:["base",vo,go]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",y2]}],"font-family":[{font:[Pd]}],"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",yt]}],"line-clamp":[{"line-clamp":["none",Zc,y2]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ca,yt]}],"list-image":[{"list-image":["none",yt]}],"list-style-type":[{list:["none","disc","decimal",yt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...U(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ca,go]}],"underline-offset":[{"underline-offset":["auto",Ca,yt]}],"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:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",yt]}],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",yt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...D(),Az]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",oz]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},cz]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[o]}],"border-w-x":[{"border-x":[o]}],"border-w-y":[{"border-y":[o]}],"border-w-s":[{"border-s":[o]}],"border-w-e":[{"border-e":[o]}],"border-w-t":[{"border-t":[o]}],"border-w-r":[{"border-r":[o]}],"border-w-b":[{"border-b":[o]}],"border-w-l":[{"border-l":[o]}],"border-opacity":[{"border-opacity":[g]}],"border-style":[{border:[...U(),"hidden"]}],"divide-x":[{"divide-x":[o]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[o]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:U()}],"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:["",...U()]}],"outline-offset":[{"outline-offset":[Ca,yt]}],"outline-w":[{outline:[Ca,go]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:R()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[Ca,go]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",vo,uz]}],"shadow-color":[{shadow:[Pd]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...P(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":P()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[A]}],"drop-shadow":[{"drop-shadow":["","none",vo,yt]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[b]}],sepia:[{sepia:[L]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[A]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[L]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",yt]}],duration:[{duration:le()}],ease:[{ease:["linear","in","out","in-out",yt]}],delay:[{delay:le()}],animate:[{animate:["none","spin","ping","pulse","bounce",yt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[Ld,yt]}],"translate-x":[{"translate-x":[S]}],"translate-y":[{"translate-y":[S]}],"skew-x":[{"skew-x":[_]}],"skew-y":[{"skew-y":[_]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",yt]}],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",yt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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",yt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ca,go,y2]}],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"]}}},mz=YG(pz);function qe(...e){return mz(dT(e))}const sv=({children:e,className:t,color:r="white"})=>{const n={white:"bg-white text-green shadow-soft",green:"bg-green text-white shadow-soft",orange:"bg-orange text-white shadow-soft",cream:"bg-cream-light text-black shadow-neumorph"};return l.jsx("div",{className:qe("rounded-full flex items-center justify-center transition-all duration-300 hover:scale-110 hover:shadow-medium",n[r]||n.white,t),children:e})},Wo=({className:e="w-6 h-6",wrapperClass:t="w-12 h-12",color:r="white",withWrapper:n=!1})=>{const i=l.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{d:"M12 4V20M4 12H20",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})});return n?l.jsx(sv,{className:t,color:r,children:i}):i},vT=({className:e="w-6 h-6",wrapperClass:t="w-12 h-12",color:r="white",withWrapper:n=!1})=>{const i=l.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("circle",{cx:"12",cy:"12",r:"8",stroke:"currentColor",strokeWidth:"2.5"})});return n?l.jsx(sv,{className:t,color:r,children:i}):i},gz=({className:e="w-6 h-6",wrapperClass:t="w-12 h-12",color:r="white",withWrapper:n=!1})=>{const i=l.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{d:"M6 6L18 18M6 18L18 6",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})});return n?l.jsx(sv,{className:t,color:r,children:i}):i},wT=({className:e="w-6 h-6",wrapperClass:t="w-12 h-12",color:r="white",withWrapper:n=!1})=>{const i=l.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("rect",{x:"4",y:"4",width:"16",height:"16",stroke:"currentColor",strokeWidth:"2.5"})});return n?l.jsx(sv,{className:t,color:r,children:i}):i};function mF(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function yT(...e){return t=>{let r=!1;const n=e.map(i=>{const s=mF(i,t);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let i=0;i{const{children:r,...n}=e,i=C.Children.toArray(r),s=i.find(vz);if(s){const a=s.props.children,o=i.map(A=>A===s?C.Children.count(a)>1?C.Children.only(null):C.isValidElement(a)?a.props.children:null:A);return l.jsx(Wy,{...n,ref:t,children:C.isValidElement(a)?C.cloneElement(a,void 0,o):null})}return l.jsx(Wy,{...n,ref:t,children:r})});xu.displayName="Slot";var Wy=C.forwardRef((e,t)=>{const{children:r,...n}=e;if(C.isValidElement(r)){const i=yz(r);return C.cloneElement(r,{...wz(n,r.props),ref:t?yT(t,i):i})}return C.Children.count(r)>1?C.Children.only(null):null});Wy.displayName="SlotClone";var xT=({children:e})=>l.jsx(l.Fragment,{children:e});function vz(e){return C.isValidElement(e)&&e.type===xT}function wz(e,t){const r={...t};for(const n in t){const i=e[n],s=t[n];/^on[A-Z]/.test(n)?i&&s?r[n]=(...o)=>{s(...o),i(...o)}:i&&(r[n]=i):n==="style"?r[n]={...i,...s}:n==="className"&&(r[n]=[i,s].filter(Boolean).join(" "))}return{...e,...r}}function yz(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)}const gF=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,vF=dT,RC=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return vF(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:i,defaultVariants:s}=t,a=Object.keys(i).map(c=>{const u=r==null?void 0:r[c],d=s==null?void 0:s[c];if(u===null)return null;const f=gF(u)||gF(d);return i[c][f]}),o=r&&Object.entries(r).reduce((c,u)=>{let[d,f]=u;return f===void 0||(c[d]=f),c},{}),A=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((c,u)=>{let{class:d,className:f,...h}=u;return Object.entries(h).every(v=>{let[p,y]=v;return Array.isArray(y)?y.includes({...s,...o}[p]):{...s,...o}[p]===y})?[...c,d,f]:c},[]);return vF(e,a,A,r==null?void 0:r.class,r==null?void 0:r.className)},xz=RC("inline-flex items-center justify-center rounded-xl text-sm font-bold ring-offset-background transition-all duration-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-[#F0F0F0] text-[#2C2C2C] shadow-neumorph-outset hover:shadow-neumorph-hover active:shadow-neumorph-inset active:text-primary",primary:"bg-primary text-[#2C2C2C] shadow-neumorph-outset hover:shadow-neumorph-hover hover:brightness-105 active:shadow-neumorph-inset",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90 shadow-neumorph-outset",outline:"border-2 border-primary text-primary bg-transparent hover:bg-primary/10 shadow-none hover:shadow-neumorph-outset",secondary:"bg-secondary text-white shadow-neumorph-outset hover:shadow-neumorph-hover active:shadow-neumorph-inset",ghost:"hover:bg-black/5 hover:text-accent-foreground shadow-none",link:"text-primary underline-offset-4 hover:underline shadow-none",white:"bg-[#F0F0F0] text-[#2C2C2C] shadow-neumorph-outset hover:shadow-neumorph-hover active:shadow-neumorph-inset"},size:{default:"h-12 px-8 py-3",sm:"h-10 rounded-lg px-4 text-xs",lg:"h-14 rounded-xl px-10 text-base",icon:"h-12 w-12 rounded-xl"}},defaultVariants:{variant:"default",size:"default"}}),Ie=Ct.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...i},s)=>{const a=n?xu:"button";return l.jsx(a,{className:qe(xz({variant:t,size:r,className:e})),ref:s,...i})});Ie.displayName="Button";const av=()=>{const[e,t]=C.useState(!1),{logoUrl:r}=Kj(),{user:n}=iv(),i=rs(),s=bl(),[a,o]=C.useState(!1),A=[{label:"Projects",type:"route",target:"/projects"},{label:"Paket Jasa",type:"anchor",target:"#paket-jasa"},{label:"Paket Jasa",type:"route",target:"/kalkulator-rab"}];n&&A.push({label:"Dashboard",type:"route",target:"/admin/projects"}),C.useEffect(()=>{const u=()=>o(window.scrollY>20);return window.addEventListener("scroll",u),()=>window.removeEventListener("scroll",u)},[]);const c=u=>{if(t(!1),u.type==="route")i(u.target),window.scrollTo({top:0,behavior:"smooth"});else if(u.type==="anchor")if(s.pathname!=="/")i("/"),setTimeout(()=>{const d=document.getElementById(u.target.substring(1));d&&d.scrollIntoView({behavior:"smooth"})},100);else{const d=document.getElementById(u.target.substring(1));d&&d.scrollIntoView({behavior:"smooth"})}};return l.jsxs(l.Fragment,{children:[l.jsx(gr.header,{initial:{y:-100},animate:{y:0},className:`fixed top-4 left-4 right-4 z-50 transition-all duration-300 rounded-2xl ${a||e?"bg-[#F0F0F0]/90 backdrop-blur-md shadow-neumorph-outset border border-white/20 py-4 px-8":"bg-transparent py-6 px-4"}`,children:l.jsxs("div",{className:"container mx-auto flex justify-between items-center",children:[l.jsx(ll,{to:"/",className:"flex items-center gap-3 group relative z-50",onClick:()=>window.scrollTo({top:0,behavior:"smooth"}),children:l.jsx("div",{className:"h-10 w-auto transition-transform duration-300 group-hover:scale-105",children:r?l.jsx("img",{src:r,alt:"Havior Architecture",className:"h-full w-auto object-contain"}):l.jsxs("span",{className:"text-2xl font-bold tracking-tight text-[#2C2C2C]",children:["SUSUN",l.jsx("span",{className:"text-secondary",children:"RUANG"})]})})}),l.jsxs("div",{className:"hidden md:flex items-center gap-4 bg-[#F0F0F0] px-2 py-2 rounded-2xl shadow-neumorph-inset border border-white/30",children:[l.jsx("nav",{className:"flex items-center gap-2",children:A.map(u=>l.jsx("button",{onClick:()=>c(u),className:`px-6 py-2.5 rounded-xl text-sm font-bold transition-all duration-300 ${s.pathname===u.target||u.type==="anchor"&&s.pathname==="/"&&s.hash===u.target?"bg-[#F0F0F0] text-primary shadow-neumorph-outset scale-105":"text-[#2C2C2C]/70 hover:text-primary hover:shadow-neumorph-outset"}`,children:u.label},u.target))}),l.jsx("a",{href:"https://wa.me/62822260024094",target:"_blank",rel:"noopener noreferrer",children:l.jsxs(Ie,{variant:"primary",size:"sm",className:"ml-2 gap-2 text-[#2C2C2C]",children:["Let's Talk ",l.jsx(Wo,{className:"w-4 h-4"})]})})]}),l.jsx("button",{className:"md:hidden p-3 bg-[#F0F0F0] text-[#2C2C2C] rounded-xl shadow-neumorph-outset hover:shadow-neumorph-hover transition-all active:shadow-neumorph-inset",onClick:()=>t(!e),children:e?l.jsx(Ei,{size:24}):l.jsx(Rj,{size:24})})]})}),l.jsx(W0,{children:e&&l.jsx(gr.div,{initial:{opacity:0,scale:.95,y:-20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-20},className:"fixed inset-x-4 top-28 bottom-4 bg-[#F0F0F0] z-40 md:hidden flex flex-col rounded-3xl shadow-neumorph-outset border border-white/20 overflow-hidden p-8",children:l.jsxs("div",{className:"flex flex-col gap-6 mt-4",children:[A.map((u,d)=>l.jsxs(gr.button,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.1+d*.1},onClick:()=>c(u),className:"w-full bg-[#F0F0F0] p-5 rounded-2xl text-lg font-bold text-left shadow-neumorph-outset hover:shadow-neumorph-hover active:shadow-neumorph-inset transition-all text-[#2C2C2C] flex justify-between items-center group",children:[u.label,l.jsx("div",{className:"w-8 h-8 rounded-full bg-[#F0F0F0] shadow-neumorph-inset flex items-center justify-center text-secondary group-hover:text-primary transition-colors",children:l.jsx(Wo,{className:"w-4 h-4"})})]},u.target)),l.jsx(gr.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.4},className:"mt-auto",children:l.jsxs("a",{href:"https://wa.me/62822260024094",target:"_blank",rel:"noopener noreferrer",onClick:()=>t(!1),className:"w-full bg-primary text-[#2C2C2C] py-5 rounded-2xl text-lg font-bold uppercase tracking-wider flex items-center justify-center gap-2 shadow-neumorph-outset hover:scale-[1.02] active:scale-[0.98] transition-transform",children:["Let's Talk ",l.jsx(Wo,{className:"w-5 h-5"})]})})]})})})]})},bT=()=>{const[e,t]=C.useState(""),[r,n]=C.useState(""),[i,s]=C.useState(!0),[a,o]=C.useState({});zt();const A=C.useCallback(async()=>{try{const{data:u,error:d}=await ct.from("content").select("*").in("field_name",["hero_title","hero_description","badge_text","title_line1","title_highlight","title_line2","description"]);if(d)throw d;const f={};u.forEach(h=>{f[h.field_name]=h.field_value}),o(f),f.hero_title&&t(f.hero_title),f.hero_description&&n(f.hero_description)}catch(u){console.error("Error fetching hero content:",u)}finally{s(!1)}},[]),c=async(u,d)=>{try{s(!0);const{data:f}=await ct.from("content").select("id").eq("field_name",u).single();let h;if(f){const{error:v}=await ct.from("content").update({field_value:d,updated_at:new Date().toISOString()}).eq("id",f.id);h=v}else{const{error:v}=await ct.from("content").insert([{id:crypto.randomUUID(),section:"hero",field_name:u,field_value:d,field_type:"textarea",created_at:new Date().toISOString(),updated_at:new Date().toISOString()}]);h=v}if(h)throw h;return o(v=>({...v,[u]:d})),u==="hero_title"&&t(d),u==="hero_description"&&n(d),{success:!0}}catch(f){return console.error(`Error updating ${u}:`,f),{success:!1,error:f}}finally{s(!1)}};return C.useEffect(()=>{A();const u=ct.channel("hero-content-changes").on("postgres_changes",{event:"*",schema:"public",table:"content",filter:"section=eq.hero"},()=>{A()}).subscribe();return()=>{ct.removeChannel(u)}},[A]),{heroTitle:e,heroDescription:r,content:a,loading:i,getHeroContent:A,updateHeroContent:c}};function bz(e,t){return t.forEach(function(r){r&&typeof r!="string"&&!Array.isArray(r)&&Object.keys(r).forEach(function(n){if(n!=="default"&&!(n in e)){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})}})}),Object.freeze(e)}function CT(e,t){return new Promise(function(r,n){let i;return Cz(e).then(function(s){try{return i=s,r(new Blob([t.slice(0,2),i,t.slice(2)],{type:"image/jpeg"}))}catch(a){return n(a)}},n)})}const Cz=e=>new Promise((t,r)=>{const n=new FileReader;n.addEventListener("load",({target:{result:i}})=>{const s=new DataView(i);let a=0;if(s.getUint16(a)!==65496)return r("not a valid JPEG");for(a+=2;;){const o=s.getUint16(a);if(o===65498)break;const A=s.getUint16(a+2);if(o===65505&&s.getUint32(a+4)===1165519206){const c=a+10;let u;switch(s.getUint16(c)){case 18761:u=!0;break;case 19789:u=!1;break;default:return r("TIFF header contains invalid endian")}if(s.getUint16(c+2,u)!==42)return r("TIFF header contains invalid version");const d=s.getUint32(c+4,u),f=c+d+2+12*s.getUint16(c+d,u);for(let h=c+d+2;h>>24&255,o[a+1]=A>>>16&255,o[a+2]=A>>>8&255,o[a+3]=A>>>0&255,new Uint8Array(o.buffer,0,a+4)},n.deflateRaw=function(i,s){s==null&&(s={level:6});var a=new Uint8Array(50+Math.floor(1.1*i.length)),o=n.F.deflateRaw(i,a,o,s.level);return new Uint8Array(a.buffer,0,o)},n.encode=function(i,s){s==null&&(s=!1);var a=0,o=n.bin.writeUint,A=n.bin.writeUshort,c={};for(var u in i){var d=!n._noNeed(u)&&!s,f=i[u],h=n.crc.crc(f,0,f.length);c[u]={cpr:d,usize:f.length,crc:h,file:d?n.deflateRaw(f):f}}for(var u in c)a+=c[u].file.length+30+46+2*n.bin.sizeUTF8(u);a+=22;var v=new Uint8Array(a),p=0,y=[];for(var u in c){var g=c[u];y.push(p),p=n._writeHeader(v,p,u,g,0)}var w=0,b=p;for(var u in c)g=c[u],y.push(p),p=n._writeHeader(v,p,u,g,1,y[w++]);var E=p-b;return o(v,p,101010256),p+=4,A(v,p+=4,w),A(v,p+=2,w),o(v,p+=2,E),o(v,p+=4,b),p+=4,p+=2,v.buffer},n._noNeed=function(i){var s=i.split(".").pop().toLowerCase();return"png,jpg,jpeg,zip".indexOf(s)!=-1},n._writeHeader=function(i,s,a,o,A,c){var u=n.bin.writeUint,d=n.bin.writeUshort,f=o.file;return u(i,s,A==0?67324752:33639248),s+=4,A==1&&(s+=2),d(i,s,20),d(i,s+=2,0),d(i,s+=2,o.cpr?8:0),u(i,s+=2,0),u(i,s+=4,o.crc),u(i,s+=4,f.length),u(i,s+=4,o.usize),d(i,s+=4,n.bin.sizeUTF8(a)),d(i,s+=2,0),s+=2,A==1&&(s+=2,s+=2,u(i,s+=6,c),s+=4),s+=n.bin.writeUTF8(i,s,a),A==0&&(i.set(f,s),s+=f.length),s},n.crc={table:function(){for(var i=new Uint32Array(256),s=0;s<256;s++){for(var a=s,o=0;o<8;o++)1&a?a=3988292384^a>>>1:a>>>=1;i[s]=a}return i}(),update:function(i,s,a,o){for(var A=0;A>>8;return i},crc:function(i,s,a){return 4294967295^n.crc.update(4294967295,i,s,a)}},n.adler=function(i,s,a){for(var o=1,A=0,c=s,u=s+a;c>8&255},readUint:function(i,s){return 16777216*i[s+3]+(i[s+2]<<16|i[s+1]<<8|i[s])},writeUint:function(i,s,a){i[s]=255&a,i[s+1]=a>>8&255,i[s+2]=a>>16&255,i[s+3]=a>>24&255},readASCII:function(i,s,a){for(var o="",A=0;A>6,i[s+A+1]=128|u>>0&63,A+=2;else if(!(4294901760&u))i[s+A]=224|u>>12,i[s+A+1]=128|u>>6&63,i[s+A+2]=128|u>>0&63,A+=3;else{if(4292870144&u)throw"e";i[s+A]=240|u>>18,i[s+A+1]=128|u>>12&63,i[s+A+2]=128|u>>6&63,i[s+A+3]=128|u>>0&63,A+=4}}return A},sizeUTF8:function(i){for(var s=i.length,a=0,o=0;o>>3}var y=c.lits,g=c.strt,w=c.prev,b=0,E=0,L=0,_=0,k=0,S=0;for(p>2&&(g[S=n.F._hash(i,0)]=0),f=0;f14e3||E>26697)&&p-f>100&&(v>>16,j=65535&H;if(H!=0){j=65535&H;var R=u(N=H>>>16,c.of0);c.lhst[257+R]++;var T=u(j,c.df0);c.dhst[T]++,_+=c.exb[R]+c.dxb[T],y[b]=N<<23|f-v,y[b+1]=j<<16|R<<8|T,b+=2,v=f+N}else c.lhst[i[f]]++;E++}}for(L==f&&i.length!=0||(v>>3},n.F._bestMatch=function(i,s,a,o,A,c){var u=32767&s,d=a[u],f=u-d+32768&32767;if(d==u||o!=n.F._hash(i,s-f))return 0;for(var h=0,v=0,p=Math.min(32767,s);f<=p&&--c!=0&&d!=u;){if(h==0||i[s+h]==i[s+h-f]){var y=n.F._howLong(i,s,f);if(y>h){if(v=f,(h=y)>=A)break;f+2g&&(g=E,d=b)}}}f+=(u=d)-(d=a[u])+32768&32767}return h<<16|v},n.F._howLong=function(i,s,a){if(i[s]!=i[s-a]||i[s+1]!=i[s+1-a]||i[s+2]!=i[s+2-a])return 0;var o=s,A=Math.min(i.length,s+258);for(s+=3;s>>23,le=P+(8388607&$);P>16,z=O>>8&255,q=255&O;S(d,f=n.F._writeLit(257+z,T,d,f),X-_.of0[z]),f+=_.exb[z],k(d,f=n.F._writeLit(q,D,d,f),J-_.df0[q]),f+=_.dxb[q],P+=X}}f=n.F._writeLit(256,T,d,f)}return f},n.F._copyExact=function(i,s,a,o,A){var c=A>>>3;return o[c]=a,o[c+1]=a>>>8,o[c+2]=255-o[c],o[c+3]=255-o[c+1],c+=4,o.set(new Uint8Array(i.buffer,s,a),c),A+(a+4<<3)},n.F.getTrees=function(){for(var i=n.F.U,s=n.F._hufTree(i.lhst,i.ltree,15),a=n.F._hufTree(i.dhst,i.dtree,15),o=[],A=n.F._lenCodes(i.ltree,o),c=[],u=n.F._lenCodes(i.dtree,c),d=0;d4&&i.itree[1+(i.ordr[h-1]<<1)]==0;)h--;return[s,a,f,A,u,h,o,c]},n.F.getSecond=function(i){for(var s=[],a=0;a>1)+",");return s},n.F.contSize=function(i,s){for(var a=0,o=0;o15&&(n.F._putsE(a,o,u,d),o+=d)}return o},n.F._lenCodes=function(i,s){for(var a=i.length;a!=2&&i[a-1]==0;)a-=2;for(var o=0;o>>1,138))<11?s.push(17,h-3):s.push(18,h-11),o+=2*h-2}else if(A==d&&c==A&&u==A){for(f=o+5;f+2>>1,6);s.push(16,h-3),o+=2*h-2}else s.push(A,0)}return a>>>1},n.F._hufTree=function(i,s,a){var o=[],A=i.length,c=s.length,u=0;for(u=0;ua&&(n.F.restrictDepth(f,a,b),b=a),u=0;us;o++){var u=i[o].d;i[o].d=s,c+=A-(1<>>=a-s;c>0;)(u=i[o].d)=0;o--)i[o].d==s&&c<0&&(i[o].d--,c++);c!=0&&console.log("debt left")},n.F._goodIndex=function(i,s){var a=0;return s[16|a]<=i&&(a|=16),s[8|a]<=i&&(a|=8),s[4|a]<=i&&(a|=4),s[2|a]<=i&&(a|=2),s[1|a]<=i&&(a|=1),a},n.F._writeLit=function(i,s,a,o){return n.F._putsF(a,o,s[i<<1]),o+s[1+(i<<1)]},n.F.inflate=function(i,s){var a=Uint8Array;if(i[0]==3&&i[1]==0)return s||new a(0);var o=n.F,A=o._bitsF,c=o._bitsE,u=o._decodeTiny,d=o.makeCodes,f=o.codes2map,h=o._get17,v=o.U,p=s==null;p&&(s=new a(i.length>>>2<<3));for(var y,g,w=0,b=0,E=0,L=0,_=0,k=0,S=0,I=0,H=0;w==0;)if(w=A(i,H,1),b=A(i,H+1,2),H+=3,b!=0){if(p&&(s=n.F._check(s,I+(1<<17))),b==1&&(y=v.flmap,g=v.fdmap,k=511,S=31),b==2){E=c(i,H,5)+257,L=c(i,H+5,5)+1,_=c(i,H+10,4)+4,H+=14;for(var N=0;N<38;N+=2)v.itree[N]=0,v.itree[N+1]=0;var j=1;for(N=0;N<_;N++){var R=c(i,H+3*N,3);v.itree[1+(v.ordr[N]<<1)]=R,R>j&&(j=R)}H+=3*_,d(v.itree,j),f(v.itree,j,v.imap),y=v.lmap,g=v.dmap,H=u(v.imap,(1<>>4;if(!(P>>>8))s[I++]=P;else{if(P==256)break;var M=I+P-254;if(P>264){var $=v.ldef[P-257];M=I+($>>>3)+c(i,H,7&$),H+=7&$}var X=g[h(i,H)&S];H+=15&X;var le=X>>>4,O=v.ddef[le],J=(O>>>4)+A(i,H,15&O);for(H+=15&O,p&&(s=n.F._check(s,I+(1<<17)));I>>3),q=i[z-4]|i[z-3]<<8;p&&(s=n.F._check(s,I+q)),s.set(new a(i.buffer,i.byteOffset+z,q),I),H=z+q<<3,I+=q}return s.length==I?s:s.slice(0,I)},n.F._check=function(i,s){var a=i.length;if(s<=a)return i;var o=new Uint8Array(Math.max(a<<1,s));return o.set(i,0),o},n.F._decodeTiny=function(i,s,a,o,A,c){for(var u=n.F._bitsE,d=n.F._get17,f=0;f>>4;if(v<=15)c[f]=v,f++;else{var p=0,y=0;v==16?(y=3+u(o,A,2),A+=2,p=c[f-1]):v==17?(y=3+u(o,A,3),A+=3):v==18&&(y=11+u(o,A,7),A+=7);for(var g=f+y;f>>1;cA&&(A=d),c++}for(;c>1,d=i[c+1],f=u<<4|d,h=s-d,v=i[c]<>>15-s]=f,v++},n.F.revCodes=function(i,s){for(var a=n.F.U.rev15,o=15-s,A=0;A>>o}},n.F._putsE=function(i,s,a){a<<=7&s;var o=s>>>3;i[o]|=a,i[o+1]|=a>>>8},n.F._putsF=function(i,s,a){a<<=7&s;var o=s>>>3;i[o]|=a,i[o+1]|=a>>>8,i[o+2]|=a>>>16},n.F._bitsE=function(i,s,a){return(i[s>>>3]|i[1+(s>>>3)]<<8)>>>(7&s)&(1<>>3]|i[1+(s>>>3)]<<8|i[2+(s>>>3)]<<16)>>>(7&s)&(1<>>3]|i[1+(s>>>3)]<<8|i[2+(s>>>3)]<<16)>>>(7&s)},n.F._get25=function(i,s){return(i[s>>>3]|i[1+(s>>>3)]<<8|i[2+(s>>>3)]<<16|i[3+(s>>>3)]<<24)>>>(7&s)},n.F.U=(t=Uint16Array,r=Uint32Array,{next_code:new t(16),bl_count:new t(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[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],ldef:new t(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[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],ddef:new r(32),flmap:new t(512),fltree:[],fdmap:new t(32),fdtree:[],lmap:new t(32768),ltree:[],ttree:[],dmap:new t(32768),dtree:[],imap:new t(512),itree:[],rev15:new t(32768),lhst:new r(286),dhst:new r(30),ihst:new r(19),lits:new r(15e3),strt:new t(65536),prev:new t(32768)}),function(){for(var i=n.F.U,s=0;s<32768;s++){var a=s;a=(4278255360&(a=(4042322160&(a=(3435973836&(a=(2863311530&a)>>>1|(1431655765&a)<<1))>>>2|(858993459&a)<<2))>>>4|(252645135&a)<<4))>>>8|(16711935&a)<<8,i.rev15[s]=(a>>>16|a<<16)>>>17}function o(A,c,u){for(;c--!=0;)A.push(0,u)}for(s=0;s<32;s++)i.ldef[s]=i.of0[s]<<3|i.exb[s],i.ddef[s]=i.df0[s]<<4|i.dxb[s];o(i.fltree,144,8),o(i.fltree,112,9),o(i.fltree,24,7),o(i.fltree,8,8),n.F.makeCodes(i.fltree,9),n.F.codes2map(i.fltree,9,i.flmap),n.F.revCodes(i.fltree,9),o(i.fdtree,32,5),n.F.makeCodes(i.fdtree,5),n.F.codes2map(i.fdtree,5,i.fdmap),n.F.revCodes(i.fdtree,5),o(i.itree,19,0),o(i.ltree,286,0),o(i.dtree,30,0),o(i.ttree,320,0)}()})();var Sz=bz({__proto__:null,default:r0},[r0]);const ps=function(){var e={nextZero(u,d){for(;u[d]!=0;)d++;return d},readUshort:(u,d)=>u[d]<<8|u[d+1],writeUshort(u,d,f){u[d]=f>>8&255,u[d+1]=255&f},readUint:(u,d)=>16777216*u[d]+(u[d+1]<<16|u[d+2]<<8|u[d+3]),writeUint(u,d,f){u[d]=f>>24&255,u[d+1]=f>>16&255,u[d+2]=f>>8&255,u[d+3]=255&f},readASCII(u,d,f){let h="";for(let v=0;vu.length<2?`0${u}`:u,readUTF8(u,d,f){let h,v="";for(let p=0;p>3)]>>7-((7&_)<<0)&1);g[I]=$[R],g[I+1]=$[R+1],g[I+2]=$[R+2],g[I+3]=T>2)]>>6-((3&_)<<1)&3),g[I]=$[R],g[I+1]=$[R+1],g[I+2]=$[R+2],g[I+3]=T>1)]>>4-((1&_)<<2)&15),g[I]=$[R],g[I+1]=$[R+1],g[I+2]=$[R+2],g[I+3]=T>>3)]>>>7-(7&P)&1))==255*S?0:255;w[X+P]=M<<24|D<<16|D<<8|D}else if(E==2)for(P=0;P>>2)]>>>6-((3&P)<<1)&3))==85*S?0:255,w[X+P]=M<<24|D<<16|D<<8|D;else if(E==4)for(P=0;P>>1)]>>>4-((1&P)<<2)&15))==17*S?0:255,w[X+P]=M<<24|D<<16|D<<8|D;else if(E==8)for(P=0;P>3,S=Math.ceil(E*_/8),I=new Uint8Array(L*S);let H=0;const N=[0,0,4,0,2,0,1],j=[0,4,0,2,0,1,0],R=[8,8,8,4,4,2,2],T=[8,8,4,4,2,2,1];let D=0;for(;D<7;){const P=R[D],M=T[D];let $=0,X=0,le=N[D];for(;le>3])>>7-(7&ie)&1,I[q*S+(ne>>3)]|=U<<7-((7&ne)<<0)),_==2&&(U=(U=w[ie>>3])>>6-(7&ie)&3,I[q*S+(ne>>2)]|=U<<6-((3&ne)<<1)),_==4&&(U=(U=w[ie>>3])>>4-(7&ie)&15,I[q*S+(ne>>1)]|=U<<4-((1&ne)<<2)),_>=8){const oe=q*S+ne*k;for(let ce=0;ce>3)+ce]}ie+=_,ne+=M}z++,q+=P}$*X!=0&&(H+=X*(1+J)),D+=1}return I}(d,u)),d}function n(u,d){return i(new Uint8Array(u.buffer,2,u.length-6),d)}var i=function(){const u={H:{}};return u.H.N=function(d,f){const h=Uint8Array;let v,p,y=0,g=0,w=0,b=0,E=0,L=0,_=0,k=0,S=0;if(d[0]==3&&d[1]==0)return f||new h(0);const I=u.H,H=I.b,N=I.e,j=I.R,R=I.n,T=I.A,D=I.Z,U=I.m,P=f==null;for(P&&(f=new h(d.length>>>2<<5));y==0;)if(y=H(d,S,1),g=H(d,S+1,2),S+=3,g!=0){if(P&&(f=u.H.W(f,k+(1<<17))),g==1&&(v=U.J,p=U.h,L=511,_=31),g==2){w=N(d,S,5)+257,b=N(d,S+5,5)+1,E=N(d,S+10,4)+4,S+=14;let $=1;for(var M=0;M<38;M+=2)U.Q[M]=0,U.Q[M+1]=0;for(M=0;M$&&($=O)}S+=3*E,R(U.Q,$),T(U.Q,$,U.u),v=U.w,p=U.d,S=j(U.u,(1<<$)-1,w+b,d,S,U.v);const X=I.V(U.v,0,w,U.C);L=(1<>>4;if(!(X>>>8))f[k++]=X;else{if(X==256)break;{let le=k+X-254;if(X>264){const ne=U.q[X-257];le=k+(ne>>>3)+N(d,S,7&ne),S+=7&ne}const O=p[D(d,S)&_];S+=15&O;const J=O>>>4,z=U.c[J],q=(z>>>4)+H(d,S,15&z);for(S+=15&z;k>>3),X=d[$-4]|d[$-3]<<8;P&&(f=u.H.W(f,k+X)),f.set(new h(d.buffer,d.byteOffset+$,X),k),S=$+X<<3,k+=X}return f.length==k?f:f.slice(0,k)},u.H.W=function(d,f){const h=d.length;if(f<=h)return d;const v=new Uint8Array(h<<1);return v.set(d,0),v},u.H.R=function(d,f,h,v,p,y){const g=u.H.e,w=u.H.Z;let b=0;for(;b>>4;if(L<=15)y[b]=L,b++;else{let _=0,k=0;L==16?(k=3+g(v,p,2),p+=2,_=y[b-1]):L==17?(k=3+g(v,p,3),p+=3):L==18&&(k=11+g(v,p,7),p+=7);const S=b+k;for(;b>>1;for(;yp&&(p=w),y++}for(;y>1,w=d[y+1],b=g<<4|w,E=f-w;let L=d[y]<>>15-f]=b,L++}},u.H.l=function(d,f){const h=u.H.m.r,v=15-f;for(let p=0;p>>v}},u.H.M=function(d,f,h){h<<=7&f;const v=f>>>3;d[v]|=h,d[v+1]|=h>>>8},u.H.I=function(d,f,h){h<<=7&f;const v=f>>>3;d[v]|=h,d[v+1]|=h>>>8,d[v+2]|=h>>>16},u.H.e=function(d,f,h){return(d[f>>>3]|d[1+(f>>>3)]<<8)>>>(7&f)&(1<>>3]|d[1+(f>>>3)]<<8|d[2+(f>>>3)]<<16)>>>(7&f)&(1<>>3]|d[1+(f>>>3)]<<8|d[2+(f>>>3)]<<16)>>>(7&f)},u.H.i=function(d,f){return(d[f>>>3]|d[1+(f>>>3)]<<8|d[2+(f>>>3)]<<16|d[3+(f>>>3)]<<24)>>>(7&f)},u.H.m=function(){const d=Uint16Array,f=Uint32Array;return{K:new d(16),j:new d(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[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],q:new d(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new f(32),J:new d(512),_:[],h:new d(32),$:[],w:new d(32768),C:[],v:[],d:new d(32768),D:[],u:new d(512),Q:[],r:new d(32768),s:new f(286),Y:new f(30),a:new f(19),t:new f(15e3),k:new d(65536),g:new d(32768)}}(),function(){const d=u.H.m;for(var f=0;f<32768;f++){let v=f;v=(2863311530&v)>>>1|(1431655765&v)<<1,v=(3435973836&v)>>>2|(858993459&v)<<2,v=(4042322160&v)>>>4|(252645135&v)<<4,v=(4278255360&v)>>>8|(16711935&v)<<8,d.r[f]=(v>>>16|v<<16)>>>17}function h(v,p,y){for(;p--!=0;)v.push(0,y)}for(f=0;f<32;f++)d.q[f]=d.S[f]<<3|d.T[f],d.c[f]=d.p[f]<<4|d.z[f];h(d._,144,8),h(d._,112,9),h(d._,24,7),h(d._,8,8),u.H.n(d._,9),u.H.A(d._,9,d.J),u.H.l(d._,9),h(d.$,32,5),u.H.n(d.$,5),u.H.A(d.$,5,d.h),u.H.l(d.$,5),h(d.Q,19,0),h(d.C,286,0),h(d.D,30,0),h(d.v,320,0)}(),u.H.N}();function s(u){return[1,null,3,1,2,null,4][u.ctype]*u.depth}function a(u,d,f,h,v){let p=s(d);const y=Math.ceil(h*p/8);let g,w;p=Math.ceil(p/8);let b=u[f],E=0;if(b>1&&(u[f]=[0,0,1][b-2]),b==3)for(E=p;E>>1)&255;for(let L=0;L>>1);for(;E>>1)}else{for(;E=0&&g>=0?(L=D*d+U<<2,_=(g+D)*v+y+U<<2):(L=(-g+D)*d-y+U<<2,_=D*v+U<<2),w==0)h[_]=u[L],h[_+1]=u[L+1],h[_+2]=u[L+2],h[_+3]=u[L+3];else if(w==1){var k=u[L+3]*.00392156862745098,S=u[L]*k,I=u[L+1]*k,H=u[L+2]*k,N=h[_+3]*(1/255),j=h[_]*N,R=h[_+1]*N,T=h[_+2]*N;const P=1-k,M=k+N*P,$=M==0?0:1/M;h[_+3]=255*M,h[_+0]=(S+j*P)*$,h[_+1]=(I+R*P)*$,h[_+2]=(H+T*P)*$}else if(w==2)k=u[L+3],S=u[L],I=u[L+1],H=u[L+2],N=h[_+3],j=h[_],R=h[_+1],T=h[_+2],k==N&&S==j&&I==R&&H==T?(h[_]=0,h[_+1]=0,h[_+2]=0,h[_+3]=0):(h[_]=S,h[_+1]=I,h[_+2]=H,h[_+3]=k);else if(w==3){if(k=u[L+3],S=u[L],I=u[L+1],H=u[L+2],N=h[_+3],j=h[_],R=h[_+1],T=h[_+2],k==N&&S==j&&I==R&&H==T)continue;if(k<220&&N>20)return!1}return!0}return{decode:function(d){const f=new Uint8Array(d);let h=8;const v=e,p=v.readUshort,y=v.readUint,g={tabs:{},frames:[]},w=new Uint8Array(f.length);let b,E=0,L=0;const _=[137,80,78,71,13,10,26,10];for(var k=0;k<8;k++)if(f[k]!=_[k])throw"The input is not a PNG file!";for(;h>>1:H>>>=1;S[I]=H}return S}(),update(S,I,H,N){for(let j=0;j>>8;return S},crc:(S,I,H)=>4294967295^n.update(4294967295,S,I,H)};function i(S,I,H,N){I[H]+=S[0]*N>>4,I[H+1]+=S[1]*N>>4,I[H+2]+=S[2]*N>>4,I[H+3]+=S[3]*N>>4}function s(S){return Math.max(0,Math.min(255,S))}function a(S,I){const H=S[0]-I[0],N=S[1]-I[1],j=S[2]-I[2],R=S[3]-I[3];return H*H+N*N+j*j+R*R}function o(S,I,H,N,j,R,T){T==null&&(T=1);const D=N.length,U=[];for(var P=0;P>>0&255,q>>>8&255,q>>>16&255,q>>>24&255])}for(P=0;P>2]=M,le[P>>2]=N[M]}}function A(S,I,H,N,j){j==null&&(j={});const{crc:R}=n,T=t.writeUint,D=t.writeUshort,U=t.writeASCII;let P=8;const M=S.frames.length>1;let $,X=!1,le=33+(M?20:0);if(j.sRGB!=null&&(le+=13),j.pHYs!=null&&(le+=21),j.iCCP!=null&&($=pako.deflate(j.iCCP),le+=21+$.length+4),S.ctype==3){for(var O=S.plte.length,J=0;J>>24!=255&&(X=!0);le+=8+3*O+4+(X?8+1*O+4:0)}for(var z=0;z>>8&255,Ee=ve>>>16&255;q[P+ce+0]=ge,q[P+ce+1]=xe,q[P+ce+2]=Ee}if(P+=3*O,T(q,P,R(q,P-3*O-4,3*O+4)),P+=4,X){for(T(q,P,O),P+=4,U(q,P,"tRNS"),P+=4,J=0;J>>24&255;P+=O,T(q,P,R(q,P-O-4,O+4)),P+=4}}let ie=0;for(z=0;znt&&(nt=rn),arSt&&(St=ar));nt==-1&&(tn=Pt=nt=St=0),Ue&&((1&tn)==1&&tn--,(1&Pt)==1&&Pt--);const Ps=(nt-tn+1)*(St-Pt+1);Ps>2,_e>>2);ce.push(ve);const Ue=new Uint8Array(Te.abuf,be,_e);M&&o(ge.img,ge.rect.width,ge.rect.height,oe,Ue,ve),ge.img.set(Ue),be+=_e}}else for(O=0;Oxe&&Qe==te[z-xe])ve[z]=ve[z-xe];else{let Te=ie[Qe];if(Te==null&&(ie[Qe]=Te=oe.length,oe.push(Qe),oe.length>=300))break;ve[z]=Te}}}const Ee=oe.length;for(Ee<=256&&P==0&&(X=Ee<=2?1:Ee<=4?2:Ee<=16?4:8,X=Math.max(X,U)),O=0;O>1)]|=_e[ke+me]<<4-4*(1&me);else if(X==2)for(me=0;me>2)]|=_e[ke+me]<<6-2*(3&me);else if(X==1)for(me=0;me>3)]|=_e[ke+me]<<7-1*(7&me)}Qe=Re,$=3,be=1}else if(q==0&&ne.length==1){Re=new Uint8Array(xe*te*3);const _e=xe*te;for(z=0;z<_e;z++){const Ue=3*z,ke=4*z;Re[Ue]=Qe[ke],Re[Ue+1]=Qe[ke+1],Re[Ue+2]=Qe[ke+2]}Qe=Re,$=2,be=3,Te=3*xe}ge.img=Qe,ge.bpl=Te,ge.bpp=be}return{ctype:$,depth:X,plte:oe,frames:ne}}function d(S,I,H,N,j,R,T){const D=Uint8Array,U=Uint32Array,P=new D(S[j-1]),M=new U(S[j-1]),$=j+1z&&(z=ce),veq&&(q=ve))}z==-1&&(O=J=z=q=0),T&&((1&O)==1&&O--,(1&J)==1&&J--),R={x:O,y:J,width:z-O+1,height:q-J+1};const ne=N[j];ne.rect=R,ne.blend=1,ne.img=new Uint8Array(R.width*R.height*4),N[j-1].dispose==0?(e(P,I,H,ne.img,R.width,R.height,-R.x,-R.y,0),f(X,I,H,ne.img,R)):e(X,I,H,ne.img,R.width,R.height,-R.x,-R.y,0)}function f(S,I,H,N,j){e(S,I,H,N,j.width,j.height,-j.x,-j.y,2)}function h(S,I,H,N,j,R,T){const D=[];let U,P=[0,1,2,3,4];R!=-1?P=[R]:(I*N>5e5||H==1)&&(P=[0]),T&&(U={level:0});const M=Sz;for(var $=0;$>1)+256&255;if(R==4)for(U=j;U>1)&255;for(U=j;U>1)&255}if(R==4){for(U=0;U>2);let M;if(H.length<2e7)for(var $=0;$>2]=M.ind,j[$>>2]=M.est.rgba;else for($=0;$>2]=M.ind,j[$>>2]=M.est.rgba}return{abuf:N.buffer,inds:P,plte:D}}function y(S,I,H){H==null&&(H=1e-4);const N=new Uint32Array(S.buffer),j={i0:0,i1:S.length,bst:null,est:null,tdst:0,left:null,right:null};j.bst=L(S,j.i0,j.i1),j.est=_(j.bst);const R=[j];for(;R.lengthD&&(D=R[T].est.L,U=T);if(D=M||P.i1<=M){P.est.L=0;continue}const $={i0:P.i0,i1:M,bst:null,est:null,tdst:0,left:null,right:null};$.bst=L(S,$.i0,$.i1),$.est=_($.bst);const X={i0:M,i1:P.i1,bst:null,est:null,tdst:0,left:null,right:null};for(X.bst={R:[],m:[],N:P.bst.N-$.bst.N},T=0;T<16;T++)X.bst.R[T]=P.bst.R[T]-$.bst.R[T];for(T=0;T<4;T++)X.bst.m[T]=P.bst.m[T]-$.bst.m[T];X.est=_(X.bst),P.left=$,P.right=X,R[U]=$,R.push(X)}for(R.sort((D,U)=>U.bst.N-D.bst.N),T=0;T0&&(T=S.right,D=S.left);const U=g(T,I,H,N,j);if(U.tdst<=R*R)return U;const P=g(D,I,H,N,j);return P.tdstR;)N-=4;if(H>=N)break;const T=I[H>>2];I[H>>2]=I[N>>2],I[N>>2]=T,H+=4,N-=4}for(;E(S,H,j)>R;)H-=4;return H+4}function E(S,I,H){return S[I]*H[0]+S[I+1]*H[1]+S[I+2]*H[2]+S[I+3]*H[3]}function L(S,I,H){const N=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],j=[0,0,0,0],R=H-I>>2;for(let T=I;T>>0}}var k={multVec:(S,I)=>[S[0]*I[0]+S[1]*I[1]+S[2]*I[2]+S[3]*I[3],S[4]*I[0]+S[5]*I[1]+S[6]*I[2]+S[7]*I[3],S[8]*I[0]+S[9]*I[1]+S[10]*I[2]+S[11]*I[3],S[12]*I[0]+S[13]*I[1]+S[14]*I[2]+S[15]*I[3]],dot:(S,I)=>S[0]*I[0]+S[1]*I[1]+S[2]*I[2]+S[3]*I[3],sml:(S,I)=>[S*I[0],S*I[1],S*I[2],S*I[3]]};ps.encode=function(I,H,N,j,R,T,D){j==null&&(j=0),D==null&&(D=!1);const U=u(I,H,N,j,[!1,!1,!1,0,D,!1]);return c(U,-1),A(U,H,N,R,T)},ps.encodeLL=function(I,H,N,j,R,T,D,U){const P={ctype:0+(j==1?0:2)+(R==0?0:4),depth:T,frames:[]},M=(j+R)*T,$=M*H;for(let X=0;X>>0),L(1),L(32),_(3),_(A),_(2835),_(2835),k(8),_(16711680),_(65280),_(255),_(4278190080),_(1466527264),function S(){for(;w0;){for(y=122+w*o,h=0;h>>24,d.setUint32(y+h,v<<8|p),h+=4;w++}E{t(new Blob([r],{type:"image/bmp"}))})},_dly:9};var si={CHROME:"CHROME",FIREFOX:"FIREFOX",DESKTOP_SAFARI:"DESKTOP_SAFARI",IE:"IE",IOS:"IOS",ETC:"ETC"},Fz={[si.CHROME]:16384,[si.FIREFOX]:11180,[si.DESKTOP_SAFARI]:16384,[si.IE]:8192,[si.IOS]:4096,[si.ETC]:8192};const MC=typeof window<"u",ST=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,n0=MC&&window.cordova&&window.cordova.require&&window.cordova.require("cordova/modulemapper"),Ez=(MC||ST)&&(n0&&n0.getOriginalSymbol(window,"File")||typeof File<"u"&&File),FT=(MC||ST)&&(n0&&n0.getOriginalSymbol(window,"FileReader")||typeof FileReader<"u"&&FileReader);function HC(e,t,r=Date.now()){return new Promise(n=>{const i=e.split(","),s=i[0].match(/:(.*?);/)[1],a=globalThis.atob(i[1]);let o=a.length;const A=new Uint8Array(o);for(;o--;)A[o]=a.charCodeAt(o);const c=new Blob([A],{type:s});c.name=t,c.lastModified=r,n(c)})}function ET(e){return new Promise((t,r)=>{const n=new FT;n.onload=()=>t(n.result),n.onerror=i=>r(i),n.readAsDataURL(e)})}function NT(e){return new Promise((t,r)=>{const n=new Image;n.onload=()=>t(n),n.onerror=i=>r(i),n.src=e})}function JA(){if(JA.cachedResult!==void 0)return JA.cachedResult;let e=si.ETC;const{userAgent:t}=navigator;return/Chrom(e|ium)/i.test(t)?e=si.CHROME:/iP(ad|od|hone)/i.test(t)&&/WebKit/i.test(t)?e=si.IOS:/Safari/i.test(t)?e=si.DESKTOP_SAFARI:/Firefox/i.test(t)?e=si.FIREFOX:(/MSIE/i.test(t)||document.documentMode)&&(e=si.IE),JA.cachedResult=e,JA.cachedResult}function _T(e,t){const r=JA(),n=Fz[r];let i=e,s=t,a=i*s;const o=i>s?s/i:i/s;for(;a>n*n;){const A=(n+i)/2,c=(n+s)/2;ABT.toBlob(e,u)).then((function(u){try{return o=u,o.name=r,o.lastModified=n,c.call(this)}catch(d){return a(d)}}).bind(this),a);{let u=function(){return c.call(this)};if(typeof OffscreenCanvas=="function"&&e instanceof OffscreenCanvas)return e.convertToBlob({type:t,quality:i}).then((function(d){try{return o=d,o.name=r,o.lastModified=n,u.call(this)}catch(f){return a(f)}}).bind(this),a);{let d;return d=e.toDataURL(t,i),HC(d,r,n).then((function(f){try{return o=f,u.call(this)}catch(h){return a(h)}}).bind(this),a)}}}function A(){return s(o)}})}function Js(e){e.width=0,e.height=0}function Kc(){return new Promise(function(e,t){let r,n,i,s;return Kc.cachedResult!==void 0?e(Kc.cachedResult):HC("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==","test.jpg",Date.now()).then(function(a){try{return r=a,i0(r).then(function(o){try{return n=o[1],s0(n,r.type,r.name,r.lastModified).then(function(A){try{return i=A,Js(n),i0(i).then(function(c){try{return s=c[0],Kc.cachedResult=s.width===1&&s.height===2,e(Kc.cachedResult)}catch(u){return t(u)}},t)}catch(c){return t(c)}},t)}catch(A){return t(A)}},t)}catch(o){return t(o)}},t)})}function jT(e){return new Promise((t,r)=>{const n=new FT;n.onload=i=>{const s=new DataView(i.target.result);if(s.getUint16(0,!1)!=65496)return t(-2);const a=s.byteLength;let o=2;for(;or(i),n.readAsArrayBuffer(e)})}function TT(e,t){const{width:r}=e,{height:n}=e,{maxWidthOrHeight:i}=t;let s,a=e;return isFinite(i)&&(r>i||n>i)&&([a,s]=ov(r,n),r>n?(a.width=i,a.height=n/r*i):(a.width=r/n*i,a.height=i),s.drawImage(e,0,0,a.width,a.height),Js(e)),a}function IT(e,t){const{width:r}=e,{height:n}=e,[i,s]=ov(r,n);switch(t>4&&t<9?(i.width=n,i.height=r):(i.width=r,i.height=n),t){case 2:s.transform(-1,0,0,1,r,0);break;case 3:s.transform(-1,0,0,-1,r,n);break;case 4:s.transform(1,0,0,-1,0,n);break;case 5:s.transform(0,1,1,0,0,0);break;case 6:s.transform(0,1,-1,0,n,0);break;case 7:s.transform(0,-1,-1,0,n,r);break;case 8:s.transform(0,-1,1,0,0,r)}return s.drawImage(e,0,0,r,n),Js(e),i}function wF(e,t,r=0){return new Promise(function(n,i){let s,a,o,A,c,u,d,f,h,v,p,y,g,w,b,E,L,_,k,S;function I(N=5){if(t.signal&&t.signal.aborted)throw t.signal.reason;s+=N,t.onProgress(Math.min(s,100))}function H(N){if(t.signal&&t.signal.aborted)throw t.signal.reason;s=Math.min(Math.max(N,s),100),t.onProgress(s)}return s=r,a=t.maxIteration||10,o=1024*t.maxSizeMB*1024,I(),i0(e,t).then((function(N){try{return[,A]=N,I(),c=TT(A,t),I(),new Promise(function(j,R){var T;if(!(T=t.exifOrientation))return jT(e).then((function(U){try{return T=U,D.call(this)}catch(P){return R(P)}}).bind(this),R);function D(){return j(T)}return D.call(this)}).then((function(j){try{return u=j,I(),Kc().then((function(R){try{return d=R?c:IT(c,u),I(),f=t.initialQuality||1,h=t.fileType||e.type,s0(d,h,e.name,e.lastModified,f).then((function(T){try{{let U=function(){if(a--&&(b>o||b>g)){let M,$;return M=S?.95*k.width:k.width,$=S?.95*k.height:k.height,[L,_]=ov(M,$),_.drawImage(k,0,0,M,$),f*=h==="image/png"?.85:.95,s0(L,h,e.name,e.lastModified,f).then(function(X){try{return E=X,Js(k),k=L,b=E.size,H(Math.min(99,Math.floor((w-b)/(w-o)*100))),U}catch(le){return i(le)}},i)}return[1]},P=function(){return Js(k),Js(L),Js(c),Js(d),Js(A),H(100),n(E)};if(v=T,I(),p=v.size>o,y=v.size>e.size,!p&&!y)return H(100),n(v);var D;return g=e.size,w=v.size,b=w,k=d,S=!t.alwaysKeepResolution&&p,(D=(function(M){for(;M;){if(M.then)return void M.then(D,i);try{if(M.pop){if(M.length)return M.pop()?P.call(this):M;M=U}else M=M.call(this)}catch($){return i($)}}}).bind(this))(U)}}catch(U){return i(U)}}).bind(this),i)}catch(T){return i(T)}}).bind(this),i)}catch(R){return i(R)}}).bind(this),i)}catch(j){return i(j)}}).bind(this),i)})}const Nz=` let scriptImported = false self.addEventListener('message', async (e) => { const { file, id, imageCompressionLibUrl, options } = e.data options.onProgress = (progress) => self.postMessage({ progress, id }) try { if (!scriptImported) { // console.log('[worker] importScripts', imageCompressionLibUrl) self.importScripts(imageCompressionLibUrl) scriptImported = true } // console.log('[worker] self', self) const compressedFile = await imageCompression(file, options) self.postMessage({ file: compressedFile, id }) } catch (e) { // console.error('[worker] error', e) self.postMessage({ error: e.message + '\\n' + e.stack, id }) } }) `;let x2;function _z(e,t){return new Promise((r,n)=>{x2||(x2=function(a){const o=[];return typeof a=="function"?o.push(`(${a})()`):o.push(a),URL.createObjectURL(new Blob(o))}(Nz));const i=new Worker(x2);i.addEventListener("message",function(a){if(t.signal&&t.signal.aborted)i.terminate();else if(a.data.progress===void 0){if(a.data.error)return n(new Error(a.data.error)),void i.terminate();r(a.data.file),i.terminate()}else t.onProgress(a.data.progress)}),i.addEventListener("error",n),t.signal&&t.signal.addEventListener("abort",()=>{n(t.signal.reason),i.terminate()}),i.postMessage({file:e,imageCompressionLibUrl:t.libURL,options:{...t,onProgress:void 0,signal:void 0}})})}function fn(e,t){return new Promise(function(r,n){let i,s,a,o,A,c;if(i={...t},a=0,{onProgress:o}=i,i.maxSizeMB=i.maxSizeMB||Number.POSITIVE_INFINITY,A=typeof i.useWebWorker!="boolean"||i.useWebWorker,delete i.useWebWorker,i.onProgress=h=>{a=h,typeof o=="function"&&o(a)},!(e instanceof Blob||e instanceof Ez))return n(new Error("The file given is not an instance of Blob or File"));if(!/^image/.test(e.type))return n(new Error("The file given is not an image"));if(c=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,!A||typeof Worker!="function"||c)return wF(e,i).then((function(h){try{return s=h,f.call(this)}catch(v){return n(v)}}).bind(this),n);var u=(function(){try{return f.call(this)}catch(h){return n(h)}}).bind(this),d=function(h){try{return wF(e,i).then(function(v){try{return s=v,u()}catch(p){return n(p)}},n)}catch(v){return n(v)}};try{return i.libURL=i.libURL||"https://cdn.jsdelivr.net/npm/browser-image-compression@2.0.2/dist/browser-image-compression.js",_z(e,i).then(function(h){try{return s=h,u()}catch{return d()}},d)}catch{d()}function f(){try{s.name=e.name,s.lastModified=e.lastModified}catch{}try{i.preserveExif&&e.type==="image/jpeg"&&(!i.fileType||i.fileType&&i.fileType===e.type)&&(s=CT(e,s))}catch{}return r(s)}})}fn.getDataUrlFromFile=ET,fn.getFilefromDataUrl=HC,fn.loadImage=NT,fn.drawImageInCanvas=UT,fn.drawFileInCanvas=i0,fn.canvasToFile=s0,fn.getExifOrientation=jT,fn.handleMaxWidthOrHeight=TT,fn.followExifOrientation=IT,fn.cleanupCanvasMemory=Js,fn.isAutoOrientationInBrowser=Kc,fn.approximateBelowMaximumCanvasSizeOfBrowser=_T,fn.copyExifWithoutOrientation=CT,fn.getBrowserName=JA,fn.version="2.0.2";const Jy=async(e,t={})=>{const r={maxSizeMB:1,maxWidthOrHeight:1920,useWebWorker:!0,fileType:"image/jpeg",initialQuality:.8,...t};try{if(console.log(`[ImageCompression] Starting compression for ${e.name} (${(e.size/1024/1024).toFixed(2)} MB)`),!e.type.startsWith("image/"))throw new Error("File is not an image");const n=await fn(e,r);return console.log(`[ImageCompression] Compression complete. New size: ${(n.size/1024/1024).toFixed(2)} MB`),n}catch(n){return console.error("[ImageCompression] Error:",n),e}},kT=()=>{const[e,t]=C.useState([]),[r,n]=C.useState(!0),[i,s]=C.useState(null),{toast:a}=zt(),o=C.useCallback(async()=>{try{n(!0),s(null);const{data:d,error:f}=await ct.from("hero_images").select("*").order("is_featured",{ascending:!1}).order("display_order",{ascending:!0}).order("created_at",{ascending:!1});if(f)throw f;t(d||[])}catch(d){console.error("[useHeroImages] Error fetching images:",d),s(d),a({title:"Error fetching images",description:d.message,variant:"destructive"})}finally{n(!1)}},[a]);C.useEffect(()=>{o()},[o]);const A=async(d,f={})=>{if(!d)return{success:!1,error:new Error("No file provided")};try{n(!0);const{display_order:h=0,is_featured:v=!1,title:p="",subtitle:y=""}=f,g=await Jy(d,{maxWidthOrHeight:1920,initialQuality:.85}),w=Date.now(),b=Math.random().toString(36).substring(7),E=g.name.split(".").pop(),L=`hero_image_${w}_${b}.${E}`,{error:_}=await ct.storage.from("hero-images").upload(L,g,{contentType:g.type||"image/jpeg",upsert:!1});if(_)throw new Error(`Storage upload failed: ${_.message}`);const{data:{publicUrl:k}}=ct.storage.from("hero-images").getPublicUrl(L),{data:S,error:I}=await ct.from("hero_images").insert([{image_url:k,display_order:parseInt(h)||0,is_featured:v,title:p,subtitle:y}]).select().single();if(I)throw await ct.storage.from("hero-images").remove([L]),new Error(`Database insert failed: ${I.message}`);return t(H=>[...H,S].sort((j,R)=>j.is_featured!==R.is_featured?R.is_featured-j.is_featured:j.display_order-R.display_order)),{success:!0,data:S}}catch(h){return console.error("[useHeroImages] Upload error:",h),{success:!1,error:h}}finally{n(!1)}},c=async(d,f,h=null)=>{try{n(!0);let v=f.image_url,p=null;if(h){const w=e.find(H=>H.id===d);p=w?w.image_url:null;const b=await Jy(h,{maxWidthOrHeight:1920,initialQuality:.85}),E=Date.now(),L=Math.random().toString(36).substring(7),_=b.name.split(".").pop(),k=`hero_image_${E}_${L}.${_}`,{error:S}=await ct.storage.from("hero-images").upload(k,b,{contentType:b.type});if(S)throw new Error(`Storage upload failed: ${S.message}`);const{data:{publicUrl:I}}=ct.storage.from("hero-images").getPublicUrl(k);v=I}const{data:y,error:g}=await ct.from("hero_images").update({...f,image_url:v,updated_at:new Date().toISOString()}).eq("id",d).select().single();if(g)throw new Error(`Database update failed: ${g.message}`);if(h&&p)try{const w=p.split("/").pop();w&&await ct.storage.from("hero-images").remove([w])}catch(w){console.warn("Cleanup warning:",w)}return t(w=>w.map(b=>b.id===d?y:b).sort((b,E)=>b.is_featured!==E.is_featured?E.is_featured-b.is_featured:b.display_order-E.display_order)),{success:!0,data:y}}catch(v){return console.error("[useHeroImages] Update error:",v),{success:!1,error:v}}finally{n(!1)}},u=async(d,f)=>{try{n(!0);const{error:h}=await ct.from("hero_images").delete().eq("id",d);if(h)throw new Error(`Database delete failed: ${h.message}`);if(f)try{const v=f.split("/").pop();v&&await ct.storage.from("hero-images").remove([v])}catch(v){console.warn("Storage deletion warning:",v)}return t(v=>v.filter(p=>p.id!==d)),{success:!0}}catch(h){return console.error("[useHeroImages] Delete error:",h),{success:!1,error:h}}finally{n(!1)}};return{images:e,featuredImage:e.find(d=>d.is_featured),heroImages:e,loading:r,error:i,uploadImage:A,updateImage:c,deleteImage:u,refresh:o}},Rt=({children:e,className:t,variant:r="default",padding:n="p-8",hoverEffect:i=!0,onClick:s,...a})=>{const o={default:"bg-[#F0F0F0] text-[#2C2C2C]",white:"bg-[#F0F0F0] text-[#2C2C2C]",green:"bg-primary text-primary-foreground",orange:"bg-secondary text-secondary-foreground"};return l.jsx(gr.div,{whileHover:i?{y:-2,scale:1.01}:{},transition:{duration:.3,ease:"easeInOut"},onClick:s,className:qe("relative rounded-2xl shadow-neumorph-outset border-none",o[r]||o.default,n,i?"hover:shadow-neumorph-hover cursor-pointer":"","overflow-hidden transition-all duration-300 ease-in-out",t),...a,children:e})},Uz=()=>{const{content:e}=bT(),{featuredImage:t,heroImages:r}=kT(),n=(t==null?void 0:t.image_url)||(r&&r.length>0?r[0].image_url:null)||"https://images.unsplash.com/photo-1698586453442-b03506d193cb?q=80&w=2070&auto=format&fit=crop";return l.jsx("section",{className:"relative min-h-screen pt-36 pb-20 px-4 md:px-8 bg-[#F0F0F0] overflow-hidden flex items-center",children:l.jsx("div",{className:"container mx-auto max-w-7xl",children:l.jsx(Rt,{variant:"default",className:"p-8 md:p-16 relative z-10 overflow-visible border-none bg-[#F0F0F0]",children:l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-12 lg:gap-20 items-center",children:[l.jsxs(gr.div,{initial:{opacity:0,x:-50},animate:{opacity:1,x:0},transition:{duration:.8,ease:"easeOut"},className:"order-2 lg:order-1",children:[l.jsxs("div",{className:"inline-flex items-center gap-2 px-6 py-3 rounded-full bg-[#F0F0F0] shadow-neumorph-inset mb-10",children:[l.jsx("span",{className:"w-3 h-3 rounded-full bg-primary animate-pulse shadow-[0_0_10px_#A8E6CF]"}),l.jsx("span",{className:"text-xs font-bold tracking-widest uppercase text-[#2C2C2C]/80",children:(e==null?void 0:e.badge_text)||"Architecture & Interior Design"})]}),l.jsxs("h1",{className:"text-5xl md:text-6xl lg:text-7xl font-bold leading-[1.1] mb-8 text-[#2C2C2C] tracking-tight drop-shadow-sm",children:[(e==null?void 0:e.title_line1)||"Minimalist spaces"," ",l.jsx("br",{}),l.jsxs("span",{className:"text-primary relative inline-block",children:[(e==null?void 0:e.title_highlight)||"meaningful",l.jsx("svg",{className:"absolute w-full h-4 -bottom-2 left-0 text-secondary opacity-40",viewBox:"0 0 100 10",preserveAspectRatio:"none",children:l.jsx("path",{d:"M0 5 Q 50 15 100 5",stroke:"currentColor",strokeWidth:"12",fill:"none",strokeLinecap:"round"})})]})," ",(e==null?void 0:e.title_line2)||"living."]}),l.jsx("p",{className:"text-xl text-[#2C2C2C]/70 mb-12 max-w-lg leading-relaxed font-medium",children:(e==null?void 0:e.description)||"We craft contemplative and tropical architectural concepts, focusing on spatial narrative, atmosphere, and human experience"}),l.jsxs("div",{className:"flex flex-col sm:flex-row gap-6 w-full sm:w-auto",children:[l.jsx(ll,{to:"/projects",children:l.jsxs(Ie,{size:"lg",className:"w-full sm:w-auto text-lg bg-[#F0F0F0] text-[#2C2C2C] shadow-neumorph-outset hover:shadow-neumorph-hover active:shadow-neumorph-inset active:scale-95 transition-all",children:["View Projects",l.jsx(Iu,{className:"ml-3 w-5 h-5"})]})}),l.jsx(ll,{to:"/kalkulator-rab",children:l.jsx(Ie,{variant:"secondary",size:"lg",className:"w-full sm:w-auto text-lg",children:"Estimate Cost"})})]})]}),l.jsxs(gr.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:{duration:.8},className:"order-1 lg:order-2 relative",children:[l.jsxs("div",{className:"relative rounded-[2.5rem] overflow-hidden shadow-neumorph-outset p-2 bg-[#F0F0F0]",children:[l.jsxs("div",{className:"rounded-[2rem] overflow-hidden relative h-[400px] md:h-[600px] w-full",children:[l.jsx("img",{src:n,alt:"Minimalist Architecture",className:"w-full h-full object-cover hover:scale-105 transition-transform duration-1000"}),l.jsx("div",{className:"absolute inset-0 shadow-[inset_0_0_40px_rgba(0,0,0,0.1)] pointer-events-none rounded-[2rem]"})]}),l.jsxs("div",{className:"absolute bottom-10 left-10 bg-[#F0F0F0]/80 backdrop-blur-md p-5 rounded-2xl shadow-neumorph-outset border border-white/20 hidden sm:block transform hover:-translate-y-2 transition-transform duration-300",children:[l.jsx("p",{className:"text-xs font-bold text-gray-500 uppercase tracking-wider mb-1",children:"Featured Project"}),l.jsx("p",{className:"text-lg font-bold text-[#2C2C2C]",children:"Casa Verde"})]})]}),l.jsx("div",{className:"absolute -z-10 -top-12 -right-12 w-48 h-48 bg-secondary rounded-full opacity-10 blur-3xl animate-pulse"}),l.jsx("div",{className:"absolute -z-10 -bottom-12 -left-12 w-64 h-64 bg-primary rounded-full opacity-10 blur-3xl animate-pulse delay-700"})]})]})})})})},Ru=({children:e,id:t,className:r="",containerClassName:n=""})=>l.jsx("section",{id:t,className:qe("py-16 md:py-24 px-4 sm:px-8 relative overflow-hidden",r),children:l.jsx(gr.div,{initial:{opacity:0,y:30},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-100px"},transition:{duration:.6,ease:"easeOut"},className:qe("container mx-auto max-w-7xl relative z-10",n),children:e})}),jz=[{province:"DKI Jakarta",location_name:"Jakarta Pusat",location_code:"JKT-CTR",price_multiplier:1.3},{province:"DKI Jakarta",location_name:"Jakarta Selatan",location_code:"JKT-STH",price_multiplier:1.25},{province:"DKI Jakarta",location_name:"Jakarta Barat",location_code:"JKT-WST",price_multiplier:1.15},{province:"DKI Jakarta",location_name:"Jakarta Timur",location_code:"JKT-EST",price_multiplier:1.1},{province:"DKI Jakarta",location_name:"Jakarta Utara",location_code:"JKT-NTH",price_multiplier:1.15},{province:"DKI Jakarta",location_name:"Kepulauan Seribu",location_code:"JKT-KPS",price_multiplier:1.4},{province:"Banten",location_name:"Tangerang",location_code:"TNG",price_multiplier:1.05},{province:"Banten",location_name:"Tangerang Selatan",location_code:"TANGSEL",price_multiplier:1.08},{province:"Banten",location_name:"Serang",location_code:"SRG",price_multiplier:.95},{province:"Banten",location_name:"Cilegon",location_code:"CLG",price_multiplier:.98},{province:"Banten",location_name:"Lebak",location_code:"LBK",price_multiplier:.9},{province:"Banten",location_name:"Pandeglang",location_code:"PDG",price_multiplier:.9},{province:"Banten",location_name:"Kab. Serang",location_code:"KSRG",price_multiplier:.92},{province:"Banten",location_name:"Kab. Tangerang",location_code:"KTNG",price_multiplier:1},{province:"Jawa Barat",location_name:"Bandung",location_code:"BDG",price_multiplier:.95},{province:"Jawa Barat",location_name:"Bandung Barat",location_code:"KBB",price_multiplier:.9},{province:"Jawa Barat",location_name:"Bekasi",location_code:"BKS",price_multiplier:1},{province:"Jawa Barat",location_name:"Bogor",location_code:"BGR",price_multiplier:1.05},{province:"Jawa Barat",location_name:"Ciamis",location_code:"CMS",price_multiplier:.8},{province:"Jawa Barat",location_name:"Cianjur",location_code:"CJR",price_multiplier:.85},{province:"Jawa Barat",location_name:"Cirebon",location_code:"CRB",price_multiplier:.85},{province:"Jawa Barat",location_name:"Cimahi",location_code:"CMH",price_multiplier:.92},{province:"Jawa Barat",location_name:"Depok",location_code:"DPK",price_multiplier:1.02},{province:"Jawa Barat",location_name:"Garut",location_code:"GRT",price_multiplier:.8},{province:"Jawa Barat",location_name:"Indramayu",location_code:"IDM",price_multiplier:.82},{province:"Jawa Barat",location_name:"Karawang",location_code:"KRW",price_multiplier:.95},{province:"Jawa Barat",location_name:"Kuningan",location_code:"KNG",price_multiplier:.8},{province:"Jawa Barat",location_name:"Majalengka",location_code:"MJL",price_multiplier:.82},{province:"Jawa Barat",location_name:"Pangandaran",location_code:"PND",price_multiplier:.85},{province:"Jawa Barat",location_name:"Purwakarta",location_code:"PWK",price_multiplier:.9},{province:"Jawa Barat",location_name:"Subang",location_code:"SBG",price_multiplier:.88},{province:"Jawa Barat",location_name:"Sukabumi",location_code:"SKB",price_multiplier:.85},{province:"Jawa Barat",location_name:"Sumedang",location_code:"SMD",price_multiplier:.85},{province:"Jawa Barat",location_name:"Tasikmalaya",location_code:"TSM",price_multiplier:.82},{province:"Jawa Barat",location_name:"Banjar",location_code:"BJR",price_multiplier:.8},{province:"Jawa Barat",location_name:"Kab. Bandung",location_code:"KBDG",price_multiplier:.9},{province:"Jawa Barat",location_name:"Kab. Bekasi",location_code:"KBKS",price_multiplier:.98},{province:"Jawa Barat",location_name:"Kab. Bogor",location_code:"KBGR",price_multiplier:1},{province:"Jawa Barat",location_name:"Kab. Cirebon",location_code:"KCRB",price_multiplier:.82},{province:"Jawa Barat",location_name:"Kab. Sukabumi",location_code:"KSKB",price_multiplier:.82},{province:"Jawa Barat",location_name:"Kab. Tasikmalaya",location_code:"KTSM",price_multiplier:.8},{province:"Jawa Tengah",location_name:"Semarang",location_code:"SMG",price_multiplier:.9},{province:"Jawa Tengah",location_name:"Surakarta (Solo)",location_code:"SOC",price_multiplier:.88},{province:"Jawa Tengah",location_name:"Magelang",location_code:"MGL",price_multiplier:.85},{province:"Jawa Tengah",location_name:"Pekalongan",location_code:"PKL",price_multiplier:.82},{province:"Jawa Tengah",location_name:"Salatiga",location_code:"SLT",price_multiplier:.85},{province:"Jawa Tengah",location_name:"Tegal",location_code:"TGL",price_multiplier:.85},{province:"Jawa Tengah",location_name:"Banjarnegara",location_code:"BNR",price_multiplier:.75},{province:"Jawa Tengah",location_name:"Banyumas (Purwokerto)",location_code:"PWT",price_multiplier:.8},{province:"Jawa Tengah",location_name:"Batang",location_code:"BTG",price_multiplier:.78},{province:"Jawa Tengah",location_name:"Blora",location_code:"BLR",price_multiplier:.75},{province:"Jawa Tengah",location_name:"Boyolali",location_code:"BYL",price_multiplier:.8},{province:"Jawa Tengah",location_name:"Brebes",location_code:"BBS",price_multiplier:.78},{province:"Jawa Tengah",location_name:"Cilacap",location_code:"CLP",price_multiplier:.82},{province:"Jawa Tengah",location_name:"Demak",location_code:"DMK",price_multiplier:.8},{province:"Jawa Tengah",location_name:"Grobogan",location_code:"GBG",price_multiplier:.75},{province:"Jawa Tengah",location_name:"Jepara",location_code:"JPR",price_multiplier:.8},{province:"Jawa Tengah",location_name:"Karanganyar",location_code:"KRA",price_multiplier:.8},{province:"Jawa Tengah",location_name:"Kebumen",location_code:"KBM",price_multiplier:.75},{province:"Jawa Tengah",location_name:"Kendal",location_code:"KDL",price_multiplier:.8},{province:"Jawa Tengah",location_name:"Klaten",location_code:"KLT",price_multiplier:.8},{province:"Jawa Tengah",location_name:"Kudus",location_code:"KDS",price_multiplier:.82},{province:"Jawa Tengah",location_name:"Pati",location_code:"PTI",price_multiplier:.78},{province:"Jawa Tengah",location_name:"Pemalang",location_code:"PML",price_multiplier:.78},{province:"Jawa Tengah",location_name:"Purbalingga",location_code:"PBG",price_multiplier:.75},{province:"Jawa Tengah",location_name:"Purworejo",location_code:"PWR",price_multiplier:.75},{province:"Jawa Tengah",location_name:"Rembang",location_code:"RBG",price_multiplier:.75},{province:"Jawa Tengah",location_name:"Sragen",location_code:"SRG",price_multiplier:.78},{province:"Jawa Tengah",location_name:"Sukoharjo",location_code:"SKH",price_multiplier:.8},{province:"Jawa Tengah",location_name:"Temanggung",location_code:"TMG",price_multiplier:.75},{province:"Jawa Tengah",location_name:"Wonogiri",location_code:"WNG",price_multiplier:.75},{province:"Jawa Tengah",location_name:"Wonosobo",location_code:"WSB",price_multiplier:.75},{province:"Jawa Tengah",location_name:"Kab. Magelang",location_code:"KMGL",price_multiplier:.8},{province:"Jawa Tengah",location_name:"Kab. Pekalongan",location_code:"KPKL",price_multiplier:.78},{province:"Jawa Tengah",location_name:"Kab. Semarang",location_code:"KSMG",price_multiplier:.85},{province:"Jawa Tengah",location_name:"Kab. Tegal",location_code:"KTGL",price_multiplier:.8},{province:"DI Yogyakarta",location_name:"Yogyakarta",location_code:"YGY",price_multiplier:.85},{province:"DI Yogyakarta",location_name:"Bantul",location_code:"BTL",price_multiplier:.8},{province:"DI Yogyakarta",location_name:"Gunung Kidul",location_code:"GNK",price_multiplier:.75},{province:"DI Yogyakarta",location_name:"Kulon Progo",location_code:"KLP",price_multiplier:.78},{province:"DI Yogyakarta",location_name:"Sleman",location_code:"SLM",price_multiplier:.82},{province:"Jawa Timur",location_name:"Surabaya",location_code:"SBY",price_multiplier:.95},{province:"Jawa Timur",location_name:"Malang",location_code:"MLG",price_multiplier:.88},{province:"Jawa Timur",location_name:"Batu",location_code:"BAT",price_multiplier:.9},{province:"Jawa Timur",location_name:"Blitar",location_code:"BLT",price_multiplier:.8},{province:"Jawa Timur",location_name:"Kediri",location_code:"KDR",price_multiplier:.82},{province:"Jawa Timur",location_name:"Madiun",location_code:"MAD",price_multiplier:.8},{province:"Jawa Timur",location_name:"Mojokerto",location_code:"MJK",price_multiplier:.85},{province:"Jawa Timur",location_name:"Pasuruan",location_code:"PSR",price_multiplier:.82},{province:"Jawa Timur",location_name:"Probolinggo",location_code:"PRO",price_multiplier:.8},{province:"Jawa Timur",location_name:"Banyuwangi",location_code:"BWI",price_multiplier:.85},{province:"Jawa Timur",location_name:"Bangkalan",location_code:"BKL",price_multiplier:.8},{province:"Jawa Timur",location_name:"Bojonegoro",location_code:"BJN",price_multiplier:.78},{province:"Jawa Timur",location_name:"Bondowoso",location_code:"BDW",price_multiplier:.75},{province:"Jawa Timur",location_name:"Gresik",location_code:"GRS",price_multiplier:.9},{province:"Jawa Timur",location_name:"Jember",location_code:"JMR",price_multiplier:.8},{province:"Jawa Timur",location_name:"Jombang",location_code:"JBG",price_multiplier:.78},{province:"Jawa Timur",location_name:"Lamongan",location_code:"LMG",price_multiplier:.78},{province:"Jawa Timur",location_name:"Lumajang",location_code:"LMJ",price_multiplier:.78},{province:"Jawa Timur",location_name:"Magetan",location_code:"MGT",price_multiplier:.75},{province:"Jawa Timur",location_name:"Nganjuk",location_code:"NGJ",price_multiplier:.75},{province:"Jawa Timur",location_name:"Ngawi",location_code:"NGW",price_multiplier:.75},{province:"Jawa Timur",location_name:"Pacitan",location_code:"PCT",price_multiplier:.75},{province:"Jawa Timur",location_name:"Pamekasan",location_code:"PMK",price_multiplier:.75},{province:"Jawa Timur",location_name:"Ponorogo",location_code:"PON",price_multiplier:.75},{province:"Jawa Timur",location_name:"Sampang",location_code:"SMP",price_multiplier:.75},{province:"Jawa Timur",location_name:"Sidoarjo",location_code:"SDA",price_multiplier:.92},{province:"Jawa Timur",location_name:"Situbondo",location_code:"STB",price_multiplier:.75},{province:"Jawa Timur",location_name:"Sumenep",location_code:"SMN",price_multiplier:.75},{province:"Jawa Timur",location_name:"Trenggalek",location_code:"TRK",price_multiplier:.75},{province:"Jawa Timur",location_name:"Tuban",location_code:"TBN",price_multiplier:.78},{province:"Jawa Timur",location_name:"Tulungagung",location_code:"TLG",price_multiplier:.78},{province:"Jawa Timur",location_name:"Kab. Blitar",location_code:"KBLT",price_multiplier:.75},{province:"Jawa Timur",location_name:"Kab. Kediri",location_code:"KKDR",price_multiplier:.78},{province:"Jawa Timur",location_name:"Kab. Madiun",location_code:"KMAD",price_multiplier:.75},{province:"Jawa Timur",location_name:"Kab. Malang",location_code:"KMLG",price_multiplier:.8},{province:"Jawa Timur",location_name:"Kab. Mojokerto",location_code:"KMJK",price_multiplier:.8},{province:"Jawa Timur",location_name:"Kab. Pasuruan",location_code:"KPSR",price_multiplier:.8},{province:"Jawa Timur",location_name:"Kab. Probolinggo",location_code:"KPRO",price_multiplier:.78},{province:"Bali",location_name:"Denpasar",location_code:"DPS",price_multiplier:.95},{province:"Bali",location_name:"Badung (Kuta/Nusa Dua)",location_code:"BDG-BALI",price_multiplier:1},{province:"Bali",location_name:"Bangli",location_code:"BGL",price_multiplier:.85},{province:"Bali",location_name:"Buleleng (Singaraja)",location_code:"SGR",price_multiplier:.85},{province:"Bali",location_name:"Gianyar (Ubud)",location_code:"GNY",price_multiplier:.9},{province:"Bali",location_name:"Jembrana",location_code:"JBR",price_multiplier:.85},{province:"Bali",location_name:"Karangasem",location_code:"KRA-BALI",price_multiplier:.85},{province:"Bali",location_name:"Klungkung",location_code:"KLK",price_multiplier:.85},{province:"Bali",location_name:"Tabanan",location_code:"TBN-BALI",price_multiplier:.88},{province:"Sumatera Utara",location_name:"Medan",location_code:"MDN",price_multiplier:.9},{province:"Sumatera Utara",location_name:"Binjai",location_code:"BNJ",price_multiplier:.85},{province:"Sumatera Utara",location_name:"Pematangsiantar",location_code:"PMS",price_multiplier:.85},{province:"Sumatera Utara",location_name:"Tebing Tinggi",location_code:"TBT",price_multiplier:.82},{province:"Sumatera Utara",location_name:"Deli Serdang",location_code:"DLS",price_multiplier:.85},{province:"Sumatera Utara",location_name:"Karo",location_code:"KRO",price_multiplier:.8},{province:"Sumatera Utara",location_name:"Langkat",location_code:"LKT",price_multiplier:.8},{province:"Sumatera Utara",location_name:"Asahan",location_code:"ASH",price_multiplier:.8},{province:"Sumatera Utara",location_name:"Labuhanbatu",location_code:"LBB",price_multiplier:.8},{province:"Sumatera Utara",location_name:"Toba Samosir",location_code:"TBS",price_multiplier:.85},{province:"Sumatera Barat",location_name:"Padang",location_code:"PDG",price_multiplier:.88},{province:"Sumatera Barat",location_name:"Bukittinggi",location_code:"BKT",price_multiplier:.85},{province:"Sumatera Barat",location_name:"Pariaman",location_code:"PRM",price_multiplier:.8},{province:"Sumatera Barat",location_name:"Payakumbuh",location_code:"PYK",price_multiplier:.8},{province:"Sumatera Barat",location_name:"Solok",location_code:"SLK",price_multiplier:.8},{province:"Sumatera Barat",location_name:"Sawahlunto",location_code:"SWL",price_multiplier:.8},{province:"Sumatera Barat",location_name:"Padang Panjang",location_code:"PDP",price_multiplier:.8},{province:"Riau",location_name:"Pekanbaru",location_code:"PKU",price_multiplier:.9},{province:"Riau",location_name:"Dumai",location_code:"DUM",price_multiplier:.88},{province:"Riau",location_name:"Bengkalis",location_code:"BKS-RIAU",price_multiplier:.85},{province:"Riau",location_name:"Kampar",location_code:"KPR",price_multiplier:.85},{province:"Riau",location_name:"Siak",location_code:"SIAK",price_multiplier:.85},{province:"Kepulauan Riau",location_name:"Batam",location_code:"BTM",price_multiplier:1},{province:"Kepulauan Riau",location_name:"Tanjung Pinang",location_code:"TPI",price_multiplier:.95},{province:"Kepulauan Riau",location_name:"Bintan",location_code:"BTN",price_multiplier:.95},{province:"Sumatera Selatan",location_name:"Palembang",location_code:"PLB",price_multiplier:.9},{province:"Sumatera Selatan",location_name:"Prabumulih",location_code:"PBM",price_multiplier:.85},{province:"Sumatera Selatan",location_name:"Lubuklinggau",location_code:"LLG",price_multiplier:.85},{province:"Sumatera Selatan",location_name:"Pagar Alam",location_code:"PGA",price_multiplier:.8},{province:"Sumatera Selatan",location_name:"Banyuasin",location_code:"BYS",price_multiplier:.85},{province:"Lampung",location_name:"Bandar Lampung",location_code:"BDL",price_multiplier:.88},{province:"Lampung",location_name:"Metro",location_code:"MET",price_multiplier:.82},{province:"Lampung",location_name:"Lampung Selatan",location_code:"LMS",price_multiplier:.8},{province:"Lampung",location_name:"Lampung Tengah",location_code:"LMT",price_multiplier:.8},{province:"Lampung",location_name:"Pringsewu",location_code:"PRW",price_multiplier:.8},{province:"Kalimantan Timur",location_name:"Samarinda",location_code:"SMD",price_multiplier:.95},{province:"Kalimantan Timur",location_name:"Balikpapan",location_code:"BPN",price_multiplier:1},{province:"Kalimantan Timur",location_name:"Bontang",location_code:"BTG-KAL",price_multiplier:.95},{province:"Kalimantan Timur",location_name:"Kutai Kartanegara",location_code:"KUKAR",price_multiplier:.92},{province:"Kalimantan Timur",location_name:"Penajam Paser Utara (IKN Area)",location_code:"PPU",price_multiplier:1.1},{province:"Kalimantan Selatan",location_name:"Banjarmasin",location_code:"BDJ",price_multiplier:.9},{province:"Kalimantan Selatan",location_name:"Banjarbaru",location_code:"BJB",price_multiplier:.88},{province:"Kalimantan Selatan",location_name:"Martapura",location_code:"MTP",price_multiplier:.85},{province:"Kalimantan Barat",location_name:"Pontianak",location_code:"PNK",price_multiplier:.9},{province:"Kalimantan Barat",location_name:"Singkawang",location_code:"SKW",price_multiplier:.88},{province:"Sulawesi Selatan",location_name:"Makassar",location_code:"UPG",price_multiplier:.92},{province:"Sulawesi Selatan",location_name:"Parepare",location_code:"PRE",price_multiplier:.85},{province:"Sulawesi Selatan",location_name:"Palopo",location_code:"PLP",price_multiplier:.85},{province:"Sulawesi Selatan",location_name:"Gowa",location_code:"GWA",price_multiplier:.88},{province:"Sulawesi Selatan",location_name:"Maros",location_code:"MRS",price_multiplier:.88},{province:"Sulawesi Utara",location_name:"Manado",location_code:"MDC",price_multiplier:.92},{province:"Sulawesi Utara",location_name:"Bitung",location_code:"BIT",price_multiplier:.9},{province:"Sulawesi Utara",location_name:"Tomohon",location_code:"TMH",price_multiplier:.88},{province:"Aceh",location_name:"Banda Aceh",location_code:"BTJ",price_multiplier:.88},{province:"Jambi",location_name:"Jambi",location_code:"DJB",price_multiplier:.85},{province:"Bengkulu",location_name:"Bengkulu",location_code:"BKS-SUM",price_multiplier:.85},{province:"Bangka Belitung",location_name:"Pangkal Pinang",location_code:"PGK",price_multiplier:.9},{province:"Kalimantan Tengah",location_name:"Palangkaraya",location_code:"PKY",price_multiplier:.9},{province:"Kalimantan Utara",location_name:"Tanjung Selor",location_code:"TJS",price_multiplier:.95},{province:"Sulawesi Tengah",location_name:"Palu",location_code:"PLW",price_multiplier:.88},{province:"Sulawesi Tenggara",location_name:"Kendari",location_code:"KDI",price_multiplier:.88},{province:"Sulawesi Barat",location_name:"Mamuju",location_code:"MJU",price_multiplier:.88},{province:"Gorontalo",location_name:"Gorontalo",location_code:"GTO",price_multiplier:.88},{province:"Nusa Tenggara Barat",location_name:"Mataram",location_code:"LOP",price_multiplier:.88},{province:"Nusa Tenggara Timur",location_name:"Kupang",location_code:"KOE",price_multiplier:.9},{province:"Maluku",location_name:"Ambon",location_code:"AMQ",price_multiplier:.95},{province:"Maluku Utara",location_name:"Ternate",location_code:"TTE",price_multiplier:.95},{province:"Papua",location_name:"Jayapura",location_code:"DJJ",price_multiplier:1.2},{province:"Papua Barat",location_name:"Manokwari",location_code:"MKW",price_multiplier:1.15},{province:"Papua Barat Daya",location_name:"Sorong",location_code:"SOQ",price_multiplier:1.1},{province:"Papua Selatan",location_name:"Merauke",location_code:"MKQ",price_multiplier:1.15},{province:"Papua Tengah",location_name:"Nabire",location_code:"NBX",price_multiplier:1.2}],yF=[{id:"fl_01",type:"lantai",category:"standard",name:"Keramik 40x40 Standar",price:85e3,unit:"m2",description:"Keramik lokal standar SNI, motif polos/minimalis"},{id:"fl_02",type:"lantai",category:"standard",name:"Keramik 50x50 Utama",price:95e3,unit:"m2",description:"Keramik ruang utama, presisi lebih baik"},{id:"fl_03",type:"lantai",category:"menengah",name:"Granit Tile 60x60 (Polos)",price:165e3,unit:"m2",description:"Double loading, stain resistance medium"},{id:"fl_04",type:"lantai",category:"menengah",name:"Granit Tile 60x60 (Motif)",price:195e3,unit:"m2",description:"Glazed polished, motif marmer digital"},{id:"fl_05",type:"lantai",category:"menengah",name:"Granit Tile 80x80",price:275e3,unit:"m2",description:"Ukuran besar, kesan luas dan mewah"},{id:"fl_06",type:"lantai",category:"luxury",name:"Marmer Ujung Pandang",price:85e4,unit:"m2",description:"Marmer lokal kualitas ekspor, slab sedang"},{id:"fl_07",type:"lantai",category:"luxury",name:"Marmer Import (Italy/Spain)",price:185e4,unit:"m2",description:"Marmer import premium, corak eksklusif"},{id:"fl_08",type:"lantai",category:"menengah",name:"Vinyl Flooring 3mm",price:185e3,unit:"m2",description:"Vinyl plank sistem lem, tahan air"},{id:"fl_09",type:"lantai",category:"menengah",name:"SPC Flooring 5mm",price:245e3,unit:"m2",description:"Stone Plastic Composite, click system, rigid"},{id:"fl_10",type:"lantai",category:"luxury",name:"Parket Kayu Jati Solid",price:95e4,unit:"m2",description:"Kayu jati asli finish UV coating"},{id:"wall_01",type:"dinding",category:"standard",name:"Cat Interior (Standar)",price:55e3,unit:"m2",description:"Cat akrilik emulsi standar + plamir + amplas"},{id:"wall_02",type:"dinding",category:"menengah",name:"Cat Interior Premium (Easy Clean)",price:95e3,unit:"m2",description:"Bisa dibersihkan, anti jamur, low odor"},{id:"wall_03",type:"dinding",category:"luxury",name:"Cat Tekstur / Dekoratif",price:25e4,unit:"m2",description:"Stucco, semen ekspos finish, atau tekstur khusus"},{id:"wall_04",type:"dinding",category:"menengah",name:"Wallpaper Vinyl",price:125e3,unit:"m2",description:"Wallpaper medium grade, tahan lama"},{id:"wall_05",type:"dinding",category:"luxury",name:"Wall Panel WPC/PVC",price:45e4,unit:"m2",description:"Panel dinding motif kayu/marmer, 3D effect"},{id:"ceil_01",type:"plafond",category:"standard",name:"Gypsum Board 9mm",price:6e4,unit:"m2",description:"Standard ekonomis, rangka hollow, finish cat"},{id:"ceil_02",type:"plafond",category:"standard",name:"Asbestos/Eternit Standard",price:4e4,unit:"m2",description:"Sangat ekonomis, bahan tradisional (non-asbes)"},{id:"ceil_03",type:"plafond",category:"standard",name:"Plafond PVC Standar",price:55e3,unit:"m2",description:"Anti air, motif terbatas, tanpa cat"},{id:"ceil_04",type:"plafond",category:"standard",name:"Beton Ekspos",price:25e3,unit:"m2",description:"Industrial look, finishing coating clear only"},{id:"ceil_05",type:"plafond",category:"menengah",name:"Gypsum Board 12mm",price:7e4,unit:"m2",description:"Lebih tebal, rigiditas tinggi, tahan lendut"},{id:"ceil_06",type:"plafond",category:"menengah",name:"Plafond PVC Premium",price:8e4,unit:"m2",description:"Motif variatif, bahan lebih tebal/elastis"},{id:"ceil_07",type:"plafond",category:"menengah",name:"Aluminium Profil T",price:1e5,unit:"m2",description:"Rangka ekspos T-bar, panel akustik/gypsum"},{id:"ceil_08",type:"plafond",category:"menengah",name:"Aluminium Profil U",price:115e3,unit:"m2",description:"Linear metal ceiling look, tahan karat"},{id:"ceil_09",type:"plafond",category:"menengah",name:"Plafond Fiber Akustik",price:7e4,unit:"m2",description:"Peredam suara ringan, tekstur serat"},{id:"ceil_10",type:"plafond",category:"menengah",name:"Plafond Kayu Meranti",price:125e3,unit:"m2",description:"Kayu lapis meranti finish natural/plitur"},{id:"ceil_11",type:"plafond",category:"menengah",name:"Akustik Mineral Fiber",price:9e4,unit:"m2",description:"High absorption, standard kantor/komersial"},{id:"ceil_12",type:"plafond",category:"luxury",name:"Gypsum Board 15mm",price:8e4,unit:"m2",description:"Extra heavy duty, kedap suara maksimal"},{id:"ceil_13",type:"plafond",category:"luxury",name:"Plafond Kayu Jati",price:175e3,unit:"m2",description:"Kayu jati solid/lumber ceiling, mewah"},{id:"ceil_14",type:"plafond",category:"luxury",name:"Plafond Gantung Suspended",price:2e5,unit:"m2",description:"Desain gantung kompleks, indirect lighting"},{id:"ceil_15",type:"plafond",category:"luxury",name:"Plafond Gantung Premium",price:25e4,unit:"m2",description:"Custom design, material composite/mixed"},{id:"tr_01",type:"kuda_kuda",category:"standard",name:"Baja Ringan C75.075 (0.75mm)",price:155e3,unit:"m2",description:"Ketebalan ekonomis standar SNI, bentang < 8m"},{id:"tr_02",type:"kuda_kuda",category:"menengah",name:"Baja Ringan C75.100 (1.00mm)",price:195e3,unit:"m2",description:"Ketebalan medium, rigiditas lebih baik"},{id:"tr_03",type:"kuda_kuda",category:"menengah",name:"Baja Ringan C75.075 (Double Canal)",price:225e3,unit:"m2",description:"Sistem double untuk kekuatan ekstra"},{id:"tr_04",type:"kuda_kuda",category:"luxury",name:"Baja Ringan C100.120 (1.20mm)",price:285e3,unit:"m2",description:"High profile untuk bentang lebar > 10m"},{id:"tr_05",type:"kuda_kuda",category:"luxury",name:"Baja Berat IWF 150",price:65e4,unit:"m2",description:"Landscape baja berat untuk desain industrial/wide span"},{id:"rf_01",type:"atap",category:"standard",name:"Genteng Metal Pasir",price:11e4,unit:"m2",description:"Ringan, berpasir (peredam suara hujan)"},{id:"rf_02",type:"atap",category:"standard",name:"Spandek Pasir 0.35mm",price:95e3,unit:"m2",description:"Lembaran panjang, minim sambungan, ekonomis"},{id:"rf_03",type:"atap",category:"menengah",name:"Genteng Keramik Glazur (M-Class)",price:325e3,unit:"m2",description:"Mewah, tahan lama, perlu rangka kuat"},{id:"rf_04",type:"atap",category:"menengah",name:"Genteng Beton Flat (CISANGKAN)",price:185e3,unit:"m2",description:"Modern minimalis, kuat, berat"},{id:"rf_05",type:"atap",category:"luxury",name:"Genteng Aspal (Bitumen)",price:285e3,unit:"m2",description:"Ringan, fleksibel, garansi panjang (Onduline/CTI)"},{id:"rf_06",type:"atap",category:"luxury",name:"Atap UPVC (Alderon)",price:35e4,unit:"m2",description:"Sejuk, kedap suara, sangat awet"}],Me={CONTENT:"website_content",IMAGES:"website_images",USERS:"admin_users",SESSION:"admin_session",LOCATIONS:"rab_locations",PRICES:"rab_prices",MATERIALS:"rab_finishing_materials",STYLES:"rab_architecture_styles",CATEGORIES:"project_categories"},xF=[{id:"1",name:"Modern Minimalis",multiplier:1,description:"Desain simpel, fungsional, hemat biaya"},{id:"2",name:"Classic / Mediterania",multiplier:1.25,description:"Detail profil rumit, pilar, arch, material mewah"},{id:"3",name:"Industrial",multiplier:1.1,description:"Ekspos struktur, besi, finishing raw material"},{id:"4",name:"Kontemporer / Luxury",multiplier:1.35,description:"Bentuk unik, cantilever, material kaca/baja dominan"},{id:"5",name:"Tropical Modern",multiplier:1.15,description:"Banyak bukaan, overstek lebar, elemen kayu/batu alam"},{id:"6",name:"Scandanavian / Japandi",multiplier:1.12,description:"Clean look, material light wood, efisien"}],Tz=()=>{if(!localStorage.getItem(Me.CONTENT)){const o=[{id:"1",section:"hero",field_name:"title",field_value:"Simplicity is the ultimate sophistication.",field_type:"text",created_at:new Date().toISOString()},{id:"2",section:"hero",field_name:"subtitle",field_value:"Explore our curated collection of architectural masterpieces.",field_type:"textarea",created_at:new Date().toISOString()},{id:"101",section:"hero",field_name:"hero_background",field_value:"",field_type:"image",created_at:new Date().toISOString()},{id:"3",section:"about",field_name:"philosophy_title",field_value:"Philosophy",field_type:"text",created_at:new Date().toISOString()},{id:"4",section:"about",field_name:"philosophy_text",field_value:"We believe in the power of minimalism. Our approach strips away the unnecessary, revealing the essential beauty of structure, light, and space.",field_type:"textarea",created_at:new Date().toISOString()},{id:"102",section:"about",field_name:"about_image",field_value:"",field_type:"image",created_at:new Date().toISOString()},{id:"5",section:"contact",field_name:"email",field_value:"hello@susunruang.com",field_type:"text",created_at:new Date().toISOString()},{id:"6",section:"contact",field_value:"phone",field_value:"+62 822-6002-4094",field_type:"text",created_at:new Date().toISOString()},{id:"100",section:"header",field_name:"logo_image",field_value:"",field_type:"image",created_at:new Date().toISOString()},{id:"103",section:"rab",field_name:"calculator_background",field_value:"",field_type:"image",created_at:new Date().toISOString()},{id:"104",section:"design_fee",field_name:"fee_background",field_value:"",field_type:"image",created_at:new Date().toISOString()}];localStorage.setItem(Me.CONTENT,JSON.stringify(o))}if(localStorage.getItem(Me.USERS)||localStorage.setItem(Me.USERS,JSON.stringify([{id:"1",email:"admin@example.com",password:"password",created_at:new Date().toISOString()}])),localStorage.getItem(Me.IMAGES)||localStorage.setItem(Me.IMAGES,JSON.stringify([])),!localStorage.getItem(Me.CATEGORIES)){const o=[{id:"cat_1",name:"Arsitek",slug:"arsitek",created_at:new Date().toISOString()},{id:"cat_2",name:"Interior",slug:"interior",created_at:new Date().toISOString()},{id:"cat_3",name:"Landscape",slug:"Landscape",created_at:new Date().toISOString()}];localStorage.setItem(Me.CATEGORIES,JSON.stringify(o))}const e=JSON.parse(localStorage.getItem(Me.STYLES)||"[]");(e.length===0||e.length({...o,created_at:new Date().toISOString()}))));const t=JSON.parse(localStorage.getItem(Me.MATERIALS)||"[]"),r=yF.map(o=>{const A=t.find(c=>c.id===o.id||c.name===o.name);return A?{...A,price:o.price,description:o.description,category:o.category,name:o.name,unit:o.unit}:{...o,id:o.id||crypto.randomUUID(),created_at:new Date().toISOString()}}),n=t.filter(o=>!yF.some(A=>A.id===o.id||A.name===o.name));localStorage.setItem(Me.MATERIALS,JSON.stringify([...r,...n]));const i=JSON.parse(localStorage.getItem(Me.LOCATIONS)||"[]"),s=JSON.parse(localStorage.getItem(Me.PRICES)||"[]"),a={Standar:55e5,Menengah:825e4,Luxury:125e5};if(i.length<50){const o=jz.map(c=>({id:crypto.randomUUID(),...c,description:`Regional rate 2026 for ${c.location_name}`,created_at:new Date().toISOString()}));localStorage.setItem(Me.LOCATIONS,JSON.stringify(o));const A=[];o.forEach(c=>{Object.entries(a).forEach(([u,d])=>{A.push({id:crypto.randomUUID(),location_id:c.id,category:u,price_per_m2:d,created_at:new Date().toISOString()})})}),localStorage.setItem(Me.PRICES,JSON.stringify(A))}else{const o=s.filter(c=>c.category==="Standar");if(o.reduce((c,u)=>c+u.price_per_m2,0)/(o.length||1)<52e5){const c=s.map(u=>a[u.category]?{...u,price_per_m2:a[u.category],updated_at:new Date().toISOString()}:u);localStorage.setItem(Me.PRICES,JSON.stringify(c))}}};Tz();const Lt={content:{getAll:()=>JSON.parse(localStorage.getItem(Me.CONTENT)||"[]"),getBySection:e=>{const t=JSON.parse(localStorage.getItem(Me.CONTENT)||"[]");return e?t.filter(r=>r.section===e):t},update:(e,t)=>{const r=JSON.parse(localStorage.getItem(Me.CONTENT)||"[]"),n=r.findIndex(i=>i.id===e);return n!==-1?(r[n]={...r[n],field_value:t,updated_at:new Date().toISOString()},localStorage.setItem(Me.CONTENT,JSON.stringify(r)),r[n]):null}},images:{getAll:()=>JSON.parse(localStorage.getItem(Me.IMAGES)||"[]"),add:e=>{const t=JSON.parse(localStorage.getItem(Me.IMAGES)||"[]"),r={...e,id:crypto.randomUUID(),uploaded_at:new Date().toISOString()};return t.push(r),localStorage.setItem(Me.IMAGES,JSON.stringify(t)),r},delete:e=>{const r=JSON.parse(localStorage.getItem(Me.IMAGES)||"[]").filter(n=>n.id!==e);localStorage.setItem(Me.IMAGES,JSON.stringify(r))}},auth:{login:(e,t)=>{const n=JSON.parse(localStorage.getItem(Me.USERS)||"[]").find(i=>i.email.toLowerCase()===e.toLowerCase()&&i.password===t);if(n){const i={user:{id:n.id,email:n.email},token:"mock-jwt-token-"+Date.now(),expires_at:new Date(Date.now()+864e5).toISOString()};return localStorage.setItem(Me.SESSION,JSON.stringify(i)),{data:{session:i},error:null}}return{data:null,error:{message:"Invalid credentials. Try admin@example.com / password"}}},logout:()=>(localStorage.removeItem(Me.SESSION),{error:null}),getSession:()=>{const e=localStorage.getItem(Me.SESSION);if(!e)return{data:{session:null},error:null};try{const t=JSON.parse(e);return new Date(t.expires_at)JSON.parse(localStorage.getItem(Me.LOCATIONS)||"[]"),getByProvince:e=>JSON.parse(localStorage.getItem(Me.LOCATIONS)||"[]").filter(r=>r.province===e),getAllProvinces:()=>{const e=JSON.parse(localStorage.getItem(Me.LOCATIONS)||"[]");return[...new Set(e.map(r=>r.province).filter(Boolean))].sort()},search:e=>{if(!e)return[];const t=JSON.parse(localStorage.getItem(Me.LOCATIONS)||"[]"),r=e.toLowerCase();return t.filter(n=>n.location_name.toLowerCase().includes(r)||n.location_code.toLowerCase().includes(r)||n.province&&n.province.toLowerCase().includes(r))},add:e=>{const t=JSON.parse(localStorage.getItem(Me.LOCATIONS)||"[]"),r={...e,id:crypto.randomUUID(),created_at:new Date().toISOString()};return t.push(r),localStorage.setItem(Me.LOCATIONS,JSON.stringify(t)),r},update:(e,t)=>{const r=JSON.parse(localStorage.getItem(Me.LOCATIONS)||"[]"),n=r.findIndex(i=>i.id===e);return n!==-1?(r[n]={...r[n],...t,updated_at:new Date().toISOString()},localStorage.setItem(Me.LOCATIONS,JSON.stringify(r)),r[n]):null},delete:e=>{const r=JSON.parse(localStorage.getItem(Me.LOCATIONS)||"[]").filter(s=>s.id!==e);localStorage.setItem(Me.LOCATIONS,JSON.stringify(r));const i=JSON.parse(localStorage.getItem(Me.PRICES)||"[]").filter(s=>s.location_id!==e);localStorage.setItem(Me.PRICES,JSON.stringify(i))}},prices:{getAll:()=>JSON.parse(localStorage.getItem(Me.PRICES)||"[]"),getByLocation:e=>JSON.parse(localStorage.getItem(Me.PRICES)||"[]").filter(r=>r.location_id===e),add:e=>{const t=JSON.parse(localStorage.getItem(Me.PRICES)||"[]"),r={...e,id:crypto.randomUUID(),created_at:new Date().toISOString()};return t.push(r),localStorage.setItem(Me.PRICES,JSON.stringify(t)),r},update:(e,t)=>{const r=JSON.parse(localStorage.getItem(Me.PRICES)||"[]"),n=r.findIndex(i=>i.id===e);return n!==-1?(r[n]={...r[n],price_per_m2:t,updated_at:new Date().toISOString()},localStorage.setItem(Me.PRICES,JSON.stringify(r)),r[n]):null}},finishingMaterials:{getAll:()=>JSON.parse(localStorage.getItem(Me.MATERIALS)||"[]"),getByType:e=>JSON.parse(localStorage.getItem(Me.MATERIALS)||"[]").filter(r=>r.type===e),add:e=>{const t=JSON.parse(localStorage.getItem(Me.MATERIALS)||"[]"),r={...e,id:crypto.randomUUID(),created_at:new Date().toISOString()};return t.push(r),localStorage.setItem(Me.MATERIALS,JSON.stringify(t)),r},update:(e,t)=>{const r=JSON.parse(localStorage.getItem(Me.MATERIALS)||"[]"),n=r.findIndex(i=>i.id===e);return n!==-1?(r[n]={...r[n],...t,updated_at:new Date().toISOString()},localStorage.setItem(Me.MATERIALS,JSON.stringify(r)),r[n]):null},delete:e=>{const r=JSON.parse(localStorage.getItem(Me.MATERIALS)||"[]").filter(n=>n.id!==e);localStorage.setItem(Me.MATERIALS,JSON.stringify(r))}},architectureStyles:{getAll:()=>JSON.parse(localStorage.getItem(Me.STYLES)||"[]"),add:e=>{const t=JSON.parse(localStorage.getItem(Me.STYLES)||"[]"),r={...e,id:crypto.randomUUID(),created_at:new Date().toISOString()};return t.push(r),localStorage.setItem(Me.STYLES,JSON.stringify(t)),r},update:(e,t)=>{const r=JSON.parse(localStorage.getItem(Me.STYLES)||"[]"),n=r.findIndex(i=>i.id===e);return n!==-1?(r[n]={...r[n],...t,updated_at:new Date().toISOString()},localStorage.setItem(Me.STYLES,JSON.stringify(r)),r[n]):null},delete:e=>{const r=JSON.parse(localStorage.getItem(Me.STYLES)||"[]").filter(n=>n.id!==e);localStorage.setItem(Me.STYLES,JSON.stringify(r))}},categories:{getAll:()=>JSON.parse(localStorage.getItem(Me.CATEGORIES)||"[]"),add:e=>{const t=JSON.parse(localStorage.getItem(Me.CATEGORIES)||"[]"),r={id:`cat_${Date.now()}`,name:e,slug:e.toLowerCase().replace(/\s+/g,"-"),created_at:new Date().toISOString()};return t.push(r),localStorage.setItem(Me.CATEGORIES,JSON.stringify(t)),r},update:(e,t)=>{const r=JSON.parse(localStorage.getItem(Me.CATEGORIES)||"[]"),n=r.findIndex(i=>i.id===e);return n!==-1?(r[n]={...r[n],name:t,slug:t.toLowerCase().replace(/\s+/g,"-"),updated_at:new Date().toISOString()},localStorage.setItem(Me.CATEGORIES,JSON.stringify(r)),r[n]):null},delete:e=>{const r=JSON.parse(localStorage.getItem(Me.CATEGORIES)||"[]").filter(n=>n.id!==e);localStorage.setItem(Me.CATEGORIES,JSON.stringify(r))}}},KC=(e=null)=>{const[t,r]=C.useState([]),[n,i]=C.useState(!0),[s,a]=C.useState(null),o=()=>{try{i(!0);const u=Lt.content.getBySection(e);r(u)}catch(u){a({message:u.message})}finally{i(!1)}};return C.useEffect(()=>{o();const u=d=>{d.key==="website_content"&&o()};return window.addEventListener("storage",u),()=>window.removeEventListener("storage",u)},[e]),{content:t,loading:n,error:s,updateContent:async(u,d)=>{try{if(await new Promise(h=>setTimeout(h,300)),!Lt.content.update(u,d))throw new Error("Item not found or update failed");return o(),{error:null}}catch(f){return{error:f}}},getContentValue:(u,d="")=>{if(!t||t.length===0)return d;const f=t.find(h=>h.field_name===u);return f?f.field_value:d},refresh:o}},Iz=({icon:e,title:t,description:r,delay:n})=>l.jsxs(Rt,{className:"h-full group transition-all duration-500 hover:-translate-y-2 bg-[#F0F0F0]",padding:"p-8",children:[l.jsx("div",{className:"absolute -right-4 -top-4 opacity-5 group-hover:opacity-10 transition-opacity duration-300 scale-150",children:l.jsx(e,{withWrapper:!1,className:"w-24 h-24",color:"black"})}),l.jsx("div",{className:"mb-6 p-4 rounded-2xl bg-[#F0F0F0] shadow-neumorph-inset inline-block",children:l.jsx(e,{withWrapper:!0,wrapperClass:"w-10 h-10",color:"orange",className:"w-5 h-5"})}),l.jsx("h3",{className:"text-xl font-bold mb-4 text-[#2C2C2C] group-hover:text-secondary transition-colors",children:t}),l.jsx("p",{className:"text-[#2C2C2C]/60 leading-relaxed text-sm font-medium",children:r})]}),kz=()=>{const{getContentValue:e,loading:t}=KC("about"),r=e("philosophy_title","Design Philosophy"),n=e("philosophy_text","We believe in the power of minimalism. Our approach strips away the unnecessary, revealing the essential beauty of structure, light, and space."),i=[{icon:Wo,title:"Precision",desc:"Meticulous attention to every joint, line, and material transition."},{icon:vT,title:"Simplicity",desc:"Removing clutter to focus on what truly matters in your living space."},{icon:wT,title:"Function",desc:"Design that serves your lifestyle with seamless efficiency."},{icon:gz,title:"Nature",desc:"Blurring the lines between indoor comfort and outdoor serenity."}];return l.jsxs(Ru,{id:"about",className:"py-24 bg-[#F0F0F0]",children:[l.jsxs("div",{className:"grid lg:grid-cols-2 gap-16 mb-24 items-center",children:[l.jsxs("div",{children:[l.jsx("span",{className:"inline-block px-4 py-2 bg-[#F0F0F0] shadow-neumorph-inset rounded-lg text-secondary font-bold tracking-widest text-xs uppercase mb-8",children:"About Us"}),l.jsx("h2",{className:"text-4xl md:text-5xl font-bold text-[#2C2C2C] mb-8 leading-tight",children:t?"Loading...":r}),l.jsx(Rt,{variant:"white",className:"mb-10 relative z-10 p-8 shadow-neumorph-outset hover:shadow-neumorph-hover transition-all",children:l.jsx("p",{className:"text-lg text-[#2C2C2C]/70 leading-relaxed font-medium",children:t?"Loading...":n})}),l.jsxs("div",{className:"flex gap-4",children:[l.jsx("div",{className:"w-16 h-3 bg-primary rounded-full shadow-neumorph-inset"}),l.jsx("div",{className:"w-4 h-3 bg-secondary rounded-full shadow-neumorph-inset"}),l.jsx("div",{className:"w-2 h-3 bg-[#2C2C2C] rounded-full shadow-neumorph-inset"})]})]}),l.jsx("div",{className:"relative",children:l.jsxs("div",{className:"grid grid-cols-2 gap-8",children:[l.jsxs("div",{className:"space-y-8 mt-12",children:[l.jsx(Rt,{padding:"p-2",className:"rotate-2 hover:rotate-0 transition-transform duration-500 bg-[#F0F0F0] shadow-neumorph-outset",children:l.jsx("img",{src:"https://horizons-cdn.hostinger.com/be71d8fd-e4d4-44bb-a5d1-b08712088a77/kks-thouse-8-lloqb.png",alt:"Detail 1",className:"rounded-2xl w-full h-48 object-cover shadow-inner"})}),l.jsx(Rt,{padding:"p-2",className:"-rotate-2 hover:rotate-0 transition-transform duration-500 bg-[#F0F0F0] shadow-neumorph-outset",children:l.jsx("img",{src:"https://horizons-cdn.hostinger.com/be71d8fd-e4d4-44bb-a5d1-b08712088a77/1r-1-x0MxY.png",alt:"Detail 2",className:"rounded-2xl w-full h-64 object-cover shadow-inner"})})]}),l.jsxs("div",{className:"space-y-8",children:[l.jsx(Rt,{padding:"p-2",className:"-rotate-1 hover:rotate-0 transition-transform duration-500 bg-[#F0F0F0] shadow-neumorph-outset",children:l.jsx("img",{src:"https://horizons-cdn.hostinger.com/be71d8fd-e4d4-44bb-a5d1-b08712088a77/gemini_generated_image_tu30zjtu30zjtu30-hSkjz.png",alt:"Detail 3",className:"rounded-2xl w-full h-64 object-cover shadow-inner"})}),l.jsx(Rt,{padding:"p-2",className:"rotate-1 hover:rotate-0 transition-transform duration-500 bg-[#F0F0F0] shadow-neumorph-outset",children:l.jsx("img",{src:"https://horizons-cdn.hostinger.com/be71d8fd-e4d4-44bb-a5d1-b08712088a77/pjof-5-CU2MQ.png",alt:"Detail 4",className:"rounded-2xl w-full h-48 object-cover shadow-inner"})})]})]})})]}),l.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-4 gap-8",children:i.map((s,a)=>l.jsx(Iz,{...s,delay:a*.1},a))})]})},b2=({title:e,icon:t,description:r,count:n,path:i})=>{const s=rs();return l.jsxs(Rt,{onClick:()=>s(i),padding:"p-8",className:"group flex flex-col h-full hover:bg-white transition-colors duration-500",children:[l.jsxs("div",{className:"flex justify-between items-start mb-8",children:[l.jsx(t,{withWrapper:!0,wrapperClass:"w-16 h-16 group-hover:scale-110 transition-transform duration-300",color:"green",className:"w-8 h-8"}),l.jsxs("span",{className:"text-xs font-bold bg-cream-light px-3 py-1 rounded-full text-black/60 border border-black/5 shadow-inner",children:[n," Projects"]})]}),l.jsx("h3",{className:"text-2xl font-bold text-black mb-4 group-hover:text-green transition-colors",children:e}),l.jsx("p",{className:"text-black/60 text-sm leading-relaxed mb-8 flex-grow",children:r}),l.jsxs("div",{className:"flex items-center gap-2 text-sm font-bold text-orange group-hover:translate-x-2 transition-transform duration-300",children:["Explore Collection ",l.jsx("span",{className:"text-lg",children:"→"})]})]})},Lz=()=>l.jsxs(Ru,{id:"categories",className:"py-24 bg-cream-light relative",children:[l.jsxs("div",{className:"max-w-3xl mx-auto text-center mb-16 px-4",children:[l.jsx("h2",{className:"text-4xl font-bold text-black mb-6",children:"Our Expertise"}),l.jsx("p",{className:"text-lg text-black/60",children:"We bring a unified minimalist vision across diverse architectural scales."})]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8",children:[l.jsx(b2,{title:"Architecture",icon:wT,description:"Holistic building design focusing on structure, light, and context.",count:"12",path:"/projects?category=Arsitek"}),l.jsx(b2,{title:"Interior",icon:vT,description:"Curated interior environments that elevate daily living experiences.",count:"18",path:"/projects?category=Interior"}),l.jsx(b2,{title:"Landscape",icon:Wo,description:"Technical execution ensuring design integrity and structural longevity.",count:"8",path:"/projects?category=Landscape"})]})]}),Pz=({project:e})=>{var n,i;const t=rs(),r=((n=e.project_images)==null?void 0:n.find(s=>s.is_cover))||((i=e.project_images)==null?void 0:i[0]);return l.jsx(Rt,{onClick:()=>t(`/projects/${e.id}`),padding:"p-3",className:"group h-[450px] flex flex-col",children:l.jsxs("div",{className:"relative w-full h-full rounded-[1.5rem] overflow-hidden shadow-neumorph-inset",children:[l.jsx("img",{src:(r==null?void 0:r.image_url)||"https://via.placeholder.com/600x400",alt:e.title,className:"w-full h-full object-cover transition-transform duration-700 group-hover:scale-110"}),l.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/80 via-black/20 to-transparent opacity-80 group-hover:opacity-90 transition-opacity duration-300"}),l.jsxs("div",{className:"absolute bottom-0 left-0 right-0 p-8 transform translate-y-2 group-hover:translate-y-0 transition-transform duration-300",children:[l.jsx("div",{className:"flex items-center gap-2 mb-3 opacity-0 group-hover:opacity-100 transition-opacity duration-300 delay-100",children:l.jsx("span",{className:"px-3 py-1 bg-green text-white text-[10px] font-bold uppercase tracking-widest rounded-full",children:e.category||"Architecture"})}),l.jsx("h3",{className:"text-2xl font-bold mb-3 text-white",children:e.title}),l.jsx("p",{className:"text-white/80 line-clamp-2 text-sm max-w-xs opacity-0 group-hover:opacity-100 transition-opacity duration-300 delay-200 mb-4",children:e.description}),l.jsxs("div",{className:"flex items-center gap-2 text-orange text-xs font-bold uppercase tracking-widest opacity-0 group-hover:opacity-100 transition-opacity duration-300 delay-300",children:["View Case Study ",l.jsx(Iu,{className:"w-4 h-4"})]})]})]})})},Qz=()=>{const[e,t]=C.useState([]),[r,n]=C.useState(!0);return C.useEffect(()=>{(async()=>{try{const{data:s}=await ct.from("projects").select("*, project_images(*)").order("created_at",{ascending:!1}).limit(3);t(s||[])}catch(s){console.error(s)}finally{n(!1)}})()},[]),l.jsxs(Ru,{id:"featured-projects",className:"py-24 bg-cream-light",children:[l.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-end mb-16 px-4",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[l.jsx(Wo,{withWrapper:!0,wrapperClass:"w-8 h-8",className:"w-4 h-4",color:"orange"}),l.jsx("span",{className:"text-orange font-bold tracking-widest text-sm uppercase",children:"Selected Works"})]}),l.jsx("h2",{className:"text-4xl md:text-5xl font-bold text-black",children:"Featured Projects"})]}),l.jsx(ll,{to:"/projects",children:l.jsxs(Ie,{variant:"white",className:"hidden md:flex gap-2",children:["View All Projects ",l.jsx(Iu,{className:"w-4 h-4"})]})})]}),r?l.jsx("div",{className:"flex justify-center py-20",children:l.jsx(kt,{className:"w-10 h-10 animate-spin text-green"})}):l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8",children:e.map(i=>l.jsx(Pz,{project:i},i.id))}),l.jsx("div",{className:"mt-12 text-center md:hidden",children:l.jsx(ll,{to:"/projects",children:l.jsx(Ie,{variant:"white",className:"w-full",children:"View All Projects"})})})]})},C2=[{id:"full_build",name:"FULL BUILD",badge:"PLATINUM",price:3e5,priceLabel:"300K",desc:"Solusi terlengkap dari nol hingga pengawasan.",features:["Konsep Desain & Denah 2D","Visualisasi 3D Exterior & Interior","Video Animasi 3D Cinematic","Gambar Arsitektur Lengkap (DED)","Detail Drawing Landscape","MEP Lengkap (Mekanikal, Elektrikal, Plumbing)","Lighting Design","Interior Konsep (tanpa gambar kerja)","Landscape Design","Rencana Anggaran Biaya (RAB)","Koordinasi Proyek Online & Offline","Pengawasan Berkala Online & Offline (max 1x / bulan ke lokasi)"],excluded:["Gambar struktur (Sipil) tidak termasuk","Akomodasi jika diperlukan tidak termasuk"],target:"Owner yang menginginkan hasil sempurna luar dalam dengan pendampingan penuh.",popular:!1,color:"bg-green-50 border-green-200 text-green-700",accentColor:"text-green-700",buttonColor:"bg-green-600 hover:bg-green-700"},{id:"build_ready",name:"BUILD READY",badge:"GOLD",price:2e5,priceLabel:"200K",desc:"Dokumen teknis siap tender & bangun.",features:["Konsep Desain & Denah 2D","Visualisasi 3D Exterior (Unlimited)","Gambar Kerja Lengkap (DED)","Rencana Anggaran Biaya (RAB)","Bonus: Softcopy File Master"],excluded:["Visualisasi 3D Interior","Video Animasi 3D","Pengawasan & Kunjungan lokasi","Gambar struktur (Sipil) tidak termasuk","Akomodasi jika diperlukan tidak termasuk"],target:"Owner yang sudah siap membangun dan membutuhkan dokumen teknis lengkap untuk kontraktor.",popular:!0,color:"bg-amber-50 border-amber-200 text-amber-700",accentColor:"text-amber-700",buttonColor:"bg-amber-600 hover:bg-amber-700"},{id:"gambar_kerja",name:"GAMBAR KERJA",badge:"SILVER",price:15e4,priceLabel:"150K",desc:"Fokus kebutuhan teknis & perizinan.",features:["Konsep Desain & Denah 2D","Visualisasi 3D Exterior (3-4 View)","Gambar Kerja Arsitektur Utama","Gambar Struktur Sederhana"],excluded:["Detail Engineering Design (MEP)","Rencana Anggaran Biaya (RAB)","3D Interior & Animasi","Gambar struktur (Sipil) tidak termasuk","Akomodasi jika diperlukan tidak termasuk"],target:"Owner yang membutuhkan gambar untuk IMB/PBG atau sudah memiliki kontraktor mandiri.",popular:!1,color:"bg-blue-50 border-blue-200 text-blue-700",accentColor:"text-blue-700",buttonColor:"bg-blue-600 hover:bg-blue-700"},{id:"konsep",name:"KONSEP",badge:"BRONZE",price:5e4,priceLabel:"50K",desc:"Brainstorming ide awal tata ruang.",features:["Konsep Denah Tata Ruang 2D","3D Konsep (tanpa di render)","Revisi Denah 2x"],excluded:["Visualisasi 3D Render","Gambar Teknis / DED","RAB","Gambar struktur (Sipil) tidak termasuk","Akomodasi jika diperlukan tidak termasuk"],target:"Owner yang baru merencanakan lahan dan ingin konsultasi layout awal.",popular:!1,color:"bg-gray-50 border-gray-200 text-gray-700",accentColor:"text-gray-700",buttonColor:"bg-gray-600 hover:bg-gray-700"}],Dz=({isOpen:e,onClose:t,pkg:r})=>r?l.jsx(W0,{children:e&&l.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[l.jsx(gr.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:t,className:"absolute inset-0 bg-black/60 backdrop-blur-sm"}),l.jsxs(gr.div,{initial:{opacity:0,scale:.9,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,y:20},transition:{type:"spring",duration:.5},className:"relative w-full max-w-lg bg-white rounded-2xl shadow-2xl overflow-hidden flex flex-col max-h-[90vh]",children:[l.jsxs("div",{className:`p-6 relative text-white bg-gradient-to-br ${Oz(r.id)}`,children:[l.jsx("button",{onClick:t,className:"absolute top-4 right-4 p-2 bg-white/20 hover:bg-white/30 rounded-full transition-colors text-white",children:l.jsx(Ei,{size:18})}),l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx("span",{className:"px-2 py-0.5 bg-white/20 rounded text-[10px] font-bold tracking-wider backdrop-blur-md border border-white/30",children:r.badge}),r.popular&&l.jsxs("span",{className:"flex items-center gap-1 px-2 py-0.5 bg-amber-400 text-amber-900 rounded text-[10px] font-bold",children:[l.jsx(rh,{size:10,fill:"currentColor"})," POPULAR"]})]}),l.jsx("h2",{className:"text-2xl font-bold mb-1",children:r.name}),l.jsxs("div",{className:"flex items-baseline gap-1",children:[l.jsx("span",{className:"text-3xl font-black",children:r.priceLabel}),l.jsx("span",{className:"text-sm opacity-90",children:"/ m²"})]})]}),l.jsxs("div",{className:"p-6 overflow-y-auto custom-scrollbar",children:[l.jsxs("p",{className:"text-gray-600 mb-6 italic border-l-4 border-gray-200 pl-4 py-1",children:['"',r.desc,'"']}),l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsxs("h3",{className:"text-sm font-bold text-gray-900 uppercase tracking-wider mb-3 flex items-center gap-2",children:[l.jsx("span",{className:"w-5 h-5 rounded-full bg-green-100 text-green-600 flex items-center justify-center",children:l.jsx(vu,{size:12,strokeWidth:3})}),"Yang Termasuk (Include)"]}),l.jsx("ul",{className:"space-y-2.5",children:r.features.map((n,i)=>l.jsxs("li",{className:"flex items-start gap-3 text-sm text-gray-700",children:[l.jsx(vu,{size:16,className:"text-green-500 mt-0.5 shrink-0"}),l.jsx("span",{children:n})]},i))})]}),r.excluded&&r.excluded.length>0&&l.jsxs("div",{children:[l.jsxs("h3",{className:"text-sm font-bold text-gray-900 uppercase tracking-wider mb-3 flex items-center gap-2",children:[l.jsx("span",{className:"w-5 h-5 rounded-full bg-red-100 text-red-500 flex items-center justify-center",children:l.jsx(Ei,{size:12,strokeWidth:3})}),"Tidak Termasuk (Exclude)"]}),l.jsx("ul",{className:"space-y-2.5",children:r.excluded.map((n,i)=>l.jsxs("li",{className:"flex items-start gap-3 text-sm text-gray-500",children:[l.jsx(Ei,{size:16,className:"text-red-300 mt-0.5 shrink-0"}),l.jsx("span",{children:n})]},i))})]}),l.jsxs("div",{className:"bg-gray-50 rounded-xl p-4 border border-gray-100",children:[l.jsxs("h3",{className:"text-xs font-bold text-gray-500 uppercase tracking-wider mb-2 flex items-center gap-2",children:[l.jsx(Iu,{size:14}),"Rekomendasi Untuk"]}),l.jsx("p",{className:"text-sm text-gray-800 leading-relaxed font-medium",children:r.target})]})]})]}),l.jsx("div",{className:"p-4 border-t border-gray-100 bg-gray-50",children:l.jsx(Ie,{onClick:t,className:"w-full bg-[#2a2a2a] hover:bg-black text-white font-bold py-3 rounded-xl",children:"Tutup"})})]})]})}):null,Oz=e=>{switch(e){case"full_build":return"from-green-600 to-emerald-800";case"build_ready":return"from-amber-500 to-orange-700";case"gambar_kerja":return"from-blue-600 to-indigo-800";case"konsep":return"from-gray-600 to-gray-800";default:return"from-gray-700 to-black"}},bF=e=>e?new Intl.NumberFormat("id-ID",{style:"currency",currency:"IDR",minimumFractionDigits:0,maximumFractionDigits:0}).format(e):"",sm=({label:e,icon:t,error:r,children:n,subLabel:i})=>l.jsxs("div",{className:"space-y-1.5 w-full",children:[l.jsxs("label",{className:"text-xs md:text-sm font-bold text-gray-700 flex items-center gap-2",children:[l.jsx(t,{className:"w-3 h-3 md:w-4 md:h-4 text-army-green"}),e]}),n,i&&l.jsx("p",{className:"text-[10px] text-gray-400",children:i}),r&&l.jsxs(gr.p,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},className:"text-[10px] text-red-500 flex items-center gap-1 font-medium",children:[l.jsx(ku,{size:10})," ",r]})]}),Rz=({data:e,onChange:t})=>{const[r,n]=C.useState({}),i=(a,o)=>{let A={...r};if(a==="location"&&(o.trim()?delete A.location:A.location="Lokasi proyek wajib diisi"),a==="landArea"&&(o<=0?A.landArea="Luas lahan harus lebih dari 0":delete A.landArea),a==="budgetMin"||a==="budgetMax"){const c=parseFloat(a==="budgetMin"?o:e.budgetMin),u=parseFloat(a==="budgetMax"?o:e.budgetMax);c&&u&&c>=u?A.budget="Budget minimum harus lebih kecil dari maximum":delete A.budget}n(A)},s=(a,o)=>{t({...e,[a]:o}),i(a,o)};return l.jsxs("div",{className:"space-y-6 bg-white rounded-xl border border-gray-200 p-6 shadow-sm",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[l.jsx("span",{className:"w-6 h-6 rounded-full bg-army-green text-white text-xs flex items-center justify-center font-bold",children:"1"}),l.jsx("h3",{className:"text-base md:text-lg font-bold text-gray-900",children:"Data Proyek"})]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[l.jsx(sm,{label:"Lokasi Proyek",icon:Lu,error:r.location,subLabel:"Kota atau daerah lokasi pembangunan",children:l.jsx("input",{type:"text",value:e.location,onChange:a=>s("location",a.target.value),placeholder:"Contoh: Jakarta Selatan",className:`w-full px-4 py-2.5 bg-gray-50 border rounded-xl text-sm focus:outline-none focus:ring-2 transition-all ${r.location?"border-red-300 focus:border-red-500 focus:ring-red-200":"border-gray-200 focus:border-army-green focus:ring-army-green/20"}`})}),l.jsx(sm,{label:"Luas Lahan",icon:jC,error:r.landArea,subLabel:"Total luas tanah yang tersedia (m²)",children:l.jsxs("div",{className:"relative",children:[l.jsx("input",{type:"number",value:e.landArea,onChange:a=>s("landArea",a.target.value),placeholder:"0",className:`w-full px-4 py-2.5 bg-gray-50 border rounded-xl text-sm focus:outline-none focus:ring-2 transition-all pr-10 ${r.landArea?"border-red-300 focus:border-red-500 focus:ring-red-200":"border-gray-200 focus:border-army-green focus:ring-army-green/20"}`}),l.jsx("span",{className:"absolute right-4 top-1/2 -translate-y-1/2 text-gray-400 text-xs font-bold pointer-events-none",children:"m²"})]})}),l.jsxs("div",{className:"md:col-span-2 space-y-2",children:[l.jsxs("label",{className:"text-xs md:text-sm font-bold text-gray-700 flex items-center gap-2",children:[l.jsx(hV,{className:"w-3 h-3 md:w-4 md:h-4 text-army-green"}),"Kisaran Budget Landscape"]}),l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"relative",children:[l.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 text-xs font-bold",children:"Rp"}),l.jsx("input",{type:"number",value:e.budgetMin,onChange:a=>s("budgetMin",a.target.value),placeholder:"Min",className:`w-full pl-9 pr-4 py-2.5 bg-gray-50 border rounded-xl text-sm focus:outline-none focus:ring-2 transition-all ${r.budget?"border-red-300 focus:border-red-500 focus:ring-red-200":"border-gray-200 focus:border-army-green focus:ring-army-green/20"}`})]}),l.jsxs("div",{className:"relative",children:[l.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 text-xs font-bold",children:"Rp"}),l.jsx("input",{type:"number",value:e.budgetMax,onChange:a=>s("budgetMax",a.target.value),placeholder:"Max",className:`w-full pl-9 pr-4 py-2.5 bg-gray-50 border rounded-xl text-sm focus:outline-none focus:ring-2 transition-all ${r.budget?"border-red-300 focus:border-red-500 focus:ring-red-200":"border-gray-200 focus:border-army-green focus:ring-army-green/20"}`})]})]}),l.jsxs("div",{className:"flex justify-between items-start",children:[l.jsx("p",{className:"text-[10px] text-gray-400",children:"Estimasi budget untuk pelaksanaan Landscape."}),r.budget&&l.jsxs(gr.p,{initial:{opacity:0},animate:{opacity:1},className:"text-[10px] text-red-500 flex items-center gap-1 font-medium",children:[l.jsx(ku,{size:10})," ",r.budget]})]}),(e.budgetMin||e.budgetMax)&&!r.budget&&l.jsxs("p",{className:"text-xs font-medium text-army-green bg-army-green/5 p-2 rounded-lg border border-army-green/10",children:["Range: ",bF(e.budgetMin||0)," - ",bF(e.budgetMax||0)]})]}),l.jsx(sm,{label:"Target Timeline",icon:Pj,children:l.jsxs("select",{value:e.timeline,onChange:a=>s("timeline",a.target.value),className:"w-full px-4 py-2.5 bg-gray-50 border border-gray-200 rounded-xl text-sm focus:outline-none focus:ring-2 focus:ring-army-green/20 focus:border-army-green transition-all appearance-none cursor-pointer",children:[l.jsx("option",{value:"",disabled:!0,children:"Pilih durasi..."}),l.jsx("option",{value:"1 Bulan",children:"1 Bulan"}),l.jsx("option",{value:"2 Bulan",children:"2 Bulan"}),l.jsx("option",{value:"3 Bulan",children:"3 Bulan"}),l.jsx("option",{value:"4 Bulan",children:"4 Bulan"}),l.jsx("option",{value:"5 Bulan",children:"5 Bulan"}),l.jsx("option",{value:"6 Bulan",children:"6 Bulan"}),l.jsx("option",{value:"Custom",children:"Custom (Diskusi Lanjut)"})]})}),l.jsx(sm,{label:"Tipe Proyek",icon:ky,children:l.jsxs("select",{value:e.projectType,onChange:a=>s("projectType",a.target.value),className:"w-full px-4 py-2.5 bg-gray-50 border border-gray-200 rounded-xl text-sm focus:outline-none focus:ring-2 focus:ring-army-green/20 focus:border-army-green transition-all appearance-none cursor-pointer",children:[l.jsx("option",{value:"",disabled:!0,children:"Pilih tipe..."}),l.jsx("option",{value:"Private Residence",children:"Private Residence (Rumah Tinggal)"}),l.jsx("option",{value:"Investment",children:"Investment (Kost/Kontrakan)"}),l.jsx("option",{value:"Commercial",children:"Commercial (Cafe/Resto/Ruko)"}),l.jsx("option",{value:"Signature Project",children:"Signature Project (Luxury)"})]})})]})]})};function $t(e){"@babel/helpers - typeof";return $t=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},$t(e)}var In=Uint8Array,Bi=Uint16Array,VC=Int32Array,Av=new In([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]),lv=new In([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]),qy=new In([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),LT=function(e,t){for(var r=new Bi(31),n=0;n<31;++n)r[n]=t+=1<>1|(lr&21845)<<1;wo=(wo&52428)>>2|(wo&13107)<<2,wo=(wo&61680)>>4|(wo&3855)<<4,Xy[lr]=((wo&65280)>>8|(wo&255)<<8)>>1}var na=function(e,t,r){for(var n=e.length,i=0,s=new Bi(t);i>A]=c}else for(o=new Bi(n),i=0;i>15-e[i]);return o},iA=new In(288);for(var lr=0;lr<144;++lr)iA[lr]=8;for(var lr=144;lr<256;++lr)iA[lr]=9;for(var lr=256;lr<280;++lr)iA[lr]=7;for(var lr=280;lr<288;++lr)iA[lr]=8;var oh=new In(32);for(var lr=0;lr<32;++lr)oh[lr]=5;var Hz=na(iA,9,0),Kz=na(iA,9,1),Vz=na(oh,5,0),$z=na(oh,5,1),B2=function(e){for(var t=e[0],r=1;rt&&(t=e[r]);return t},fs=function(e,t,r){var n=t/8|0;return(e[n]|e[n+1]<<8)>>(t&7)&r},S2=function(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(t&7)},$C=function(e){return(e+7)/8|0},OT=function(e,t,r){return(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length),new In(e.subarray(t,r))},Gz=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],xs=function(e,t,r){var n=new Error(t||Gz[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,xs),!r)throw n;return n},zz=function(e,t,r,n){var i=e.length,s=n?n.length:0;if(!i||t.f&&!t.l)return r||new In(0);var a=!r,o=a||t.i!=2,A=t.i;a&&(r=new In(i*3));var c=function(ge){var xe=r.length;if(ge>xe){var Ee=new In(Math.max(xe*2,ge));Ee.set(r),r=Ee}},u=t.f||0,d=t.p||0,f=t.b||0,h=t.l,v=t.d,p=t.m,y=t.n,g=i*8;do{if(!h){u=fs(e,d,1);var w=fs(e,d+1,3);if(d+=3,w)if(w==1)h=Kz,v=$z,p=9,y=5;else if(w==2){var _=fs(e,d,31)+257,k=fs(e,d+10,15)+4,S=_+fs(e,d+5,31)+1;d+=14;for(var I=new In(S),H=new In(19),N=0;N>4;if(b<16)I[N++]=b;else{var U=0,P=0;for(b==16?(P=3+fs(e,d,3),d+=2,U=I[N-1]):b==17?(P=3+fs(e,d,7),d+=3):b==18&&(P=11+fs(e,d,127),d+=7);P--;)I[N++]=U}}var M=I.subarray(0,_),$=I.subarray(_);p=B2(M),y=B2($),h=na(M,p,1),v=na($,y,1)}else xs(1);else{var b=$C(d)+4,E=e[b-4]|e[b-3]<<8,L=b+E;if(L>i){A&&xs(0);break}o&&c(f+E),r.set(e.subarray(b,L),f),t.b=f+=E,t.p=d=L*8,t.f=u;continue}if(d>g){A&&xs(0);break}}o&&c(f+131072);for(var X=(1<>4;if(d+=U&15,d>g){A&&xs(0);break}if(U||xs(2),J<256)r[f++]=J;else if(J==256){O=d,h=null;break}else{var z=J-254;if(J>264){var N=J-257,q=Av[N];z=fs(e,d,(1<>4;ne||xs(3),d+=ne&15;var $=Mz[ie];if(ie>3){var q=lv[ie];$+=S2(e,d)&(1<g){A&&xs(0);break}o&&c(f+131072);var oe=f+z;if(f<$){var ce=s-$,ve=Math.min($,oe);for(ce+f<0&&xs(3);f>8},Qd=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},F2=function(e,t){for(var r=[],n=0;nf&&(f=s[n].s);var h=new Bi(f+1),v=Zy(r[u-1],h,0);if(v>t){var n=0,p=0,y=v-t,g=1<t)p+=g-(1<>=y;p>0;){var b=s[n].s;h[b]=0&&p;--n){var E=s[n].s;h[E]==t&&(--h[E],++p)}v=t}return{t:new In(h),l:v}},Zy=function(e,t,r){return e.s==-1?Math.max(Zy(e.l,t,r+1),Zy(e.r,t,r+1)):t[e.s]=r},BF=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new Bi(++t),n=0,i=e[0],s=1,a=function(A){r[n++]=A},o=1;o<=t;++o)if(e[o]==i&&o!=t)++s;else{if(!i&&s>2){for(;s>138;s-=138)a(32754);s>2&&(a(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(a(i),--s;s>6;s-=6)a(8304);s>2&&(a(s-3<<5|8208),s=0)}for(;s--;)a(i);s=1,i=e[o]}return{c:r.subarray(0,n),n:t}},Dd=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 s=0;s4&&!H[qy[j-1]];--j);var R=c+5<<3,T=Dd(i,iA)+Dd(s,oh)+a,D=Dd(i,f)+Dd(s,p)+a+14+3*j+Dd(k,H)+2*k[16]+3*k[17]+7*k[18];if(A>=0&&R<=T&&R<=D)return RT(t,u,e.subarray(A,A+c));var U,P,M,$;if(Ba(t,u,1+(D15&&(Ba(t,u,J[S]>>5&127),u+=J[S]>>12)}}else U=Hz,P=iA,M=Vz,$=oh;for(var S=0;S255){var z=q>>18&31;Qd(t,u,U[z+257]),u+=P[z+257],z>7&&(Ba(t,u,q>>23&31),u+=Av[z]);var ne=q&31;Qd(t,u,M[ne]),u+=$[ne],ne>3&&(Qd(t,u,q>>5&8191),u+=lv[ne])}else Qd(t,u,U[q]),u+=P[q]}return Qd(t,u,U[256]),u+P[256]},Wz=new VC([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),MT=new In(0),Jz=function(e,t,r,n,i,s){var a=s.z||e.length,o=new In(n+a+5*(1+Math.ceil(a/7e3))+i),A=o.subarray(n,o.length-i),c=s.l,u=(s.r||0)&7;if(t){u&&(A[0]=s.r>>3);for(var d=Wz[t-1],f=d>>13,h=d&8191,v=(1<7e3||H>24576)&&(U>423||!c)){u=SF(e,A,0,E,L,_,S,H,j,I-j,u),H=k=S=0,j=I;for(var P=0;P<286;++P)L[P]=0;for(var P=0;P<30;++P)_[P]=0}var M=2,$=0,X=h,le=T-D&32767;if(U>2&&R==b(I-le))for(var O=Math.min(f,U)-1,J=Math.min(32767,I),z=Math.min(258,U);le<=J&&--X&&T!=D;){if(e[I+M]==e[I+M-le]){for(var q=0;qM){if(M=q,$=le,q>O)break;for(var ne=Math.min(le,q-2),ie=0,P=0;Pie&&(ie=ve,D=oe)}}}T=D,D=p[T],le+=T-D&32767}if($){E[H++]=268435456|Yy[M]<<18|CF[$];var ge=Yy[M]&31,xe=CF[$]&31;S+=Av[ge]+lv[xe],++L[257+ge],++_[xe],N=I+M,++k}else E[H++]=e[I],++L[e[I]]}}for(I=Math.max(I,N);I=a&&(A[u/8|0]=c,Ee=a),u=RT(A,u+1,e.subarray(I,Ee))}s.i=a}return OT(o,0,n+$C(u)+i)},HT=function(){var e=1,t=0;return{p:function(r){for(var n=e,i=t,s=r.length|0,a=0;a!=s;){for(var o=Math.min(a+2655,s);a>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}}},qz=function(e,t,r,n,i){if(!i&&(i={l:1},t.dictionary)){var s=t.dictionary.subarray(-32768),a=new In(s.length+e.length);a.set(s),a.set(e,s.length),e=a,i.w=s.length}return Jz(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)},KT=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},Yz=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=HT();i.p(t.dictionary),KT(e,2,i.d())}},Xz=function(e,t){return((e[0]&15)!=8||e[0]>>4>7||(e[0]<<8|e[1])%31)&&xs(6,"invalid zlib data"),(e[1]>>5&1)==+!t&&xs(6,"invalid zlib data: "+(e[1]&32?"need":"unexpected")+" dictionary"),(e[1]>>3&4)+2};function ex(e,t){t||(t={});var r=HT();r.p(e);var n=qz(e,t,t.dictionary?6:2,4);return Yz(n,t),KT(n,n.length-4,r.d()),n}function Zz(e,t){return zz(e.subarray(Xz(e,t&&t.dictionary),-4),{i:2},t&&t.out,t&&t.dictionary)}var eW=typeof TextDecoder<"u"&&new TextDecoder,tW=0;try{eW.decode(MT,{stream:!0}),tW=1}catch{}var lt=function(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this}();function E2(){lt.console&&typeof lt.console.log=="function"&<.console.log.apply(lt.console,arguments)}var Zt={log:E2,warn:function(e){lt.console&&(typeof lt.console.warn=="function"?lt.console.warn.apply(lt.console,arguments):E2.call(null,arguments))},error:function(e){lt.console&&(typeof lt.console.error=="function"?lt.console.error.apply(lt.console,arguments):E2(e))}};function N2(e,t,r){var n=new XMLHttpRequest;n.open("GET",e),n.responseType="blob",n.onload=function(){RA(n.response,t,r)},n.onerror=function(){Zt.error("could not download file")},n.send()}function FF(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function am(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 bf,tx,RA=lt.saveAs||((typeof window>"u"?"undefined":$t(window))!=="object"||window!==lt?function(){}:typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype?function(e,t,r){var n=lt.URL||lt.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?FF(i.href)?N2(e,t,r):am(i,i.target="_blank"):am(i)):(i.href=n.createObjectURL(e),setTimeout(function(){n.revokeObjectURL(i.href)},4e4),setTimeout(function(){am(i)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,r){if(t=t||e.name||"download",typeof e=="string")if(FF(e))N2(e,t,r);else{var n=document.createElement("a");n.href=e,n.target="_blank",setTimeout(function(){am(n)})}else navigator.msSaveOrOpenBlob(function(i,s){return s===void 0?s={autoBom:!1}:$t(s)!=="object"&&(Zt.warn("Deprecated: Expected third argument to be a object"),s={autoBom:!s}),s.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(i.type)?new Blob([String.fromCharCode(65279),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 N2(e,t,r);var i=e.type==="application/octet-stream",s=/constructor/i.test(lt.HTMLElement)||lt.safari,a=/CriOS\/[\d]+/.test(navigator.userAgent);if((a||i&&s)&&(typeof FileReader>"u"?"undefined":$t(FileReader))==="object"){var o=new FileReader;o.onloadend=function(){var u=o.result;u=a?u:u.replace(/^data:[^;]*;/,"data:attachment/file;"),n?n.location.href=u:location=u,n=null},o.readAsDataURL(e)}else{var A=lt.URL||lt.webkitURL,c=A.createObjectURL(e);n?n.location=c:location.href=c,n=null,setTimeout(function(){A.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 VT(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(o){return[parseInt(o[1]),parseInt(o[2]),parseInt(o[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(o){return[parseInt(o[1],16),parseInt(o[2],16),parseInt(o[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(o){return[parseInt(o[1]+o[1],16),parseInt(o[2]+o[2],16),parseInt(o[3]+o[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 o=this.r.toString(16),A=this.g.toString(16),c=this.b.toString(16);return o.length==1&&(o="0"+o),A.length==1&&(A="0"+A),c.length==1&&(c="0"+c),"#"+o+A+c}}/** * @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 _2(e,t){var r=e[0],n=e[1],i=e[2],s=e[3];r=Sn(r,n,i,s,t[0],7,-680876936),s=Sn(s,r,n,i,t[1],12,-389564586),i=Sn(i,s,r,n,t[2],17,606105819),n=Sn(n,i,s,r,t[3],22,-1044525330),r=Sn(r,n,i,s,t[4],7,-176418897),s=Sn(s,r,n,i,t[5],12,1200080426),i=Sn(i,s,r,n,t[6],17,-1473231341),n=Sn(n,i,s,r,t[7],22,-45705983),r=Sn(r,n,i,s,t[8],7,1770035416),s=Sn(s,r,n,i,t[9],12,-1958414417),i=Sn(i,s,r,n,t[10],17,-42063),n=Sn(n,i,s,r,t[11],22,-1990404162),r=Sn(r,n,i,s,t[12],7,1804603682),s=Sn(s,r,n,i,t[13],12,-40341101),i=Sn(i,s,r,n,t[14],17,-1502002290),r=Fn(r,n=Sn(n,i,s,r,t[15],22,1236535329),i,s,t[1],5,-165796510),s=Fn(s,r,n,i,t[6],9,-1069501632),i=Fn(i,s,r,n,t[11],14,643717713),n=Fn(n,i,s,r,t[0],20,-373897302),r=Fn(r,n,i,s,t[5],5,-701558691),s=Fn(s,r,n,i,t[10],9,38016083),i=Fn(i,s,r,n,t[15],14,-660478335),n=Fn(n,i,s,r,t[4],20,-405537848),r=Fn(r,n,i,s,t[9],5,568446438),s=Fn(s,r,n,i,t[14],9,-1019803690),i=Fn(i,s,r,n,t[3],14,-187363961),n=Fn(n,i,s,r,t[8],20,1163531501),r=Fn(r,n,i,s,t[13],5,-1444681467),s=Fn(s,r,n,i,t[2],9,-51403784),i=Fn(i,s,r,n,t[7],14,1735328473),r=En(r,n=Fn(n,i,s,r,t[12],20,-1926607734),i,s,t[5],4,-378558),s=En(s,r,n,i,t[8],11,-2022574463),i=En(i,s,r,n,t[11],16,1839030562),n=En(n,i,s,r,t[14],23,-35309556),r=En(r,n,i,s,t[1],4,-1530992060),s=En(s,r,n,i,t[4],11,1272893353),i=En(i,s,r,n,t[7],16,-155497632),n=En(n,i,s,r,t[10],23,-1094730640),r=En(r,n,i,s,t[13],4,681279174),s=En(s,r,n,i,t[0],11,-358537222),i=En(i,s,r,n,t[3],16,-722521979),n=En(n,i,s,r,t[6],23,76029189),r=En(r,n,i,s,t[9],4,-640364487),s=En(s,r,n,i,t[12],11,-421815835),i=En(i,s,r,n,t[15],16,530742520),r=Nn(r,n=En(n,i,s,r,t[2],23,-995338651),i,s,t[0],6,-198630844),s=Nn(s,r,n,i,t[7],10,1126891415),i=Nn(i,s,r,n,t[14],15,-1416354905),n=Nn(n,i,s,r,t[5],21,-57434055),r=Nn(r,n,i,s,t[12],6,1700485571),s=Nn(s,r,n,i,t[3],10,-1894986606),i=Nn(i,s,r,n,t[10],15,-1051523),n=Nn(n,i,s,r,t[1],21,-2054922799),r=Nn(r,n,i,s,t[8],6,1873313359),s=Nn(s,r,n,i,t[15],10,-30611744),i=Nn(i,s,r,n,t[6],15,-1560198380),n=Nn(n,i,s,r,t[13],21,1309151649),r=Nn(r,n,i,s,t[4],6,-145523070),s=Nn(s,r,n,i,t[11],10,-1120210379),i=Nn(i,s,r,n,t[2],15,718787259),n=Nn(n,i,s,r,t[9],21,-343485551),e[0]=Lo(r,e[0]),e[1]=Lo(n,e[1]),e[2]=Lo(i,e[2]),e[3]=Lo(s,e[3])}function cv(e,t,r,n,i,s){return t=Lo(Lo(t,e),Lo(n,s)),Lo(t<>>32-i,r)}function Sn(e,t,r,n,i,s,a){return cv(t&r|~t&n,e,t,i,s,a)}function Fn(e,t,r,n,i,s,a){return cv(t&n|r&~n,e,t,i,s,a)}function En(e,t,r,n,i,s,a){return cv(t^r^n,e,t,i,s,a)}function Nn(e,t,r,n,i,s,a){return cv(r^(t|~n),e,t,i,s,a)}function $T(e){var t,r=e.length,n=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=e.length;t+=64)_2(n,rW(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(_2(n,i),t=0;t<16;t++)i[t]=0;return i[14]=8*r,_2(n,i),n}function rW(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}bf=lt.atob.bind(lt),tx=lt.btoa.bind(lt);var EF="0123456789abcdef".split("");function nW(e){for(var t="",r=0;r<4;r++)t+=EF[e>>8*r+4&15]+EF[e>>8*r&15];return t}function iW(e){return String.fromCharCode((255&e)>>0,(65280&e)>>8,(16711680&e)>>16,(4278190080&e)>>24)}function rx(e){return $T(e).map(iW).join("")}var sW=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 nx(e,t){var r,n,i,s;if(e!==r){for(var a=(i=e,s=1+(256/e.length>>0),new Array(s+1).join(i)),o=[],A=0;A<256;A++)o[A]=A;var c=0;for(A=0;A<256;A++){var u=o[A];c=(c+u+a.charCodeAt(A))%256,o[A]=o[c],o[c]=u}r=e,n=o}else o=n;var d=t.length,f=0,h=0,v="";for(A=0;A€/\f©þdSiz";var s=(t+this.padding).substr(0,32),a=(r+this.padding).substr(0,32);this.O=this.processOwnerPassword(s,a),this.P=-(1+(255^i)),this.encryptionKey=rx(s+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(n)).substr(0,5),this.U=nx(this.encryptionKey,this.padding)}function bc(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?t+="#"+("0"+i.toString(16)).slice(-2):t+=e[n]}return t}function _F(e){if($t(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 s=Math.random().toString(35);return t[r][s]=[n,!!i],s},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 s in t[r]){var a=t[r][s];try{a[0].apply(e,n)}catch(o){lt.console&&Zt.error("jsPDF PubSub Error",o.message,o)}a[1]&&i.push(s)}i.length&&i.forEach(this.unsubscribe)}},this.getTopics=function(){return t}}function a0(e){if(!(this instanceof a0))return new a0(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 GT(e,t){this.gState=e,this.matrix=t,this.id="",this.objectNumber=-1}function KA(e,t,r,n,i){if(!(this instanceof KA))return new KA(e,t,r,n,i);this.type=e==="axial"?2:3,this.coords=t,this.colors=r,GT.call(this,n,i)}function Vc(e,t,r,n,i){if(!(this instanceof Vc))return new Vc(e,t,r,n,i);this.boundingBox=e,this.xStep=t,this.yStep=r,this.stream="",this.cloneIndex=0,GT.call(this,n,i)}function it(e){var t,r=typeof arguments[0]=="string"?arguments[0]:"p",n=arguments[1],i=arguments[2],s=arguments[3],a=[],o=1,A=16,c="S",u=null;$t(e=e||{})==="object"&&(r=e.orientation,n=e.unit||n,i=e.format||i,s=e.compress||e.compressPdf||s,(u=e.encryption||null)!==null&&(u.userPassword=u.userPassword||"",u.ownerPassword=u.ownerPassword||"",u.userPermissions=u.userPermissions||[]),o=typeof e.userUnit=="number"?Math.abs(e.userUnit):1,e.precision!==void 0&&(t=e.precision),e.floatPrecision!==void 0&&(A=e.floatPrecision),c=e.defaultPathOperation||"S"),a=e.filters||(s===!0?["FlateEncode"]:a),n=n||"mm",r=(""+(r||"P")).toLowerCase();var d=e.putOnlyUsedFonts||!1,f={},h={internal:{},__private__:{}};h.__private__.PubSub=_F;var v="1.3",p=h.__private__.getPdfVersion=function(){return v};h.__private__.setPdfVersion=function(B){v=B};var y={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 y};var g=h.__private__.getPageFormat=function(B){return y[B]};i=i||"a4";var w={COMPAT:"compat",ADVANCED:"advanced"},b=w.COMPAT;function E(){this.saveGraphicsState(),te(new st(Le,0,0,-Le,0,ro()*Le).toString()+" cm"),this.setFontSize(this.getFontSize()/Le),c="n",b=w.ADVANCED}function L(){this.restoreGraphicsState(),c="S",b=w.COMPAT}var _=h.__private__.combineFontStyleAndFontWeight=function(B,V){if(B=="bold"&&V=="normal"||B=="bold"&&V==400||B=="normal"&&V=="italic"||B=="bold"&&V=="italic")throw new Error("Invalid Combination of fontweight and fontstyle");return V&&(B=V==400||V==="normal"?B==="italic"?"italic":"normal":V!=700&&V!=="bold"||B!=="normal"?(V==700?"bold":V)+""+B:"bold"),B};h.advancedAPI=function(B){var V=b===w.COMPAT;return V&&E.call(this),typeof B!="function"||(B(this),V&&L.call(this)),this},h.compatAPI=function(B){var V=b===w.ADVANCED;return V&&L.call(this),typeof B!="function"||(B(this),V&&E.call(this)),this},h.isAdvancedAPI=function(){return b===w.ADVANCED};var k,S=function(B){if(b!==w.ADVANCED)throw new Error(B+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},I=h.roundToPrecision=h.__private__.roundToPrecision=function(B,V){var re=t||V;if(isNaN(B)||isNaN(re))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return B.toFixed(re).replace(/0+$/,"")};k=h.hpf=h.__private__.hpf=typeof A=="number"?function(B){if(isNaN(B))throw new Error("Invalid argument passed to jsPDF.hpf");return I(B,A)}:A==="smart"?function(B){if(isNaN(B))throw new Error("Invalid argument passed to jsPDF.hpf");return I(B,B>-1&&B<1?16:5)}:function(B){if(isNaN(B))throw new Error("Invalid argument passed to jsPDF.hpf");return I(B,16)};var H=h.f2=h.__private__.f2=function(B){if(isNaN(B))throw new Error("Invalid argument passed to jsPDF.f2");return I(B,2)},N=h.__private__.f3=function(B){if(isNaN(B))throw new Error("Invalid argument passed to jsPDF.f3");return I(B,3)},j=h.scale=h.__private__.scale=function(B){if(isNaN(B))throw new Error("Invalid argument passed to jsPDF.scale");return b===w.COMPAT?B*Le:b===w.ADVANCED?B:void 0},R=function(B){return b===w.COMPAT?ro()-B:b===w.ADVANCED?B:void 0},T=function(B){return j(R(B))};h.__private__.setPrecision=h.setPrecision=function(B){typeof parseInt(B,10)=="number"&&(t=parseInt(B,10))};var D,U="00000000000000000000000000000000",P=h.__private__.getFileId=function(){return U},M=h.__private__.setFileId=function(B){return U=B!==void 0&&/^[a-fA-F0-9]{32}$/.test(B)?B.toUpperCase():U.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),u!==null&&(xn=new xc(u.userPermissions,u.userPassword,u.ownerPassword,U)),U};h.setFileId=function(B){return M(B),this},h.getFileId=function(){return P()};var $=h.__private__.convertDateToPDFDate=function(B){var V=B.getTimezoneOffset(),re=V<0?"+":"-",se=Math.floor(Math.abs(V/60)),fe=Math.abs(V%60),ye=[re,z(se),"'",z(fe),"'"].join("");return["D:",B.getFullYear(),z(B.getMonth()+1),z(B.getDate()),z(B.getHours()),z(B.getMinutes()),z(B.getSeconds()),ye].join("")},X=h.__private__.convertPDFDateToDate=function(B){var V=parseInt(B.substr(2,4),10),re=parseInt(B.substr(6,2),10)-1,se=parseInt(B.substr(8,2),10),fe=parseInt(B.substr(10,2),10),ye=parseInt(B.substr(12,2),10),Ne=parseInt(B.substr(14,2),10);return new Date(V,re,se,fe,ye,Ne,0)},le=h.__private__.setCreationDate=function(B){var V;if(B===void 0&&(B=new Date),B instanceof Date)V=$(B);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(B))throw new Error("Invalid argument passed to jsPDF.setCreationDate");V=B}return D=V},O=h.__private__.getCreationDate=function(B){var V=D;return B==="jsDate"&&(V=X(D)),V};h.setCreationDate=function(B){return le(B),this},h.getCreationDate=function(B){return O(B)};var J,z=h.__private__.padd2=function(B){return("0"+parseInt(B)).slice(-2)},q=h.__private__.padd2Hex=function(B){return("00"+(B=B.toString())).substr(B.length)},ne=0,ie=[],oe=[],ce=0,ve=[],ge=[],xe=!1,Ee=oe,Re=function(){ne=0,ce=0,oe=[],ie=[],ve=[],ua=Hr(),is=Hr()};h.__private__.setCustomOutputDestination=function(B){xe=!0,Ee=B};var me=function(B){xe||(Ee=B)};h.__private__.resetCustomOutputDestination=function(){xe=!1,Ee=oe};var te=h.__private__.out=function(B){return B=B.toString(),ce+=B.length+1,Ee.push(B),Ee},Qe=h.__private__.write=function(B){return te(arguments.length===1?B.toString():Array.prototype.join.call(arguments," "))},Te=h.__private__.getArrayBuffer=function(B){for(var V=B.length,re=new ArrayBuffer(V),se=new Uint8Array(re);V--;)se[V]=B.charCodeAt(V);return re},be=[["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 be};var _e=e.fontSize||16;h.__private__.setFontSize=h.setFontSize=function(B){return _e=b===w.ADVANCED?B/Le:B,this};var Ue,ke=h.__private__.getFontSize=h.getFontSize=function(){return b===w.COMPAT?_e:_e*Le},De=e.R2L||!1;h.__private__.setR2L=h.setR2L=function(B){return De=B,this},h.__private__.getR2L=h.getR2L=function(){return De};var Ve,Ye=h.__private__.setZoomMode=function(B){var V=[void 0,null,"fullwidth","fullheight","fullpage","original"];if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(B))Ue=B;else if(isNaN(B)){if(V.indexOf(B)===-1)throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+B+'" is not recognized.');Ue=B}else Ue=parseInt(B,10)};h.__private__.getZoomMode=function(){return Ue};var ut,bt=h.__private__.setPageMode=function(B){if([void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(B)==-1)throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+B+'" is not recognized.');Ve=B};h.__private__.getPageMode=function(){return Ve};var dt=h.__private__.setLayoutMode=function(B){if([void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(B)==-1)throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+B+'" is not recognized.');ut=B};h.__private__.getLayoutMode=function(){return ut},h.__private__.setDisplayMode=h.setDisplayMode=function(B,V,re){return Ye(B),dt(V),bt(re),this};var Xe={title:"",subject:"",author:"",keywords:"",creator:""};h.__private__.getDocumentProperty=function(B){if(Object.keys(Xe).indexOf(B)===-1)throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return Xe[B]},h.__private__.getDocumentProperties=function(){return Xe},h.__private__.setDocumentProperties=h.setProperties=h.setDocumentProperties=function(B){for(var V in Xe)Xe.hasOwnProperty(V)&&B[V]&&(Xe[V]=B[V]);return this},h.__private__.setDocumentProperty=function(B,V){if(Object.keys(Xe).indexOf(B)===-1)throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return Xe[B]=V};var et,Le,Ht,vt,Cr,Nt={},Wt={},Ii=[],_t={},Ls={},Jt={},di={},tn=null,Pt=0,nt=[],St=new _F(h),Ps=e.hotfixes||[],ar={},rn={},Qs=[],st=function B(V,re,se,fe,ye,Ne){if(!(this instanceof B))return new B(V,re,se,fe,ye,Ne);isNaN(V)&&(V=1),isNaN(re)&&(re=0),isNaN(se)&&(se=0),isNaN(fe)&&(fe=1),isNaN(ye)&&(ye=0),isNaN(Ne)&&(Ne=0),this._matrix=[V,re,se,fe,ye,Ne]};Object.defineProperty(st.prototype,"sx",{get:function(){return this._matrix[0]},set:function(B){this._matrix[0]=B}}),Object.defineProperty(st.prototype,"shy",{get:function(){return this._matrix[1]},set:function(B){this._matrix[1]=B}}),Object.defineProperty(st.prototype,"shx",{get:function(){return this._matrix[2]},set:function(B){this._matrix[2]=B}}),Object.defineProperty(st.prototype,"sy",{get:function(){return this._matrix[3]},set:function(B){this._matrix[3]=B}}),Object.defineProperty(st.prototype,"tx",{get:function(){return this._matrix[4]},set:function(B){this._matrix[4]=B}}),Object.defineProperty(st.prototype,"ty",{get:function(){return this._matrix[5]},set:function(B){this._matrix[5]=B}}),Object.defineProperty(st.prototype,"a",{get:function(){return this._matrix[0]},set:function(B){this._matrix[0]=B}}),Object.defineProperty(st.prototype,"b",{get:function(){return this._matrix[1]},set:function(B){this._matrix[1]=B}}),Object.defineProperty(st.prototype,"c",{get:function(){return this._matrix[2]},set:function(B){this._matrix[2]=B}}),Object.defineProperty(st.prototype,"d",{get:function(){return this._matrix[3]},set:function(B){this._matrix[3]=B}}),Object.defineProperty(st.prototype,"e",{get:function(){return this._matrix[4]},set:function(B){this._matrix[4]=B}}),Object.defineProperty(st.prototype,"f",{get:function(){return this._matrix[5]},set:function(B){this._matrix[5]=B}}),Object.defineProperty(st.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(st.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(st.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(st.prototype,"isIdentity",{get:function(){return this.sx===1&&this.shy===0&&this.shx===0&&this.sy===1&&this.tx===0&&this.ty===0}}),st.prototype.join=function(B){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(k).join(B)},st.prototype.multiply=function(B){var V=B.sx*this.sx+B.shy*this.shx,re=B.sx*this.shy+B.shy*this.sy,se=B.shx*this.sx+B.sy*this.shx,fe=B.shx*this.shy+B.sy*this.sy,ye=B.tx*this.sx+B.ty*this.shx+this.tx,Ne=B.tx*this.shy+B.ty*this.sy+this.ty;return new st(V,re,se,fe,ye,Ne)},st.prototype.decompose=function(){var B=this.sx,V=this.shy,re=this.shx,se=this.sy,fe=this.tx,ye=this.ty,Ne=Math.sqrt(B*B+V*V),Ke=(B/=Ne)*re+(V/=Ne)*se;re-=B*Ke,se-=V*Ke;var Ze=Math.sqrt(re*re+se*se);return Ke/=Ze,B*(se/=Ze)>16&255,se=Ze>>8&255,fe=255&Ze}if(se===void 0||ye===void 0&&re===se&&se===fe)if(typeof re=="string")V=re+" "+Ne[0];else switch(B.precision){case 2:V=H(re/255)+" "+Ne[0];break;case 3:default:V=N(re/255)+" "+Ne[0]}else if(ye===void 0||$t(ye)==="object"){if(ye&&!isNaN(ye.a)&&ye.a===0)return V=["1.","1.","1.",Ne[1]].join(" ");if(typeof re=="string")V=[re,se,fe,Ne[1]].join(" ");else switch(B.precision){case 2:V=[H(re/255),H(se/255),H(fe/255),Ne[1]].join(" ");break;default:case 3:V=[N(re/255),N(se/255),N(fe/255),Ne[1]].join(" ")}}else if(typeof re=="string")V=[re,se,fe,ye,Ne[2]].join(" ");else switch(B.precision){case 2:V=[H(re),H(se),H(fe),H(ye),Ne[2]].join(" ");break;case 3:default:V=[N(re),N(se),N(fe),N(ye),Ne[2]].join(" ")}return V},Os=h.__private__.getFilters=function(){return a},ki=h.__private__.putStream=function(B){var V=(B=B||{}).data||"",re=B.filters||Os(),se=B.alreadyAppliedFilters||[],fe=B.addLength1||!1,ye=V.length,Ne=B.objectId,Ke=function(bn){return bn};if(u!==null&&Ne===void 0)throw new Error("ObjectId must be passed to putStream for file encryption");u!==null&&(Ke=xn.encryptor(Ne,0));var Ze={};re===!0&&(re=["FlateEncode"]);var mt=B.additionalKeyValues||[],ht=(Ze=it.API.processDataByFilters!==void 0?it.API.processDataByFilters(V,re):{data:V,reverseChain:[]}).reverseChain+(Array.isArray(se)?se.join(" "):se.toString());if(Ze.data.length!==0&&(mt.push({key:"Length",value:Ze.data.length}),fe===!0&&mt.push({key:"Length1",value:ye})),ht.length!=0)if(ht.split("/").length-1==1)mt.push({key:"Filter",value:ht});else{mt.push({key:"Filter",value:"["+ht+"]"});for(var Ut=0;Ut>"),Ze.data.length!==0&&(te("stream"),te(Ke(Ze.data)),te("endstream"))},Rs=h.__private__.putPage=function(B){var V=B.number,re=B.data,se=B.objId,fe=B.contentsObjId;fi(se,!0),te("<>"),te("endobj");var ye=re.join(` `);return b===w.ADVANCED&&(ye+=` Q`),fi(fe,!0),ki({data:ye,filters:Os(),objectId:fe}),te("endobj"),se},xA=h.__private__.putPages=function(){var B,V,re=[];for(B=1;B<=Pt;B++)nt[B].objId=Hr(),nt[B].contentsObjId=Hr();for(B=1;B<=Pt;B++)re.push(Rs({number:B,data:ge[B],objId:nt[B].objId,contentsObjId:nt[B].contentsObjId,mediaBox:nt[B].mediaBox,cropBox:nt[B].cropBox,bleedBox:nt[B].bleedBox,trimBox:nt[B].trimBox,artBox:nt[B].artBox,userUnit:nt[B].userUnit,rootDictionaryObjId:ua,resourceDictionaryObjId:is}));fi(ua,!0),te("<>"),te("endobj"),St.publish("postPutPages")},Tl=function(B){St.publish("putFont",{font:B,out:te,newObject:Jr,putStream:ki}),B.isAlreadyPutted!==!0&&(B.objectNumber=Jr(),te("<<"),te("/Type /Font"),te("/BaseFont /"+bc(B.postScriptName)),te("/Subtype /Type1"),typeof B.encoding=="string"&&te("/Encoding /"+B.encoding),te("/FirstChar 32"),te("/LastChar 255"),te(">>"),te("endobj"))},Il=function(){for(var B in Nt)Nt.hasOwnProperty(B)&&(d===!1||d===!0&&f.hasOwnProperty(B))&&Tl(Nt[B])},kl=function(B){B.objectNumber=Jr();var V=[];V.push({key:"Type",value:"/XObject"}),V.push({key:"Subtype",value:"/Form"}),V.push({key:"BBox",value:"["+[k(B.x),k(B.y),k(B.x+B.width),k(B.y+B.height)].join(" ")+"]"}),V.push({key:"Matrix",value:"["+B.matrix.toString()+"]"});var re=B.pages[1].join(` `);ki({data:re,additionalKeyValues:V,objectId:B.objectNumber}),te("endobj")},Ll=function(){for(var B in ar)ar.hasOwnProperty(B)&&kl(ar[B])},Oh=function(B,V){var re,se=[],fe=1/(V-1);for(re=0;re<1;re+=fe)se.push(re);if(se.push(1),B[0].offset!=0){var ye={offset:0,color:B[0].color};B.unshift(ye)}if(B[B.length-1].offset!=1){var Ne={offset:1,color:B[B.length-1].color};B.push(Ne)}for(var Ke="",Ze=0,mt=0;mtB[Ze+1].offset;)Ze++;var ht=B[Ze].offset,Ut=(re-ht)/(B[Ze+1].offset-ht),vr=B[Ze].color,Br=B[Ze+1].color;Ke+=q(Math.round((1-Ut)*vr[0]+Ut*Br[0]).toString(16))+q(Math.round((1-Ut)*vr[1]+Ut*Br[1]).toString(16))+q(Math.round((1-Ut)*vr[2]+Ut*Br[2]).toString(16))}return Ke.trim()},Ov=function(B,V){V||(V=21);var re=Jr(),se=Oh(B.colors,V),fe=[];fe.push({key:"FunctionType",value:"0"}),fe.push({key:"Domain",value:"[0.0 1.0]"}),fe.push({key:"Size",value:"["+V+"]"}),fe.push({key:"BitsPerSample",value:"8"}),fe.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),fe.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),ki({data:se,additionalKeyValues:fe,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:re}),te("endobj"),B.objectNumber=Jr(),te("<< /ShadingType "+B.type),te("/ColorSpace /DeviceRGB");var ye="/Coords ["+k(parseFloat(B.coords[0]))+" "+k(parseFloat(B.coords[1]))+" ";B.type===2?ye+=k(parseFloat(B.coords[2]))+" "+k(parseFloat(B.coords[3])):ye+=k(parseFloat(B.coords[2]))+" "+k(parseFloat(B.coords[3]))+" "+k(parseFloat(B.coords[4]))+" "+k(parseFloat(B.coords[5])),te(ye+="]"),B.matrix&&te("/Matrix ["+B.matrix.toString()+"]"),te("/Function "+re+" 0 R"),te("/Extend [true true]"),te(">>"),te("endobj")},Rv=function(B,V){var re=Hr(),se=Jr();V.push({resourcesOid:re,objectOid:se}),B.objectNumber=se;var fe=[];fe.push({key:"Type",value:"/Pattern"}),fe.push({key:"PatternType",value:"1"}),fe.push({key:"PaintType",value:"1"}),fe.push({key:"TilingType",value:"1"}),fe.push({key:"BBox",value:"["+B.boundingBox.map(k).join(" ")+"]"}),fe.push({key:"XStep",value:k(B.xStep)}),fe.push({key:"YStep",value:k(B.yStep)}),fe.push({key:"Resources",value:re+" 0 R"}),B.matrix&&fe.push({key:"Matrix",value:"["+B.matrix.toString()+"]"}),ki({data:B.stream,additionalKeyValues:fe,objectId:B.objectNumber}),te("endobj")},Pl=function(B){var V;for(V in _t)_t.hasOwnProperty(V)&&(_t[V]instanceof KA?Ov(_t[V]):_t[V]instanceof Vc&&Rv(_t[V],B))},Rh=function(B){for(var V in B.objectNumber=Jr(),te("<<"),B)switch(V){case"opacity":te("/ca "+H(B[V]));break;case"stroke-opacity":te("/CA "+H(B[V]))}te(">>"),te("endobj")},Mv=function(){var B;for(B in Jt)Jt.hasOwnProperty(B)&&Rh(Jt[B])},$u=function(){for(var B in te("/XObject <<"),ar)ar.hasOwnProperty(B)&&ar[B].objectNumber>=0&&te("/"+B+" "+ar[B].objectNumber+" 0 R");St.publish("putXobjectDict"),te(">>")},Hv=function(){xn.oid=Jr(),te("<<"),te("/Filter /Standard"),te("/V "+xn.v),te("/R "+xn.r),te("/U <"+xn.toHexString(xn.U)+">"),te("/O <"+xn.toHexString(xn.O)+">"),te("/P "+xn.P),te(">>"),te("endobj")},Mh=function(){for(var B in te("/Font <<"),Nt)Nt.hasOwnProperty(B)&&(d===!1||d===!0&&f.hasOwnProperty(B))&&te("/"+B+" "+Nt[B].objectNumber+" 0 R");te(">>")},Kv=function(){if(Object.keys(_t).length>0){for(var B in te("/Shading <<"),_t)_t.hasOwnProperty(B)&&_t[B]instanceof KA&&_t[B].objectNumber>=0&&te("/"+B+" "+_t[B].objectNumber+" 0 R");St.publish("putShadingPatternDict"),te(">>")}},Ql=function(B){if(Object.keys(_t).length>0){for(var V in te("/Pattern <<"),_t)_t.hasOwnProperty(V)&&_t[V]instanceof h.TilingPattern&&_t[V].objectNumber>=0&&_t[V].objectNumber>")}},Vv=function(){if(Object.keys(Jt).length>0){var B;for(B in te("/ExtGState <<"),Jt)Jt.hasOwnProperty(B)&&Jt[B].objectNumber>=0&&te("/"+B+" "+Jt[B].objectNumber+" 0 R");St.publish("putGStateDict"),te(">>")}},_r=function(B){fi(B.resourcesOid,!0),te("<<"),te("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),Mh(),Kv(),Ql(B.objectOid),Vv(),$u(),te(">>"),te("endobj")},Hh=function(){var B=[];Il(),Mv(),Ll(),Pl(B),St.publish("putResources"),B.forEach(_r),_r({resourcesOid:is,objectOid:Number.MAX_SAFE_INTEGER}),St.publish("postPutResources")},Kh=function(){St.publish("putAdditionalObjects");for(var B=0;B>8&&(Ze=!0);B=Ke.join("")}for(re=B.length;Ze===void 0&&re!==0;)B.charCodeAt(re-1)>>8&&(Ze=!0),re--;if(!Ze)return B;for(Ke=V.noBOM?[]:[254,255],re=0,se=B.length;re>8)>>8)throw new Error("Character at position "+re+" of string '"+B+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");Ke.push(ht),Ke.push(mt-(ht<<8))}return String.fromCharCode.apply(void 0,Ke)},Jn=h.__private__.pdfEscape=h.pdfEscape=function(B,V){return Dl(B,V).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},zu=h.__private__.beginPage=function(B){ge[++Pt]=[],nt[Pt]={objId:0,contentsObjId:0,userUnit:Number(o),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(B[0]),topRightY:Number(B[1])}},Gh(Pt),me(ge[J])},$h=function(B,V){var re,se,fe;switch(r=V||r,typeof B=="string"&&(re=g(B.toLowerCase()),Array.isArray(re)&&(se=re[0],fe=re[1])),Array.isArray(B)&&(se=B[0]*Le,fe=B[1]*Le),isNaN(se)&&(se=i[0],fe=i[1]),(se>14400||fe>14400)&&(Zt.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),se=Math.min(14400,se),fe=Math.min(14400,fe)),i=[se,fe],r.substr(0,1)){case"l":fe>se&&(i=[fe,se]);break;case"p":se>fe&&(i=[fe,se])}zu(i),Xh(Yu),te(As),Zu!==0&&te(Zu+" J"),ed!==0&&te(ed+" j"),St.publish("addPage",{pageNumber:Pt})},Gv=function(B){B>0&&B<=Pt&&(ge.splice(B,1),nt.splice(B,1),Pt--,J>Pt&&(J=Pt),this.setPage(J))},Gh=function(B){B>0&&B<=Pt&&(J=B)},zv=h.__private__.getNumberOfPages=h.getNumberOfPages=function(){return ge.length-1},zh=function(B,V,re){var se,fe=void 0;return re=re||{},B=B!==void 0?B:Nt[et].fontName,V=V!==void 0?V:Nt[et].fontStyle,se=B.toLowerCase(),Wt[se]!==void 0&&Wt[se][V]!==void 0?fe=Wt[se][V]:Wt[B]!==void 0&&Wt[B][V]!==void 0?fe=Wt[B][V]:re.disableWarning===!1&&Zt.warn("Unable to look up font label for font '"+B+"', '"+V+"'. Refer to getFontList() for available fonts."),fe||re.noFallback||(fe=Wt.times[V])==null&&(fe=Wt.times.normal),fe},Wv=h.__private__.putInfo=function(){var B=Jr(),V=function(se){return se};for(var re in u!==null&&(V=xn.encryptor(B,0)),te("<<"),te("/Producer ("+Jn(V("jsPDF "+it.version))+")"),Xe)Xe.hasOwnProperty(re)&&Xe[re]&&te("/"+re.substr(0,1).toUpperCase()+re.substr(1)+" ("+Jn(V(Xe[re]))+")");te("/CreationDate ("+Jn(V(D))+")"),te(">>"),te("endobj")},Wu=h.__private__.putCatalog=function(B){var V=(B=B||{}).rootDictionaryObjId||ua;switch(Jr(),te("<<"),te("/Type /Catalog"),te("/Pages "+V+" 0 R"),Ue||(Ue="fullwidth"),Ue){case"fullwidth":te("/OpenAction [3 0 R /FitH null]");break;case"fullheight":te("/OpenAction [3 0 R /FitV null]");break;case"fullpage":te("/OpenAction [3 0 R /Fit]");break;case"original":te("/OpenAction [3 0 R /XYZ null null 1]");break;default:var re=""+Ue;re.substr(re.length-1)==="%"&&(Ue=parseInt(Ue)/100),typeof Ue=="number"&&te("/OpenAction [3 0 R /XYZ null null "+H(Ue)+"]")}switch(ut||(ut="continuous"),ut){case"continuous":te("/PageLayout /OneColumn");break;case"single":te("/PageLayout /SinglePage");break;case"two":case"twoleft":te("/PageLayout /TwoColumnLeft");break;case"tworight":te("/PageLayout /TwoColumnRight")}Ve&&te("/PageMode /"+Ve),St.publish("putCatalog"),te(">>"),te("endobj")},Jv=h.__private__.putTrailer=function(){te("trailer"),te("<<"),te("/Size "+(ne+1)),te("/Root "+ne+" 0 R"),te("/Info "+(ne-1)+" 0 R"),u!==null&&te("/Encrypt "+xn.oid+" 0 R"),te("/ID [ <"+U+"> <"+U+"> ]"),te(">>")},qv=h.__private__.putHeader=function(){te("%PDF-"+v),te("%ºß¬à")},Yv=h.__private__.putXRef=function(){var B="0000000000";te("xref"),te("0 "+(ne+1)),te("0000000000 65535 f ");for(var V=1;V<=ne;V++)typeof ie[V]=="function"?te((B+ie[V]()).slice(-10)+" 00000 n "):ie[V]!==void 0?te((B+ie[V]).slice(-10)+" 00000 n "):te("0000000000 00000 n ")},da=h.__private__.buildDocument=function(){Re(),me(oe),St.publish("buildDocument"),qv(),xA(),Kh(),Hh(),u!==null&&Hv(),Wv(),Wu();var B=ce;return Yv(),Jv(),te("startxref"),te(""+B),te("%%EOF"),me(ge[J]),oe.join(` `)},Ol=h.__private__.getBlob=function(B){return new Blob([Te(B)],{type:"application/pdf"})},Rl=h.output=h.__private__.output=os(function(B,V){switch(typeof(V=V||{})=="string"?V={filename:V}:V.filename=V.filename||"generated.pdf",B){case void 0:return da();case"save":h.save(V.filename);break;case"arraybuffer":return Te(da());case"blob":return Ol(da());case"bloburi":case"bloburl":if(lt.URL!==void 0&&typeof lt.URL.createObjectURL=="function")return lt.URL&<.URL.createObjectURL(Ol(da()))||void 0;Zt.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var re="",se=da();try{re=tx(se)}catch{re=tx(unescape(encodeURIComponent(se)))}return"data:application/pdf;filename="+V.filename+";base64,"+re;case"pdfobjectnewwindow":if(Object.prototype.toString.call(lt)==="[object Window]"){var fe="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",ye=' integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==" crossorigin="anonymous"';V.pdfObjectUrl&&(fe=V.pdfObjectUrl,ye="");var Ne='